@pie-lib/math-input 6.6.1-next.324 → 6.6.1-next.417
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.
- package/CHANGELOG.md +95 -0
- package/lib/horizontal-keypad.js +20 -31
- package/lib/horizontal-keypad.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/keypad/index.js +42 -61
- package/lib/keypad/index.js.map +1 -1
- package/lib/keypad/keys-layout.js +1 -1
- package/lib/keys/comparison.js +5 -3
- package/lib/keys/comparison.js.map +1 -1
- package/lib/keys/digits.js +2 -2
- package/lib/keys/digits.js.map +1 -1
- package/lib/keys/geometry.js +5 -3
- package/lib/keys/geometry.js.map +1 -1
- package/lib/keys/grades.js +10 -22
- package/lib/keys/grades.js.map +1 -1
- package/lib/keys/index.js +3 -3
- package/lib/keys/index.js.map +1 -1
- package/lib/keys/utils.js +7 -17
- package/lib/keys/utils.js.map +1 -1
- package/lib/math-input.js +27 -41
- package/lib/math-input.js.map +1 -1
- package/lib/mq/index.js +2 -2
- package/lib/mq/index.js.map +1 -1
- package/lib/mq/input.js +23 -35
- package/lib/mq/input.js.map +1 -1
- package/lib/mq/static.js +19 -29
- package/lib/mq/static.js.map +1 -1
- package/package.json +2 -2
- package/src/keypad/index.jsx +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,101 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **math-input:** PD-1669 handle latex with errors in keypad buttons ([6b36f17](https://github.com/pie-framework/pie-lib/commit/6b36f175deffbd0a0fe021f4f7a11d7c4f14a014))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @pie-lib/math-input
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [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)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @pie-lib/math-input
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [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)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* **math-input:** Fixed left-right arrow button ([6109149](https://github.com/pie-framework/pie-lib/commit/6109149))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [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)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **math-input:** create proper latex expression for log base button ([ca0c3f0](https://github.com/pie-framework/pie-lib/commit/ca0c3f0))
|
|
50
|
+
* **math-input:** Made overarc button consistent with the others PD-1315 ([8726469](https://github.com/pie-framework/pie-lib/commit/8726469))
|
|
51
|
+
* **math-input:** Made segment, ray and line buttons more consistent PD-1315 ([e7e4e29](https://github.com/pie-framework/pie-lib/commit/e7e4e29))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [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)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Bug Fixes
|
|
61
|
+
|
|
62
|
+
* **math-input, math-toolbar:** Adjusted parallelogram button size ([699431e](https://github.com/pie-framework/pie-lib/commit/699431e))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## [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)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* **math-input:** render measured angle as m + angle sign PD-368 ([670fb56](https://github.com/pie-framework/pie-lib/commit/670fb56))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## [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)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @pie-lib/math-input
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## [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)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* **math-input:** default latex when received is wrong ([d872f60](https://github.com/pie-framework/pie-lib/commit/d872f60))
|
|
93
|
+
* **math-input:** default latex when received is wrong (2) ([dc71307](https://github.com/pie-framework/pie-lib/commit/dc71307))
|
|
94
|
+
* **math-input:** fix e button on advanced algebra math editor PD-1280 ([dbfb53b](https://github.com/pie-framework/pie-lib/commit/dbfb53b))
|
|
95
|
+
* **math-input:** Fixed arrows button for pits ([66dd6a9](https://github.com/pie-framework/pie-lib/commit/66dd6a9))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
6
101
|
# [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
102
|
|
|
8
103
|
|
package/lib/horizontal-keypad.js
CHANGED
|
@@ -1,46 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
var _grades = require("./keys/grades");
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
var _utils = require("./keys/utils");
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
var _keypad = _interopRequireDefault(require("./keypad"));
|
|
35
33
|
|
|
36
|
-
function
|
|
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
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
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
38
|
var toOldModel = function toOldModel(d) {
|
|
45
39
|
if (d.command) {
|
|
46
40
|
return {
|
|
@@ -60,30 +54,28 @@ var toOldModel = function toOldModel(d) {
|
|
|
60
54
|
};
|
|
61
55
|
|
|
62
56
|
var HorizontalKeypad = /*#__PURE__*/function (_React$Component) {
|
|
63
|
-
|
|
57
|
+
(0, _inherits2["default"])(HorizontalKeypad, _React$Component);
|
|
64
58
|
|
|
65
59
|
var _super = _createSuper(HorizontalKeypad);
|
|
66
60
|
|
|
67
61
|
function HorizontalKeypad() {
|
|
68
62
|
var _this;
|
|
69
63
|
|
|
70
|
-
|
|
64
|
+
(0, _classCallCheck2["default"])(this, HorizontalKeypad);
|
|
71
65
|
|
|
72
66
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
67
|
args[_key] = arguments[_key];
|
|
74
68
|
}
|
|
75
69
|
|
|
76
70
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
77
|
-
|
|
78
|
-
_defineProperty(_assertThisInitialized(_this), "keypadPress", function (data) {
|
|
71
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "keypadPress", function (data) {
|
|
79
72
|
var onClick = _this.props.onClick;
|
|
80
73
|
onClick(toOldModel(data));
|
|
81
74
|
});
|
|
82
|
-
|
|
83
75
|
return _this;
|
|
84
76
|
}
|
|
85
77
|
|
|
86
|
-
|
|
78
|
+
(0, _createClass2["default"])(HorizontalKeypad, [{
|
|
87
79
|
key: "render",
|
|
88
80
|
value: function render() {
|
|
89
81
|
var _this$props = this.props,
|
|
@@ -105,13 +97,11 @@ var HorizontalKeypad = /*#__PURE__*/function (_React$Component) {
|
|
|
105
97
|
});
|
|
106
98
|
}
|
|
107
99
|
}]);
|
|
108
|
-
|
|
109
100
|
return HorizontalKeypad;
|
|
110
101
|
}(_react["default"].Component);
|
|
111
102
|
|
|
112
103
|
exports["default"] = HorizontalKeypad;
|
|
113
|
-
|
|
114
|
-
_defineProperty(HorizontalKeypad, "propTypes", {
|
|
104
|
+
(0, _defineProperty2["default"])(HorizontalKeypad, "propTypes", {
|
|
115
105
|
className: _propTypes["default"].string,
|
|
116
106
|
mode: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
117
107
|
layoutForKeyPad: _propTypes["default"].object,
|
|
@@ -120,8 +110,7 @@ _defineProperty(HorizontalKeypad, "propTypes", {
|
|
|
120
110
|
noDecimal: _propTypes["default"].bool,
|
|
121
111
|
additionalKeys: _propTypes["default"].array
|
|
122
112
|
});
|
|
123
|
-
|
|
124
|
-
_defineProperty(HorizontalKeypad, "defaultProps", {
|
|
113
|
+
(0, _defineProperty2["default"])(HorizontalKeypad, "defaultProps", {
|
|
125
114
|
mode: 'scientific',
|
|
126
115
|
noDecimal: false,
|
|
127
116
|
additionalKeys: []
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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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AAE,IAAAG,mBAAA,EAAa,IAAAC,oBAAA,EAAaT,IAAb,CAAb,EAAiCM,cAAjC,CALlB;QAME,OAAO,EAAE,KAAKI,WANhB;QAOE,IAAI,EAAEV;MAPR,EADF;IAWD;;;EAtC2CW,iBAAA,CAAMC,S;;;iCAA/BhB,gB,eACA;EACjBO,SAAS,EAAEU,qBAAA,CAAUC,MADJ;EAEjBd,IAAI,EAAEa,qBAAA,CAAUE,SAAV,CAAoB,CAACF,qBAAA,CAAUC,MAAX,EAAmBD,qBAAA,CAAUG,MAA7B,CAApB,CAFW;EAGjBX,eAAe,EAAEQ,qBAAA,CAAUI,MAHV;EAIjBnB,OAAO,EAAEe,qBAAA,CAAUK,IAAV,CAAeC,UAJP;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,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
@@ -32,8 +34,6 @@ var mq = _interopRequireWildcard(require("./mq"));
|
|
|
32
34
|
|
|
33
35
|
exports.mq = mq;
|
|
34
36
|
|
|
35
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
36
|
-
|
|
37
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); }
|
|
38
38
|
|
|
39
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; }
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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;;AAC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CAAWC,QAAX,GAAsB,MAAtB;IACD;EACF,CAJD;AAKD,CAPD"}
|
package/lib/keypad/index.js
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = exports.KeyPad = void 0;
|
|
9
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
|
|
16
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
+
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
|
|
20
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
21
|
+
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
+
|
|
24
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
+
|
|
26
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
+
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
|
|
10
30
|
var _react = _interopRequireDefault(require("react"));
|
|
11
31
|
|
|
12
32
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -37,48 +57,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
37
57
|
|
|
38
58
|
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; }
|
|
39
59
|
|
|
40
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
41
|
-
|
|
42
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
43
|
-
|
|
44
60
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
45
61
|
|
|
46
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
47
|
-
|
|
48
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
49
|
-
|
|
50
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
51
|
-
|
|
52
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
53
|
-
|
|
54
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
55
|
-
|
|
56
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
62
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
57
63
|
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
61
|
-
|
|
62
|
-
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); } }
|
|
63
|
-
|
|
64
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
65
|
-
|
|
66
|
-
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
67
|
-
|
|
68
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
69
|
-
|
|
70
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
71
|
-
|
|
72
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
73
|
-
|
|
74
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
64
|
+
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); }; }
|
|
75
65
|
|
|
76
66
|
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; } }
|
|
77
67
|
|
|
78
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
79
|
-
|
|
80
|
-
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; }
|
|
81
|
-
|
|
82
68
|
var log = (0, _debug["default"])('pie-lib:math-inline:keypad');
|
|
83
69
|
var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
84
70
|
return {
|
|
@@ -107,14 +93,16 @@ var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
|
107
93
|
width: '30px',
|
|
108
94
|
marginTop: '0 !important',
|
|
109
95
|
borderTop: '2px solid black',
|
|
96
|
+
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',
|
|
110
97
|
'&.mq-arrow-both': {
|
|
98
|
+
top: '5px !important',
|
|
111
99
|
'& *': {
|
|
112
100
|
lineHeight: '1 !important'
|
|
113
101
|
},
|
|
114
102
|
'&:before': {
|
|
115
103
|
fontSize: '80%',
|
|
116
104
|
left: 'calc(-13%)',
|
|
117
|
-
top: '-0.
|
|
105
|
+
top: '-0.31em'
|
|
118
106
|
},
|
|
119
107
|
'&:after': {
|
|
120
108
|
fontSize: '80% !important',
|
|
@@ -124,12 +112,12 @@ var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
|
124
112
|
'&.mq-empty:before': {
|
|
125
113
|
fontSize: '80%',
|
|
126
114
|
left: 'calc(-13%)',
|
|
127
|
-
top: '-0.
|
|
115
|
+
top: '-0.26em'
|
|
128
116
|
},
|
|
129
117
|
'&.mq-empty:after': {
|
|
130
118
|
fontSize: '80%',
|
|
131
119
|
right: 'calc(-13%)',
|
|
132
|
-
top: '-0.
|
|
120
|
+
top: '-0.26em'
|
|
133
121
|
},
|
|
134
122
|
'&.mq-empty': {
|
|
135
123
|
minHeight: '1.4em'
|
|
@@ -190,7 +178,7 @@ var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
|
190
178
|
paddingTop: '0 !important'
|
|
191
179
|
},
|
|
192
180
|
'&:after': {
|
|
193
|
-
top: '-
|
|
181
|
+
top: '-2.8em !important'
|
|
194
182
|
}
|
|
195
183
|
}
|
|
196
184
|
}
|
|
@@ -240,33 +228,30 @@ var createCustomLayout = function createCustomLayout(layoutObj) {
|
|
|
240
228
|
};
|
|
241
229
|
|
|
242
230
|
var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
243
|
-
|
|
231
|
+
(0, _inherits2["default"])(KeyPad, _React$Component);
|
|
244
232
|
|
|
245
233
|
var _super = _createSuper(KeyPad);
|
|
246
234
|
|
|
247
235
|
function KeyPad() {
|
|
248
236
|
var _this;
|
|
249
237
|
|
|
250
|
-
|
|
238
|
+
(0, _classCallCheck2["default"])(this, KeyPad);
|
|
251
239
|
|
|
252
240
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
253
241
|
args[_key] = arguments[_key];
|
|
254
242
|
}
|
|
255
243
|
|
|
256
244
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
257
|
-
|
|
258
|
-
_defineProperty(_assertThisInitialized(_this), "buttonClick", function (key) {
|
|
245
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "buttonClick", function (key) {
|
|
259
246
|
log('[buttonClick]', key);
|
|
260
247
|
var onPress = _this.props.onPress;
|
|
261
248
|
onPress(key);
|
|
262
249
|
});
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
var transposed = [].concat(_toConsumableArray((0, _keysLayout.sortKeys)(base)), _toConsumableArray((0, _keysLayout.sortKeys)(extras)));
|
|
250
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "flowKeys", function (base, extras) {
|
|
251
|
+
var transposed = [].concat((0, _toConsumableArray2["default"])((0, _keysLayout.sortKeys)(base)), (0, _toConsumableArray2["default"])((0, _keysLayout.sortKeys)(extras)));
|
|
266
252
|
return _lodash["default"].flatten(transposed);
|
|
267
253
|
});
|
|
268
|
-
|
|
269
|
-
_defineProperty(_assertThisInitialized(_this), "keyIsNotAllowed", function (key) {
|
|
254
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "keyIsNotAllowed", function (key) {
|
|
270
255
|
var noDecimal = _this.props.noDecimal;
|
|
271
256
|
|
|
272
257
|
if ((key.write === '.' && key.label === '.' || key.write === ',' && key.label === ',') && noDecimal) {
|
|
@@ -275,11 +260,10 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
275
260
|
|
|
276
261
|
return false;
|
|
277
262
|
});
|
|
278
|
-
|
|
279
263
|
return _this;
|
|
280
264
|
}
|
|
281
265
|
|
|
282
|
-
|
|
266
|
+
(0, _createClass2["default"])(KeyPad, [{
|
|
283
267
|
key: "render",
|
|
284
268
|
value: function render() {
|
|
285
269
|
var _this2 = this;
|
|
@@ -315,15 +299,15 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
315
299
|
});
|
|
316
300
|
}
|
|
317
301
|
|
|
318
|
-
var common = _objectSpread({
|
|
302
|
+
var common = _objectSpread(_objectSpread({
|
|
319
303
|
onClick: onClick,
|
|
320
304
|
className: (0, _classnames["default"])(classes.labelButton, !keysWithoutBaseSet && classes[k.category], classes[k.extraClass], k.label === ',' && classes.comma, k.label === '.' && classes.dot),
|
|
321
305
|
disabled: _this2.keyIsNotAllowed(k),
|
|
322
306
|
key: "".concat(k.label || k.latex || k.command, "-").concat(index)
|
|
323
|
-
}, k.actions || {});
|
|
307
|
+
}, k.actions || {}), k.extraProps || {});
|
|
324
308
|
|
|
325
309
|
if (k.latex) {
|
|
326
|
-
return /*#__PURE__*/_react["default"].createElement(LatexButton,
|
|
310
|
+
return /*#__PURE__*/_react["default"].createElement(LatexButton, (0, _extends2["default"])({
|
|
327
311
|
latex: k.latex
|
|
328
312
|
}, common, {
|
|
329
313
|
className: classes.latexButton
|
|
@@ -334,7 +318,7 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
334
318
|
return /*#__PURE__*/_react["default"].createElement(_Button["default"], common, k.label);
|
|
335
319
|
} else {
|
|
336
320
|
var Icon = k.icon ? k.icon : 'div';
|
|
337
|
-
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"],
|
|
321
|
+
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], (0, _extends2["default"])({
|
|
338
322
|
tabIndex: '-1'
|
|
339
323
|
}, common), /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
340
324
|
className: classes.icon
|
|
@@ -343,13 +327,11 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
343
327
|
}));
|
|
344
328
|
}
|
|
345
329
|
}]);
|
|
346
|
-
|
|
347
330
|
return KeyPad;
|
|
348
331
|
}(_react["default"].Component);
|
|
349
332
|
|
|
350
333
|
exports.KeyPad = KeyPad;
|
|
351
|
-
|
|
352
|
-
_defineProperty(KeyPad, "propTypes", {
|
|
334
|
+
(0, _defineProperty2["default"])(KeyPad, "propTypes", {
|
|
353
335
|
classes: _propTypes["default"].object.isRequired,
|
|
354
336
|
className: _propTypes["default"].string,
|
|
355
337
|
baseSet: _propTypes["default"].array,
|
|
@@ -360,8 +342,7 @@ _defineProperty(KeyPad, "propTypes", {
|
|
|
360
342
|
noDecimal: _propTypes["default"].bool,
|
|
361
343
|
mode: _propTypes["default"].string
|
|
362
344
|
});
|
|
363
|
-
|
|
364
|
-
_defineProperty(KeyPad, "defaultProps", {
|
|
345
|
+
(0, _defineProperty2["default"])(KeyPad, "defaultProps", {
|
|
365
346
|
baseSet: _keys.baseSet,
|
|
366
347
|
noDecimal: false
|
|
367
348
|
});
|
package/lib/keypad/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["log","debug","LatexButton","withStyles","theme","root","textTransform","padding","margin","fontSize","latexButton","pointerEvents","transform","marginBottom","backgroundColor","fade","palette","secondary","main","borderTop","width","marginTop","lineHeight","left","top","right","minHeight","border","display","paddingTop","parallelButton","fontStyle","leftRightArrowButton","props","buttonClass","latex","classNames","classes","mqClassName","MQ","MathQuill","getInterface","span","document","createElement","innerHTML","mathField","StaticMath","parseLatex","e","className","onClick","createCustomLayout","layoutObj","gridTemplateColumns","columns","gridTemplateRows","rows","gridAutoFlow","KeyPad","key","onPress","base","extras","transposed","sortKeys","_","flatten","noDecimal","write","label","baseSet","additionalKeys","layoutForKeyPad","onFocus","mode","noBaseSet","keysWithoutBaseSet","includes","allKeys","flowKeys","shift","length","style","Math","floor","keys","map","k","index","buttonClick","bind","common","labelButton","category","extraClass","comma","dot","disabled","keyIsNotAllowed","command","actions","Icon","icon","React","Component","PropTypes","object","isRequired","string","array","func","bool","styles","fontFamily","gridRowGap","gridColumnGap","character","holder","position","height","borderRadius","spacing","unit","minWidth","lighten","primary","light","operators","comparison","green"],"sources":["../../src/keypad/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { lighten, fade } from '@material-ui/core/styles/colorManipulator';\nimport green from '@material-ui/core/colors/green';\nimport { sortKeys } from './keys-layout';\nimport * as mq from '../mq';\nimport { baseSet } from '../keys';\nimport debug from 'debug';\nimport _ from 'lodash';\n\nconst log = debug('pie-lib:math-inline:keypad');\n\nconst LatexButton = withStyles(theme => ({\n root: {\n textTransform: 'none',\n padding: 0,\n margin: 0,\n fontSize: '110% !important'\n },\n latexButton: {\n pointerEvents: 'none',\n textTransform: 'none !important',\n '& .mq-scaled.mq-sqrt-prefix': {\n transform: 'scale(1, 0.9) !important'\n },\n '& .mq-sup-only .mq-sup': {\n marginBottom: '0.9px !important'\n },\n '& .mq-empty': {\n backgroundColor: `${fade(theme.palette.secondary.main, 0.4)} !important`\n },\n '& .mq-overline .mq-overline-inner': {\n borderTop: '2px solid black'\n },\n '& .mq-overarrow': {\n width: '30px',\n marginTop: '0 !important',\n borderTop: '2px solid black',\n '&.mq-arrow-both': {\n '& *': {\n lineHeight: '1 !important'\n },\n '&:before': {\n fontSize: '80%',\n left: 'calc(-13%)',\n top: '-0.25em'\n },\n '&:after': {\n fontSize: '80% !important',\n right: 'calc(-13%) !important',\n top: '-1.5em'\n },\n '&.mq-empty:before': {\n fontSize: '80%',\n left: 'calc(-13%)',\n top: '-0.25em'\n },\n '&.mq-empty:after': {\n fontSize: '80%',\n right: 'calc(-13%)',\n top: '-0.25em'\n },\n '&.mq-empty': {\n minHeight: '1.4em'\n }\n },\n '&.mq-arrow-right:before': {\n fontSize: '80%',\n right: 'calc(-13%)',\n top: '-0.25em'\n },\n '& .mq-overarrow-inner': {\n border: 'none !important'\n },\n '& .mq-overarrow-inner .mq-overarrow-inner-right': {\n display: 'none !important'\n }\n },\n '& .mq-root-block': {\n padding: '5px'\n },\n '& .mq-overarrow.mq-arrow-both.mq-empty:after': {\n right: '-6px',\n fontSize: '80% !important',\n top: '-3px'\n },\n '& .mq-overarrow.mq-arrow-right.mq-empty:before': {\n right: '-5px',\n fontSize: '80% !important',\n top: '-3px'\n },\n '& .mq-overarrow.mq-arrow-both.mq-empty:before': {\n left: '-6px',\n fontSize: '80% !important',\n top: '-3px'\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important'\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85\n },\n '& .mq-overarc': {\n borderTop: '2px solid black !important',\n '& .mq-overline-inner': {\n borderTop: 'none !important',\n paddingTop: '0 !important'\n }\n }\n },\n parallelButton: {\n fontStyle: 'italic'\n },\n leftRightArrowButton: {\n '& .mq-overarrow.mq-arrow-both': {\n '& .mq-overline-inner': {\n borderTop: 'none !important',\n paddingTop: '0 !important'\n },\n '&:after': {\n top: '-1.64em !important'\n }\n }\n }\n}))(props => {\n let buttonClass;\n\n if (props.latex === '\\\\parallel') {\n buttonClass = classNames(\n props.classes.latexButton,\n props.mqClassName,\n props.classes.parallelButton\n );\n } else if (props.latex === '\\\\overleftrightarrow{\\\\overline{}}') {\n buttonClass = classNames(\n props.classes.latexButton,\n props.mqClassName,\n props.classes.leftRightArrowButton\n );\n } else {\n buttonClass = classNames(props.classes.latexButton, props.mqClassName);\n }\n\n try {\n const MQ = MathQuill.getInterface(2);\n const span = document.createElement('span');\n span.innerHTML = '';\n const mathField = MQ.StaticMath(span);\n\n mathField.parseLatex(props.latex);\n mathField.latex(props.latex);\n } catch (e) {\n // received latex has errors - do not create button\n return <></>;\n }\n\n return (\n <Button className={classNames(props.classes.root, props.className)} onClick={props.onClick}>\n <mq.Static className={buttonClass} latex={props.latex} />\n </Button>\n );\n});\n\nconst createCustomLayout = layoutObj => {\n if (layoutObj) {\n return {\n gridTemplateColumns: `repeat(${layoutObj.columns}, minmax(min-content, 150px))`,\n gridTemplateRows: `repeat(${layoutObj.rows}, minmax(40px, 60px))`,\n gridAutoFlow: 'initial'\n };\n }\n\n return {};\n};\n\nexport class KeyPad extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n baseSet: PropTypes.array,\n additionalKeys: PropTypes.array,\n layoutForKeyPad: PropTypes.object,\n onPress: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n noDecimal: PropTypes.bool,\n mode: PropTypes.string\n };\n static defaultProps = {\n baseSet: baseSet,\n noDecimal: false\n };\n\n buttonClick = key => {\n log('[buttonClick]', key);\n const { onPress } = this.props;\n onPress(key);\n };\n\n flowKeys = (base, extras) => {\n const transposed = [...sortKeys(base), ...sortKeys(extras)];\n return _.flatten(transposed);\n };\n\n keyIsNotAllowed = key => {\n const { noDecimal } = this.props;\n\n if (\n ((key.write === '.' && key.label === '.') || (key.write === ',' && key.label === ',')) &&\n noDecimal\n ) {\n return true;\n }\n\n return false;\n };\n\n render() {\n const {\n classes,\n className,\n baseSet,\n additionalKeys,\n layoutForKeyPad,\n onFocus,\n mode\n } = this.props;\n\n const noBaseSet = [\n 'non-negative-integers',\n 'integers',\n 'decimals',\n 'fractions',\n 'item-authoring',\n 'language'\n ];\n\n const keysWithoutBaseSet = noBaseSet.includes(mode);\n const allKeys = keysWithoutBaseSet\n ? this.flowKeys([], additionalKeys || [])\n : this.flowKeys(baseSet, additionalKeys || []); //, ...sortKeys(additionalKeys)];\n\n const shift = allKeys.length % 5 ? 1 : 0;\n const style = {\n gridTemplateColumns: `repeat(${Math.floor(allKeys.length / 5) +\n shift}, minmax(min-content, 150px))`,\n ...createCustomLayout(layoutForKeyPad)\n };\n return (\n <div\n className={classNames(classes.keys, className, classes[mode])}\n style={style}\n onFocus={onFocus}\n >\n {allKeys.map((k, index) => {\n const onClick = this.buttonClick.bind(this, k);\n\n if (!k) {\n return <span key={`empty-${index}`} />;\n }\n\n const common = {\n onClick,\n className: classNames(\n classes.labelButton,\n !keysWithoutBaseSet && classes[k.category],\n classes[k.extraClass],\n k.label === ',' && classes.comma,\n k.label === '.' && classes.dot\n ),\n disabled: this.keyIsNotAllowed(k),\n key: `${k.label || k.latex || k.command}-${index}`,\n ...(k.actions || {})\n };\n\n if (k.latex) {\n return <LatexButton latex={k.latex} {...common} className={classes.latexButton} />;\n }\n\n if (k.label) {\n return <Button {...common}>{k.label}</Button>;\n } else {\n const Icon = k.icon ? k.icon : 'div';\n\n return (\n <IconButton tabIndex={'-1'} {...common}>\n <Icon className={classes.icon} />\n </IconButton>\n );\n }\n })}\n </div>\n );\n }\n}\n\nconst styles = theme => ({\n keys: {\n '& *': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'\n },\n width: '100%',\n display: 'grid',\n gridTemplateRows: 'repeat(5, minmax(40px, 60px))',\n gridRowGap: '0px',\n gridColumnGap: '0px',\n gridAutoFlow: 'column'\n },\n character: {\n textTransform: 'initial !important'\n },\n holder: {\n position: 'relative',\n width: '100%',\n height: '100%',\n backgroundColor: '#cef',\n borderRadius: 0,\n padding: `${theme.spacing.unit}px 0 ${theme.spacing.unit}px 0`\n },\n labelButton: {\n minWidth: 'auto',\n fontSize: '140% !important',\n backgroundColor: lighten(theme.palette.primary.light, 0.5),\n '&:hover': {\n backgroundColor: lighten(theme.palette.primary.light, 0.7)\n },\n borderRadius: 0\n },\n latexButton: {\n minWidth: 'auto',\n borderRadius: 0,\n backgroundColor: lighten(theme.palette.primary.light, 0.5),\n '&:hover': {\n backgroundColor: lighten(theme.palette.primary.light, 0.7)\n }\n },\n base: {},\n operators: {\n backgroundColor: lighten(theme.palette.secondary.light, 0.5),\n '&:hover': {\n backgroundColor: lighten(theme.palette.secondary.light, 0.7)\n }\n },\n comparison: {\n backgroundColor: lighten(green[500], 0.5),\n '&:hover': {\n backgroundColor: lighten(green[500], 0.7)\n }\n },\n comma: {\n fontSize: '200% !important',\n lineHeight: '100%'\n },\n dot: {\n fontSize: '200% !important',\n lineHeight: '100%'\n },\n icon: {\n height: '30px'\n }\n});\n\nexport default withStyles(styles)(KeyPad);\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,IAAAC,iBAAA,EAAM,4BAAN,CAAZ;AAEA,IAAMC,WAAW,GAAG,IAAAC,kBAAA,EAAW,UAAAC,KAAK;EAAA,OAAK;IACvCC,IAAI,EAAE;MACJC,aAAa,EAAE,MADX;MAEJC,OAAO,EAAE,CAFL;MAGJC,MAAM,EAAE,CAHJ;MAIJC,QAAQ,EAAE;IAJN,CADiC;IAOvCC,WAAW,EAAE;MACXC,aAAa,EAAE,MADJ;MAEXL,aAAa,EAAE,iBAFJ;MAGX,+BAA+B;QAC7BM,SAAS,EAAE;MADkB,CAHpB;MAMX,0BAA0B;QACxBC,YAAY,EAAE;MADU,CANf;MASX,eAAe;QACbC,eAAe,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QzH,KAAK,CAACY,OAAN,CAAcC,SAAd,CAAwB8G,KAAhC,EAAuC,GAAvC;MADR;IAFF,CAzCY;IA+CvBE,UAAU,EAAE;MACVnH,eAAe,EAAE,IAAA+G,yBAAA,EAAQK,iBAAA,CAAM,GAAN,CAAR,EAAoB,GAApB,CADP;MAEV,WAAW;QACTpH,eAAe,EAAE,IAAA+G,yBAAA,EAAQK,iBAAA,CAAM,GAAN,CAAR,EAAoB,GAApB;MADR;IAFD,CA/CW;IAqDvBlC,KAAK,EAAE;MACLvF,QAAQ,EAAE,iBADL;MAELa,UAAU,EAAE;IAFP,CArDgB;IAyDvB2E,GAAG,EAAE;MACHxF,QAAQ,EAAE,iBADP;MAEHa,UAAU,EAAE;IAFT,CAzDkB;IA6DvBiF,IAAI,EAAE;MACJiB,MAAM,EAAE;IADJ;EA7DiB,CAAL;AAAA,CAApB;;eAkEe,IAAArH,kBAAA,EAAW8G,MAAX,EAAmBtD,MAAnB,C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["log","debug","LatexButton","withStyles","theme","root","textTransform","padding","margin","fontSize","latexButton","pointerEvents","transform","marginBottom","backgroundColor","fade","palette","secondary","main","borderTop","width","marginTop","fontFamily","top","lineHeight","left","right","minHeight","border","display","paddingTop","parallelButton","fontStyle","leftRightArrowButton","props","buttonClass","latex","classNames","classes","mqClassName","MQ","MathQuill","getInterface","span","document","createElement","innerHTML","mathField","StaticMath","parseLatex","e","className","onClick","createCustomLayout","layoutObj","gridTemplateColumns","columns","gridTemplateRows","rows","gridAutoFlow","KeyPad","key","onPress","base","extras","transposed","sortKeys","_","flatten","noDecimal","write","label","baseSet","additionalKeys","layoutForKeyPad","onFocus","mode","noBaseSet","keysWithoutBaseSet","includes","allKeys","flowKeys","shift","length","style","Math","floor","keys","map","k","index","buttonClick","bind","common","labelButton","category","extraClass","comma","dot","disabled","keyIsNotAllowed","command","actions","extraProps","Icon","icon","React","Component","PropTypes","object","isRequired","string","array","func","bool","styles","gridRowGap","gridColumnGap","character","holder","position","height","borderRadius","spacing","unit","minWidth","lighten","primary","light","operators","comparison","green"],"sources":["../../src/keypad/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { lighten, fade } from '@material-ui/core/styles/colorManipulator';\nimport green from '@material-ui/core/colors/green';\nimport { sortKeys } from './keys-layout';\nimport * as mq from '../mq';\nimport { baseSet } from '../keys';\nimport debug from 'debug';\nimport _ from 'lodash';\n\nconst log = debug('pie-lib:math-inline:keypad');\n\nconst LatexButton = withStyles(theme => ({\n root: {\n textTransform: 'none',\n padding: 0,\n margin: 0,\n fontSize: '110% !important'\n },\n latexButton: {\n pointerEvents: 'none',\n textTransform: 'none !important',\n '& .mq-scaled.mq-sqrt-prefix': {\n transform: 'scale(1, 0.9) !important'\n },\n '& .mq-sup-only .mq-sup': {\n marginBottom: '0.9px !important'\n },\n '& .mq-empty': {\n backgroundColor: `${fade(theme.palette.secondary.main, 0.4)} !important`\n },\n '& .mq-overline .mq-overline-inner': {\n borderTop: '2px solid black'\n },\n '& .mq-overarrow': {\n width: '30px',\n marginTop: '0 !important',\n borderTop: '2px solid black',\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n\n '&.mq-arrow-both': {\n top: '5px !important',\n '& *': {\n lineHeight: '1 !important'\n },\n '&:before': {\n fontSize: '80%',\n left: 'calc(-13%)',\n top: '-0.31em'\n },\n '&:after': {\n fontSize: '80% !important',\n right: 'calc(-13%) !important',\n top: '-1.5em'\n },\n '&.mq-empty:before': {\n fontSize: '80%',\n left: 'calc(-13%)',\n top: '-0.26em'\n },\n '&.mq-empty:after': {\n fontSize: '80%',\n right: 'calc(-13%)',\n top: '-0.26em'\n },\n '&.mq-empty': {\n minHeight: '1.4em'\n }\n },\n '&.mq-arrow-right:before': {\n fontSize: '80%',\n right: 'calc(-13%)',\n top: '-0.25em'\n },\n '& .mq-overarrow-inner': {\n border: 'none !important'\n },\n '& .mq-overarrow-inner .mq-overarrow-inner-right': {\n display: 'none !important'\n }\n },\n '& .mq-root-block': {\n padding: '5px'\n },\n '& .mq-overarrow.mq-arrow-both.mq-empty:after': {\n right: '-6px',\n fontSize: '80% !important',\n top: '-3px'\n },\n '& .mq-overarrow.mq-arrow-right.mq-empty:before': {\n right: '-5px',\n fontSize: '80% !important',\n top: '-3px'\n },\n '& .mq-overarrow.mq-arrow-both.mq-empty:before': {\n left: '-6px',\n fontSize: '80% !important',\n top: '-3px'\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important'\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85\n },\n '& .mq-overarc': {\n borderTop: '2px solid black !important',\n '& .mq-overline-inner': {\n borderTop: 'none !important',\n paddingTop: '0 !important'\n }\n }\n },\n parallelButton: {\n fontStyle: 'italic'\n },\n leftRightArrowButton: {\n '& .mq-overarrow.mq-arrow-both': {\n '& .mq-overline-inner': {\n borderTop: 'none !important',\n paddingTop: '0 !important'\n },\n '&:after': {\n top: '-2.8em !important'\n }\n }\n }\n}))(props => {\n let buttonClass;\n\n if (props.latex === '\\\\parallel') {\n buttonClass = classNames(\n props.classes.latexButton,\n props.mqClassName,\n props.classes.parallelButton\n );\n } else if (props.latex === '\\\\overleftrightarrow{\\\\overline{}}') {\n buttonClass = classNames(\n props.classes.latexButton,\n props.mqClassName,\n props.classes.leftRightArrowButton\n );\n } else {\n buttonClass = classNames(props.classes.latexButton, props.mqClassName);\n }\n\n try {\n const MQ = MathQuill.getInterface(2);\n const span = document.createElement('span');\n span.innerHTML = '';\n const mathField = MQ.StaticMath(span);\n\n mathField.parseLatex(props.latex);\n mathField.latex(props.latex);\n } catch (e) {\n // received latex has errors - do not create button\n return <></>;\n }\n\n return (\n <Button className={classNames(props.classes.root, props.className)} onClick={props.onClick}>\n <mq.Static className={buttonClass} latex={props.latex} />\n </Button>\n );\n});\n\nconst createCustomLayout = layoutObj => {\n if (layoutObj) {\n return {\n gridTemplateColumns: `repeat(${layoutObj.columns}, minmax(min-content, 150px))`,\n gridTemplateRows: `repeat(${layoutObj.rows}, minmax(40px, 60px))`,\n gridAutoFlow: 'initial'\n };\n }\n\n return {};\n};\n\nexport class KeyPad extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n baseSet: PropTypes.array,\n additionalKeys: PropTypes.array,\n layoutForKeyPad: PropTypes.object,\n onPress: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n noDecimal: PropTypes.bool,\n mode: PropTypes.string\n };\n static defaultProps = {\n baseSet: baseSet,\n noDecimal: false\n };\n\n buttonClick = key => {\n log('[buttonClick]', key);\n const { onPress } = this.props;\n onPress(key);\n };\n\n flowKeys = (base, extras) => {\n const transposed = [...sortKeys(base), ...sortKeys(extras)];\n return _.flatten(transposed);\n };\n\n keyIsNotAllowed = key => {\n const { noDecimal } = this.props;\n\n if (\n ((key.write === '.' && key.label === '.') || (key.write === ',' && key.label === ',')) &&\n noDecimal\n ) {\n return true;\n }\n\n return false;\n };\n\n render() {\n const {\n classes,\n className,\n baseSet,\n additionalKeys,\n layoutForKeyPad,\n onFocus,\n mode\n } = this.props;\n\n const noBaseSet = [\n 'non-negative-integers',\n 'integers',\n 'decimals',\n 'fractions',\n 'item-authoring',\n 'language'\n ];\n\n const keysWithoutBaseSet = noBaseSet.includes(mode);\n const allKeys = keysWithoutBaseSet\n ? this.flowKeys([], additionalKeys || [])\n : this.flowKeys(baseSet, additionalKeys || []); //, ...sortKeys(additionalKeys)];\n\n const shift = allKeys.length % 5 ? 1 : 0;\n const style = {\n gridTemplateColumns: `repeat(${Math.floor(allKeys.length / 5) +\n shift}, minmax(min-content, 150px))`,\n ...createCustomLayout(layoutForKeyPad)\n };\n return (\n <div\n className={classNames(classes.keys, className, classes[mode])}\n style={style}\n onFocus={onFocus}\n >\n {allKeys.map((k, index) => {\n const onClick = this.buttonClick.bind(this, k);\n\n if (!k) {\n return <span key={`empty-${index}`} />;\n }\n\n const common = {\n onClick,\n className: classNames(\n classes.labelButton,\n !keysWithoutBaseSet && classes[k.category],\n classes[k.extraClass],\n k.label === ',' && classes.comma,\n k.label === '.' && classes.dot\n ),\n disabled: this.keyIsNotAllowed(k),\n key: `${k.label || k.latex || k.command}-${index}`,\n ...(k.actions || {}),\n ...(k.extraProps || {})\n };\n\n if (k.latex) {\n return <LatexButton latex={k.latex} {...common} className={classes.latexButton} />;\n }\n\n if (k.label) {\n return <Button {...common}>{k.label}</Button>;\n } else {\n const Icon = k.icon ? k.icon : 'div';\n\n return (\n <IconButton tabIndex={'-1'} {...common}>\n <Icon className={classes.icon} />\n </IconButton>\n );\n }\n })}\n </div>\n );\n }\n}\n\nconst styles = theme => ({\n keys: {\n '& *': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'\n },\n width: '100%',\n display: 'grid',\n gridTemplateRows: 'repeat(5, minmax(40px, 60px))',\n gridRowGap: '0px',\n gridColumnGap: '0px',\n gridAutoFlow: 'column'\n },\n character: {\n textTransform: 'initial !important'\n },\n holder: {\n position: 'relative',\n width: '100%',\n height: '100%',\n backgroundColor: '#cef',\n borderRadius: 0,\n padding: `${theme.spacing.unit}px 0 ${theme.spacing.unit}px 0`\n },\n labelButton: {\n minWidth: 'auto',\n fontSize: '140% !important',\n backgroundColor: lighten(theme.palette.primary.light, 0.5),\n '&:hover': {\n backgroundColor: lighten(theme.palette.primary.light, 0.7)\n },\n borderRadius: 0\n },\n latexButton: {\n minWidth: 'auto',\n borderRadius: 0,\n backgroundColor: lighten(theme.palette.primary.light, 0.5),\n '&:hover': {\n backgroundColor: lighten(theme.palette.primary.light, 0.7)\n }\n },\n base: {},\n operators: {\n backgroundColor: lighten(theme.palette.secondary.light, 0.5),\n '&:hover': {\n backgroundColor: lighten(theme.palette.secondary.light, 0.7)\n }\n },\n comparison: {\n backgroundColor: lighten(green[500], 0.5),\n '&:hover': {\n backgroundColor: lighten(green[500], 0.7)\n }\n },\n comma: {\n fontSize: '200% !important',\n lineHeight: '100%'\n },\n dot: {\n fontSize: '200% !important',\n lineHeight: '100%'\n },\n icon: {\n height: '30px'\n }\n});\n\nexport default withStyles(styles)(KeyPad);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,IAAAC,iBAAA,EAAM,4BAAN,CAAZ;AAEA,IAAMC,WAAW,GAAG,IAAAC,kBAAA,EAAW,UAAAC,KAAK;EAAA,OAAK;IACvCC,IAAI,EAAE;MACJC,aAAa,EAAE,MADX;MAEJC,OAAO,EAAE,CAFL;MAGJC,MAAM,EAAE,CAHJ;MAIJC,QAAQ,EAAE;IAJN,CADiC;IAOvCC,WAAW,EAAE;MACXC,aAAa,EAAE,MADJ;MAEXL,aAAa,EAAE,iBAFJ;MAGX,+BAA+B;QAC7BM,SAAS,EAAE;MADkB,CAHpB;MAMX,0BAA0B;QACxBC,YAAY,EAAE;MADU,CANf;MASX,eAAe;QACbC,eAAe,YAAK,IAAAC,sBAAA,EAAKX,KAAK,CAACY,OAAN,CAAcC,SAAd,CAAwBC,IAA7B,EAAmC,GAAnC,CAAL;MADF,CATJ;MAYX,qCAAqC;QACnCC,SAAS,EAAE;MADwB,CAZ1B;MAeX,mBAAmB;QACjBC,KAAK,EAAE,MADU;QAEjBC,SAAS,EAAE,cAFM;QAGjBF,SAAS,EAAE,iBAHM;QAIjBG,UAAU,EAAE,iDAJK;QAMjB,mBAAmB;UACjBC,GAAG,EAAE,gBADY;UAEjB,OAAO;YACLC,UAAU,EAAE;UADP,CAFU;UAKjB,YAAY;YACVf,QAAQ,EAAE,KADA;YAEVgB,IAAI,EAAE,YAFI;YAGVF,GAAG,EAAE;UAHK,CALK;UAUjB,WAAW;YACTd,QAAQ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