@pie-element/math-templated 3.2.3-next.3 → 3.3.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/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.1.5/module/index.js";
2
- import {_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.1.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.2.0/module/index.js";
2
+ import {_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.2.0/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
5
5
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
@@ -29436,7 +29436,7 @@ TexError$1.default = TexError;
29436
29436
  }
29437
29437
  },
29438
29438
  loader: {
29439
- load: ["input/mml", '[mml]/mml3'],
29439
+ load: ["input/mml"],
29440
29440
  preLoad: function preLoad() {},
29441
29441
  failed: function failed(error) {
29442
29442
  return console.log(("MathJax(").concat(error["package"] || '?', "): ").concat(error.message));
@@ -73010,7 +73010,7 @@ var _interopRequireDefault$3c = interopRequireDefault.exports;
73010
73010
  Object.defineProperty(color$1, "__esModule", {
73011
73011
  value: true
73012
73012
  });
73013
- color$1.white = color$1.v = color$1.transparent = color$1.text = color$1.secondaryText = color$1.secondaryLight = color$1.secondaryDark = color$1.secondaryBackground = color$1.secondary = color$1.primaryText = color$1.primaryLight = color$1.primaryDark = color$1.primary = color$1.missingWithIcon = color$1.missing = color$1.incorrectWithIcon = color$1.incorrectSecondary = color$1.incorrect = color$1.disabledSecondary = color$1.disabled = color$1.defaults = color$1.correctWithIcon = color$1.correctSecondary = color$1.correct = color$1.borderLight = color$1.borderDark = color$1.border = color$1.black = color$1.backgroundDark = color$1.background = void 0;
73013
+ color$1.white = color$1.v = color$1.transparent = color$1.text = color$1.tertiaryLight = color$1.tertiary = color$1.secondaryText = color$1.secondaryLight = color$1.secondaryDark = color$1.secondaryBackground = color$1.secondary = color$1.primaryText = color$1.primaryLight = color$1.primaryDark = color$1.primary = color$1.missingWithIcon = color$1.missing = color$1.incorrectWithIcon = color$1.incorrectSecondary = color$1.incorrect = color$1.disabledSecondary = color$1.disabled = color$1.defaults = color$1.correctWithIcon = color$1.correctSecondary = color$1.correct = color$1.borderLight = color$1.borderDark = color$1.border = color$1.black = color$1.backgroundDark = color$1.background = void 0;
73014
73014
  var _green = _interopRequireDefault$3c(green$1);
73015
73015
  var _orange = _interopRequireDefault$3c(orange$1);
73016
73016
  var _pink = _interopRequireDefault$3c(pink$1);
@@ -73034,6 +73034,8 @@ var defaults = {
73034
73034
  SECONDARY: _pink["default"].A400,
73035
73035
  SECONDARY_LIGHT: _pink["default"][200],
73036
73036
  SECONDARY_DARK: _pink["default"][900],
73037
+ TERTIARY: '#146EB3',
73038
+ TERTIARY_LIGHT: '#D0E2F0',
73037
73039
  BACKGROUND: 'rgba(255,255,255,0)',
73038
73040
  BACKGROUND_DARK: '#ECEDF1',
73039
73041
  SECONDARY_BACKGROUND: 'rgba(241,241,241,1)',
@@ -73147,6 +73149,14 @@ var secondaryBackground = function secondaryBackground() {
73147
73149
  return pv('secondary-background', defaults.SECONDARY_BACKGROUND);
73148
73150
  };
73149
73151
  color$1.secondaryBackground = secondaryBackground;
73152
+ var tertiary = function tertiary() {
73153
+ return pv('tertiary', defaults.TERTIARY);
73154
+ };
73155
+ color$1.tertiary = tertiary;
73156
+ var tertiaryLight = function tertiaryLight() {
73157
+ return pv('tertiary-light', defaults.TERTIARY_LIGHT);
73158
+ };
73159
+ color$1.tertiaryLight = tertiaryLight;
73150
73160
  var border = function border() {
73151
73161
  return pv('border', defaults.BORDER);
73152
73162
  };
@@ -76813,9 +76823,9 @@ const require$$11$r = _dll_prop_types;
76813
76823
  color: theme.palette.common.black
76814
76824
  }
76815
76825
  },
76816
- '&:not(.MathJax) > table td, &:not(.MathJax) > table th': {
76826
+ '&:not(.MathJax) table td, &:not(.MathJax) table th': {
76817
76827
  padding: '.6em 1em',
76818
- textAlign: 'center'
76828
+ textAlign: 'left'
76819
76829
  },
76820
76830
  '&:not(.MathJax) > table td > p.kds-indent': {
76821
76831
  textAlign: 'initial'
@@ -81051,18 +81061,23 @@ const require$$17$2 = _dll_classnames;
81051
81061
  }, {
81052
81062
  key: "updateDimensions",
81053
81063
  value: function updateDimensions() {
81054
- var _this$spanRef2, _this$spanRef3;
81055
- var height = ((_this$spanRef2 = this.spanRef) === null || _this$spanRef2 === void 0 ? void 0 : _this$spanRef2.offsetHeight) || 0;
81056
- var width = ((_this$spanRef3 = this.spanRef) === null || _this$spanRef3 === void 0 ? void 0 : _this$spanRef3.offsetWidth) || 0;
81057
- var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
81058
- var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
81059
- if (height > responseAreaHeight || width > responseAreaWidth) {
81064
+ if (this.spanRef && this.rootRef) {
81065
+ this.rootRef.style.width = 'auto';
81066
+ var width = this.spanRef.offsetWidth || 0;
81067
+ var height = this.spanRef.offsetHeight || 0;
81068
+ var widthWithPadding = width + 24;
81069
+ var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
81070
+ var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
81071
+ var adjustedWidth = widthWithPadding <= responseAreaWidth ? responseAreaWidth : widthWithPadding;
81072
+ var adjustedHeight = height <= responseAreaHeight ? responseAreaHeight : height;
81060
81073
  this.setState(function (prevState) {
81061
81074
  return {
81062
- width: width > responseAreaWidth ? width + 24 : prevState.width,
81063
- height: height > responseAreaHeight ? height : prevState.height
81075
+ width: adjustedWidth > responseAreaWidth ? adjustedWidth : prevState.width,
81076
+ height: adjustedHeight > responseAreaHeight ? adjustedHeight : prevState.height
81064
81077
  };
81065
81078
  });
81079
+ this.rootRef.style.width = ("").concat(adjustedWidth, "px");
81080
+ this.rootRef.style.height = ("").concat(adjustedHeight, "px");
81066
81081
  }
81067
81082
  }
81068
81083
  }, {
@@ -81077,13 +81092,15 @@ const require$$17$2 = _dll_classnames;
81077
81092
  }, {
81078
81093
  key: "getRootDimensions",
81079
81094
  value: function getRootDimensions() {
81095
+ var responseAreaWidth = !isNaN(parseFloat(this.props.emptyResponseAreaWidth)) ? parseFloat(this.props.emptyResponseAreaWidth) : 0;
81096
+ var responseAreaHeight = !isNaN(parseFloat(this.props.emptyResponseAreaHeight)) ? parseFloat(this.props.emptyResponseAreaHeight) : 0;
81080
81097
  var rootStyle = {
81081
- height: this.state.height || this.props.emptyResponseAreaHeight,
81082
- width: this.state.width || this.props.emptyResponseAreaWidth
81098
+ height: this.state.height || responseAreaHeight,
81099
+ width: this.state.width || responseAreaWidth
81083
81100
  };
81084
- return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), this.props.emptyResponseAreaWidth ? {} : {
81101
+ return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), responseAreaWidth ? {} : {
81085
81102
  minWidth: 90
81086
- }), this.props.emptyResponseAreaHeight ? {} : {
81103
+ }), responseAreaHeight ? {} : {
81087
81104
  minHeight: 32
81088
81105
  });
81089
81106
  }
@@ -4,11 +4,11 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "2.1.5"
7
+ "version": "2.2.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.1.2"
11
+ "version": "5.2.0"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.1.5/module/index.js";
2
- import {_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.1.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.2.0/module/index.js";
2
+ import {_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.2.0/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
5
5
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
@@ -29399,7 +29399,7 @@ TexError$1.default = TexError;
29399
29399
  }
29400
29400
  },
29401
29401
  loader: {
29402
- load: ["input/mml", '[mml]/mml3'],
29402
+ load: ["input/mml"],
29403
29403
  preLoad: function preLoad() {},
29404
29404
  failed: function failed(error) {
29405
29405
  return console.log(("MathJax(").concat(error["package"] || '?', "): ").concat(error.message));
@@ -72973,7 +72973,7 @@ var _interopRequireDefault$3c = interopRequireDefault.exports;
72973
72973
  Object.defineProperty(color$1, "__esModule", {
72974
72974
  value: true
72975
72975
  });
72976
- color$1.white = color$1.v = color$1.transparent = color$1.text = color$1.secondaryText = color$1.secondaryLight = color$1.secondaryDark = color$1.secondaryBackground = color$1.secondary = color$1.primaryText = color$1.primaryLight = color$1.primaryDark = color$1.primary = color$1.missingWithIcon = color$1.missing = color$1.incorrectWithIcon = color$1.incorrectSecondary = color$1.incorrect = color$1.disabledSecondary = color$1.disabled = color$1.defaults = color$1.correctWithIcon = color$1.correctSecondary = color$1.correct = color$1.borderLight = color$1.borderDark = color$1.border = color$1.black = color$1.backgroundDark = color$1.background = void 0;
72976
+ color$1.white = color$1.v = color$1.transparent = color$1.text = color$1.tertiaryLight = color$1.tertiary = color$1.secondaryText = color$1.secondaryLight = color$1.secondaryDark = color$1.secondaryBackground = color$1.secondary = color$1.primaryText = color$1.primaryLight = color$1.primaryDark = color$1.primary = color$1.missingWithIcon = color$1.missing = color$1.incorrectWithIcon = color$1.incorrectSecondary = color$1.incorrect = color$1.disabledSecondary = color$1.disabled = color$1.defaults = color$1.correctWithIcon = color$1.correctSecondary = color$1.correct = color$1.borderLight = color$1.borderDark = color$1.border = color$1.black = color$1.backgroundDark = color$1.background = void 0;
72977
72977
  var _green = _interopRequireDefault$3c(green$1);
72978
72978
  var _orange = _interopRequireDefault$3c(orange$1);
72979
72979
  var _pink = _interopRequireDefault$3c(pink$1);
@@ -72997,6 +72997,8 @@ var defaults = {
72997
72997
  SECONDARY: _pink["default"].A400,
72998
72998
  SECONDARY_LIGHT: _pink["default"][200],
72999
72999
  SECONDARY_DARK: _pink["default"][900],
73000
+ TERTIARY: '#146EB3',
73001
+ TERTIARY_LIGHT: '#D0E2F0',
73000
73002
  BACKGROUND: 'rgba(255,255,255,0)',
73001
73003
  BACKGROUND_DARK: '#ECEDF1',
73002
73004
  SECONDARY_BACKGROUND: 'rgba(241,241,241,1)',
@@ -73110,6 +73112,14 @@ var secondaryBackground = function secondaryBackground() {
73110
73112
  return pv('secondary-background', defaults.SECONDARY_BACKGROUND);
73111
73113
  };
73112
73114
  color$1.secondaryBackground = secondaryBackground;
73115
+ var tertiary = function tertiary() {
73116
+ return pv('tertiary', defaults.TERTIARY);
73117
+ };
73118
+ color$1.tertiary = tertiary;
73119
+ var tertiaryLight = function tertiaryLight() {
73120
+ return pv('tertiary-light', defaults.TERTIARY_LIGHT);
73121
+ };
73122
+ color$1.tertiaryLight = tertiaryLight;
73113
73123
  var border = function border() {
73114
73124
  return pv('border', defaults.BORDER);
73115
73125
  };
@@ -76776,9 +76786,9 @@ const require$$11$r = _dll_prop_types;
76776
76786
  color: theme.palette.common.black
76777
76787
  }
76778
76788
  },
76779
- '&:not(.MathJax) > table td, &:not(.MathJax) > table th': {
76789
+ '&:not(.MathJax) table td, &:not(.MathJax) table th': {
76780
76790
  padding: '.6em 1em',
76781
- textAlign: 'center'
76791
+ textAlign: 'left'
76782
76792
  },
76783
76793
  '&:not(.MathJax) > table td > p.kds-indent': {
76784
76794
  textAlign: 'initial'
@@ -81014,18 +81024,23 @@ const require$$17$2 = _dll_classnames;
81014
81024
  }, {
81015
81025
  key: "updateDimensions",
81016
81026
  value: function updateDimensions() {
81017
- var _this$spanRef2, _this$spanRef3;
81018
- var height = ((_this$spanRef2 = this.spanRef) === null || _this$spanRef2 === void 0 ? void 0 : _this$spanRef2.offsetHeight) || 0;
81019
- var width = ((_this$spanRef3 = this.spanRef) === null || _this$spanRef3 === void 0 ? void 0 : _this$spanRef3.offsetWidth) || 0;
81020
- var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
81021
- var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
81022
- if (height > responseAreaHeight || width > responseAreaWidth) {
81027
+ if (this.spanRef && this.rootRef) {
81028
+ this.rootRef.style.width = 'auto';
81029
+ var width = this.spanRef.offsetWidth || 0;
81030
+ var height = this.spanRef.offsetHeight || 0;
81031
+ var widthWithPadding = width + 24;
81032
+ var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
81033
+ var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
81034
+ var adjustedWidth = widthWithPadding <= responseAreaWidth ? responseAreaWidth : widthWithPadding;
81035
+ var adjustedHeight = height <= responseAreaHeight ? responseAreaHeight : height;
81023
81036
  this.setState(function (prevState) {
81024
81037
  return {
81025
- width: width > responseAreaWidth ? width + 24 : prevState.width,
81026
- height: height > responseAreaHeight ? height : prevState.height
81038
+ width: adjustedWidth > responseAreaWidth ? adjustedWidth : prevState.width,
81039
+ height: adjustedHeight > responseAreaHeight ? adjustedHeight : prevState.height
81027
81040
  };
81028
81041
  });
81042
+ this.rootRef.style.width = ("").concat(adjustedWidth, "px");
81043
+ this.rootRef.style.height = ("").concat(adjustedHeight, "px");
81029
81044
  }
81030
81045
  }
81031
81046
  }, {
@@ -81040,13 +81055,15 @@ const require$$17$2 = _dll_classnames;
81040
81055
  }, {
81041
81056
  key: "getRootDimensions",
81042
81057
  value: function getRootDimensions() {
81058
+ var responseAreaWidth = !isNaN(parseFloat(this.props.emptyResponseAreaWidth)) ? parseFloat(this.props.emptyResponseAreaWidth) : 0;
81059
+ var responseAreaHeight = !isNaN(parseFloat(this.props.emptyResponseAreaHeight)) ? parseFloat(this.props.emptyResponseAreaHeight) : 0;
81043
81060
  var rootStyle = {
81044
- height: this.state.height || this.props.emptyResponseAreaHeight,
81045
- width: this.state.width || this.props.emptyResponseAreaWidth
81061
+ height: this.state.height || responseAreaHeight,
81062
+ width: this.state.width || responseAreaWidth
81046
81063
  };
81047
- return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), this.props.emptyResponseAreaWidth ? {} : {
81064
+ return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), responseAreaWidth ? {} : {
81048
81065
  minWidth: 90
81049
- }), this.props.emptyResponseAreaHeight ? {} : {
81066
+ }), responseAreaHeight ? {} : {
81050
81067
  minHeight: 32
81051
81068
  });
81052
81069
  }
package/package.json CHANGED
@@ -4,19 +4,19 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "3.2.3-next.3+ace661f34",
7
+ "version": "3.3.0",
8
8
  "description": "",
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
- "@pie-lib/pie-toolbox": "2.1.3",
12
+ "@pie-lib/pie-toolbox": "2.2.0",
13
13
  "prop-types": "^15.6.1",
14
14
  "react": "^16.8.1",
15
15
  "react-dom": "^16.8.1"
16
16
  },
17
17
  "author": "",
18
18
  "license": "ISC",
19
- "gitHead": "ace661f34b6e59271949e848ce2474dce65c4d64",
19
+ "gitHead": "20cc12d3d06ad5318bfa4c6994cf7c7614dfed2f",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },