@pie-element/math-inline 8.3.5-next.9 → 8.3.5

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,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@8.3.4...@pie-element/math-inline@8.3.5) (2025-01-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4555, PD-4660, PD-4426, PD-4607, PD-4394, PD-4521 ([e4928b4](https://github.com/pie-framework/pie-elements/commit/e4928b4f9ac268a892b382045f76ae4eac6b458e))
12
+ * **math-inline:** fix session save being called on render PD-4604 ([fcb0812](https://github.com/pie-framework/pie-elements/commit/fcb0812b9c4b818dbe43a0abeb879a02f90b5abc))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [8.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline@8.3.3...@pie-element/math-inline@8.3.4) (2024-12-20)
7
19
 
8
20
 
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.2.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@8.2.4...@pie-element/math-inline-configure@8.2.5) (2025-01-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4555, PD-4660, PD-4426, PD-4607, PD-4394, PD-4521 ([e4928b4](https://github.com/pie-framework/pie-elements/commit/e4928b4f9ac268a892b382045f76ae4eac6b458e))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [8.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-configure@8.2.3...@pie-element/math-inline-configure@8.2.4) (2024-12-20)
7
18
 
8
19
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/math-inline-configure",
3
3
  "private": true,
4
- "version": "8.2.4",
4
+ "version": "8.2.5",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -11,7 +11,7 @@
11
11
  "@material-ui/icons": "^3.0.1",
12
12
  "@pie-framework/mathquill": "^1.1.3",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
- "@pie-lib/pie-toolbox": "2.5.0",
14
+ "@pie-lib/pie-toolbox": "2.6.0",
15
15
  "classnames": "^2.2.5",
16
16
  "debug": "^3.1.0",
17
17
  "prop-types": "^15.6.2",
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-controller@7.1.6...@pie-element/math-inline-controller@7.1.7) (2025-01-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-4555, PD-4660, PD-4426, PD-4607, PD-4394, PD-4521 ([e4928b4](https://github.com/pie-framework/pie-elements/commit/e4928b4f9ac268a892b382045f76ae4eac6b458e))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [7.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-inline-controller@7.1.5...@pie-element/math-inline-controller@7.1.6) (2024-12-20)
7
18
 
8
19
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/math-inline-controller",
3
3
  "private": true,
4
- "version": "7.1.6",
4
+ "version": "7.1.7",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@pie-framework/math-validation": "^1.2.3",
13
- "@pie-lib/pie-toolbox": "2.5.0",
13
+ "@pie-lib/pie-toolbox": "2.6.0",
14
14
  "debug": "^3.1.0",
15
15
  "lodash": "^4.17.15"
16
16
  },
@@ -109,7 +109,7 @@ var SimpleQuestionBlockRaw = /*#__PURE__*/function (_React$Component) {
109
109
  classNames: {
110
110
  editor: classes.responseEditor
111
111
  },
112
- latex: session.response || '',
112
+ latex: session.response,
113
113
  keypadMode: equationEditor,
114
114
  onChange: onSimpleResponseChange,
115
115
  onDone: function onDone() {},
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/simple-question-block.jsx"],"names":["SimpleQuestionBlockRaw","props","e","document","getElementById","mathToolBarId","contains","target","mathToolBarContainsTarget","setState","showKeypad","onSubFieldFocus","Date","getTime","classes","model","showCorrect","session","emptyResponse","onSimpleResponseChange","config","disabled","correctness","correct","responses","equationEditor","expression","incorrect","length","answer","response","editor","responseEditor","onFocus","React","Component","PropTypes","object","func","isRequired","bool","SimpleQuestionBlock","theme","display","justifyContent","width","maxWidth","height","textAlign","padding","spacing","unit","border","color","primaryLight","marginTop","marginBottom","text","background","fontSize","letterSpacing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEaA,sB;;;;;AAYX,kCAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,kHAMS,UAACC,CAAD;AAAA,aAAOC,QAAQ,CAACC,cAAT,CAAwB,MAAKC,aAA7B,EAA4CC,QAA5C,CAAqDJ,CAAC,CAACK,MAAvD,CAAP;AAAA,KANT;AAAA,oGAQL,UAACL,CAAD,EAAO;AACnB,UAAI;AACF,YAAI,CAAC,MAAKM,yBAAL,CAA+BN,CAA/B,CAAL,EAAwC;AACtC,gBAAKO,QAAL,CAAc;AAAEC,YAAAA,UAAU,EAAE;AAAd,WAAd;AACD;AACF,OAJD,CAIE,OAAOR,CAAP,EAAU,CACV;AACD;AACF,KAhBkB;AAAA,gGAkBT,YAAM;AACd,UAAQS,eAAR,GAA4B,MAAKV,KAAjC,CAAQU,eAAR;AAEAA,MAAAA,e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wB,CAA5B;eA6CeyC,mB","sourcesContent":["import React from 'react';\nimport { MathToolbar } from '@pie-lib/pie-toolbox/math-toolbar';\nimport { mq } from '@pie-lib/pie-toolbox/math-input';\nimport cx from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\n\nexport class SimpleQuestionBlockRaw extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n onSimpleResponseChange: PropTypes.func,\n model: PropTypes.object.isRequired,\n emptyResponse: PropTypes.bool,\n session: PropTypes.object.isRequired,\n showCorrect: PropTypes.bool,\n onSubFieldFocus: PropTypes.func.isRequired,\n showKeypad: PropTypes.bool.isRequired,\n };\n\n constructor(props) {\n super(props);\n\n this.mathToolBarId = `math-toolbar-${new Date().getTime()}`;\n }\n\n mathToolBarContainsTarget = (e) => document.getElementById(this.mathToolBarId).contains(e.target);\n\n handleClick = (e) => {\n try {\n if (!this.mathToolBarContainsTarget(e)) {\n this.setState({ showKeypad: false });\n }\n } catch (e) {\n // console.log(e.toString());\n }\n };\n\n onFocus = () => {\n const { onSubFieldFocus } = this.props;\n\n onSubFieldFocus(this.mathToolBarId);\n };\n\n render() {\n const { classes, model, showCorrect, session, emptyResponse, onSimpleResponseChange, showKeypad } = this.props;\n const { config, disabled, correctness } = model || {};\n\n if (!config) {\n return;\n }\n\n const correct = correctness && correctness.correct;\n const { responses, equationEditor } = config;\n\n return (\n <div className={classes.expression} data-keypad={true}>\n {showCorrect || disabled ? (\n <div\n className={cx(classes.static, {\n [classes.incorrect]: !emptyResponse && !correct && !showCorrect,\n [classes.correct]: !emptyResponse && (correct || showCorrect),\n })}\n >\n <mq.Static\n latex={showCorrect ? responses && responses.length && responses[0].answer : session.response || ''}\n />\n </div>\n ) : (\n <div id={this.mathToolBarId}>\n <MathToolbar\n classNames={{ editor: classes.responseEditor }}\n latex={session.response || ''}\n keypadMode={equationEditor}\n onChange={onSimpleResponseChange}\n onDone={() => {}}\n onFocus={this.onFocus}\n controlledKeypad={true}\n showKeypad={showKeypad}\n hideDoneButton={true}\n />\n </div>\n )}\n </div>\n );\n }\n}\n\nconst SimpleQuestionBlock = withStyles((theme) => ({\n responseEditor: {\n display: 'flex',\n justifyContent: 'center',\n width: 'auto',\n maxWidth: 'fit-content',\n height: 'auto',\n textAlign: 'left',\n padding: theme.spacing.unit,\n '&.mq-math-mode': {\n border: `1px solid ${color.primaryLight()}`,\n },\n },\n expression: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n padding: theme.spacing.unit,\n },\n static: {\n color: color.text(),\n background: color.background(),\n border: `1px solid ${color.primaryLight()}`,\n width: 'fit-content',\n fontSize: '1rem',\n padding: theme.spacing.unit / 2,\n '& > .mq-math-mode': {\n '& > .mq-hasCursor': {\n '& > .mq-cursor': {\n display: 'none',\n },\n },\n },\n },\n correct: {\n border: `2px solid ${color.correct()} !important`,\n padding: theme.spacing.unit,\n letterSpacing: '0.5px',\n },\n incorrect: {\n border: `2px solid ${color.incorrect()} !important`,\n padding: theme.spacing.unit,\n letterSpacing: '0.5px',\n },\n}))(SimpleQuestionBlockRaw);\n\nexport default SimpleQuestionBlock;\n"],"file":"simple-question-block.js"}
1
+ {"version":3,"sources":["../src/simple-question-block.jsx"],"names":["SimpleQuestionBlockRaw","props","e","document","getElementById","mathToolBarId","contains","target","mathToolBarContainsTarget","setState","showKeypad","onSubFieldFocus","Date","getTime","classes","model","showCorrect","session","emptyResponse","onSimpleResponseChange","config","disabled","correctness","correct","responses","equationEditor","expression","incorrect","length","answer","response","editor","responseEditor","onFocus","React","Component","PropTypes","object","func","isRequired","bool","SimpleQuestionBlock","theme","display","justifyContent","width","maxWidth","height","textAlign","padding","spacing","unit","border","color","primaryLight","marginTop","marginBottom","text","background","fontSize","letterSpacing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEaA,sB;;;;;AAYX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,2BAAqB;AACnB,6BAAqB;AACnB,4BAAkB;AAChBR,YAAAA,OAAO,EAAE;AADO;AADC;AADF;AAPf,KAlByC;AAiCjDpB,IAAAA,OAAO,EAAE;AACP6B,MAAAA,MAAM,sBAAeC,gBAAM9B,OAAN,EAAf,gBADC;AAEP0B,MAAAA,OAAO,EAAEP,KAAK,CAACQ,OAAN,CAAcC,IAFhB;AAGPS,MAAAA,aAAa,EAAE;AAHR,KAjCwC;AAsCjDjC,IAAAA,SAAS,EAAE;AACTyB,MAAAA,MAAM,sBAAeC,gBAAM1B,SAAN,EAAf,gBADG;AAETsB,MAAAA,OAAO,EAAEP,KAAK,CAACQ,OAAN,CAAcC,IAFd;AAGTS,MAAAA,aAAa,EAAE;AAHN;AAtCsC,GAAZ;AAAA,CAAX,EA2CxB5D,sBA3CwB,CAA5B;eA6CeyC,mB","sourcesContent":["import React from 'react';\nimport { MathToolbar } from '@pie-lib/pie-toolbox/math-toolbar';\nimport { mq } from '@pie-lib/pie-toolbox/math-input';\nimport cx from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\n\nexport class SimpleQuestionBlockRaw extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n onSimpleResponseChange: PropTypes.func,\n model: PropTypes.object.isRequired,\n emptyResponse: PropTypes.bool,\n session: PropTypes.object.isRequired,\n showCorrect: PropTypes.bool,\n onSubFieldFocus: PropTypes.func.isRequired,\n showKeypad: PropTypes.bool.isRequired,\n };\n\n constructor(props) {\n super(props);\n\n this.mathToolBarId = `math-toolbar-${new Date().getTime()}`;\n }\n\n mathToolBarContainsTarget = (e) => document.getElementById(this.mathToolBarId).contains(e.target);\n\n handleClick = (e) => {\n try {\n if (!this.mathToolBarContainsTarget(e)) {\n this.setState({ showKeypad: false });\n }\n } catch (e) {\n // console.log(e.toString());\n }\n };\n\n onFocus = () => {\n const { onSubFieldFocus } = this.props;\n\n onSubFieldFocus(this.mathToolBarId);\n };\n\n render() {\n const { classes, model, showCorrect, session, emptyResponse, onSimpleResponseChange, showKeypad } = this.props;\n const { config, disabled, correctness } = model || {};\n\n if (!config) {\n return;\n }\n\n const correct = correctness && correctness.correct;\n const { responses, equationEditor } = config;\n\n return (\n <div className={classes.expression} data-keypad={true}>\n {showCorrect || disabled ? (\n <div\n className={cx(classes.static, {\n [classes.incorrect]: !emptyResponse && !correct && !showCorrect,\n [classes.correct]: !emptyResponse && (correct || showCorrect),\n })}\n >\n <mq.Static\n latex={showCorrect ? responses && responses.length && responses[0].answer : session.response || ''}\n />\n </div>\n ) : (\n <div id={this.mathToolBarId}>\n <MathToolbar\n classNames={{ editor: classes.responseEditor }}\n latex={session.response}\n keypadMode={equationEditor}\n onChange={onSimpleResponseChange}\n onDone={() => {}}\n onFocus={this.onFocus}\n controlledKeypad={true}\n showKeypad={showKeypad}\n hideDoneButton={true}\n />\n </div>\n )}\n </div>\n );\n }\n}\n\nconst SimpleQuestionBlock = withStyles((theme) => ({\n responseEditor: {\n display: 'flex',\n justifyContent: 'center',\n width: 'auto',\n maxWidth: 'fit-content',\n height: 'auto',\n textAlign: 'left',\n padding: theme.spacing.unit,\n '&.mq-math-mode': {\n border: `1px solid ${color.primaryLight()}`,\n },\n },\n expression: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n padding: theme.spacing.unit,\n },\n static: {\n color: color.text(),\n background: color.background(),\n border: `1px solid ${color.primaryLight()}`,\n width: 'fit-content',\n fontSize: '1rem',\n padding: theme.spacing.unit / 2,\n '& > .mq-math-mode': {\n '& > .mq-hasCursor': {\n '& > .mq-cursor': {\n display: 'none',\n },\n },\n },\n },\n correct: {\n border: `2px solid ${color.correct()} !important`,\n padding: theme.spacing.unit,\n letterSpacing: '0.5px',\n },\n incorrect: {\n border: `2px solid ${color.incorrect()} !important`,\n padding: theme.spacing.unit,\n letterSpacing: '0.5px',\n },\n}))(SimpleQuestionBlockRaw);\n\nexport default SimpleQuestionBlock;\n"],"file":"simple-question-block.js"}
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.5.0/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.4.1/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.5.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.5.0/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.4.1/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.5.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -8474,7 +8474,7 @@ class SimpleQuestionBlockRaw extends React$2.Component {
8474
8474
  classNames: {
8475
8475
  editor: classes.responseEditor
8476
8476
  },
8477
- latex: session.response || '',
8477
+ latex: session.response,
8478
8478
  keypadMode: equationEditor,
8479
8479
  onChange: onSimpleResponseChange,
8480
8480
  onDone: () => {},
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.4.1"
11
+ "version": "5.5.0"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_pie_framework__mathquill, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.5.0/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.4.1/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.5.0/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -8214,7 +8214,7 @@ class SimpleQuestionBlockRaw extends React$2.Component {
8214
8214
  classNames: {
8215
8215
  editor: classes.responseEditor
8216
8216
  },
8217
- latex: session.response || '',
8217
+ latex: session.response,
8218
8218
  keypadMode: equationEditor,
8219
8219
  onChange: onSimpleResponseChange,
8220
8220
  onDone: () => {},
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "8.3.5-next.9+7562ece6d",
7
+ "version": "8.3.5",
8
8
  "main": "lib/index.js",
9
9
  "description": "",
10
10
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "@material-ui/core": "^3.9.2",
15
15
  "@pie-framework/mathquill": "^1.1.3",
16
16
  "@pie-framework/pie-player-events": "^0.1.0",
17
- "@pie-lib/pie-toolbox": "2.5.0",
17
+ "@pie-lib/pie-toolbox": "2.6.0",
18
18
  "classnames": "^2.2.5",
19
19
  "debug": "^4.1.1",
20
20
  "lodash": "^4.17.10",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "author": "",
26
26
  "license": "ISC",
27
- "gitHead": "7562ece6de0bd941264481b93ebb68c58ff30f71",
27
+ "gitHead": "67c7ce92d1e5e2e3bba47606b7004e094caba59e",
28
28
  "module": "src/index.js",
29
29
  "exports": {
30
30
  ".": "./src/index.js",