@pie-lib/math-input 6.6.1-next.45 → 6.6.1-next.506

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.
Files changed (69) hide show
  1. package/CHANGELOG.json +60 -0
  2. package/CHANGELOG.md +140 -0
  3. package/lib/horizontal-keypad.js +33 -38
  4. package/lib/horizontal-keypad.js.map +1 -1
  5. package/lib/index.js +12 -7
  6. package/lib/index.js.map +1 -1
  7. package/lib/keypad/index.js +119 -71
  8. package/lib/keypad/index.js.map +1 -1
  9. package/lib/keypad/keys-layout.js +5 -1
  10. package/lib/keypad/keys-layout.js.map +1 -1
  11. package/lib/keys/basic-operators.js +1 -1
  12. package/lib/keys/basic-operators.js.map +1 -1
  13. package/lib/keys/chars.js +1 -1
  14. package/lib/keys/chars.js.map +1 -1
  15. package/lib/keys/comparison.js +7 -5
  16. package/lib/keys/comparison.js.map +1 -1
  17. package/lib/keys/constants.js +17 -1
  18. package/lib/keys/constants.js.map +1 -1
  19. package/lib/keys/digits.js +2 -2
  20. package/lib/keys/digits.js.map +1 -1
  21. package/lib/keys/edit.js.map +1 -1
  22. package/lib/keys/exponent.js +1 -1
  23. package/lib/keys/exponent.js.map +1 -1
  24. package/lib/keys/fractions.js +1 -1
  25. package/lib/keys/fractions.js.map +1 -1
  26. package/lib/keys/geometry.js +35 -7
  27. package/lib/keys/geometry.js.map +1 -1
  28. package/lib/keys/grades.js +122 -37
  29. package/lib/keys/grades.js.map +1 -1
  30. package/lib/keys/index.js +7 -3
  31. package/lib/keys/index.js.map +1 -1
  32. package/lib/keys/log.js +2 -2
  33. package/lib/keys/log.js.map +1 -1
  34. package/lib/keys/logic.js +1 -1
  35. package/lib/keys/logic.js.map +1 -1
  36. package/lib/keys/matrices.js +1 -1
  37. package/lib/keys/matrices.js.map +1 -1
  38. package/lib/keys/misc.js +1 -1
  39. package/lib/keys/misc.js.map +1 -1
  40. package/lib/keys/navigation.js.map +1 -1
  41. package/lib/keys/operators.js.map +1 -1
  42. package/lib/keys/statistics.js +8 -1
  43. package/lib/keys/statistics.js.map +1 -1
  44. package/lib/keys/sub-sup.js +1 -1
  45. package/lib/keys/sub-sup.js.map +1 -1
  46. package/lib/keys/trigonometry.js +1 -1
  47. package/lib/keys/trigonometry.js.map +1 -1
  48. package/lib/keys/utils.js +11 -17
  49. package/lib/keys/utils.js.map +1 -1
  50. package/lib/keys/vars.js +1 -1
  51. package/lib/keys/vars.js.map +1 -1
  52. package/lib/math-input.js +39 -47
  53. package/lib/math-input.js.map +1 -1
  54. package/lib/mq/custom-elements.js.map +1 -1
  55. package/lib/mq/index.js +2 -2
  56. package/lib/mq/index.js.map +1 -1
  57. package/lib/mq/input.js +67 -40
  58. package/lib/mq/input.js.map +1 -1
  59. package/lib/mq/static.js +26 -34
  60. package/lib/mq/static.js.map +1 -1
  61. package/package.json +3 -3
  62. package/src/horizontal-keypad.jsx +4 -1
  63. package/src/keypad/index.jsx +97 -11
  64. package/src/keys/constants.js +16 -0
  65. package/src/keys/geometry.js +26 -2
  66. package/src/keys/grades.js +198 -84
  67. package/src/keys/log.js +1 -1
  68. package/src/keys/statistics.js +7 -0
  69. package/src/mq/input.jsx +35 -0
package/CHANGELOG.json CHANGED
@@ -1483,5 +1483,65 @@
1483
1483
  "committerDate": "2021-09-14 13:35:44 +0300",
1484
1484
  "isTagged": true,
1485
1485
  "tag": "@pie-lib/math-input@6.6.3"
1486
+ },
1487
+ {
1488
+ "type": "fix",
1489
+ "scope": "math-input",
1490
+ "subject": "Made overarc button consistent with the others PD-1315",
1491
+ "merge": null,
1492
+ "header": "fix(math-input): Made overarc button consistent with the others PD-1315",
1493
+ "body": null,
1494
+ "footer": null,
1495
+ "notes": [],
1496
+ "hash": "872646962368946f1cbefc9aab4a94e74cb9590f",
1497
+ "gitTags": " (origin/fix/PD-1315)",
1498
+ "committerDate": "2021-09-27 13:26:37 +0300",
1499
+ "isTagged": true,
1500
+ "tag": "@pie-lib/math-input@6.6.5"
1501
+ },
1502
+ {
1503
+ "type": "fix",
1504
+ "scope": "math-input",
1505
+ "subject": "Made segment, ray and line buttons more consistent PD-1315",
1506
+ "merge": null,
1507
+ "header": "fix(math-input): Made segment, ray and line buttons more consistent PD-1315",
1508
+ "body": null,
1509
+ "footer": null,
1510
+ "notes": [],
1511
+ "hash": "e7e4e29e8eae6dd5f0a98040c523cb518b61de3e",
1512
+ "gitTags": "",
1513
+ "committerDate": "2021-09-24 14:53:08 +0300",
1514
+ "isTagged": true,
1515
+ "tag": "@pie-lib/math-input@6.6.5"
1516
+ },
1517
+ {
1518
+ "type": "fix",
1519
+ "scope": "math-input",
1520
+ "subject": "create proper latex expression for log base button",
1521
+ "merge": null,
1522
+ "header": "fix(math-input): create proper latex expression for log base button",
1523
+ "body": null,
1524
+ "footer": null,
1525
+ "notes": [],
1526
+ "hash": "ca0c3f00b7cdb8ae2e5d6e1003cec7a4942fb6aa",
1527
+ "gitTags": " (origin/fix/log-base-x-expression)",
1528
+ "committerDate": "2021-09-23 13:38:33 +0300",
1529
+ "isTagged": true,
1530
+ "tag": "@pie-lib/math-input@6.6.5"
1531
+ },
1532
+ {
1533
+ "type": "fix",
1534
+ "scope": "math-input",
1535
+ "subject": "Fixed left-right arrow button",
1536
+ "merge": null,
1537
+ "header": "fix(math-input): Fixed left-right arrow button",
1538
+ "body": null,
1539
+ "footer": null,
1540
+ "notes": [],
1541
+ "hash": "6109149689e75bfaba2bf1677c909bb7cbaa3145",
1542
+ "gitTags": " (origin/fix/math-input-arrow)",
1543
+ "committerDate": "2021-10-04 13:14:10 +0300",
1544
+ "isTagged": true,
1545
+ "tag": "@pie-lib/math-input@6.6.6"
1486
1546
  }
1487
1547
  ]
package/CHANGELOG.md CHANGED
@@ -3,6 +3,146 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.7.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.7.1...@pie-lib/math-input@6.7.2) (2022-07-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * bump mathquill to 1.1.3 ([48b84c5](https://github.com/pie-framework/pie-lib/commit/48b84c534cbf519e172a80d18a48b26eda3cf7e6))
12
+
13
+
14
+
15
+
16
+
17
+ ## [6.7.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.7.0...@pie-lib/math-input@6.7.1) (2022-07-18)
18
+
19
+
20
+ ### Reverts
21
+
22
+ * Revert "feat(math-toolbar): Make math-toolbar style inline with mathjax for Geometry" ([fee3f22](https://github.com/pie-framework/pie-lib/commit/fee3f22897a03d1d5c892f731dfc441dba9ed10f))
23
+ * Revert "feat(math-toolbar): Make math-toolbar preview style inline with mathjax" ([bb86c35](https://github.com/pie-framework/pie-lib/commit/bb86c35ed56228c673020faf5ea089fb99418fd8))
24
+
25
+
26
+
27
+
28
+
29
+ # [6.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.10...@pie-lib/math-input@6.7.0) (2022-07-18)
30
+
31
+
32
+ ### Features
33
+
34
+ * **characters:** special character accents span 2 rows, added border for visibility [PD-1462] ([c60b0bc](https://github.com/pie-framework/pie-lib/commit/c60b0bc8ff45cc01f53bc752fd5dd64da623f6be))
35
+ * **math-toolbar:** Make math-toolbar preview style inline with mathjax ([266b1bc](https://github.com/pie-framework/pie-lib/commit/266b1bc9a277530fd653edfacbb836596957dd33))
36
+ * **math-toolbar:** Make math-toolbar style inline with mathjax for Geometry ([811bde0](https://github.com/pie-framework/pie-lib/commit/811bde0aa97633822fa3260666e298e841b6b9f7))
37
+ * **plugins:** added special characters adding capabilities [PD-1462] ([b9f41e1](https://github.com/pie-framework/pie-lib/commit/b9f41e11f44df140a66145d0b04558ca2b0ea48e))
38
+
39
+
40
+
41
+
42
+
43
+ ## [6.6.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.9...@pie-lib/math-input@6.6.10) (2022-06-13)
44
+
45
+ **Note:** Version bump only for package @pie-lib/math-input
46
+
47
+
48
+
49
+
50
+
51
+ ## [6.6.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.8...@pie-lib/math-input@6.6.9) (2022-04-12)
52
+
53
+
54
+ ### Bug Fixes
55
+
56
+ * **math-input:** PD-1669 handle latex with errors in keypad buttons ([6b36f17](https://github.com/pie-framework/pie-lib/commit/6b36f175deffbd0a0fe021f4f7a11d7c4f14a014))
57
+
58
+
59
+
60
+
61
+
62
+ ## [6.6.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.7...@pie-lib/math-input@6.6.8) (2022-02-04)
63
+
64
+ **Note:** Version bump only for package @pie-lib/math-input
65
+
66
+
67
+
68
+
69
+
70
+ ## [6.6.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.6...@pie-lib/math-input@6.6.7) (2022-01-10)
71
+
72
+ **Note:** Version bump only for package @pie-lib/math-input
73
+
74
+
75
+
76
+
77
+
78
+ ## [6.6.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.5...@pie-lib/math-input@6.6.6) (2021-10-04)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * **math-input:** Fixed left-right arrow button ([6109149](https://github.com/pie-framework/pie-lib/commit/6109149))
84
+
85
+
86
+
87
+
88
+
89
+ ## [6.6.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.4...@pie-lib/math-input@6.6.5) (2021-10-04)
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ * **math-input:** create proper latex expression for log base button ([ca0c3f0](https://github.com/pie-framework/pie-lib/commit/ca0c3f0))
95
+ * **math-input:** Made overarc button consistent with the others PD-1315 ([8726469](https://github.com/pie-framework/pie-lib/commit/8726469))
96
+ * **math-input:** Made segment, ray and line buttons more consistent PD-1315 ([e7e4e29](https://github.com/pie-framework/pie-lib/commit/e7e4e29))
97
+
98
+
99
+
100
+
101
+
102
+ ## [6.6.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.3...@pie-lib/math-input@6.6.4) (2021-09-20)
103
+
104
+
105
+ ### Bug Fixes
106
+
107
+ * **math-input, math-toolbar:** Adjusted parallelogram button size ([699431e](https://github.com/pie-framework/pie-lib/commit/699431e))
108
+
109
+
110
+
111
+
112
+
113
+ ## [6.6.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.2...@pie-lib/math-input@6.6.3) (2021-09-16)
114
+
115
+
116
+ ### Bug Fixes
117
+
118
+ * **math-input:** render measured angle as m + angle sign PD-368 ([670fb56](https://github.com/pie-framework/pie-lib/commit/670fb56))
119
+
120
+
121
+
122
+
123
+
124
+ ## [6.6.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.1...@pie-lib/math-input@6.6.2) (2021-09-08)
125
+
126
+ **Note:** Version bump only for package @pie-lib/math-input
127
+
128
+
129
+
130
+
131
+
132
+ ## [6.6.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.0...@pie-lib/math-input@6.6.1) (2021-09-08)
133
+
134
+
135
+ ### Bug Fixes
136
+
137
+ * **math-input:** default latex when received is wrong ([d872f60](https://github.com/pie-framework/pie-lib/commit/d872f60))
138
+ * **math-input:** default latex when received is wrong (2) ([dc71307](https://github.com/pie-framework/pie-lib/commit/dc71307))
139
+ * **math-input:** fix e button on advanced algebra math editor PD-1280 ([dbfb53b](https://github.com/pie-framework/pie-lib/commit/dbfb53b))
140
+ * **math-input:** Fixed arrows button for pits ([66dd6a9](https://github.com/pie-framework/pie-lib/commit/66dd6a9))
141
+
142
+
143
+
144
+
145
+
6
146
  # [6.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.5.14...@pie-lib/math-input@6.6.0) (2021-08-30)
7
147
 
8
148
 
@@ -1,41 +1,39 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports["default"] = void 0;
7
9
 
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _grades = require("./keys/grades");
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
11
 
14
- var _utils = require("./keys/utils");
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
13
 
16
- var _keypad = _interopRequireDefault(require("./keypad"));
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
15
 
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
17
 
20
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
19
 
22
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
21
 
24
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
23
 
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
24
+ var _react = _interopRequireDefault(require("react"));
27
25
 
28
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
26
+ var _propTypes = _interopRequireDefault(require("prop-types"));
29
27
 
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
+ var _grades = require("./keys/grades");
31
29
 
32
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
+ var _utils = require("./keys/utils");
33
31
 
34
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
32
+ var _keypad = _interopRequireDefault(require("./keypad"));
35
33
 
36
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
37
35
 
38
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
36
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
37
 
40
38
  var toOldModel = function toOldModel(d) {
41
39
  if (d.command) {
@@ -55,33 +53,29 @@ var toOldModel = function toOldModel(d) {
55
53
  }
56
54
  };
57
55
 
58
- var HorizontalKeypad =
59
- /*#__PURE__*/
60
- function (_React$Component) {
61
- _inherits(HorizontalKeypad, _React$Component);
56
+ var HorizontalKeypad = /*#__PURE__*/function (_React$Component) {
57
+ (0, _inherits2["default"])(HorizontalKeypad, _React$Component);
62
58
 
63
- function HorizontalKeypad() {
64
- var _getPrototypeOf2;
59
+ var _super = _createSuper(HorizontalKeypad);
65
60
 
61
+ function HorizontalKeypad() {
66
62
  var _this;
67
63
 
68
- _classCallCheck(this, HorizontalKeypad);
64
+ (0, _classCallCheck2["default"])(this, HorizontalKeypad);
69
65
 
70
66
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
71
67
  args[_key] = arguments[_key];
72
68
  }
73
69
 
74
- _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(HorizontalKeypad)).call.apply(_getPrototypeOf2, [this].concat(args)));
75
-
76
- _defineProperty(_assertThisInitialized(_this), "keypadPress", function (data) {
70
+ _this = _super.call.apply(_super, [this].concat(args));
71
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "keypadPress", function (data) {
77
72
  var onClick = _this.props.onClick;
78
73
  onClick(toOldModel(data));
79
74
  });
80
-
81
75
  return _this;
82
76
  }
83
77
 
84
- _createClass(HorizontalKeypad, [{
78
+ (0, _createClass2["default"])(HorizontalKeypad, [{
85
79
  key: "render",
86
80
  value: function render() {
87
81
  var _this$props = this.props,
@@ -89,33 +83,34 @@ function (_React$Component) {
89
83
  onFocus = _this$props.onFocus,
90
84
  noDecimal = _this$props.noDecimal,
91
85
  className = _this$props.className,
92
- additionalKeys = _this$props.additionalKeys;
86
+ additionalKeys = _this$props.additionalKeys,
87
+ layoutForKeyPad = _this$props.layoutForKeyPad;
93
88
  var normalizedKeys = (0, _grades.normalizeAdditionalKeys)(additionalKeys);
94
- return _react["default"].createElement(_keypad["default"], {
89
+ return /*#__PURE__*/_react["default"].createElement(_keypad["default"], {
95
90
  className: className,
96
91
  onFocus: onFocus,
97
92
  noDecimal: noDecimal,
93
+ layoutForKeyPad: layoutForKeyPad,
98
94
  additionalKeys: (0, _utils.extendKeySet)((0, _grades.keysForGrade)(mode), normalizedKeys),
99
- onPress: this.keypadPress
95
+ onPress: this.keypadPress,
96
+ mode: mode
100
97
  });
101
98
  }
102
99
  }]);
103
-
104
100
  return HorizontalKeypad;
105
101
  }(_react["default"].Component);
106
102
 
107
103
  exports["default"] = HorizontalKeypad;
108
-
109
- _defineProperty(HorizontalKeypad, "propTypes", {
104
+ (0, _defineProperty2["default"])(HorizontalKeypad, "propTypes", {
110
105
  className: _propTypes["default"].string,
111
106
  mode: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
107
+ layoutForKeyPad: _propTypes["default"].object,
112
108
  onClick: _propTypes["default"].func.isRequired,
113
109
  onFocus: _propTypes["default"].func,
114
110
  noDecimal: _propTypes["default"].bool,
115
111
  additionalKeys: _propTypes["default"].array
116
112
  });
117
-
118
- _defineProperty(HorizontalKeypad, "defaultProps", {
113
+ (0, _defineProperty2["default"])(HorizontalKeypad, "defaultProps", {
119
114
  mode: 'scientific',
120
115
  noDecimal: false,
121
116
  additionalKeys: []
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/horizontal-keypad.jsx"],"names":["toOldModel","d","command","value","type","write","keystroke","HorizontalKeypad","data","onClick","props","mode","onFocus","noDecimal","className","additionalKeys","normalizedKeys","keypadPress","React","Component","PropTypes","string","oneOfType","number","func","isRequired","bool","array"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,CAAC,EAAI;AACtB,MAAIA,CAAC,CAACC,OAAN,EAAe;AACb,WAAO;AAAEC,MAAAA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sBAAUI,IAAV,CAAeC,UAHP;AAIjBb,EAAAA,OAAO,EAAEQ,sBAAUI,IAJF;AAKjBX,EAAAA,SAAS,EAAEO,sBAAUM,IALJ;AAMjBX,EAAAA,cAAc,EAAEK,sBAAUO;AANT,C;;gBADApB,gB,kBAUG;AACpBI,EAAAA,IAAI,EAAE,YADc;AAEpBE,EAAAA,SAAS,EAAE,KAFS;AAGpBE,EAAAA,cAAc,EAAE;AAHI,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { keysForGrade, normalizeAdditionalKeys } from './keys/grades';\nimport { extendKeySet } from './keys/utils';\nimport Keypad from './keypad';\n\nconst toOldModel = d => {\n if (d.command) {\n return { value: d.command, type: 'command' };\n } else if (d.write) {\n return { value: d.write };\n } else if (d.keystroke) {\n return { type: 'cursor', value: d.keystroke };\n }\n};\n\nexport default class HorizontalKeypad extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n mode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onClick: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array\n };\n\n static defaultProps = {\n mode: 'scientific',\n noDecimal: false,\n additionalKeys: []\n };\n\n keypadPress = data => {\n const { onClick } = this.props;\n\n onClick(toOldModel(data));\n };\n\n render() {\n const { mode, onFocus, noDecimal, className, additionalKeys } = this.props;\n const normalizedKeys = normalizeAdditionalKeys(additionalKeys);\n\n return (\n <Keypad\n className={className}\n onFocus={onFocus}\n noDecimal={noDecimal}\n additionalKeys={extendKeySet(keysForGrade(mode), normalizedKeys)}\n onPress={this.keypadPress}\n />\n );\n }\n}\n"],"file":"horizontal-keypad.js"}
1
+ {"version":3,"file":"horizontal-keypad.js","names":["toOldModel","d","command","value","type","write","keystroke","HorizontalKeypad","data","onClick","props","mode","onFocus","noDecimal","className","additionalKeys","layoutForKeyPad","normalizedKeys","normalizeAdditionalKeys","extendKeySet","keysForGrade","keypadPress","React","Component","PropTypes","string","oneOfType","number","object","func","isRequired","bool","array"],"sources":["../src/horizontal-keypad.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { keysForGrade, normalizeAdditionalKeys } from './keys/grades';\nimport { extendKeySet } from './keys/utils';\nimport Keypad from './keypad';\n\nconst toOldModel = d => {\n if (d.command) {\n return { value: d.command, type: 'command' };\n } else if (d.write) {\n return { value: d.write };\n } else if (d.keystroke) {\n return { type: 'cursor', value: d.keystroke };\n }\n};\n\nexport default class HorizontalKeypad extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n mode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n layoutForKeyPad: PropTypes.object,\n onClick: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array\n };\n\n static defaultProps = {\n mode: 'scientific',\n noDecimal: false,\n additionalKeys: []\n };\n\n keypadPress = data => {\n const { onClick } = this.props;\n\n onClick(toOldModel(data));\n };\n\n render() {\n const { mode, onFocus, noDecimal, className, additionalKeys, layoutForKeyPad } = this.props;\n const normalizedKeys = normalizeAdditionalKeys(additionalKeys);\n\n return (\n <Keypad\n className={className}\n onFocus={onFocus}\n noDecimal={noDecimal}\n layoutForKeyPad={layoutForKeyPad}\n additionalKeys={extendKeySet(keysForGrade(mode), normalizedKeys)}\n onPress={this.keypadPress}\n mode={mode}\n />\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,CAAC,EAAI;EACtB,IAAIA,CAAC,CAACC,OAAN,EAAe;IACb,OAAO;MAAEC,KAAK,EAAEF,CAAC,CAACC,OAAX;MAAoBE,IAAI,EAAE;IAA1B,CAAP;EACD,CAFD,MAEO,IAAIH,CAAC,CAACI,KAAN,EAAa;IAClB,OAAO;MAAEF,KAAK,EAAEF,CAAC,CAACI;IAAX,CAAP;E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;EAKjBlB,OAAO,EAAEY,qBAAA,CAAUK,IALF;EAMjBhB,SAAS,EAAEW,qBAAA,CAAUO,IANJ;EAOjBhB,cAAc,EAAES,qBAAA,CAAUQ;AAPT,C;iCADAzB,gB,kBAWG;EACpBI,IAAI,EAAE,YADc;EAEpBE,SAAS,EAAE,KAFS;EAGpBE,cAAc,EAAE;AAHI,C"}
package/lib/index.js CHANGED
@@ -1,21 +1,26 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
3
7
  Object.defineProperty(exports, "__esModule", {
4
8
  value: true
5
9
  });
6
- Object.defineProperty(exports, "keysForGrade", {
10
+ Object.defineProperty(exports, "HorizontalKeypad", {
7
11
  enumerable: true,
8
12
  get: function get() {
9
- return _grades.keysForGrade;
13
+ return _horizontalKeypad["default"];
10
14
  }
11
15
  });
12
- Object.defineProperty(exports, "HorizontalKeypad", {
16
+ exports.keys = exports.addBrackets = void 0;
17
+ Object.defineProperty(exports, "keysForGrade", {
13
18
  enumerable: true,
14
19
  get: function get() {
15
- return _horizontalKeypad["default"];
20
+ return _grades.keysForGrade;
16
21
  }
17
22
  });
18
- exports.mq = exports.keys = exports.updateSpans = exports.removeBrackets = exports.addBrackets = void 0;
23
+ exports.updateSpans = exports.removeBrackets = exports.mq = void 0;
19
24
 
20
25
  var _grades = require("./keys/grades");
21
26
 
@@ -29,9 +34,9 @@ var mq = _interopRequireWildcard(require("./mq"));
29
34
 
30
35
  exports.mq = mq;
31
36
 
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
38
 
34
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
39
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
40
 
36
41
  var addLeftBracket = function addLeftBracket(s) {
37
42
  return s.indexOf('\\(') === 0 ? s : "\\(".concat(s);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.jsx"],"names":["addLeftBracket","s","indexOf","addRightBracket","length","rmLeftBracket","substring","rmRightBracket","addBrackets","removeBrackets","updateSpans","spans","Array","from","document","querySelectorAll","forEach","span","innerText","className","style","fontSize"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAoBA;;;;AAEA;;AAEA;;;;;;;;AAtBA,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,CAAC;AAAA,SAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqB,CAArB,GAAyBD,CAAzB,gBAAmCA,CAAnC,CAAL;AAAA,CAAxB;;AACA,IAAME,eAAe,GAA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X,GAAsB,MAAtB;AACD;AACF,GAJD;AAKD,CAPD","sourcesContent":["import { keysForGrade } from './keys/grades';\n\nconst addLeftBracket = s => (s.indexOf('\\\\(') === 0 ? s : `\\\\(${s}`);\nconst addRightBracket = s => (s.indexOf('\\\\)') === s.length - 2 ? s : `${s}\\\\)`);\nconst rmLeftBracket = s => (s.indexOf('\\\\(') === 0 ? s.substring(2) : s);\nconst rmRightBracket = s => (s.indexOf('\\\\)') === s.length - 2 ? s.substring(0, s.length - 2) : s);\n\nconst addBrackets = s => addRightBracket(addLeftBracket(s));\nconst removeBrackets = s => rmRightBracket(rmLeftBracket(s));\n\n// increase the font of parallel notation\nconst updateSpans = () => {\n const spans = Array.from(document.querySelectorAll('span[mathquill-command-id]'));\n (spans || []).forEach(span => {\n if (span && span.innerText === '∥' && span.className !== 'mq-editable-field') {\n span.style.fontSize = '32px';\n }\n });\n};\n\nimport * as keys from './keys';\n\nimport HorizontalKeypad from './horizontal-keypad';\n\nimport * as mq from './mq';\n\nexport { keysForGrade, addBrackets, removeBrackets, keys, HorizontalKeypad, mq, updateSpans };\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":["addLeftBracket","s","indexOf","addRightBracket","length","rmLeftBracket","substring","rmRightBracket","addBrackets","removeBrackets","updateSpans","spans","Array","from","document","querySelectorAll","forEach","span","innerText","className","style","fontSize"],"sources":["../src/index.jsx"],"sourcesContent":["import { keysForGrade } from './keys/grades';\n\nconst addLeftBracket = s => (s.indexOf('\\\\(') === 0 ? s : `\\\\(${s}`);\nconst addRightBracket = s => (s.indexOf('\\\\)') === s.length - 2 ? s : `${s}\\\\)`);\nconst rmLeftBracket = s => (s.indexOf('\\\\(') === 0 ? s.substring(2) : s);\nconst rmRightBracket = s => (s.indexOf('\\\\)') === s.length - 2 ? s.substring(0, s.length - 2) : s);\n\nconst addBrackets = s => addRightBracket(addLeftBracket(s));\nconst removeBrackets = s => rmRightBracket(rmLeftBracket(s));\n\n// increase the font of parallel notation\nconst updateSpans = () => {\n const spans = Array.from(document.querySelectorAll('span[mathquill-command-id]'));\n (spans || []).forEach(span => {\n if (span && span.innerText === '∥' && span.className !== 'mq-editable-field') {\n span.style.fontSize = '32px';\n }\n });\n};\n\nimport * as keys from './keys';\n\nimport HorizontalKeypad from './horizontal-keypad';\n\nimport * as mq from './mq';\n\nexport { keysForGrade, addBrackets, removeBrackets, keys, HorizontalKeypad, mq, updateSpans };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAoBA;;;;AAEA;;AAEA;;;;;;;;AAtBA,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqB,CAArB,GAAyBD,CAAzB,gBAAmCA,CAAnC,CAAL;AAAA,CAAxB;;AACA,IAAME,eAAe,GAAG,SAAlBA,eAAkB,CAAAF,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqBD,CAAC,CAACG,MAAF,GAAW,CAAhC,GAAoCH,CAApC,aAA2CA,CAA3C,QAAL;AAAA,CAAzB;;AACA,IAAMI,aAAa,GAAG,SAAhBA,aAAgB,CAAAJ,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqB,CAArB,GAAyBD,CAAC,CAACK,SAAF,CAAY,CAAZ,CAAzB,GAA0CL,CAA/C;AAAA,CAAvB;;AACA,IAAMM,cAAc,GAAG,SAAjBA,cAAiB,CAAAN,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqBD,CAAC,CAACG,MAAF,GAAW,CAAhC,GAAoCH,CAAC,CAACK,SAAF,CAAY,CAAZ,EAAeL,CAAC,CAACG,MAAF,GAAW,CAA1B,CAApC,GAAmEH,CAAxE;AAAA,CAAxB;;AAEA,IAAMO,WAAW,GAAG,SAAdA,WAAc,CAAAP,CAAC;EAAA,OAAIE,eAAe,CAACH,cAAc,CAACC,CAAD,CAAf,CA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