@pie-element/complex-rubric 3.1.1-next.0 → 3.1.1-next.1

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.
@@ -7,7 +7,7 @@
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/pie-toolbox": "2.0.9",
10
+ "@pie-lib/pie-toolbox": "2.0.10",
11
11
  "lodash": "^4.17.15"
12
12
  },
13
13
  "author": "",
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.7/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.8/module/index.js";
2
2
  import RubricConfigure from '@pie-element/rubric/configure/lib';
3
3
  import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.6/module/index.js";
4
4
  function _mergeNamespaces(n, m) {
@@ -92076,7 +92076,7 @@ const require$$24 = _dll_pie_framework__mathquill;
92076
92076
  }
92077
92077
  if (keyPadElement) {
92078
92078
  keyPadElement.removeEventListener('touchstart', this.handleKeypadInteraction, true);
92079
- keyPadElement.addEventListener('mousedown', this.handleKeypadInteraction, true);
92079
+ keyPadElement.removeEventListener('mousedown', this.handleKeypadInteraction, true);
92080
92080
  }
92081
92081
  }
92082
92082
  }, {
@@ -93597,7 +93597,7 @@ const require$$10$w = _dll_classnames;
93597
93597
  hideDoneButtonBackground: _propTypes["default"].bool,
93598
93598
  error: _propTypes["default"].any,
93599
93599
  maxResponseAreas: _propTypes["default"].number,
93600
- keyPadCharacterRef: _propTypes["default"].func,
93600
+ keyPadCharacterRef: _propTypes["default"].object,
93601
93601
  setKeypadInteraction: _propTypes["default"].func
93602
93602
  });
93603
93603
  (0, _defineProperty2["default"])(RawPureToolbar, "defaultProps", {
@@ -103913,10 +103913,10 @@ var specialConfig = {
103913
103913
  write: 'Ç',
103914
103914
  label: 'Ç'
103915
103915
  }], [{
103916
- unicode: 'U+00A0',
103917
- description: 'NO-BREAK SPACE',
103918
- write: String.fromCodePoint('0x00A0'),
103919
- label: ' '
103916
+ unicode: 'U+200A',
103917
+ description: 'HAIR SPACE',
103918
+ write: String.fromCodePoint('0x200A'),
103919
+ label: ' '
103920
103920
  }, {
103921
103921
  unicode: 'U+00A7',
103922
103922
  description: 'SECTION SIGN',
@@ -104003,10 +104003,10 @@ var specialConfig = {
104003
104003
  write: '−',
104004
104004
  label: '−'
104005
104005
  }], [{
104006
- unicode: 'U+200A',
104007
- description: 'HAIR SPACE',
104008
- write: String.fromCodePoint('0x200A'),
104009
- label: ' '
104006
+ unicode: 'U+00A0',
104007
+ description: 'NO-BREAK SPACE',
104008
+ write: String.fromCodePoint('0x00A0'),
104009
+ label: ' '
104010
104010
  }, {
104011
104011
  unicode: 'U+2022',
104012
104012
  description: 'BULLET',
@@ -104053,10 +104053,10 @@ var specialConfig = {
104053
104053
  write: '–',
104054
104054
  label: '–'
104055
104055
  }], [{
104056
- unicode: 'U+0009',
104057
- description: 'TAB',
104058
- write: String.fromCodePoint('0x0009'),
104059
- label: 'TAB'
104056
+ unicode: 'U+2003',
104057
+ description: 'EM SPACE',
104058
+ write: String.fromCodePoint('0x2003'),
104059
+ label: ' '
104060
104060
  }, {
104061
104061
  unicode: 'U+25E6',
104062
104062
  description: 'WHITE BULLET',
@@ -113972,9 +113972,7 @@ const require$$23 = _dll_classnames;
113972
113972
  (0, _classCallCheck2["default"])(this, Editor);
113973
113973
  _this = _super.call(this, _props);
113974
113974
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setKeypadInteraction", function (interacted) {
113975
- _this.setState({
113976
- keypadInteractionDetected: interacted
113977
- });
113975
+ _this.keypadInteractionDetected = interacted;
113978
113976
  });
113979
113977
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDialog", function (open) {
113980
113978
  var extraDialogProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -114259,10 +114257,9 @@ const require$$23 = _dll_classnames;
114259
114257
  log('[onBlur]');
114260
114258
  var relatedTarget = event.relatedTarget;
114261
114259
  var toolbarElement = _this.toolbarRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]")));
114262
- var keypadInteractionDetected = _this.state.keypadInteractionDetected;
114263
114260
  var isRawDoneButton = _this.doneButtonRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.doneButtonRef.className, "\"]")));
114264
- _this.skipBlurHandling = keypadInteractionDetected ? true : false;
114265
- if (toolbarElement && !isRawDoneButton) {
114261
+ _this.skipBlurHandling = _this.keypadInteractionDetected ? true : false;
114262
+ if (toolbarElement && !isRawDoneButton && !_this.state.focusToolbar) {
114266
114263
  _this.setState({
114267
114264
  focusToolbar: true
114268
114265
  });
@@ -114282,13 +114279,10 @@ const require$$23 = _dll_classnames;
114282
114279
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDomBlur", function (e) {
114283
114280
  var editorDOM = document.querySelector(("[data-key=\"").concat(_this.state.value.document.key, "\"]"));
114284
114281
  setTimeout(function () {
114285
- var _this$state2 = _this.state, stateValue = _this$state2.value, keypadInteractionDetected = _this$state2.keypadInteractionDetected;
114282
+ var stateValue = _this.state.value;
114286
114283
  if (!_this.wrapperRef) {
114287
114284
  return;
114288
114285
  }
114289
- if (keypadInteractionDetected) {
114290
- _this.setKeypadInteraction(false);
114291
- }
114292
114286
  var editorElement = !editorDOM || document.activeElement.closest(("[class*=\"").concat(editorDOM.className, "\"]"));
114293
114287
  var toolbarElement = !_this.toolbarRef || document.activeElement.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]"));
114294
114288
  var isInCurrentComponent = _this.wrapperRef.contains(editorElement) || _this.wrapperRef.contains(toolbarElement);
@@ -114305,9 +114299,8 @@ const require$$23 = _dll_classnames;
114305
114299
  var _navigator;
114306
114300
  var editorDOM = document.querySelector(("[data-key=\"").concat(_this.state.value.document.key, "\"]"));
114307
114301
  var isTouchDevice = typeof window !== 'undefined' && (('ontouchstart' in window) || ((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.maxTouchPoints) > 0);
114308
- var keypadInteractionDetected = _this.state.keypadInteractionDetected;
114309
114302
  log('[onFocus]', document.activeElement);
114310
- if (keypadInteractionDetected && _this.__TEMPORARY_CHANGE_DATA) {
114303
+ if (_this.keypadInteractionDetected && _this.__TEMPORARY_CHANGE_DATA) {
114311
114304
  _this.__TEMPORARY_CHANGE_DATA = null;
114312
114305
  }
114313
114306
  if (_this.__TEMPORARY_CHANGE_DATA) {
@@ -114330,9 +114323,14 @@ const require$$23 = _dll_classnames;
114330
114323
  }
114331
114324
  _this.stashValue();
114332
114325
  _this.props.onFocus();
114333
- if (!keypadInteractionDetected && !isTouchDevice) {
114326
+ var isKeypadInteractionActive = _this.keypadInteractionDetected;
114327
+ var shouldFocusEditor = !isKeypadInteractionActive && !isTouchDevice;
114328
+ if (shouldFocusEditor) {
114334
114329
  change === null || change === void 0 ? void 0 : change.focus();
114335
114330
  }
114331
+ if (isKeypadInteractionActive) {
114332
+ _this.setKeypadInteraction(false);
114333
+ }
114336
114334
  resolve();
114337
114335
  });
114338
114336
  });
@@ -114345,7 +114343,7 @@ const require$$23 = _dll_classnames;
114345
114343
  }
114346
114344
  });
114347
114345
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "resetValue", function (force) {
114348
- var _this$state3 = _this.state, value = _this$state3.value, focusedNode = _this$state3.focusedNode;
114346
+ var _this$state2 = _this.state, value = _this$state2.value, focusedNode = _this$state2.focusedNode;
114349
114347
  var stopReset = _this.plugins.reduce(function (s, p) {
114350
114348
  return s || p.stopReset && p.stopReset(_this.state.value);
114351
114349
  }, false);
@@ -114574,12 +114572,12 @@ const require$$23 = _dll_classnames;
114574
114572
  isHtmlMode: false,
114575
114573
  isEditedInHtmlMode: false,
114576
114574
  focusToolbar: false,
114577
- keypadInteractionDetected: false,
114578
114575
  dialog: {
114579
114576
  open: false
114580
114577
  }
114581
114578
  };
114582
114579
  _this.keyPadCharacterRef = _react["default"].createRef();
114580
+ _this.keypadInteractionDetected = false;
114583
114581
  _this.toggleHtmlMode = _this.toggleHtmlMode.bind((0, _assertThisInitialized2["default"])(_this));
114584
114582
  _this.handleToolbarFocus = _this.handleToolbarFocus.bind((0, _assertThisInitialized2["default"])(_this));
