@pie-element/math-templated 2.20.1-next.18 → 2.20.1-next.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.
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
10
10
  "@pie-framework/pie-configure-events": "^1.3.0",
11
- "@pie-lib/pie-toolbox": "1.29.0",
11
+ "@pie-lib/pie-toolbox": "1.28.0",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "prop-types": "^15.6.2",
@@ -7,7 +7,7 @@
7
7
  "module": "src/index.js",
8
8
  "dependencies": {
9
9
  "@pie-framework/math-validation": "^1.2.2",
10
- "@pie-lib/pie-toolbox": "1.29.0",
10
+ "@pie-lib/pie-toolbox": "1.28.0",
11
11
  "debug": "^3.1.0",
12
12
  "lodash": "^4.17.15"
13
13
  },
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.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_editable_html} from "../../../@pie-lib/pie-toolbox-module@4.23.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.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_editable_html} from "../../../@pie-lib/pie-toolbox-module@4.12.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;
@@ -43053,10 +43053,8 @@ var mathjaxScript = {};
43053
43053
  Object.defineProperty(mathjaxScript, "__esModule", {
43054
43054
  value: true
43055
43055
  });
43056
- mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
43056
+ mathjaxScript.initializeMathJax = void 0;
43057
43057
  var _renderMath = renderMath$1;
43058
- var MathJaxVersion = '3.2.2';
43059
- mathjaxScript.MathJaxVersion = MathJaxVersion;
43060
43058
  var initializeMathJax = function initializeMathJax(renderOpts) {
43061
43059
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
43062
43060
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -43127,7 +43125,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
43127
43125
  };
43128
43126
  var script = document.createElement('script');
43129
43127
  script.type = 'text/javascript';
43130
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
43128
+ script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
43131
43129
  script.async = true;
43132
43130
  document.body.appendChild(script);
43133
43131
  });
@@ -102816,7 +102814,7 @@ getDefaultExportFromCjs(mathRendering);
102816
102814
  fixMathElements(executeOn);
102817
102815
  adjustMathMLStyle(executeOn);
102818
102816
  var mathJaxCustomKey = getMathJaxCustomKey();
102819
- if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
102817
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
102820
102818
  renderOpts = renderOpts || defaultOpts();
102821
102819
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
102822
102820
  }
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_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.1/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@4.23.1/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_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.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@4.12.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;
@@ -21848,10 +21848,8 @@ var mathjaxScript = {};
21848
21848
  Object.defineProperty(mathjaxScript, "__esModule", {
21849
21849
  value: true
21850
21850
  });
21851
- mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
21851
+ mathjaxScript.initializeMathJax = void 0;
21852
21852
  var _renderMath = renderMath$2;
21853
- var MathJaxVersion = '3.2.2';
21854
- mathjaxScript.MathJaxVersion = MathJaxVersion;
21855
21853
  var initializeMathJax = function initializeMathJax(renderOpts) {
21856
21854
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
21857
21855
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -21922,7 +21920,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
21922
21920
  };
21923
21921
  var script = document.createElement('script');
21924
21922
  script.type = 'text/javascript';
21925
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
21923
+ script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
21926
21924
  script.async = true;
21927
21925
  document.body.appendChild(script);
21928
21926
  });
@@ -81751,7 +81749,7 @@ getDefaultExportFromCjs(mathRendering);
81751
81749
  fixMathElements(executeOn);
81752
81750
  adjustMathMLStyle(executeOn);
81753
81751
  var mathJaxCustomKey = getMathJaxCustomKey();
81754
- if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
81752
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
81755
81753
  renderOpts = renderOpts || defaultOpts();
81756
81754
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
81757
81755
  }
@@ -123953,27 +123951,6 @@ const {findKey: require$$10$5} = _dll_lodash;
123953
123951
  var _findKey = _interopRequireDefault(require$$10$5);
123954
123952
  var _choice = _interopRequireDefault(choice$1);
123955
123953
  var _dragInTheBlankDp = _interopRequireDefault(dragInTheBlankDp);
123956
- function ownKeys(object, enumerableOnly) {
123957
- var keys = Object.keys(object);
123958
- if (Object.getOwnPropertySymbols) {
123959
- var symbols = Object.getOwnPropertySymbols(object);
123960
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
123961
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
123962
- })), keys.push.apply(keys, symbols));
123963
- }
123964
- return keys;
123965
- }
123966
- function _objectSpread(target) {
123967
- for (var i = 1; i < arguments.length; i++) {
123968
- var source = null != arguments[i] ? arguments[i] : {};
123969
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
123970
- (0, _defineProperty2["default"])(target, key, source[key]);
123971
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
123972
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
123973
- });
123974
- }
123975
- return target;
123976
- }
123977
123954
  function _createSuper(Derived) {
123978
123955
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
123979
123956
  return function _createSuperInternal() {
@@ -124044,9 +124021,7 @@ const {findKey: require$$10$5} = _dll_lodash;
124044
124021
  });
124045
124022
  return foundChoice === undefined;
124046
124023
  });
124047
- var elementStyle = _objectSpread(_objectSpread({}, this.getStyleForWrapper()), {}, {
124048
- minWidth: '100px'
124049
- });
124024
+ var elementStyle = this.getStyleForWrapper();
124050
124025
  return _react["default"].createElement("div", {
124051
124026
  style: elementStyle
124052
124027
  }, _react["default"].createElement(_dragInTheBlankDp["default"], {
@@ -124088,12 +124063,12 @@ const require$$16 = _dll_classnames;
124088
124063
  });
124089
124064
  exports["default"] = exports.DRAG_TYPE = exports.BlankContent = void 0;
124090
124065
  var _objectWithoutProperties2 = _interopRequireDefault(objectWithoutProperties.exports);
124091
- var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
124092
124066
  var _classCallCheck2 = _interopRequireDefault(classCallCheck$3.exports);
124093
124067
  var _createClass2 = _interopRequireDefault(createClass$2.exports);
124094
124068
  var _inherits2 = _interopRequireDefault(inherits$1.exports);
124095
124069
  var _possibleConstructorReturn2 = _interopRequireDefault(possibleConstructorReturn$1.exports);
124096
124070
  var _getPrototypeOf2 = _interopRequireDefault(getPrototypeOf$1.exports);
124071
+ var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
124097
124072
  var _react = _interopRequireDefault(require$$8$5);
124098
124073
  var _reactDom = _interopRequireDefault(require$$9$6);
124099
124074
  var _propTypes = _interopRequireDefault(require$$10$4);
@@ -124166,7 +124141,10 @@ const require$$16 = _dll_classnames;
124166
124141
  backgroundColor: _renderUi.color.background(),
124167
124142
  border: ("2px dashed ").concat(_renderUi.color.text()),
124168
124143
  color: _renderUi.color.text(),
124144
+ minWidth: '90px',
124169
124145
  fontSize: 'inherit',
124146
+ minHeight: '32px',
124147
+ height: 'auto',
124170
124148
  maxWidth: '374px',
124171
124149
  position: 'relative',
124172
124150
  borderRadius: '3px'
@@ -124208,8 +124186,7 @@ const require$$16 = _dll_classnames;
124208
124186
  (0, _classCallCheck2["default"])(this, BlankContent);
124209
124187
  _this = _super.call(this);
124210
124188
  _this.state = {
124211
- height: 0,
124212
- width: 0
124189
+ height: 0
124213
124190
  };
124214
124191
  return _this;
124215
124192
  }
@@ -124223,33 +124200,17 @@ const require$$16 = _dll_classnames;
124223
124200
  if (JSON.stringify(currentChoice) !== JSON.stringify(prevChoice)) {
124224
124201
  if (!currentChoice) {
124225
124202
  this.setState({
124226
- height: 0,
124227
- width: 0
124203
+ height: 0
124228
124204
  });
124229
124205
  return;
124230
124206
  }
124231
124207
  setTimeout(function () {
124232
- _this2.updateDimensions();
124208
+ _this2.setState({
124209
+ height: _this2.spanRef.offsetHeight
124210
+ });
124233
124211
  }, 300);
124234
124212
  }
124235
124213
  }
124236
- }, {
124237
- key: "updateDimensions",
124238
- value: function updateDimensions() {
124239
- var _this$spanRef, _this$spanRef2;
124240
- var height = ((_this$spanRef = this.spanRef) === null || _this$spanRef === void 0 ? void 0 : _this$spanRef.offsetHeight) || 0;
124241
- var width = ((_this$spanRef2 = this.spanRef) === null || _this$spanRef2 === void 0 ? void 0 : _this$spanRef2.offsetWidth) || 0;
124242
- var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
124243
- var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
124244
- if (height > responseAreaHeight || width > responseAreaWidth) {
124245
- this.setState(function (prevState) {
124246
- return {
124247
- width: width > responseAreaWidth ? width : prevState.width,
124248
- height: height > responseAreaHeight ? height : prevState.height
124249
- };
124250
- });
124251
- }
124252
- }
124253
124214
  }, {
124254
124215
  key: "addDraggableFalseAttributes",
124255
124216
  value: function addDraggableFalseAttributes(parent) {
@@ -124259,19 +124220,6 @@ const require$$16 = _dll_classnames;
124259
124220
  }
124260
124221
  });
124261
124222
  }
124262
- }, {
124263
- key: "getRootDimensions",
124264
- value: function getRootDimensions() {
124265
- var rootStyle = {
124266
- height: this.state.height || this.props.emptyResponseAreaHeight,
124267
- width: this.state.width || this.props.emptyResponseAreaWidth
124268
- };
124269
- return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), this.props.emptyResponseAreaWidth ? {} : {
124270
- minWidth: 90
124271
- }), this.props.emptyResponseAreaHeight ? {} : {
124272
- minHeight: 32
124273
- });
124274
- }
124275
124223
  }, {
124276
124224
  key: "render",
124277
124225
  value: function render() {
@@ -124307,7 +124255,9 @@ const require$$16 = _dll_classnames;
124307
124255
  }, ' ')),
124308
124256
  className: (0, _classnames3["default"])(classes.chip, isOver && classes.over, (_classnames2 = {}, (0, _defineProperty2["default"])(_classnames2, classes.correct, correct !== undefined && correct), (0, _defineProperty2["default"])(_classnames2, classes.incorrect, correct !== undefined && !correct), _classnames2)),
124309
124257
  variant: disabled ? 'outlined' : undefined,
124310
- style: _objectSpread({}, this.getRootDimensions()),
124258
+ style: _objectSpread({}, this.state.height ? {
124259
+ height: this.state.height
124260
+ } : {}),
124311
124261
  classes: {
124312
124262
  label: isOver && classes.over
124313
124263
  }
@@ -124317,11 +124267,7 @@ const require$$16 = _dll_classnames;
124317
124267
  return BlankContent;
124318
124268
  })(_react["default"].Component);
124319
124269
  exports.BlankContent = BlankContent;
124320
- BlankContent.defaultProps = {
124321
- emptyResponseAreaWidth: 0,
124322
- emptyResponseAreaHeight: 0
124323
- };
124324
- BlankContent.propTypes = {
124270
+ (0, _defineProperty2["default"])(BlankContent, "propTypes", {
124325
124271
  id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
124326
124272
  disabled: _propTypes["default"].bool,
124327
124273
  duplicates: _propTypes["default"].bool,
@@ -124330,10 +124276,8 @@ const require$$16 = _dll_classnames;
124330
124276
  isOver: _propTypes["default"].bool,
124331
124277
  dragItem: _propTypes["default"].object,
124332
124278
  correct: _propTypes["default"].bool,
124333
- onChange: _propTypes["default"].func,
124334
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
124335
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
124336
- };
124279
+ onChange: _propTypes["default"].func
124280
+ });
124337
124281
  var StyledBlankContent = useStyles(BlankContent);
124338
124282
  var connectedBlankContent = useStyles(function (_ref4) {
124339
124283
  var connectDragSource = _ref4.connectDragSource, connectDropTarget = _ref4.connectDropTarget, props = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
@@ -124418,27 +124362,6 @@ const require$$9$5 = _dll_prop_types;
124418
124362
  var _choices = _interopRequireDefault(choices);
124419
124363
  var _blank = _interopRequireDefault(blank);
124420
124364
  var _withMask = withMask$1;
124421
- function ownKeys(object, enumerableOnly) {
124422
- var keys = Object.keys(object);
124423
- if (Object.getOwnPropertySymbols) {
124424
- var symbols = Object.getOwnPropertySymbols(object);
124425
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
124426
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
124427
- })), keys.push.apply(keys, symbols));
124428
- }
124429
- return keys;
124430
- }
124431
- function _objectSpread(target) {
124432
- for (var i = 1; i < arguments.length; i++) {
124433
- var source = null != arguments[i] ? arguments[i] : {};
124434
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
124435
- (0, _defineProperty2["default"])(target, key, source[key]);
124436
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
124437
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
124438
- });
124439
- }
124440
- return target;
124441
- }
124442
124365
  function _createSuper(Derived) {
124443
124366
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
124444
124367
  return function _createSuperInternal() {
@@ -124467,7 +124390,7 @@ const require$$9$5 = _dll_prop_types;
124467
124390
  return function (node, data, onChange) {
124468
124391
  var dataset = node.data ? node.data.dataset || ({}) : {};
124469
124392
  if (dataset.component === 'blank') {
124470
- var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer, emptyResponseAreaWidth = props.emptyResponseAreaWidth, emptyResponseAreaHeight = props.emptyResponseAreaHeight;
124393
+ var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer;
124471
124394
  var choiceId = showCorrectAnswer ? correctResponse[dataset.id] : data[dataset.id];
124472
124395
  var choice = choiceId && props.choices.find(function (c) {
124473
124396
  return c.id === choiceId;
@@ -124479,8 +124402,6 @@ const require$$9$5 = _dll_prop_types;
124479
124402
  duplicates: duplicates,
124480
124403
  choice: choice,
124481
124404
  id: dataset.id,
124482
- emptyResponseAreaWidth: emptyResponseAreaWidth,
124483
- emptyResponseAreaHeight: emptyResponseAreaHeight,
124484
124405
  onChange: onChange
124485
124406
  });
124486
124407
  }
@@ -124498,17 +124419,12 @@ const require$$9$5 = _dll_prop_types;
124498
124419
  _this = _super.call.apply(_super, [this].concat(args));
124499
124420
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPositionDirection", function (choicePosition) {
124500
124421
  var flexDirection;
124501
- var justifyContent;
124502
- var alignItems;
124503
124422
  switch (choicePosition) {
124504
124423
  case 'left':
124505
124424
  flexDirection = 'row';
124506
- alignItems = 'center';
124507
124425
  break;
124508
124426
  case 'right':
124509
124427
  flexDirection = 'row-reverse';
124510
- justifyContent = 'flex-end';
124511
- alignItems = 'center';
124512
124428
  break;
124513
124429
  case 'below':
124514
124430
  flexDirection = 'column-reverse';
@@ -124517,11 +124433,7 @@ const require$$9$5 = _dll_prop_types;
124517
124433
  flexDirection = 'column';
124518
124434
  break;
124519
124435
  }
124520
- return {
124521
- flexDirection: flexDirection,
124522
- justifyContent: justifyContent,
124523
- alignItems: alignItems
124524
- };
124436
+ return flexDirection;
124525
124437
  });
124526
124438
  return _this;
124527
124439
  }
@@ -124541,12 +124453,12 @@ const require$$9$5 = _dll_prop_types;
124541
124453
  key: "render",
124542
124454
  value: function render() {
124543
124455
  var _this2 = this;
124544
- var _this$props = this.props, markup = _this$props.markup, duplicates = _this$props.duplicates, layout = _this$props.layout, value = _this$props.value, onChange = _this$props.onChange, choicesPosition = _this$props.choicesPosition, choices = _this$props.choices, correctResponse = _this$props.correctResponse, disabled = _this$props.disabled, feedback = _this$props.feedback, showCorrectAnswer = _this$props.showCorrectAnswer, emptyResponseAreaWidth = _this$props.emptyResponseAreaWidth, emptyResponseAreaHeight = _this$props.emptyResponseAreaHeight;
124456
+ var _this$props = this.props, markup = _this$props.markup, duplicates = _this$props.duplicates, layout = _this$props.layout, value = _this$props.value, onChange = _this$props.onChange, choicesPosition = _this$props.choicesPosition, choices = _this$props.choices, correctResponse = _this$props.correctResponse, disabled = _this$props.disabled, feedback = _this$props.feedback, showCorrectAnswer = _this$props.showCorrectAnswer;
124545
124457
  var choicePosition = choicesPosition || 'below';
124546
- var style = _objectSpread({
124458
+ var style = {
124547
124459
  display: 'flex',
124548
- minWidth: '100px'
124549
- }, this.getPositionDirection(choicePosition));
124460
+ flexDirection: this.getPositionDirection(choicePosition)
124461
+ };
124550
124462
  return _react["default"].createElement("div", {
124551
124463
  ref: function ref(_ref) {
124552
124464
  return _ref && (_this2.rootRef = _ref);
@@ -124568,9 +124480,7 @@ const require$$9$5 = _dll_prop_types;
124568
124480
  duplicates: duplicates,
124569
124481
  feedback: feedback,
124570
124482
  correctResponse: correctResponse,
124571
- showCorrectAnswer: showCorrectAnswer,
124572
- emptyResponseAreaWidth: emptyResponseAreaWidth,
124573
- emptyResponseAreaHeight: emptyResponseAreaHeight
124483
+ showCorrectAnswer: showCorrectAnswer
124574
124484
  }));
124575
124485
  }
124576
124486
  }]);
@@ -124591,9 +124501,7 @@ const require$$9$5 = _dll_prop_types;
124591
124501
  disabled: _propTypes["default"].bool,
124592
124502
  feedback: _propTypes["default"].object,
124593
124503
  correctResponse: _propTypes["default"].object,
124594
- showCorrectAnswer: _propTypes["default"].bool,
124595
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
124596
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
124504
+ showCorrectAnswer: _propTypes["default"].bool
124597
124505
  });
124598
124506
  })(dragInTheBlank);
124599
124507
  getDefaultExportFromCjs(dragInTheBlank);
@@ -4,11 +4,11 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.21.1"
7
+ "version": "1.21.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "4.23.1"
11
+ "version": "4.12.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_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.1/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@4.23.1/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_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.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@4.12.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;
@@ -21811,10 +21811,8 @@ var mathjaxScript = {};
21811
21811
  Object.defineProperty(mathjaxScript, "__esModule", {
21812
21812
  value: true
21813
21813
  });
21814
- mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
21814
+ mathjaxScript.initializeMathJax = void 0;
21815
21815
  var _renderMath = renderMath$3;
21816
- var MathJaxVersion = '3.2.2';
21817
- mathjaxScript.MathJaxVersion = MathJaxVersion;
21818
21816
  var initializeMathJax = function initializeMathJax(renderOpts) {
21819
21817
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
21820
21818
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -21885,7 +21883,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
21885
21883
  };
21886
21884
  var script = document.createElement('script');
21887
21885
  script.type = 'text/javascript';
21888
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
21886
+ script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
21889
21887
  script.async = true;
21890
21888
  document.body.appendChild(script);
21891
21889
  });
@@ -81714,7 +81712,7 @@ getDefaultExportFromCjs(mathRendering);
81714
81712
  fixMathElements(executeOn);
81715
81713
  adjustMathMLStyle(executeOn);
81716
81714
  var mathJaxCustomKey = getMathJaxCustomKey();
81717
- if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
81715
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
81718
81716
  renderOpts = renderOpts || defaultOpts();
81719
81717
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
81720
81718
  }
@@ -123916,27 +123914,6 @@ const {findKey: require$$10$5} = _dll_lodash;
123916
123914
  var _findKey = _interopRequireDefault(require$$10$5);
123917
123915
  var _choice = _interopRequireDefault(choice$1);
123918
123916
  var _dragInTheBlankDp = _interopRequireDefault(dragInTheBlankDp);
123919
- function ownKeys(object, enumerableOnly) {
123920
- var keys = Object.keys(object);
123921
- if (Object.getOwnPropertySymbols) {
123922
- var symbols = Object.getOwnPropertySymbols(object);
123923
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
123924
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
123925
- })), keys.push.apply(keys, symbols));
123926
- }
123927
- return keys;
123928
- }
123929
- function _objectSpread(target) {
123930
- for (var i = 1; i < arguments.length; i++) {
123931
- var source = null != arguments[i] ? arguments[i] : {};
123932
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
123933
- (0, _defineProperty2["default"])(target, key, source[key]);
123934
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
123935
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
123936
- });
123937
- }
123938
- return target;
123939
- }
123940
123917
  function _createSuper(Derived) {
123941
123918
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
123942
123919
  return function _createSuperInternal() {
@@ -124007,9 +123984,7 @@ const {findKey: require$$10$5} = _dll_lodash;
124007
123984
  });
124008
123985
  return foundChoice === undefined;
124009
123986
  });
124010
- var elementStyle = _objectSpread(_objectSpread({}, this.getStyleForWrapper()), {}, {
124011
- minWidth: '100px'
124012
- });
123987
+ var elementStyle = this.getStyleForWrapper();
124013
123988
  return _react["default"].createElement("div", {
124014
123989
  style: elementStyle
124015
123990
  }, _react["default"].createElement(_dragInTheBlankDp["default"], {
@@ -124051,12 +124026,12 @@ const require$$16 = _dll_classnames;
124051
124026
  });
124052
124027
  exports["default"] = exports.DRAG_TYPE = exports.BlankContent = void 0;
124053
124028
  var _objectWithoutProperties2 = _interopRequireDefault(objectWithoutProperties.exports);
124054
- var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
124055
124029
  var _classCallCheck2 = _interopRequireDefault(classCallCheck$3.exports);
124056
124030
  var _createClass2 = _interopRequireDefault(createClass$2.exports);
124057
124031
  var _inherits2 = _interopRequireDefault(inherits$1.exports);
124058
124032
  var _possibleConstructorReturn2 = _interopRequireDefault(possibleConstructorReturn$1.exports);
124059
124033
  var _getPrototypeOf2 = _interopRequireDefault(getPrototypeOf$1.exports);
124034
+ var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
124060
124035
  var _react = _interopRequireDefault(require$$8$5);
124061
124036
  var _reactDom = _interopRequireDefault(require$$9$6);
124062
124037
  var _propTypes = _interopRequireDefault(require$$10$4);
@@ -124129,7 +124104,10 @@ const require$$16 = _dll_classnames;
124129
124104
  backgroundColor: _renderUi.color.background(),
124130
124105
  border: ("2px dashed ").concat(_renderUi.color.text()),
124131
124106
  color: _renderUi.color.text(),
124107
+ minWidth: '90px',
124132
124108
  fontSize: 'inherit',
124109
+ minHeight: '32px',
124110
+ height: 'auto',
124133
124111
  maxWidth: '374px',
124134
124112
  position: 'relative',
124135
124113
  borderRadius: '3px'
@@ -124171,8 +124149,7 @@ const require$$16 = _dll_classnames;
124171
124149
  (0, _classCallCheck2["default"])(this, BlankContent);
124172
124150
  _this = _super.call(this);
124173
124151
  _this.state = {
124174
- height: 0,
124175
- width: 0
124152
+ height: 0
124176
124153
  };
124177
124154
  return _this;
124178
124155
  }
@@ -124186,33 +124163,17 @@ const require$$16 = _dll_classnames;
124186
124163
  if (JSON.stringify(currentChoice) !== JSON.stringify(prevChoice)) {
124187
124164
  if (!currentChoice) {
124188
124165
  this.setState({
124189
- height: 0,
124190
- width: 0
124166
+ height: 0
124191
124167
  });
124192
124168
  return;
124193
124169
  }
124194
124170
  setTimeout(function () {
124195
- _this2.updateDimensions();
124171
+ _this2.setState({
124172
+ height: _this2.spanRef.offsetHeight
124173
+ });
124196
124174
  }, 300);
124197
124175
  }
124198
124176
  }
124199
- }, {
124200
- key: "updateDimensions",
124201
- value: function updateDimensions() {
124202
- var _this$spanRef, _this$spanRef2;
124203
- var height = ((_this$spanRef = this.spanRef) === null || _this$spanRef === void 0 ? void 0 : _this$spanRef.offsetHeight) || 0;
124204
- var width = ((_this$spanRef2 = this.spanRef) === null || _this$spanRef2 === void 0 ? void 0 : _this$spanRef2.offsetWidth) || 0;
124205
- var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
124206
- var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
124207
- if (height > responseAreaHeight || width > responseAreaWidth) {
124208
- this.setState(function (prevState) {
124209
- return {
124210
- width: width > responseAreaWidth ? width : prevState.width,
124211
- height: height > responseAreaHeight ? height : prevState.height
124212
- };
124213
- });
124214
- }
124215
- }
124216
124177
  }, {
124217
124178
  key: "addDraggableFalseAttributes",
124218
124179
  value: function addDraggableFalseAttributes(parent) {
@@ -124222,19 +124183,6 @@ const require$$16 = _dll_classnames;
124222
124183
  }
124223
124184
  });
124224
124185
  }
124225
- }, {
124226
- key: "getRootDimensions",
124227
- value: function getRootDimensions() {
124228
- var rootStyle = {
124229
- height: this.state.height || this.props.emptyResponseAreaHeight,
124230
- width: this.state.width || this.props.emptyResponseAreaWidth
124231
- };
124232
- return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), this.props.emptyResponseAreaWidth ? {} : {
124233
- minWidth: 90
124234
- }), this.props.emptyResponseAreaHeight ? {} : {
124235
- minHeight: 32
124236
- });
124237
- }
124238
124186
  }, {
124239
124187
  key: "render",
124240
124188
  value: function render() {
@@ -124270,7 +124218,9 @@ const require$$16 = _dll_classnames;
124270
124218
  }, ' ')),
124271
124219
  className: (0, _classnames3["default"])(classes.chip, isOver && classes.over, (_classnames2 = {}, (0, _defineProperty2["default"])(_classnames2, classes.correct, correct !== undefined && correct), (0, _defineProperty2["default"])(_classnames2, classes.incorrect, correct !== undefined && !correct), _classnames2)),
124272
124220
  variant: disabled ? 'outlined' : undefined,
124273
- style: _objectSpread({}, this.getRootDimensions()),
124221
+ style: _objectSpread({}, this.state.height ? {
124222
+ height: this.state.height
124223
+ } : {}),
124274
124224
  classes: {
124275
124225
  label: isOver && classes.over
124276
124226
  }
@@ -124280,11 +124230,7 @@ const require$$16 = _dll_classnames;
124280
124230
  return BlankContent;
124281
124231
  })(_react["default"].Component);
124282
124232
  exports.BlankContent = BlankContent;
124283
- BlankContent.defaultProps = {
124284
- emptyResponseAreaWidth: 0,
124285
- emptyResponseAreaHeight: 0
124286
- };
124287
- BlankContent.propTypes = {
124233
+ (0, _defineProperty2["default"])(BlankContent, "propTypes", {
124288
124234
  id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
124289
124235
  disabled: _propTypes["default"].bool,
124290
124236
  duplicates: _propTypes["default"].bool,
@@ -124293,10 +124239,8 @@ const require$$16 = _dll_classnames;
124293
124239
  isOver: _propTypes["default"].bool,
124294
124240
  dragItem: _propTypes["default"].object,
124295
124241
  correct: _propTypes["default"].bool,
124296
- onChange: _propTypes["default"].func,
124297
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
124298
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
124299
- };
124242
+ onChange: _propTypes["default"].func
124243
+ });
124300
124244
  var StyledBlankContent = useStyles(BlankContent);
124301
124245
  var connectedBlankContent = useStyles(function (_ref4) {
124302
124246
  var connectDragSource = _ref4.connectDragSource, connectDropTarget = _ref4.connectDropTarget, props = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
@@ -124381,27 +124325,6 @@ const require$$9$5 = _dll_prop_types;
124381
124325
  var _choices = _interopRequireDefault(choices);
124382
124326
  var _blank = _interopRequireDefault(blank);
124383
124327
  var _withMask = withMask$1;
124384
- function ownKeys(object, enumerableOnly) {
124385
- var keys = Object.keys(object);
124386
- if (Object.getOwnPropertySymbols) {
124387
- var symbols = Object.getOwnPropertySymbols(object);
124388
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
124389
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
124390
- })), keys.push.apply(keys, symbols));
124391
- }
124392
- return keys;
124393
- }
124394
- function _objectSpread(target) {
124395
- for (var i = 1; i < arguments.length; i++) {
124396
- var source = null != arguments[i] ? arguments[i] : {};
124397
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
124398
- (0, _defineProperty2["default"])(target, key, source[key]);
124399
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
124400
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
124401
- });
124402
- }
124403
- return target;
124404
- }
124405
124328
  function _createSuper(Derived) {
124406
124329
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
124407
124330
  return function _createSuperInternal() {
@@ -124430,7 +124353,7 @@ const require$$9$5 = _dll_prop_types;
124430
124353
  return function (node, data, onChange) {
124431
124354
  var dataset = node.data ? node.data.dataset || ({}) : {};
124432
124355
  if (dataset.component === 'blank') {
124433
- var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer, emptyResponseAreaWidth = props.emptyResponseAreaWidth, emptyResponseAreaHeight = props.emptyResponseAreaHeight;
124356
+ var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer;
124434
124357
  var choiceId = showCorrectAnswer ? correctResponse[dataset.id] : data[dataset.id];
124435
124358
  var choice = choiceId && props.choices.find(function (c) {
124436
124359
  return c.id === choiceId;
@@ -124442,8 +124365,6 @@ const require$$9$5 = _dll_prop_types;
124442
124365
  duplicates: duplicates,
124443
124366
  choice: choice,
124444
124367
  id: dataset.id,
124445
- emptyResponseAreaWidth: emptyResponseAreaWidth,
124446
- emptyResponseAreaHeight: emptyResponseAreaHeight,
124447
124368
  onChange: onChange
124448
124369
  });
124449
124370
  }
@@ -124461,17 +124382,12 @@ const require$$9$5 = _dll_prop_types;
124461
124382
  _this = _super.call.apply(_super, [this].concat(args));
124462
124383
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPositionDirection", function (choicePosition) {
124463
124384
  var flexDirection;
124464
- var justifyContent;
124465
- var alignItems;
124466
124385
  switch (choicePosition) {
124467
124386
  case 'left':
124468
124387
  flexDirection = 'row';
124469
- alignItems = 'center';
124470
124388
  break;
124471
124389
  case 'right':
124472
124390
  flexDirection = 'row-reverse';
124473
- justifyContent = 'flex-end';
124474
- alignItems = 'center';
124475
124391
  break;
124476
124392
  case 'below':
124477
124393
  flexDirection = 'column-reverse';
@@ -124480,11 +124396,7 @@ const require$$9$5 = _dll_prop_types;
124480
124396
  flexDirection = 'column';
124481
124397
  break;
124482
124398
  }
124483
- return {
124484
- flexDirection: flexDirection,
124485
- justifyContent: justifyContent,
124486
- alignItems: alignItems
124487
- };
124399
+ return flexDirection;
124488
124400
  });
124489
124401
  return _this;
124490
124402
  }
@@ -124504,12 +124416,12 @@ const require$$9$5 = _dll_prop_types;
124504
124416
  key: "render",
124505
124417
  value: function render() {
124506
124418
  var _this2 = this;
124507
- var _this$props = this.props, markup = _this$props.markup, duplicates = _this$props.duplicates, layout = _this$props.layout, value = _this$props.value, onChange = _this$props.onChange, choicesPosition = _this$props.choicesPosition, choices = _this$props.choices, correctResponse = _this$props.correctResponse, disabled = _this$props.disabled, feedback = _this$props.feedback, showCorrectAnswer = _this$props.showCorrectAnswer, emptyResponseAreaWidth = _this$props.emptyResponseAreaWidth, emptyResponseAreaHeight = _this$props.emptyResponseAreaHeight;
124419
+ var _this$props = this.props, markup = _this$props.markup, duplicates = _this$props.duplicates, layout = _this$props.layout, value = _this$props.value, onChange = _this$props.onChange, choicesPosition = _this$props.choicesPosition, choices = _this$props.choices, correctResponse = _this$props.correctResponse, disabled = _this$props.disabled, feedback = _this$props.feedback, showCorrectAnswer = _this$props.showCorrectAnswer;
124508
124420
  var choicePosition = choicesPosition || 'below';
124509
- var style = _objectSpread({
124421
+ var style = {
124510
124422
  display: 'flex',
124511
- minWidth: '100px'
124512
- }, this.getPositionDirection(choicePosition));
124423
+ flexDirection: this.getPositionDirection(choicePosition)
124424
+ };
124513
124425
  return _react["default"].createElement("div", {
124514
124426
  ref: function ref(_ref) {
124515
124427
  return _ref && (_this2.rootRef = _ref);
@@ -124531,9 +124443,7 @@ const require$$9$5 = _dll_prop_types;
124531
124443
  duplicates: duplicates,
124532
124444
  feedback: feedback,
124533
124445
  correctResponse: correctResponse,
124534
- showCorrectAnswer: showCorrectAnswer,
124535
- emptyResponseAreaWidth: emptyResponseAreaWidth,
124536
- emptyResponseAreaHeight: emptyResponseAreaHeight
124446
+ showCorrectAnswer: showCorrectAnswer
124537
124447
  }));
124538
124448
  }
124539
124449
  }]);
@@ -124554,9 +124464,7 @@ const require$$9$5 = _dll_prop_types;
124554
124464
  disabled: _propTypes["default"].bool,
124555
124465
  feedback: _propTypes["default"].object,
124556
124466
  correctResponse: _propTypes["default"].object,
124557
- showCorrectAnswer: _propTypes["default"].bool,
124558
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
124559
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
124467
+ showCorrectAnswer: _propTypes["default"].bool
124560
124468
  });
124561
124469
  })(dragInTheBlank);
124562
124470
  getDefaultExportFromCjs(dragInTheBlank);
package/package.json CHANGED
@@ -4,19 +4,19 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "2.20.1-next.18+a61e1177e",
7
+ "version": "2.20.1-next.5+6084f693c",
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": "1.29.0",
12
+ "@pie-lib/pie-toolbox": "1.28.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": "a61e1177e55cd7bd8d244c638fda8a313f960078",
19
+ "gitHead": "6084f693cf23739eba410d0a16ee53a292e9077d",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },