@pie-element/explicit-constructed-response 6.20.1-next.18 → 6.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
  "@material-ui/core": "^3.9.2",
9
9
  "@material-ui/icons": "^3.0.1",
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
  "classnames": "^2.2.6",
13
13
  "debug": "^3.1.0",
14
14
  "lodash": "^4.17.15",
@@ -8,7 +8,7 @@
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
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
  "type-of": "^2.0.1"
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} 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_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} 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;
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.23.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} 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;
@@ -19152,10 +19152,8 @@ var mathjaxScript = {};
19152
19152
  Object.defineProperty(mathjaxScript, "__esModule", {
19153
19153
  value: true
19154
19154
  });
19155
- mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
19155
+ mathjaxScript.initializeMathJax = void 0;
19156
19156
  var _renderMath = renderMath$2;
19157
- var MathJaxVersion = '3.2.2';
19158
- mathjaxScript.MathJaxVersion = MathJaxVersion;
19159
19157
  var initializeMathJax = function initializeMathJax(renderOpts) {
19160
19158
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
19161
19159
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -19226,7 +19224,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
19226
19224
  };
19227
19225
  var script = document.createElement('script');
19228
19226
  script.type = 'text/javascript';
19229
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
19227
+ script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
19230
19228
  script.async = true;
19231
19229
  document.body.appendChild(script);
19232
19230
  });
@@ -79055,7 +79053,7 @@ getDefaultExportFromCjs(mathRendering);
79055
79053
  fixMathElements(executeOn);
79056
79054
  adjustMathMLStyle(executeOn);
79057
79055
  var mathJaxCustomKey = getMathJaxCustomKey();
79058
- if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
79056
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
79059
79057
  renderOpts = renderOpts || defaultOpts();
79060
79058
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
79061
79059
  }
@@ -122191,27 +122189,6 @@ const {findKey: require$$10$5} = _dll_lodash;
122191
122189
  var _findKey = _interopRequireDefault(require$$10$5);
122192
122190
  var _choice = _interopRequireDefault(choice$1);
122193
122191
  var _dragInTheBlankDp = _interopRequireDefault(dragInTheBlankDp);
122194
- function ownKeys(object, enumerableOnly) {
122195
- var keys = Object.keys(object);
122196
- if (Object.getOwnPropertySymbols) {
122197
- var symbols = Object.getOwnPropertySymbols(object);
122198
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
122199
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
122200
- })), keys.push.apply(keys, symbols));
122201
- }
122202
- return keys;
122203
- }
122204
- function _objectSpread(target) {
122205
- for (var i = 1; i < arguments.length; i++) {
122206
- var source = null != arguments[i] ? arguments[i] : {};
122207
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
122208
- (0, _defineProperty2["default"])(target, key, source[key]);
122209
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
122210
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
122211
- });
122212
- }
122213
- return target;
122214
- }
122215
122192
  function _createSuper(Derived) {
122216
122193
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
122217
122194
  return function _createSuperInternal() {
@@ -122282,9 +122259,7 @@ const {findKey: require$$10$5} = _dll_lodash;
122282
122259
  });
122283
122260
  return foundChoice === undefined;
122284
122261
  });
122285
- var elementStyle = _objectSpread(_objectSpread({}, this.getStyleForWrapper()), {}, {
122286
- minWidth: '100px'
122287
- });
122262
+ var elementStyle = this.getStyleForWrapper();
122288
122263
  return _react["default"].createElement("div", {
122289
122264
  style: elementStyle
122290
122265
  }, _react["default"].createElement(_dragInTheBlankDp["default"], {
@@ -122326,12 +122301,12 @@ const require$$16 = _dll_classnames;
122326
122301
  });
122327
122302
  exports["default"] = exports.DRAG_TYPE = exports.BlankContent = void 0;
122328
122303
  var _objectWithoutProperties2 = _interopRequireDefault(objectWithoutProperties.exports);
122329
- var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
122330
122304
  var _classCallCheck2 = _interopRequireDefault(classCallCheck$3.exports);
122331
122305
  var _createClass2 = _interopRequireDefault(createClass$2.exports);
122332
122306
  var _inherits2 = _interopRequireDefault(inherits$2.exports);
122333
122307
  var _possibleConstructorReturn2 = _interopRequireDefault(possibleConstructorReturn$2.exports);
122334
122308
  var _getPrototypeOf2 = _interopRequireDefault(getPrototypeOf$2.exports);
122309
+ var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
122335
122310
  var _react = _interopRequireDefault(require$$8$5);
122336
122311
  var _reactDom = _interopRequireDefault(require$$9$6);
122337
122312
  var _propTypes = _interopRequireDefault(require$$10$4);
@@ -122404,7 +122379,10 @@ const require$$16 = _dll_classnames;
122404
122379
  backgroundColor: _renderUi.color.background(),
122405
122380
  border: ("2px dashed ").concat(_renderUi.color.text()),
122406
122381
  color: _renderUi.color.text(),
122382
+ minWidth: '90px',
122407
122383
  fontSize: 'inherit',
122384
+ minHeight: '32px',
122385
+ height: 'auto',
122408
122386
  maxWidth: '374px',
122409
122387
  position: 'relative',
122410
122388
  borderRadius: '3px'
@@ -122446,8 +122424,7 @@ const require$$16 = _dll_classnames;
122446
122424
  (0, _classCallCheck2["default"])(this, BlankContent);
122447
122425
  _this = _super.call(this);
122448
122426
  _this.state = {
122449
- height: 0,
122450
- width: 0
122427
+ height: 0
122451
122428
  };
122452
122429
  return _this;
122453
122430
  }
@@ -122461,33 +122438,17 @@ const require$$16 = _dll_classnames;
122461
122438
  if (JSON.stringify(currentChoice) !== JSON.stringify(prevChoice)) {
122462
122439
  if (!currentChoice) {
122463
122440
  this.setState({
122464
- height: 0,
122465
- width: 0
122441
+ height: 0
122466
122442
  });
122467
122443
  return;
122468
122444
  }
122469
122445
  setTimeout(function () {
122470
- _this2.updateDimensions();
122446
+ _this2.setState({
122447
+ height: _this2.spanRef.offsetHeight
122448
+ });
122471
122449
  }, 300);
122472
122450
  }
122473
122451
  }
122474
- }, {
122475
- key: "updateDimensions",
122476
- value: function updateDimensions() {
122477
- var _this$spanRef, _this$spanRef2;
122478
- var height = ((_this$spanRef = this.spanRef) === null || _this$spanRef === void 0 ? void 0 : _this$spanRef.offsetHeight) || 0;
122479
- var width = ((_this$spanRef2 = this.spanRef) === null || _this$spanRef2 === void 0 ? void 0 : _this$spanRef2.offsetWidth) || 0;
122480
- var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
122481
- var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
122482
- if (height > responseAreaHeight || width > responseAreaWidth) {
122483
- this.setState(function (prevState) {
122484
- return {
122485
- width: width > responseAreaWidth ? width : prevState.width,
122486
- height: height > responseAreaHeight ? height : prevState.height
122487
- };
122488
- });
122489
- }
122490
- }
122491
122452
  }, {
122492
122453
  key: "addDraggableFalseAttributes",
122493
122454
  value: function addDraggableFalseAttributes(parent) {
@@ -122497,19 +122458,6 @@ const require$$16 = _dll_classnames;
122497
122458
  }
122498
122459
  });
122499
122460
  }
122500
- }, {
122501
- key: "getRootDimensions",
122502
- value: function getRootDimensions() {
122503
- var rootStyle = {
122504
- height: this.state.height || this.props.emptyResponseAreaHeight,
122505
- width: this.state.width || this.props.emptyResponseAreaWidth
122506
- };
122507
- return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), this.props.emptyResponseAreaWidth ? {} : {
122508
- minWidth: 90
122509
- }), this.props.emptyResponseAreaHeight ? {} : {
122510
- minHeight: 32
122511
- });
122512
- }
122513
122461
  }, {
122514
122462
  key: "render",
122515
122463
  value: function render() {
@@ -122545,7 +122493,9 @@ const require$$16 = _dll_classnames;
122545
122493
  }, ' ')),
122546
122494
  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)),
122547
122495
  variant: disabled ? 'outlined' : undefined,
122548
- style: _objectSpread({}, this.getRootDimensions()),
122496
+ style: _objectSpread({}, this.state.height ? {
122497
+ height: this.state.height
122498
+ } : {}),
122549
122499
  classes: {
122550
122500
  label: isOver && classes.over
122551
122501
  }
@@ -122555,11 +122505,7 @@ const require$$16 = _dll_classnames;
122555
122505
  return BlankContent;
122556
122506
  })(_react["default"].Component);
122557
122507
  exports.BlankContent = BlankContent;
122558
- BlankContent.defaultProps = {
122559
- emptyResponseAreaWidth: 0,
122560
- emptyResponseAreaHeight: 0
122561
- };
122562
- BlankContent.propTypes = {
122508
+ (0, _defineProperty2["default"])(BlankContent, "propTypes", {
122563
122509
  id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
122564
122510
  disabled: _propTypes["default"].bool,
122565
122511
  duplicates: _propTypes["default"].bool,
@@ -122568,10 +122514,8 @@ const require$$16 = _dll_classnames;
122568
122514
  isOver: _propTypes["default"].bool,
122569
122515
  dragItem: _propTypes["default"].object,
122570
122516
  correct: _propTypes["default"].bool,
122571
- onChange: _propTypes["default"].func,
122572
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
122573
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
122574
- };
122517
+ onChange: _propTypes["default"].func
122518
+ });
122575
122519
  var StyledBlankContent = useStyles(BlankContent);
122576
122520
  var connectedBlankContent = useStyles(function (_ref4) {
122577
122521
  var connectDragSource = _ref4.connectDragSource, connectDropTarget = _ref4.connectDropTarget, props = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
@@ -122656,27 +122600,6 @@ const require$$9$5 = _dll_prop_types;
122656
122600
  var _choices = _interopRequireDefault(choices);
122657
122601
  var _blank = _interopRequireDefault(blank);
122658
122602
  var _withMask = withMask$1;
122659
- function ownKeys(object, enumerableOnly) {
122660
- var keys = Object.keys(object);
122661
- if (Object.getOwnPropertySymbols) {
122662
- var symbols = Object.getOwnPropertySymbols(object);
122663
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
122664
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
122665
- })), keys.push.apply(keys, symbols));
122666
- }
122667
- return keys;
122668
- }
122669
- function _objectSpread(target) {
122670
- for (var i = 1; i < arguments.length; i++) {
122671
- var source = null != arguments[i] ? arguments[i] : {};
122672
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
122673
- (0, _defineProperty2["default"])(target, key, source[key]);
122674
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
122675
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
122676
- });
122677
- }
122678
- return target;
122679
- }
122680
122603
  function _createSuper(Derived) {
122681
122604
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
122682
122605
  return function _createSuperInternal() {
@@ -122705,7 +122628,7 @@ const require$$9$5 = _dll_prop_types;
122705
122628
  return function (node, data, onChange) {
122706
122629
  var dataset = node.data ? node.data.dataset || ({}) : {};
122707
122630
  if (dataset.component === 'blank') {
122708
- var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer, emptyResponseAreaWidth = props.emptyResponseAreaWidth, emptyResponseAreaHeight = props.emptyResponseAreaHeight;
122631
+ var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer;
122709
122632
  var choiceId = showCorrectAnswer ? correctResponse[dataset.id] : data[dataset.id];
122710
122633
  var choice = choiceId && props.choices.find(function (c) {
122711
122634
  return c.id === choiceId;
@@ -122717,8 +122640,6 @@ const require$$9$5 = _dll_prop_types;
122717
122640
  duplicates: duplicates,
122718
122641
  choice: choice,
122719
122642
  id: dataset.id,
122720
- emptyResponseAreaWidth: emptyResponseAreaWidth,
122721
- emptyResponseAreaHeight: emptyResponseAreaHeight,
122722
122643
  onChange: onChange
122723
122644
  });
122724
122645
  }
@@ -122736,17 +122657,12 @@ const require$$9$5 = _dll_prop_types;
122736
122657
  _this = _super.call.apply(_super, [this].concat(args));
122737
122658
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPositionDirection", function (choicePosition) {
122738
122659
  var flexDirection;
122739
- var justifyContent;
122740
- var alignItems;
122741
122660
  switch (choicePosition) {
122742
122661
  case 'left':
122743
122662
  flexDirection = 'row';
122744
- alignItems = 'center';
122745
122663
  break;
122746
122664
  case 'right':
122747
122665
  flexDirection = 'row-reverse';
122748
- justifyContent = 'flex-end';
122749
- alignItems = 'center';
122750
122666
  break;
122751
122667
  case 'below':
122752
122668
  flexDirection = 'column-reverse';
@@ -122755,11 +122671,7 @@ const require$$9$5 = _dll_prop_types;
122755
122671
  flexDirection = 'column';
122756
122672
  break;
122757
122673
  }
122758
- return {
122759
- flexDirection: flexDirection,
122760
- justifyContent: justifyContent,
122761
- alignItems: alignItems
122762
- };
122674
+ return flexDirection;
122763
122675
  });
122764
122676
  return _this;
122765
122677
  }
@@ -122779,12 +122691,12 @@ const require$$9$5 = _dll_prop_types;
122779
122691
  key: "render",
122780
122692
  value: function render() {
122781
122693
  var _this2 = this;
122782
- 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;
122694
+ 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;
122783
122695
  var choicePosition = choicesPosition || 'below';
122784
- var style = _objectSpread({
122696
+ var style = {
122785
122697
  display: 'flex',
122786
- minWidth: '100px'
122787
- }, this.getPositionDirection(choicePosition));
122698
+ flexDirection: this.getPositionDirection(choicePosition)
122699
+ };
122788
122700
  return _react["default"].createElement("div", {
122789
122701
  ref: function ref(_ref) {
122790
122702
  return _ref && (_this2.rootRef = _ref);
@@ -122806,9 +122718,7 @@ const require$$9$5 = _dll_prop_types;
122806
122718
  duplicates: duplicates,
122807
122719
  feedback: feedback,
122808
122720
  correctResponse: correctResponse,
122809
- showCorrectAnswer: showCorrectAnswer,
122810
- emptyResponseAreaWidth: emptyResponseAreaWidth,
122811
- emptyResponseAreaHeight: emptyResponseAreaHeight
122721
+ showCorrectAnswer: showCorrectAnswer
122812
122722
  }));
122813
122723
  }
122814
122724
  }]);
@@ -122829,9 +122739,7 @@ const require$$9$5 = _dll_prop_types;
122829
122739
  disabled: _propTypes["default"].bool,
122830
122740
  feedback: _propTypes["default"].object,
122831
122741
  correctResponse: _propTypes["default"].object,
122832
- showCorrectAnswer: _propTypes["default"].bool,
122833
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
122834
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
122742
+ showCorrectAnswer: _propTypes["default"].bool
122835
122743
  });
122836
122744
  })(dragInTheBlank);
122837
122745
  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_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.1/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.23.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.21.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} 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;
@@ -19115,10 +19115,8 @@ var mathjaxScript = {};
19115
19115
  Object.defineProperty(mathjaxScript, "__esModule", {
19116
19116
  value: true
19117
19117
  });
19118
- mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
19118
+ mathjaxScript.initializeMathJax = void 0;
19119
19119
  var _renderMath = renderMath$2;
19120
- var MathJaxVersion = '3.2.2';
19121
- mathjaxScript.MathJaxVersion = MathJaxVersion;
19122
19120
  var initializeMathJax = function initializeMathJax(renderOpts) {
19123
19121
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
19124
19122
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -19189,7 +19187,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
19189
19187
  };
19190
19188
  var script = document.createElement('script');
19191
19189
  script.type = 'text/javascript';
19192
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
19190
+ script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
19193
19191
  script.async = true;
19194
19192
  document.body.appendChild(script);
19195
19193
  });
@@ -79018,7 +79016,7 @@ getDefaultExportFromCjs(mathRendering);
79018
79016
  fixMathElements(executeOn);
79019
79017
  adjustMathMLStyle(executeOn);
79020
79018
  var mathJaxCustomKey = getMathJaxCustomKey();
79021
- if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
79019
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
79022
79020
  renderOpts = renderOpts || defaultOpts();
79023
79021
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
79024
79022
  }
@@ -122154,27 +122152,6 @@ const {findKey: require$$10$5} = _dll_lodash;
122154
122152
  var _findKey = _interopRequireDefault(require$$10$5);
122155
122153
  var _choice = _interopRequireDefault(choice$1);
122156
122154
  var _dragInTheBlankDp = _interopRequireDefault(dragInTheBlankDp);
122157
- function ownKeys(object, enumerableOnly) {
122158
- var keys = Object.keys(object);
122159
- if (Object.getOwnPropertySymbols) {
122160
- var symbols = Object.getOwnPropertySymbols(object);
122161
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
122162
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
122163
- })), keys.push.apply(keys, symbols));
122164
- }
122165
- return keys;
122166
- }
122167
- function _objectSpread(target) {
122168
- for (var i = 1; i < arguments.length; i++) {
122169
- var source = null != arguments[i] ? arguments[i] : {};
122170
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
122171
- (0, _defineProperty2["default"])(target, key, source[key]);
122172
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
122173
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
122174
- });
122175
- }
122176
- return target;
122177
- }
122178
122155
  function _createSuper(Derived) {
122179
122156
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
122180
122157
  return function _createSuperInternal() {
@@ -122245,9 +122222,7 @@ const {findKey: require$$10$5} = _dll_lodash;
122245
122222
  });
122246
122223
  return foundChoice === undefined;
122247
122224
  });
122248
- var elementStyle = _objectSpread(_objectSpread({}, this.getStyleForWrapper()), {}, {
122249
- minWidth: '100px'
122250
- });
122225
+ var elementStyle = this.getStyleForWrapper();
122251
122226
  return _react["default"].createElement("div", {
122252
122227
  style: elementStyle
122253
122228
  }, _react["default"].createElement(_dragInTheBlankDp["default"], {
@@ -122289,12 +122264,12 @@ const require$$16 = _dll_classnames;
122289
122264
  });
122290
122265
  exports["default"] = exports.DRAG_TYPE = exports.BlankContent = void 0;
122291
122266
  var _objectWithoutProperties2 = _interopRequireDefault(objectWithoutProperties.exports);
122292
- var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
122293
122267
  var _classCallCheck2 = _interopRequireDefault(classCallCheck$3.exports);
122294
122268
  var _createClass2 = _interopRequireDefault(createClass$2.exports);
122295
122269
  var _inherits2 = _interopRequireDefault(inherits$2.exports);
122296
122270
  var _possibleConstructorReturn2 = _interopRequireDefault(possibleConstructorReturn$2.exports);
122297
122271
  var _getPrototypeOf2 = _interopRequireDefault(getPrototypeOf$2.exports);
122272
+ var _defineProperty2 = _interopRequireDefault(defineProperty$4.exports);
122298
122273
  var _react = _interopRequireDefault(require$$8$5);
122299
122274
  var _reactDom = _interopRequireDefault(require$$9$6);
122300
122275
  var _propTypes = _interopRequireDefault(require$$10$4);
@@ -122367,7 +122342,10 @@ const require$$16 = _dll_classnames;
122367
122342
  backgroundColor: _renderUi.color.background(),
122368
122343
  border: ("2px dashed ").concat(_renderUi.color.text()),
122369
122344
  color: _renderUi.color.text(),
122345
+ minWidth: '90px',
122370
122346
  fontSize: 'inherit',
122347
+ minHeight: '32px',
122348
+ height: 'auto',
122371
122349
  maxWidth: '374px',
122372
122350
  position: 'relative',
122373
122351
  borderRadius: '3px'
@@ -122409,8 +122387,7 @@ const require$$16 = _dll_classnames;
122409
122387
  (0, _classCallCheck2["default"])(this, BlankContent);
122410
122388
  _this = _super.call(this);
122411
122389
  _this.state = {
122412
- height: 0,
122413
- width: 0
122390
+ height: 0
122414
122391
  };
122415
122392
  return _this;
122416
122393
  }
@@ -122424,33 +122401,17 @@ const require$$16 = _dll_classnames;
122424
122401
  if (JSON.stringify(currentChoice) !== JSON.stringify(prevChoice)) {
122425
122402
  if (!currentChoice) {
122426
122403
  this.setState({
122427
- height: 0,
122428
- width: 0
122404
+ height: 0
122429
122405
  });
122430
122406
  return;
122431
122407
  }
122432
122408
  setTimeout(function () {
122433
- _this2.updateDimensions();
122409
+ _this2.setState({
122410
+ height: _this2.spanRef.offsetHeight
122411
+ });
122434
122412
  }, 300);
122435
122413
  }
122436
122414
  }
122437
- }, {
122438
- key: "updateDimensions",
122439
- value: function updateDimensions() {
122440
- var _this$spanRef, _this$spanRef2;
122441
- var height = ((_this$spanRef = this.spanRef) === null || _this$spanRef === void 0 ? void 0 : _this$spanRef.offsetHeight) || 0;
122442
- var width = ((_this$spanRef2 = this.spanRef) === null || _this$spanRef2 === void 0 ? void 0 : _this$spanRef2.offsetWidth) || 0;
122443
- var responseAreaHeight = parseFloat(this.props.emptyResponseAreaHeight) || 0;
122444
- var responseAreaWidth = parseFloat(this.props.emptyResponseAreaWidth) || 0;
122445
- if (height > responseAreaHeight || width > responseAreaWidth) {
122446
- this.setState(function (prevState) {
122447
- return {
122448
- width: width > responseAreaWidth ? width : prevState.width,
122449
- height: height > responseAreaHeight ? height : prevState.height
122450
- };
122451
- });
122452
- }
122453
- }
122454
122415
  }, {
122455
122416
  key: "addDraggableFalseAttributes",
122456
122417
  value: function addDraggableFalseAttributes(parent) {
@@ -122460,19 +122421,6 @@ const require$$16 = _dll_classnames;
122460
122421
  }
122461
122422
  });
122462
122423
  }
122463
- }, {
122464
- key: "getRootDimensions",
122465
- value: function getRootDimensions() {
122466
- var rootStyle = {
122467
- height: this.state.height || this.props.emptyResponseAreaHeight,
122468
- width: this.state.width || this.props.emptyResponseAreaWidth
122469
- };
122470
- return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), this.props.emptyResponseAreaWidth ? {} : {
122471
- minWidth: 90
122472
- }), this.props.emptyResponseAreaHeight ? {} : {
122473
- minHeight: 32
122474
- });
122475
- }
122476
122424
  }, {
122477
122425
  key: "render",
122478
122426
  value: function render() {
@@ -122508,7 +122456,9 @@ const require$$16 = _dll_classnames;
122508
122456
  }, ' ')),
122509
122457
  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)),
122510
122458
  variant: disabled ? 'outlined' : undefined,
122511
- style: _objectSpread({}, this.getRootDimensions()),
122459
+ style: _objectSpread({}, this.state.height ? {
122460
+ height: this.state.height
122461
+ } : {}),
122512
122462
  classes: {
122513
122463
  label: isOver && classes.over
122514
122464
  }
@@ -122518,11 +122468,7 @@ const require$$16 = _dll_classnames;
122518
122468
  return BlankContent;
122519
122469
  })(_react["default"].Component);
122520
122470
  exports.BlankContent = BlankContent;
122521
- BlankContent.defaultProps = {
122522
- emptyResponseAreaWidth: 0,
122523
- emptyResponseAreaHeight: 0
122524
- };
122525
- BlankContent.propTypes = {
122471
+ (0, _defineProperty2["default"])(BlankContent, "propTypes", {
122526
122472
  id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
122527
122473
  disabled: _propTypes["default"].bool,
122528
122474
  duplicates: _propTypes["default"].bool,
@@ -122531,10 +122477,8 @@ const require$$16 = _dll_classnames;
122531
122477
  isOver: _propTypes["default"].bool,
122532
122478
  dragItem: _propTypes["default"].object,
122533
122479
  correct: _propTypes["default"].bool,
122534
- onChange: _propTypes["default"].func,
122535
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
122536
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
122537
- };
122480
+ onChange: _propTypes["default"].func
122481
+ });
122538
122482
  var StyledBlankContent = useStyles(BlankContent);
122539
122483
  var connectedBlankContent = useStyles(function (_ref4) {
122540
122484
  var connectDragSource = _ref4.connectDragSource, connectDropTarget = _ref4.connectDropTarget, props = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
@@ -122619,27 +122563,6 @@ const require$$9$5 = _dll_prop_types;
122619
122563
  var _choices = _interopRequireDefault(choices);
122620
122564
  var _blank = _interopRequireDefault(blank);
122621
122565
  var _withMask = withMask$1;
122622
- function ownKeys(object, enumerableOnly) {
122623
- var keys = Object.keys(object);
122624
- if (Object.getOwnPropertySymbols) {
122625
- var symbols = Object.getOwnPropertySymbols(object);
122626
- (enumerableOnly && (symbols = symbols.filter(function (sym) {
122627
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
122628
- })), keys.push.apply(keys, symbols));
122629
- }
122630
- return keys;
122631
- }
122632
- function _objectSpread(target) {
122633
- for (var i = 1; i < arguments.length; i++) {
122634
- var source = null != arguments[i] ? arguments[i] : {};
122635
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
122636
- (0, _defineProperty2["default"])(target, key, source[key]);
122637
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
122638
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
122639
- });
122640
- }
122641
- return target;
122642
- }
122643
122566
  function _createSuper(Derived) {
122644
122567
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
122645
122568
  return function _createSuperInternal() {
@@ -122668,7 +122591,7 @@ const require$$9$5 = _dll_prop_types;
122668
122591
  return function (node, data, onChange) {
122669
122592
  var dataset = node.data ? node.data.dataset || ({}) : {};
122670
122593
  if (dataset.component === 'blank') {
122671
- var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer, emptyResponseAreaWidth = props.emptyResponseAreaWidth, emptyResponseAreaHeight = props.emptyResponseAreaHeight;
122594
+ var disabled = props.disabled, duplicates = props.duplicates, correctResponse = props.correctResponse, feedback = props.feedback, showCorrectAnswer = props.showCorrectAnswer;
122672
122595
  var choiceId = showCorrectAnswer ? correctResponse[dataset.id] : data[dataset.id];
122673
122596
  var choice = choiceId && props.choices.find(function (c) {
122674
122597
  return c.id === choiceId;
@@ -122680,8 +122603,6 @@ const require$$9$5 = _dll_prop_types;
122680
122603
  duplicates: duplicates,
122681
122604
  choice: choice,
122682
122605
  id: dataset.id,
122683
- emptyResponseAreaWidth: emptyResponseAreaWidth,
122684
- emptyResponseAreaHeight: emptyResponseAreaHeight,
122685
122606
  onChange: onChange
122686
122607
  });
122687
122608
  }
@@ -122699,17 +122620,12 @@ const require$$9$5 = _dll_prop_types;
122699
122620
  _this = _super.call.apply(_super, [this].concat(args));
122700
122621
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPositionDirection", function (choicePosition) {
122701
122622
  var flexDirection;
122702
- var justifyContent;
122703
- var alignItems;
122704
122623
  switch (choicePosition) {
122705
122624
  case 'left':
122706
122625
  flexDirection = 'row';
122707
- alignItems = 'center';
122708
122626
  break;
122709
122627
  case 'right':
122710
122628
  flexDirection = 'row-reverse';
122711
- justifyContent = 'flex-end';
122712
- alignItems = 'center';
122713
122629
  break;
122714
122630
  case 'below':
122715
122631
  flexDirection = 'column-reverse';
@@ -122718,11 +122634,7 @@ const require$$9$5 = _dll_prop_types;
122718
122634
  flexDirection = 'column';
122719
122635
  break;
122720
122636
  }
122721
- return {
122722
- flexDirection: flexDirection,
122723
- justifyContent: justifyContent,
122724
- alignItems: alignItems
122725
- };
122637
+ return flexDirection;
122726
122638
  });
122727
122639
  return _this;
122728
122640
  }
@@ -122742,12 +122654,12 @@ const require$$9$5 = _dll_prop_types;
122742
122654
  key: "render",
122743
122655
  value: function render() {
122744
122656
  var _this2 = this;
122745
- 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;
122657
+ 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;
122746
122658
  var choicePosition = choicesPosition || 'below';
122747
- var style = _objectSpread({
122659
+ var style = {
122748
122660
  display: 'flex',
122749
- minWidth: '100px'
122750
- }, this.getPositionDirection(choicePosition));
122661
+ flexDirection: this.getPositionDirection(choicePosition)
122662
+ };
122751
122663
  return _react["default"].createElement("div", {
122752
122664
  ref: function ref(_ref) {
122753
122665
  return _ref && (_this2.rootRef = _ref);
@@ -122769,9 +122681,7 @@ const require$$9$5 = _dll_prop_types;
122769
122681
  duplicates: duplicates,
122770
122682
  feedback: feedback,
122771
122683
  correctResponse: correctResponse,
122772
- showCorrectAnswer: showCorrectAnswer,
122773
- emptyResponseAreaWidth: emptyResponseAreaWidth,
122774
- emptyResponseAreaHeight: emptyResponseAreaHeight
122684
+ showCorrectAnswer: showCorrectAnswer
122775
122685
  }));
122776
122686
  }
122777
122687
  }]);
@@ -122792,9 +122702,7 @@ const require$$9$5 = _dll_prop_types;
122792
122702
  disabled: _propTypes["default"].bool,
122793
122703
  feedback: _propTypes["default"].object,
122794
122704
  correctResponse: _propTypes["default"].object,
122795
- showCorrectAnswer: _propTypes["default"].bool,
122796
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
122797
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
122705
+ showCorrectAnswer: _propTypes["default"].bool
122798
122706
  });
122799
122707
  })(dragInTheBlank);
122800
122708
  getDefaultExportFromCjs(dragInTheBlank);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "6.20.1-next.18+a61e1177e",
7
+ "version": "6.20.1-next.5+6084f693c",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "postpublish": "../../scripts/postpublish"
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@material-ui/core": "^3.9.2",
14
14
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/pie-toolbox": "1.29.0",
15
+ "@pie-lib/pie-toolbox": "1.28.0",
16
16
  "classnames": "^2.2.5",
17
17
  "lodash": "^4.17.10",
18
18
  "prop-types": "^15.6.1",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "author": "",
23
23
  "license": "ISC",
24
- "gitHead": "a61e1177e55cd7bd8d244c638fda8a313f960078",
24
+ "gitHead": "6084f693cf23739eba410d0a16ee53a292e9077d",
25
25
  "main": "lib/index.js",
26
26
  "module": "src/index.js",
27
27
  "exports": {