114585
114583
  _this.handleToolbarBlur = _this.handleToolbarBlur.bind((0, _assertThisInitialized2["default"])(_this));
@@ -114594,6 +114592,9 @@ const require$$23 = _dll_classnames;
114594
114592
  (0, _createClass2["default"])(Editor, [{
114595
114593
  key: "handleToolbarFocus",
114596
114594
  value: function handleToolbarFocus() {
114595
+ if (this.state.focusToolbar) {
114596
+ return;
114597
+ }
114597
114598
  this.setState({
114598
114599
  focusToolbar: true
114599
114600
  });
@@ -114608,7 +114609,7 @@ const require$$23 = _dll_classnames;
114608
114609
  focusToolbar: false
114609
114610
  });
114610
114611
  }
114611
- }, 10);
114612
+ }, 0);
114612
114613
  }
114613
114614
  }, {
114614
114615
  key: "toolbarContainsFocus",
@@ -114647,7 +114648,7 @@ const require$$23 = _dll_classnames;
114647
114648
  key: "UNSAFE_componentWillReceiveProps",
114648
114649
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
114649
114650
  var _nextProps$value, _nextProps$value$docu, _this$props$value;
114650
- var _this$state4 = this.state, isHtmlMode = _this$state4.isHtmlMode, toolbarOpts = _this$state4.toolbarOpts;
114651
+ var _this$state3 = this.state, isHtmlMode = _this$state3.isHtmlMode, toolbarOpts = _this$state3.toolbarOpts;
114651
114652
  var newToolbarOpts = createToolbarOpts(nextProps.toolbarOpts, nextProps.error, isHtmlMode);
114652
114653
  if (!(0, _isEqual["default"])(newToolbarOpts, toolbarOpts)) {
114653
114654
  this.setState({
@@ -114703,7 +114704,7 @@ const require$$23 = _dll_classnames;
114703
114704
  var _ref4 = pluginProps || ({});
114704
114705
  _ref4.customPlugins;
114705
114706
  var otherPluginProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
114706
- var _this$state5 = this.state, value = _this$state5.value, focusedNode = _this$state5.focusedNode, toolbarOpts = _this$state5.toolbarOpts, dialog = _this$state5.dialog, scheduled = _this$state5.scheduled;
114707
+ var _this$state4 = this.state, value = _this$state4.value, focusedNode = _this$state4.focusedNode, toolbarOpts = _this$state4.toolbarOpts, dialog = _this$state4.dialog, scheduled = _this$state4.scheduled;
114707
114708
  log('[render] value: ', value);
114708
114709
  var sizeStyle = this.buildSizeStyle();
114709
114710
  var names = (0, _classnames["default"])((_classNames = {}, (0, _defineProperty2["default"])(_classNames, classes.withBg, highlightShape), (0, _defineProperty2["default"])(_classNames, classes.toolbarOnTop, toolbarOpts.alwaysVisible && toolbarOpts.position === 'top'), (0, _defineProperty2["default"])(_classNames, classes.scheduled, scheduled), _classNames), className);
package/module/element.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.7/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.8/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.6/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -36719,7 +36719,7 @@ const require$$24 = _dll_pie_framework__mathquill;
36719
36719
  }
36720
36720
  if (keyPadElement) {
36721
36721
  keyPadElement.removeEventListener('touchstart', this.handleKeypadInteraction, true);
36722
- keyPadElement.addEventListener('mousedown', this.handleKeypadInteraction, true);
36722
+ keyPadElement.removeEventListener('mousedown', this.handleKeypadInteraction, true);
36723
36723
  }
36724
36724
  }
36725
36725
  }, {
@@ -83663,7 +83663,7 @@ const require$$10$x = _dll_classnames;
83663
83663
  hideDoneButtonBackground: _propTypes["default"].bool,
83664
83664
  error: _propTypes["default"].any,
83665
83665
  maxResponseAreas: _propTypes["default"].number,
83666
- keyPadCharacterRef: _propTypes["default"].func,
83666
+ keyPadCharacterRef: _propTypes["default"].object,
83667
83667
  setKeypadInteraction: _propTypes["default"].func
83668
83668
  });
83669
83669
  (0, _defineProperty2["default"])(RawPureToolbar, "defaultProps", {
@@ -102173,10 +102173,10 @@ var specialConfig = {
102173
102173
  write: 'Ç',
102174
102174
  label: 'Ç'
102175
102175
  }], [{
102176
- unicode: 'U+00A0',
102177
- description: 'NO-BREAK SPACE',
102178
- write: String.fromCodePoint('0x00A0'),
102179
- label: ' '
102176
+ unicode: 'U+200A',
102177
+ description: 'HAIR SPACE',
102178
+ write: String.fromCodePoint('0x200A'),
102179
+ label: ' '
102180
102180
  }, {
102181
102181
  unicode: 'U+00A7',
102182
102182
  description: 'SECTION SIGN',
@@ -102263,10 +102263,10 @@ var specialConfig = {
102263
102263
  write: '−',
102264
102264
  label: '−'
102265
102265
  }], [{
102266
- unicode: 'U+200A',
102267
- description: 'HAIR SPACE',
102268
- write: String.fromCodePoint('0x200A'),
102269
- label: ' '
102266
+ unicode: 'U+00A0',
102267
+ description: 'NO-BREAK SPACE',
102268
+ write: String.fromCodePoint('0x00A0'),
102269
+ label: ' '
102270
102270
  }, {
102271
102271
  unicode: 'U+2022',
102272
102272
  description: 'BULLET',
@@ -102313,10 +102313,10 @@ var specialConfig = {
102313
102313
  write: '–',
102314
102314
  label: '–'
102315
102315
  }], [{
102316
- unicode: 'U+0009',
102317
- description: 'TAB',
102318
- write: String.fromCodePoint('0x0009'),
102319
- label: 'TAB'
102316
+ unicode: 'U+2003',
102317
+ description: 'EM SPACE',
102318
+ write: String.fromCodePoint('0x2003'),
102319
+ label: ' '
102320
102320
  }, {
102321
102321
  unicode: 'U+25E6',
102322
102322
  description: 'WHITE BULLET',
@@ -112037,9 +112037,7 @@ const require$$23 = _dll_classnames;
112037
112037
  (0, _classCallCheck2["default"])(this, Editor);
112038
112038
  _this = _super.call(this, _props);
112039
112039
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setKeypadInteraction", function (interacted) {
112040
- _this.setState({
112041
- keypadInteractionDetected: interacted
112042
- });
112040
+ _this.keypadInteractionDetected = interacted;
112043
112041
  });
112044
112042
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDialog", function (open) {
112045
112043
  var extraDialogProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -112324,10 +112322,9 @@ const require$$23 = _dll_classnames;
112324
112322
  log('[onBlur]');
112325
112323
  var relatedTarget = event.relatedTarget;
112326
112324
  var toolbarElement = _this.toolbarRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]")));
112327
- var keypadInteractionDetected = _this.state.keypadInteractionDetected;
112328
112325
  var isRawDoneButton = _this.doneButtonRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.doneButtonRef.className, "\"]")));
112329
- _this.skipBlurHandling = keypadInteractionDetected ? true : false;
112330
- if (toolbarElement && !isRawDoneButton) {
112326
+ _this.skipBlurHandling = _this.keypadInteractionDetected ? true : false;
112327
+ if (toolbarElement && !isRawDoneButton && !_this.state.focusToolbar) {
112331
112328
  _this.setState({
112332
112329
  focusToolbar: true
112333
112330
  });
@@ -112347,13 +112344,10 @@ const require$$23 = _dll_classnames;
112347
112344
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDomBlur", function (e) {
112348
112345
  var editorDOM = document.querySelector(("[data-key=\"").concat(_this.state.value.document.key, "\"]"));
112349
112346
  setTimeout(function () {
112350
- var _this$state2 = _this.state, stateValue = _this$state2.value, keypadInteractionDetected = _this$state2.keypadInteractionDetected;
112347
+ var stateValue = _this.state.value;
112351
112348
  if (!_this.wrapperRef) {
112352
112349
  return;
112353
112350
  }
112354
- if (keypadInteractionDetected) {
112355
- _this.setKeypadInteraction(false);
112356
- }
112357
112351
  var editorElement = !editorDOM || document.activeElement.closest(("[class*=\"").concat(editorDOM.className, "\"]"));
112358
112352
  var toolbarElement = !_this.toolbarRef || document.activeElement.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]"));
112359
112353
  var isInCurrentComponent = _this.wrapperRef.contains(editorElement) || _this.wrapperRef.contains(toolbarElement);
@@ -112370,9 +112364,8 @@ const require$$23 = _dll_classnames;
112370
112364
  var _navigator;
112371
112365
  var editorDOM = document.querySelector(("[data-key=\"").concat(_this.state.value.document.key, "\"]"));
112372
112366
  var isTouchDevice = typeof window !== 'undefined' && (('ontouchstart' in window) || ((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.maxTouchPoints) > 0);
112373
- var keypadInteractionDetected = _this.state.keypadInteractionDetected;
112374
112367
  log('[onFocus]', document.activeElement);
112375
- if (keypadInteractionDetected && _this.__TEMPORARY_CHANGE_DATA) {
112368
+ if (_this.keypadInteractionDetected && _this.__TEMPORARY_CHANGE_DATA) {
112376
112369
  _this.__TEMPORARY_CHANGE_DATA = null;
112377
112370
  }
112378
112371
  if (_this.__TEMPORARY_CHANGE_DATA) {
@@ -112395,9 +112388,14 @@ const require$$23 = _dll_classnames;
112395
112388
  }
112396
112389
  _this.stashValue();
112397
112390
  _this.props.onFocus();
112398
- if (!keypadInteractionDetected && !isTouchDevice) {
112391
+ var isKeypadInteractionActive = _this.keypadInteractionDetected;
112392
+ var shouldFocusEditor = !isKeypadInteractionActive && !isTouchDevice;
112393
+ if (shouldFocusEditor) {
112399
112394
  change === null || change === void 0 ? void 0 : change.focus();
112400
112395
  }
112396
+ if (isKeypadInteractionActive) {
112397
+ _this.setKeypadInteraction(false);
112398
+ }
112401
112399
  resolve();
112402
112400
  });
112403
112401
  });
@@ -112410,7 +112408,7 @@ const require$$23 = _dll_classnames;
112410
112408
  }
112411
112409
  });
112412
112410
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "resetValue", function (force) {
112413
- var _this$state3 = _this.state, value = _this$state3.value, focusedNode = _this$state3.focusedNode;
112411
+ var _this$state2 = _this.state, value = _this$state2.value, focusedNode = _this$state2.focusedNode;
112414
112412
  var stopReset = _this.plugins.reduce(function (s, p) {
112415
112413
  return s || p.stopReset && p.stopReset(_this.state.value);
112416
112414
  }, false);
@@ -112639,12 +112637,12 @@ const require$$23 = _dll_classnames;
112639
112637
  isHtmlMode: false,
112640
112638
  isEditedInHtmlMode: false,
112641
112639
  focusToolbar: false,
112642
- keypadInteractionDetected: false,
112643
112640
  dialog: {
112644
112641
  open: false
112645
112642
  }
112646
112643
  };
112647
112644
  _this.keyPadCharacterRef = _react["default"].createRef();
112645
+ _this.keypadInteractionDetected = false;
112648
112646
  _this.toggleHtmlMode = _this.toggleHtmlMode.bind((0, _assertThisInitialized2["default"])(_this));
112649
112647
  _this.handleToolbarFocus = _this.handleToolbarFocus.bind((0, _assertThisInitialized2["default"])(_this));
112650
112648
  _this.handleToolbarBlur = _this.handleToolbarBlur.bind((0, _assertThisInitialized2["default"])(_this));
@@ -112659,6 +112657,9 @@ const require$$23 = _dll_classnames;
112659
112657
  (0, _createClass2["default"])(Editor, [{
112660
112658
  key: "handleToolbarFocus",
112661
112659
  value: function handleToolbarFocus() {
112660
+ if (this.state.focusToolbar) {
112661
+ return;
112662
+ }
112662
112663
  this.setState({
112663
112664
  focusToolbar: true
112664
112665
  });
@@ -112673,7 +112674,7 @@ const require$$23 = _dll_classnames;
112673
112674
  focusToolbar: false
112674
112675
  });
112675
112676
  }
112676
- }, 10);
112677
+ }, 0);
112677
112678
  }
112678
112679
  }, {
112679
112680
  key: "toolbarContainsFocus",
@@ -112712,7 +112713,7 @@ const require$$23 = _dll_classnames;
112712
112713
  key: "UNSAFE_componentWillReceiveProps",
112713
112714
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
112714
112715
  var _nextProps$value, _nextProps$value$docu, _this$props$value;
112715
- var _this$state4 = this.state, isHtmlMode = _this$state4.isHtmlMode, toolbarOpts = _this$state4.toolbarOpts;
112716
+ var _this$state3 = this.state, isHtmlMode = _this$state3.isHtmlMode, toolbarOpts = _this$state3.toolbarOpts;
112716
112717
  var newToolbarOpts = createToolbarOpts(nextProps.toolbarOpts, nextProps.error, isHtmlMode);
112717
112718
  if (!(0, _isEqual["default"])(newToolbarOpts, toolbarOpts)) {
112718
112719
  this.setState({
@@ -112768,7 +112769,7 @@ const require$$23 = _dll_classnames;
112768
112769
  var _ref4 = pluginProps || ({});
112769
112770
  _ref4.customPlugins;
112770
112771
  var otherPluginProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
112771
- var _this$state5 = this.state, value = _this$state5.value, focusedNode = _this$state5.focusedNode, toolbarOpts = _this$state5.toolbarOpts, dialog = _this$state5.dialog, scheduled = _this$state5.scheduled;
112772
+ var _this$state4 = this.state, value = _this$state4.value, focusedNode = _this$state4.focusedNode, toolbarOpts = _this$state4.toolbarOpts, dialog = _this$state4.dialog, scheduled = _this$state4.scheduled;
112772
112773
  log('[render] value: ', value);
112773
112774
  var sizeStyle = this.buildSizeStyle();
112774
112775
  var names = (0, _classnames["default"])((_classNames = {}, (0, _defineProperty2["default"])(_classNames, classes.withBg, highlightShape), (0, _defineProperty2["default"])(_classNames, classes.toolbarOnTop, toolbarOpts.alwaysVisible && toolbarOpts.position === 'top'), (0, _defineProperty2["default"])(_classNames, classes.scheduled, scheduled), _classNames), className);
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "2.0.7"
7
+ "version": "2.0.8"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
package/module/print.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.7/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.8/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.6/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -36719,7 +36719,7 @@ const require$$24 = _dll_pie_framework__mathquill;
36719
36719
  }
36720
36720
  if (keyPadElement) {
36721
36721
  keyPadElement.removeEventListener('touchstart', this.handleKeypadInteraction, true);
36722
- keyPadElement.addEventListener('mousedown', this.handleKeypadInteraction, true);
36722
+ keyPadElement.removeEventListener('mousedown', this.handleKeypadInteraction, true);
36723
36723
  }
36724
36724
  }
36725
36725
  }, {
@@ -83663,7 +83663,7 @@ const require$$10$x = _dll_classnames;
83663
83663
  hideDoneButtonBackground: _propTypes["default"].bool,
83664
83664
  error: _propTypes["default"].any,
83665
83665
  maxResponseAreas: _propTypes["default"].number,
83666
- keyPadCharacterRef: _propTypes["default"].func,
83666
+ keyPadCharacterRef: _propTypes["default"].object,
83667
83667
  setKeypadInteraction: _propTypes["default"].func
83668
83668
  });
83669
83669
  (0, _defineProperty2["default"])(RawPureToolbar, "defaultProps", {
@@ -102173,10 +102173,10 @@ var specialConfig = {
102173
102173
  write: 'Ç',
102174
102174
  label: 'Ç'
102175
102175
  }], [{
102176
- unicode: 'U+00A0',
102177
- description: 'NO-BREAK SPACE',
102178
- write: String.fromCodePoint('0x00A0'),
102179
- label: ' '
102176
+ unicode: 'U+200A',
102177
+ description: 'HAIR SPACE',
102178
+ write: String.fromCodePoint('0x200A'),
102179
+ label: ' '
102180
102180
  }, {
102181
102181
  unicode: 'U+00A7',
102182
102182
  description: 'SECTION SIGN',
@@ -102263,10 +102263,10 @@ var specialConfig = {
102263
102263
  write: '−',
102264
102264
  label: '−'
102265
102265
  }], [{
102266
- unicode: 'U+200A',
102267
- description: 'HAIR SPACE',
102268
- write: String.fromCodePoint('0x200A'),
102269
- label: ' '
102266
+ unicode: 'U+00A0',
102267
+ description: 'NO-BREAK SPACE',
102268
+ write: String.fromCodePoint('0x00A0'),
102269
+ label: ' '
102270
102270
  }, {
102271
102271
  unicode: 'U+2022',
102272
102272
  description: 'BULLET',
@@ -102313,10 +102313,10 @@ var specialConfig = {
102313
102313
  write: '–',
102314
102314
  label: '–'
102315
102315
  }], [{
102316
- unicode: 'U+0009',
102317
- description: 'TAB',
102318
- write: String.fromCodePoint('0x0009'),
102319
- label: 'TAB'
102316
+ unicode: 'U+2003',
102317
+ description: 'EM SPACE',
102318
+ write: String.fromCodePoint('0x2003'),
102319
+ label: ' '
102320
102320
  }, {
102321
102321
  unicode: 'U+25E6',
102322
102322
  description: 'WHITE BULLET',
@@ -112037,9 +112037,7 @@ const require$$23 = _dll_classnames;
112037
112037
  (0, _classCallCheck2["default"])(this, Editor);
112038
112038
  _this = _super.call(this, _props);
112039
112039
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setKeypadInteraction", function (interacted) {
112040
- _this.setState({
112041
- keypadInteractionDetected: interacted
112042
- });
112040
+ _this.keypadInteractionDetected = interacted;
112043
112041
  });
112044
112042
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDialog", function (open) {
112045
112043
  var extraDialogProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -112324,10 +112322,9 @@ const require$$23 = _dll_classnames;
112324
112322
  log('[onBlur]');
112325
112323
  var relatedTarget = event.relatedTarget;
112326
112324
  var toolbarElement = _this.toolbarRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]")));
112327
- var keypadInteractionDetected = _this.state.keypadInteractionDetected;
112328
112325
  var isRawDoneButton = _this.doneButtonRef && (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.closest(("[class*=\"").concat(_this.doneButtonRef.className, "\"]")));
112329
- _this.skipBlurHandling = keypadInteractionDetected ? true : false;
112330
- if (toolbarElement && !isRawDoneButton) {
112326
+ _this.skipBlurHandling = _this.keypadInteractionDetected ? true : false;
112327
+ if (toolbarElement && !isRawDoneButton && !_this.state.focusToolbar) {
112331
112328
  _this.setState({
112332
112329
  focusToolbar: true
112333
112330
  });
@@ -112347,13 +112344,10 @@ const require$$23 = _dll_classnames;
112347
112344
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDomBlur", function (e) {
112348
112345
  var editorDOM = document.querySelector(("[data-key=\"").concat(_this.state.value.document.key, "\"]"));
112349
112346
  setTimeout(function () {
112350
- var _this$state2 = _this.state, stateValue = _this$state2.value, keypadInteractionDetected = _this$state2.keypadInteractionDetected;
112347
+ var stateValue = _this.state.value;
112351
112348
  if (!_this.wrapperRef) {
112352
112349
  return;
112353
112350
  }
112354
- if (keypadInteractionDetected) {
112355
- _this.setKeypadInteraction(false);
112356
- }
112357
112351
  var editorElement = !editorDOM || document.activeElement.closest(("[class*=\"").concat(editorDOM.className, "\"]"));
112358
112352
  var toolbarElement = !_this.toolbarRef || document.activeElement.closest(("[class*=\"").concat(_this.toolbarRef.className, "\"]"));
112359
112353
  var isInCurrentComponent = _this.wrapperRef.contains(editorElement) || _this.wrapperRef.contains(toolbarElement);
@@ -112370,9 +112364,8 @@ const require$$23 = _dll_classnames;
112370
112364
  var _navigator;
112371
112365
  var editorDOM = document.querySelector(("[data-key=\"").concat(_this.state.value.document.key, "\"]"));
112372
112366
  var isTouchDevice = typeof window !== 'undefined' && (('ontouchstart' in window) || ((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.maxTouchPoints) > 0);
112373
- var keypadInteractionDetected = _this.state.keypadInteractionDetected;
112374
112367
  log('[onFocus]', document.activeElement);
112375
- if (keypadInteractionDetected && _this.__TEMPORARY_CHANGE_DATA) {
112368
+ if (_this.keypadInteractionDetected && _this.__TEMPORARY_CHANGE_DATA) {
112376
112369
  _this.__TEMPORARY_CHANGE_DATA = null;
112377
112370
  }
112378
112371
  if (_this.__TEMPORARY_CHANGE_DATA) {
@@ -112395,9 +112388,14 @@ const require$$23 = _dll_classnames;
112395
112388
  }
112396
112389
  _this.stashValue();
112397
112390
  _this.props.onFocus();
112398
- if (!keypadInteractionDetected && !isTouchDevice) {
112391
+ var isKeypadInteractionActive = _this.keypadInteractionDetected;
112392
+ var shouldFocusEditor = !isKeypadInteractionActive && !isTouchDevice;
112393
+ if (shouldFocusEditor) {
112399
112394
  change === null || change === void 0 ? void 0 : change.focus();
112400
112395
  }
112396
+ if (isKeypadInteractionActive) {
112397
+ _this.setKeypadInteraction(false);
112398
+ }
112401
112399
  resolve();
112402
112400
  });
112403
112401
  });
@@ -112410,7 +112408,7 @@ const require$$23 = _dll_classnames;
112410
112408
  }
112411
112409
  });
112412
112410
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "resetValue", function (force) {
112413
- var _this$state3 = _this.state, value = _this$state3.value, focusedNode = _this$state3.focusedNode;
112411
+ var _this$state2 = _this.state, value = _this$state2.value, focusedNode = _this$state2.focusedNode;
112414
112412
  var stopReset = _this.plugins.reduce(function (s, p) {
112415
112413
  return s || p.stopReset && p.stopReset(_this.state.value);
112416
112414
  }, false);
@@ -112639,12 +112637,12 @@ const require$$23 = _dll_classnames;
112639
112637
  isHtmlMode: false,
112640
112638
  isEditedInHtmlMode: false,
112641
112639
  focusToolbar: false,
112642
- keypadInteractionDetected: false,
112643
112640
  dialog: {
112644
112641
  open: false
112645
112642
  }
112646
112643
  };
112647
112644
  _this.keyPadCharacterRef = _react["default"].createRef();
112645
+ _this.keypadInteractionDetected = false;
112648
112646
  _this.toggleHtmlMode = _this.toggleHtmlMode.bind((0, _assertThisInitialized2["default"])(_this));
112649
112647
  _this.handleToolbarFocus = _this.handleToolbarFocus.bind((0, _assertThisInitialized2["default"])(_this));
112650
112648
  _this.handleToolbarBlur = _this.handleToolbarBlur.bind((0, _assertThisInitialized2["default"])(_this));
@@ -112659,6 +112657,9 @@ const require$$23 = _dll_classnames;
112659
112657
  (0, _createClass2["default"])(Editor, [{
112660
112658
  key: "handleToolbarFocus",
112661
112659
  value: function handleToolbarFocus() {
112660
+ if (this.state.focusToolbar) {
112661
+ return;
112662
+ }
112662
112663
  this.setState({
112663
112664
  focusToolbar: true
112664
112665
  });
@@ -112673,7 +112674,7 @@ const require$$23 = _dll_classnames;
112673
112674
  focusToolbar: false
112674
112675
  });
112675
112676
  }
112676
- }, 10);
112677
+ }, 0);
112677
112678
  }
112678
112679
  }, {
112679
112680
  key: "toolbarContainsFocus",
@@ -112712,7 +112713,7 @@ const require$$23 = _dll_classnames;
112712
112713
  key: "UNSAFE_componentWillReceiveProps",
112713
112714
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
112714
112715
  var _nextProps$value, _nextProps$value$docu, _this$props$value;
112715
- var _this$state4 = this.state, isHtmlMode = _this$state4.isHtmlMode, toolbarOpts = _this$state4.toolbarOpts;
112716
+ var _this$state3 = this.state, isHtmlMode = _this$state3.isHtmlMode, toolbarOpts = _this$state3.toolbarOpts;
112716
112717
  var newToolbarOpts = createToolbarOpts(nextProps.toolbarOpts, nextProps.error, isHtmlMode);
112717
112718
  if (!(0, _isEqual["default"])(newToolbarOpts, toolbarOpts)) {
112718
112719
  this.setState({
@@ -112768,7 +112769,7 @@ const require$$23 = _dll_classnames;
112768
112769
  var _ref4 = pluginProps || ({});
112769
112770
  _ref4.customPlugins;
112770
112771
  var otherPluginProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded);
112771
- var _this$state5 = this.state, value = _this$state5.value, focusedNode = _this$state5.focusedNode, toolbarOpts = _this$state5.toolbarOpts, dialog = _this$state5.dialog, scheduled = _this$state5.scheduled;
112772
+ var _this$state4 = this.state, value = _this$state4.value, focusedNode = _this$state4.focusedNode, toolbarOpts = _this$state4.toolbarOpts, dialog = _this$state4.dialog, scheduled = _this$state4.scheduled;
112772
112773
  log('[render] value: ', value);
112773
112774
  var sizeStyle = this.buildSizeStyle();
112774
112775
  var names = (0, _classnames["default"])((_classNames = {}, (0, _defineProperty2["default"])(_classNames, classes.withBg, highlightShape), (0, _defineProperty2["default"])(_classNames, classes.toolbarOnTop, toolbarOpts.alwaysVisible && toolbarOpts.position === 'top'), (0, _defineProperty2["default"])(_classNames, classes.scheduled, scheduled), _classNames), className);
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "3.1.1-next.0+a141032db",
4
+ "version": "3.1.1-next.1+2d60730eb",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
10
- "@pie-element/multi-trait-rubric": "^4.1.1-next.0+a141032db",
11
- "@pie-element/rubric": "^4.1.1-next.0+a141032db",
10
+ "@pie-element/multi-trait-rubric": "^4.1.1-next.1+2d60730eb",
11
+ "@pie-element/rubric": "^4.1.1-next.1+2d60730eb",
12
12
  "@pie-framework/pie-player-events": "^0.1.0",
13
13
  "classnames": "^2.2.5",
14
14
  "debug": "^4.1.1",
15
15
  "lodash": "^4.17.11",
16
16
  "prop-types": "^15.7.2"
17
17
  },
18
- "gitHead": "a141032dbfc08b9bcba32b7cc63c789258c9a01b",
18
+ "gitHead": "2d60730eb6c3ade08e522c58218cff2f6cb496cb",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },