@pie-element/explicit-constructed-response 7.6.6-next.15 → 7.6.6-next.17

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": "2.23.2",
11
+ "@pie-lib/pie-toolbox": "2.23.3",
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": "2.23.2",
11
+ "@pie-lib/pie-toolbox": "2.23.3",
12
12
  "debug": "^3.1.0",
13
13
  "he": "^1.2.0",
14
14
  "lodash": "^4.17.15",
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.5.2/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@8.5.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@8.5.2/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.5.2/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@8.5.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@8.5.2/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) {
@@ -149762,6 +149762,9 @@ const require$$16$1 = _dll_classnames;
149762
149762
  (0, _classCallCheck2["default"])(this, BlankContent);
149763
149763
  _this = _super.call(this, props);
149764
149764
  _this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2["default"])(_this));
149765
+ _this.state = {
149766
+ hoveredElementSize: null
149767
+ };
149765
149768
  return _this;
149766
149769
  }
149767
149770
  (0, _createClass2["default"])(BlankContent, [{
@@ -149782,21 +149785,46 @@ const require$$16$1 = _dll_classnames;
149782
149785
  this.elementRef.className = this.elementRef.contains(event.target) ? classes.selected : '';
149783
149786
  }
149784
149787
  }
149788
+ }, {
149789
+ key: "getSnapshotBeforeUpdate",
149790
+ value: function getSnapshotBeforeUpdate(prevProps) {
149791
+ if (!prevProps.isOver && this.props.isOver && this.elementRef) {
149792
+ var node = this.elementRef;
149793
+ return {
149794
+ width: node.offsetWidth,
149795
+ height: node.offsetHeight
149796
+ };
149797
+ }
149798
+ return null;
149799
+ }
149785
149800
  }, {
149786
149801
  key: "componentDidUpdate",
149787
- value: function componentDidUpdate() {
149788
- if (this.elementRef) {
149802
+ value: function componentDidUpdate(prevProps, prevState, snapshot) {
149803
+ if (this.elementRef && typeof _mathRendering.renderMath === 'function') {
149789
149804
  (0, _mathRendering.renderMath)(this.elementRef);
149790
149805
  }
149806
+ if (snapshot && (!this.state.hoveredElementSize || this.state.hoveredElementSize.width !== snapshot.width || this.state.hoveredElementSize.height !== snapshot.height)) {
149807
+ this.setState({
149808
+ hoveredElementSize: snapshot
149809
+ });
149810
+ return;
149811
+ }
149812
+ if (prevProps.isOver && !this.props.isOver && this.state.hoveredElementSize) {
149813
+ this.setState({
149814
+ hoveredElementSize: null
149815
+ });
149816
+ }
149791
149817
  }
149792
149818
  }, {
149793
149819
  key: "render",
149794
149820
  value: function render() {
149795
149821
  var _this2 = this;
149796
149822
  var _this$props = this.props, n = _this$props.n, children = _this$props.children, isDragging = _this$props.isDragging, dragItem = _this$props.dragItem, isOver = _this$props.isOver, value = _this$props.value;
149823
+ var hoveredElementSize = this.state.hoveredElementSize;
149797
149824
  var label = dragItem && isOver ? dragItem.value.value : value.value || "\xA0";
149798
149825
  var finalLabel = isDragging ? "\xA0" : label;
149799
149826
  var hasGrip = finalLabel !== "\xA0";
149827
+ var isPreview = dragItem && isOver;
149800
149828
  return _react["default"].createElement("div", {
149801
149829
  ref: function ref(_ref) {
149802
149830
  return _this2.elementRef = _ref;
@@ -149805,13 +149833,15 @@ const require$$16$1 = _dll_classnames;
149805
149833
  display: 'inline-flex',
149806
149834
  minWidth: '178px',
149807
149835
  minHeight: '36px',
149808
- background: '#FFF',
149809
- border: '1px solid #C0C3CF',
149836
+ background: isPreview ? ("").concat(_renderUi.color.defaults.BORDER_LIGHT) : ("").concat(_renderUi.color.defaults.WHITE),
149837
+ border: isPreview ? ("1px solid ").concat(_renderUi.color.defaults.BORDER_DARK) : ("1px solid ").concat(_renderUi.color.defaults.BORDER_LIGHT),
149810
149838
  boxSizing: 'border-box',
149811
149839
  borderRadius: '3px',
149812
149840
  overflow: 'hidden',
149813
149841
  position: 'relative',
149814
- padding: '8px 8px 8px 35px'
149842
+ padding: '8px 8px 8px 35px',
149843
+ width: hoveredElementSize ? hoveredElementSize.width : undefined,
149844
+ height: hoveredElementSize ? hoveredElementSize.height : undefined
149815
149845
  },
149816
149846
  "data-key": n.key,
149817
149847
  contentEditable: false
@@ -149873,7 +149903,9 @@ const require$$16$1 = _dll_classnames;
149873
149903
  var DropTile = (0, _drag.DropTarget)('drag-in-the-blank-choice', tileTarget, function (connect, monitor) {
149874
149904
  return {
149875
149905
  connectDropTarget: connect.dropTarget(),
149876
- isOver: monitor.isOver(),
149906
+ isOver: monitor.isOver({
149907
+ shallow: true
149908
+ }),
149877
149909
  dragItem: monitor.getItem()
149878
149910
  };
149879
149911
  })(connectedBlankContent);
@@ -155560,14 +155592,18 @@ const require$$19 = _dll_classnames;
155560
155592
  visibility: 'hidden',
155561
155593
  top: 0,
155562
155594
  left: 0
155563
- }
155595
+ },
155596
+ tabIndex: -1,
155597
+ "aria-hidden": "true"
155564
155598
  }, (choices || []).map(function (c, index) {
155565
155599
  return _react["default"].createElement(_MenuItem["default"], {
155566
155600
  key: index,
155567
155601
  classes: {
155568
155602
  root: classes.menuRoot,
155569
155603
  selected: classes.selected
155570
- }
155604
+ },
155605
+ tabIndex: -1,
155606
+ "aria-hidden": "true"
155571
155607
  }, _react["default"].createElement("span", {
155572
155608
  className: classes.label,
155573
155609
  dangerouslySetInnerHTML: {
@@ -155576,7 +155612,9 @@ const require$$19 = _dll_classnames;
155576
155612
  }));
155577
155613
  })), _react["default"].createElement(_InputLabel["default"], {
155578
155614
  className: classes.srOnly,
155579
- id: labelId
155615
+ id: labelId,
155616
+ tabIndex: -1,
155617
+ "aria-hidden": "true"
155580
155618
  }, labelText), _react["default"].createElement(_Button["default"], {
155581
155619
  ref: this.buttonRef,
155582
155620
  style: _objectSpread(_objectSpread({}, this.state.menuWidth && ({
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "8.5.1"
11
+ "version": "8.5.2"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_classnames, _dll_react_dom, _dll_pie_framework__mathquill, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.5.2/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@8.5.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@8.5.2/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) {
@@ -149725,6 +149725,9 @@ const require$$16$1 = _dll_classnames;
149725
149725
  (0, _classCallCheck2["default"])(this, BlankContent);
149726
149726
  _this = _super.call(this, props);
149727
149727
  _this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2["default"])(_this));
149728
+ _this.state = {
149729
+ hoveredElementSize: null
149730
+ };
149728
149731
  return _this;
149729
149732
  }
149730
149733
  (0, _createClass2["default"])(BlankContent, [{
@@ -149745,21 +149748,46 @@ const require$$16$1 = _dll_classnames;
149745
149748
  this.elementRef.className = this.elementRef.contains(event.target) ? classes.selected : '';
149746
149749
  }
149747
149750
  }
149751
+ }, {
149752
+ key: "getSnapshotBeforeUpdate",
149753
+ value: function getSnapshotBeforeUpdate(prevProps) {
149754
+ if (!prevProps.isOver && this.props.isOver && this.elementRef) {
149755
+ var node = this.elementRef;
149756
+ return {
149757
+ width: node.offsetWidth,
149758
+ height: node.offsetHeight
149759
+ };
149760
+ }
149761
+ return null;
149762
+ }
149748
149763
  }, {
149749
149764
  key: "componentDidUpdate",
149750
- value: function componentDidUpdate() {
149751
- if (this.elementRef) {
149765
+ value: function componentDidUpdate(prevProps, prevState, snapshot) {
149766
+ if (this.elementRef && typeof _mathRendering.renderMath === 'function') {
149752
149767
  (0, _mathRendering.renderMath)(this.elementRef);
149753
149768
  }
149769
+ if (snapshot && (!this.state.hoveredElementSize || this.state.hoveredElementSize.width !== snapshot.width || this.state.hoveredElementSize.height !== snapshot.height)) {
149770
+ this.setState({
149771
+ hoveredElementSize: snapshot
149772
+ });
149773
+ return;
149774
+ }
149775
+ if (prevProps.isOver && !this.props.isOver && this.state.hoveredElementSize) {
149776
+ this.setState({
149777
+ hoveredElementSize: null
149778
+ });
149779
+ }
149754
149780
  }
149755
149781
  }, {
149756
149782
  key: "render",
149757
149783
  value: function render() {
149758
149784
  var _this2 = this;
149759
149785
  var _this$props = this.props, n = _this$props.n, children = _this$props.children, isDragging = _this$props.isDragging, dragItem = _this$props.dragItem, isOver = _this$props.isOver, value = _this$props.value;
149786
+ var hoveredElementSize = this.state.hoveredElementSize;
149760
149787
  var label = dragItem && isOver ? dragItem.value.value : value.value || "\xA0";
149761
149788
  var finalLabel = isDragging ? "\xA0" : label;
149762
149789
  var hasGrip = finalLabel !== "\xA0";
149790
+ var isPreview = dragItem && isOver;
149763
149791
  return _react["default"].createElement("div", {
149764
149792
  ref: function ref(_ref) {
149765
149793
  return _this2.elementRef = _ref;
@@ -149768,13 +149796,15 @@ const require$$16$1 = _dll_classnames;
149768
149796
  display: 'inline-flex',
149769
149797
  minWidth: '178px',
149770
149798
  minHeight: '36px',
149771
- background: '#FFF',
149772
- border: '1px solid #C0C3CF',
149799
+ background: isPreview ? ("").concat(_renderUi.color.defaults.BORDER_LIGHT) : ("").concat(_renderUi.color.defaults.WHITE),
149800
+ border: isPreview ? ("1px solid ").concat(_renderUi.color.defaults.BORDER_DARK) : ("1px solid ").concat(_renderUi.color.defaults.BORDER_LIGHT),
149773
149801
  boxSizing: 'border-box',
149774
149802
  borderRadius: '3px',
149775
149803
  overflow: 'hidden',
149776
149804
  position: 'relative',
149777
- padding: '8px 8px 8px 35px'
149805
+ padding: '8px 8px 8px 35px',
149806
+ width: hoveredElementSize ? hoveredElementSize.width : undefined,
149807
+ height: hoveredElementSize ? hoveredElementSize.height : undefined
149778
149808
  },
149779
149809
  "data-key": n.key,
149780
149810
  contentEditable: false
@@ -149836,7 +149866,9 @@ const require$$16$1 = _dll_classnames;
149836
149866
  var DropTile = (0, _drag.DropTarget)('drag-in-the-blank-choice', tileTarget, function (connect, monitor) {
149837
149867
  return {
149838
149868
  connectDropTarget: connect.dropTarget(),
149839
- isOver: monitor.isOver(),
149869
+ isOver: monitor.isOver({
149870
+ shallow: true
149871
+ }),
149840
149872
  dragItem: monitor.getItem()
149841
149873
  };
149842
149874
  })(connectedBlankContent);
@@ -155523,14 +155555,18 @@ const require$$19 = _dll_classnames;
155523
155555
  visibility: 'hidden',
155524
155556
  top: 0,
155525
155557
  left: 0
155526
- }
155558
+ },
155559
+ tabIndex: -1,
155560
+ "aria-hidden": "true"
155527
155561
  }, (choices || []).map(function (c, index) {
155528
155562
  return _react["default"].createElement(_MenuItem["default"], {
155529
155563
  key: index,
155530
155564
  classes: {
155531
155565
  root: classes.menuRoot,
155532
155566
  selected: classes.selected
155533
- }
155567
+ },
155568
+ tabIndex: -1,
155569
+ "aria-hidden": "true"
155534
155570
  }, _react["default"].createElement("span", {
155535
155571
  className: classes.label,
155536
155572
  dangerouslySetInnerHTML: {
@@ -155539,7 +155575,9 @@ const require$$19 = _dll_classnames;
155539
155575
  }));
155540
155576
  })), _react["default"].createElement(_InputLabel["default"], {
155541
155577
  className: classes.srOnly,
155542
- id: labelId
155578
+ id: labelId,
155579
+ tabIndex: -1,
155580
+ "aria-hidden": "true"
155543
155581
  }, labelText), _react["default"].createElement(_Button["default"], {
155544
155582
  ref: this.buttonRef,
155545
155583
  style: _objectSpread(_objectSpread({}, this.state.menuWidth && ({
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "7.6.6-next.15+e7330e746",
7
+ "version": "7.6.6-next.17+fe5bbd145",
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": "2.23.2",
15
+ "@pie-lib/pie-toolbox": "2.23.3",
16
16
  "classnames": "^2.2.5",
17
17
  "he": "^1.2.0",
18
18
  "lodash": "^4.17.10",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "author": "",
24
24
  "license": "ISC",
25
- "gitHead": "e7330e746f2a1695f3e96d0647dd7cde82043b8e",
25
+ "gitHead": "fe5bbd1455a83f8d2a97029ec86ffce85e8a5e59",
26
26
  "main": "lib/index.js",
27
27
  "module": "src/index.js",
28
28
  "exports": {