@pie-lib/math-toolbar 3.1.0-beta.7 → 4.0.0-next.41
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/dist/done-button.d.ts +30 -0
- package/dist/done-button.js +35 -0
- package/dist/editor-and-pad.d.ts +47 -0
- package/dist/editor-and-pad.js +352 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.js +158 -0
- package/dist/math-preview.d.ts +22 -0
- package/dist/math-preview.js +125 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +9 -0
- package/package.json +30 -26
- package/CHANGELOG.json +0 -17
- package/CHANGELOG.md +0 -1049
- package/lib/__tests__/editor-and-pad-mathlive.test.js +0 -272
- package/lib/__tests__/editor-and-pad-mathlive.test.js.map +0 -1
- package/lib/__tests__/editor-and-pad.test.js +0 -78
- package/lib/__tests__/editor-and-pad.test.js.map +0 -1
- package/lib/__tests__/index.test.js +0 -27
- package/lib/__tests__/index.test.js.map +0 -1
- package/lib/__tests__/math-preview.test.js +0 -91
- package/lib/__tests__/math-preview.test.js.map +0 -1
- package/lib/done-button.js +0 -51
- package/lib/done-button.js.map +0 -1
- package/lib/editor-and-pad.js +0 -536
- package/lib/editor-and-pad.js.map +0 -1
- package/lib/index.js +0 -241
- package/lib/index.js.map +0 -1
- package/lib/math-preview.js +0 -206
- package/lib/math-preview.js.map +0 -1
- package/lib/utils.js +0 -17
- package/lib/utils.js.map +0 -1
- package/src/__tests__/editor-and-pad-mathlive.test.js +0 -178
- package/src/__tests__/editor-and-pad.test.js +0 -74
- package/src/__tests__/index.test.js +0 -21
- package/src/__tests__/math-preview.test.js +0 -83
- package/src/done-button.jsx +0 -36
- package/src/editor-and-pad.jsx +0 -505
- package/src/index.jsx +0 -220
- package/src/math-preview.jsx +0 -174
- package/src/utils.js +0 -11
package/lib/editor-and-pad.js
DELETED
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.EditorAndPad = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
18
|
-
var _styles = require("@mui/material/styles");
|
|
19
|
-
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
20
|
-
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
21
|
-
var _lodashEs = require("lodash-es");
|
|
22
|
-
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
23
|
-
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
24
|
-
var _mathInputMathlive = require("@pie-lib/math-input-mathlive");
|
|
25
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
26
|
-
var _utils = require("./utils");
|
|
27
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
29
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
|
-
var _mq$CommonMqStyles = _mathInputMathlive.mq.CommonMqStyles,
|
|
32
|
-
commonMqFontStyles = _mq$CommonMqStyles.commonMqFontStyles,
|
|
33
|
-
commonMqKeyboardStyles = _mq$CommonMqStyles.commonMqKeyboardStyles,
|
|
34
|
-
longdivStyles = _mq$CommonMqStyles.longdivStyles,
|
|
35
|
-
supsubStyles = _mq$CommonMqStyles.supsubStyles;
|
|
36
|
-
var log = (0, _debug["default"])('@pie-lib:math-toolbar:editor-and-pad');
|
|
37
|
-
var decimalRegex = /\.|,/g;
|
|
38
|
-
var MathToolbarContainer = (0, _styles.styled)('div')(function (_ref) {
|
|
39
|
-
var theme = _ref.theme;
|
|
40
|
-
return {
|
|
41
|
-
zIndex: 9,
|
|
42
|
-
position: 'relative',
|
|
43
|
-
textAlign: 'center',
|
|
44
|
-
width: 'auto',
|
|
45
|
-
'& > .mq-math-mode': {
|
|
46
|
-
border: 'solid 1px lightgrey'
|
|
47
|
-
},
|
|
48
|
-
'& > .mq-focused': {
|
|
49
|
-
outline: 'none',
|
|
50
|
-
boxShadow: 'none',
|
|
51
|
-
border: "dotted 1px ".concat(theme.palette.primary.main),
|
|
52
|
-
borderRadius: '0px'
|
|
53
|
-
},
|
|
54
|
-
'& .mq-overarrow-inner': {
|
|
55
|
-
border: 'none !important',
|
|
56
|
-
paddingTop: '0 !important'
|
|
57
|
-
},
|
|
58
|
-
'& .mq-overarrow-inner-right': {
|
|
59
|
-
display: 'none !important'
|
|
60
|
-
},
|
|
61
|
-
'& .mq-overarrow-inner-left': {
|
|
62
|
-
display: 'none !important'
|
|
63
|
-
},
|
|
64
|
-
'& .mq-longdiv-inner': {
|
|
65
|
-
borderTop: '1px solid !important',
|
|
66
|
-
paddingTop: '1.5px !important'
|
|
67
|
-
},
|
|
68
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
69
|
-
top: '7.8px',
|
|
70
|
-
marginTop: '0px',
|
|
71
|
-
minWidth: '1.23em'
|
|
72
|
-
},
|
|
73
|
-
'& .mq-parallelogram': {
|
|
74
|
-
lineHeight: 0.85
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
var InputAndTypeContainer = (0, _styles.styled)('div')(function (_ref2) {
|
|
79
|
-
var theme = _ref2.theme,
|
|
80
|
-
hide = _ref2.hide;
|
|
81
|
-
return {
|
|
82
|
-
display: hide ? 'none' : 'flex',
|
|
83
|
-
alignItems: 'center',
|
|
84
|
-
'& .mq-editable-field .mq-cursor': {
|
|
85
|
-
top: '-4px'
|
|
86
|
-
},
|
|
87
|
-
'& .mq-math-mode .mq-selection, .mq-editable-field .mq-selection': {
|
|
88
|
-
paddingTop: '18px'
|
|
89
|
-
},
|
|
90
|
-
'& .mq-math-mode .mq-overarrow': {
|
|
91
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
92
|
-
},
|
|
93
|
-
'& .mq-math-mode .mq-overline .mq-overline-inner': {
|
|
94
|
-
paddingTop: '0.4em !important'
|
|
95
|
-
},
|
|
96
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
97
|
-
minWidth: '1.23em',
|
|
98
|
-
'& *': {
|
|
99
|
-
lineHeight: '1 !important'
|
|
100
|
-
},
|
|
101
|
-
'&:before': {
|
|
102
|
-
top: '-0.45em',
|
|
103
|
-
left: '-1px'
|
|
104
|
-
},
|
|
105
|
-
'&:after': {
|
|
106
|
-
position: 'absolute !important',
|
|
107
|
-
top: '0px !important',
|
|
108
|
-
right: '-2px'
|
|
109
|
-
},
|
|
110
|
-
'&.mq-empty:after': {
|
|
111
|
-
top: '-0.45em'
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
'& .mq-overarrow.mq-arrow-right': {
|
|
115
|
-
'&:before': {
|
|
116
|
-
top: '-0.4em',
|
|
117
|
-
right: '-1px'
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
'& *': _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, commonMqFontStyles), supsubStyles), longdivStyles), {}, {
|
|
121
|
-
'& .mq-math-mode .mq-sqrt-prefix': {
|
|
122
|
-
verticalAlign: 'baseline !important',
|
|
123
|
-
top: '1px !important',
|
|
124
|
-
left: '-0.1em !important'
|
|
125
|
-
},
|
|
126
|
-
'& .mq-math-mode .mq-overarc ': {
|
|
127
|
-
paddingTop: '0.45em !important'
|
|
128
|
-
},
|
|
129
|
-
'& .mq-math-mode .mq-empty': {
|
|
130
|
-
padding: '9px 1px !important'
|
|
131
|
-
},
|
|
132
|
-
'& .mq-math-mode .mq-root-block': {
|
|
133
|
-
paddingTop: '10px'
|
|
134
|
-
},
|
|
135
|
-
'& .mq-scaled .mq-sqrt-prefix': {
|
|
136
|
-
top: '0 !important'
|
|
137
|
-
},
|
|
138
|
-
'& .mq-math-mode .mq-longdiv .mq-longdiv-inner': {
|
|
139
|
-
marginLeft: '4px !important',
|
|
140
|
-
paddingTop: '6px !important',
|
|
141
|
-
paddingLeft: '6px !important'
|
|
142
|
-
},
|
|
143
|
-
'& .mq-math-mode .mq-paren': {
|
|
144
|
-
verticalAlign: 'top !important',
|
|
145
|
-
padding: '1px 0.1em !important'
|
|
146
|
-
},
|
|
147
|
-
'& .mq-math-mode .mq-sqrt-stem': {
|
|
148
|
-
borderTop: '0.07em solid',
|
|
149
|
-
marginLeft: '-1.5px',
|
|
150
|
-
marginTop: '-2px !important',
|
|
151
|
-
paddingTop: '5px !important'
|
|
152
|
-
},
|
|
153
|
-
'& .mq-math-mode .mq-denominator': {
|
|
154
|
-
marginTop: '-5px !important',
|
|
155
|
-
padding: '0.5em 0.1em 0.1em !important'
|
|
156
|
-
},
|
|
157
|
-
'& .mq-math-mode .mq-numerator, .mq-math-mode .mq-over': {
|
|
158
|
-
padding: '0 0.1em !important',
|
|
159
|
-
paddingBottom: '0 !important',
|
|
160
|
-
marginBottom: '-2px'
|
|
161
|
-
}
|
|
162
|
-
}),
|
|
163
|
-
'& span[data-prime="true"]': {
|
|
164
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
});
|
|
168
|
-
var StyledFormControl = (0, _styles.styled)(_FormControl["default"])({
|
|
169
|
-
flex: 'initial',
|
|
170
|
-
width: '25%',
|
|
171
|
-
minWidth: '100px',
|
|
172
|
-
marginLeft: '15px',
|
|
173
|
-
marginTop: '5px',
|
|
174
|
-
marginBottom: '5px',
|
|
175
|
-
marginRight: '5px',
|
|
176
|
-
'& label': {
|
|
177
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
178
|
-
},
|
|
179
|
-
'& div': {
|
|
180
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
var StyledInputLabel = (0, _styles.styled)(_InputLabel["default"])(function () {
|
|
184
|
-
return {
|
|
185
|
-
backgroundColor: 'transparent'
|
|
186
|
-
};
|
|
187
|
-
});
|
|
188
|
-
var InputContainerDiv = (0, _styles.styled)('div')(function (_ref3) {
|
|
189
|
-
var theme = _ref3.theme,
|
|
190
|
-
error = _ref3.error;
|
|
191
|
-
return _objectSpread(_objectSpread({
|
|
192
|
-
minWidth: '500px',
|
|
193
|
-
maxWidth: '900px',
|
|
194
|
-
minHeight: '30px',
|
|
195
|
-
width: '100%',
|
|
196
|
-
display: 'flex',
|
|
197
|
-
marginTop: theme.spacing(1),
|
|
198
|
-
marginBottom: theme.spacing(1)
|
|
199
|
-
}, error && {
|
|
200
|
-
border: '2px solid red'
|
|
201
|
-
}), {}, {
|
|
202
|
-
'& .mq-sqrt-prefix .mq-scaled': {
|
|
203
|
-
verticalAlign: 'middle !important'
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
var MathEditor = (0, _styles.styled)(_mathInputMathlive.mq.Input)(function (_ref4) {
|
|
208
|
-
var controlledKeypadMode = _ref4.controlledKeypadMode;
|
|
209
|
-
return {
|
|
210
|
-
maxWidth: controlledKeypadMode ? '400px' : '500px',
|
|
211
|
-
color: _renderUi.color.text(),
|
|
212
|
-
backgroundColor: _renderUi.color.background(),
|
|
213
|
-
padding: '2px'
|
|
214
|
-
};
|
|
215
|
-
});
|
|
216
|
-
var AddAnswerBlockButton = (0, _styles.styled)(_Button["default"])({
|
|
217
|
-
position: 'absolute',
|
|
218
|
-
right: '12px',
|
|
219
|
-
border: '1px solid lightgrey',
|
|
220
|
-
color: _renderUi.color.text()
|
|
221
|
-
});
|
|
222
|
-
var StyledHr = (0, _styles.styled)('hr')(function (_ref5) {
|
|
223
|
-
var theme = _ref5.theme;
|
|
224
|
-
return {
|
|
225
|
-
padding: 0,
|
|
226
|
-
margin: 0,
|
|
227
|
-
height: '1px',
|
|
228
|
-
border: 'none',
|
|
229
|
-
borderBottom: "solid 1px ".concat(theme.palette.primary.main)
|
|
230
|
-
};
|
|
231
|
-
});
|
|
232
|
-
var KeyboardContainer = (0, _styles.styled)(_mathInputMathlive.HorizontalKeypad)(function (_ref6) {
|
|
233
|
-
var mode = _ref6.mode;
|
|
234
|
-
return _objectSpread(_objectSpread({}, commonMqKeyboardStyles), mode === 'language' && {
|
|
235
|
-
'& *': {
|
|
236
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
var toNodeData = function toNodeData(data) {
|
|
241
|
-
if (!data) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
var type = data.type,
|
|
245
|
-
value = data.value;
|
|
246
|
-
if (type === 'command' || type === 'cursor') {
|
|
247
|
-
return data;
|
|
248
|
-
} else if (type === 'answer') {
|
|
249
|
-
return _objectSpread({
|
|
250
|
-
type: 'answer'
|
|
251
|
-
}, data);
|
|
252
|
-
} else if (value === 'clear') {
|
|
253
|
-
return {
|
|
254
|
-
type: 'clear'
|
|
255
|
-
};
|
|
256
|
-
} else {
|
|
257
|
-
return {
|
|
258
|
-
type: 'write',
|
|
259
|
-
value: value
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
var EditorAndPad = exports.EditorAndPad = /*#__PURE__*/function (_React$Component) {
|
|
264
|
-
function EditorAndPad(props) {
|
|
265
|
-
var _this;
|
|
266
|
-
(0, _classCallCheck2["default"])(this, EditorAndPad);
|
|
267
|
-
_this = _callSuper(this, EditorAndPad, [props]);
|
|
268
|
-
(0, _defineProperty2["default"])(_this, "onClick", function (data) {
|
|
269
|
-
var _this$props = _this.props,
|
|
270
|
-
noDecimal = _this$props.noDecimal,
|
|
271
|
-
noLatexHandling = _this$props.noLatexHandling,
|
|
272
|
-
onChange = _this$props.onChange;
|
|
273
|
-
var c = toNodeData(data);
|
|
274
|
-
log('mathChange: ', c);
|
|
275
|
-
if (noLatexHandling) {
|
|
276
|
-
onChange(c.value);
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// if decimals are not allowed for this response, we discard the input
|
|
281
|
-
if (noDecimal && (c.value === '.' || c.value === ',')) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
if (!c) {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
if (c.type === 'clear') {
|
|
288
|
-
log('call clear...');
|
|
289
|
-
_this.input.clear();
|
|
290
|
-
} else if (c.type === 'command') {
|
|
291
|
-
_this.input.command(c.value);
|
|
292
|
-
} else if (c.type === 'cursor') {
|
|
293
|
-
_this.input.keystroke(c.value);
|
|
294
|
-
} else if (c.type === 'answer') {
|
|
295
|
-
_this.input.write('%response%');
|
|
296
|
-
} else {
|
|
297
|
-
_this.input.write(c.value);
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
(0, _defineProperty2["default"])(_this, "updateDisable", function (isEdit) {
|
|
301
|
-
var maxResponseAreas = _this.props.maxResponseAreas;
|
|
302
|
-
if (maxResponseAreas) {
|
|
303
|
-
var shouldDisable = _this.checkResponseAreasNumber(maxResponseAreas, isEdit);
|
|
304
|
-
_this.setState({
|
|
305
|
-
addDisabled: shouldDisable
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
(0, _defineProperty2["default"])(_this, "onAnswerBlockClick", function () {
|
|
310
|
-
_this.props.onAnswerBlockAdd();
|
|
311
|
-
_this.onClick({
|
|
312
|
-
type: 'answer'
|
|
313
|
-
});
|
|
314
|
-
_this.updateDisable(true);
|
|
315
|
-
});
|
|
316
|
-
(0, _defineProperty2["default"])(_this, "onEditorChange", function (latex) {
|
|
317
|
-
var _this$props2 = _this.props,
|
|
318
|
-
onChange = _this$props2.onChange,
|
|
319
|
-
noDecimal = _this$props2.noDecimal;
|
|
320
|
-
(0, _mathInputMathlive.updateSpans)();
|
|
321
|
-
(0, _utils.markFractionBaseSuperscripts)();
|
|
322
|
-
_this.updateDisable(true);
|
|
323
|
-
|
|
324
|
-
// if no decimals are allowed and the last change is a decimal dot, discard the change
|
|
325
|
-
if (noDecimal && (latex.indexOf('.') !== -1 || latex.indexOf(',') !== -1) && _this.input) {
|
|
326
|
-
_this.input.clear();
|
|
327
|
-
_this.input.write(latex.replace(decimalRegex, ''));
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// eslint-disable-next-line no-useless-escape
|
|
332
|
-
var regexMatch = latex.match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);
|
|
333
|
-
if (_this.input && regexMatch && regexMatch !== null && regexMatch !== void 0 && regexMatch.length) {
|
|
334
|
-
try {
|
|
335
|
-
// Undo the empty fraction the editor just created after a digit.
|
|
336
|
-
// MathQuill needed cursor surgery via `__controller`; MathLive has no
|
|
337
|
-
// such internals, so use the public delete command. `keystroke` accepts
|
|
338
|
-
// the MathQuill name and maps it to the engine's selector.
|
|
339
|
-
_this.input.keystroke('Backspace');
|
|
340
|
-
} catch (e) {
|
|
341
|
-
// eslint-disable-next-line no-console
|
|
342
|
-
console.error(e.toString());
|
|
343
|
-
}
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
onChange(latex);
|
|
347
|
-
});
|
|
348
|
-
(0, _defineProperty2["default"])(_this, "onEditorTypeChange", function (evt) {
|
|
349
|
-
_this.setState({
|
|
350
|
-
equationEditor: evt.target.value
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
(0, _defineProperty2["default"])(_this, "checkResponseAreasNumber", function (maxResponseAreas, isEdit) {
|
|
354
|
-
var _ref7 = _this.input && _this.input.props || {},
|
|
355
|
-
latex = _ref7.latex;
|
|
356
|
-
if (latex) {
|
|
357
|
-
var count = (latex.match(/answerBlock/g) || []).length;
|
|
358
|
-
return isEdit ? count === maxResponseAreas - 1 : count === maxResponseAreas;
|
|
359
|
-
}
|
|
360
|
-
return false;
|
|
361
|
-
});
|
|
362
|
-
_this.state = {
|
|
363
|
-
equationEditor: 'item-authoring',
|
|
364
|
-
addDisabled: false
|
|
365
|
-
};
|
|
366
|
-
return _this;
|
|
367
|
-
}
|
|
368
|
-
(0, _inherits2["default"])(EditorAndPad, _React$Component);
|
|
369
|
-
return (0, _createClass2["default"])(EditorAndPad, [{
|
|
370
|
-
key: "componentDidMount",
|
|
371
|
-
value: function componentDidMount() {
|
|
372
|
-
var _this2 = this;
|
|
373
|
-
if (this.input && this.props.autoFocus) {
|
|
374
|
-
// adding a timeout to wait for other stuff related to focus to be finished
|
|
375
|
-
setTimeout(function () {
|
|
376
|
-
return _this2.input.focus();
|
|
377
|
-
}, 0);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}, {
|
|
381
|
-
key: "shouldComponentUpdate",
|
|
382
|
-
value:
|
|
383
|
-
/** Only render if the editor's latex is different
|
|
384
|
-
* or the keypad state changed from one state to the other (shown / hidden) */
|
|
385
|
-
function shouldComponentUpdate(nextProps, nextState) {
|
|
386
|
-
// `this.input` is set via a ref, and the underlying math engine loads
|
|
387
|
-
// asynchronously, so neither is guaranteed to exist on early renders.
|
|
388
|
-
// Treat "not ready" as different, so the first real render is not skipped.
|
|
389
|
-
var inputIsDifferent = !this.input || this.input.latex() !== nextProps.latex;
|
|
390
|
-
log('[shouldComponentUpdate] ', 'inputIsDifferent: ', inputIsDifferent);
|
|
391
|
-
if (!(0, _lodashEs.isEqual)(this.props.error, nextProps.error)) {
|
|
392
|
-
return true;
|
|
393
|
-
}
|
|
394
|
-
if (!inputIsDifferent && this.props.keypadMode !== nextProps.keypadMode) {
|
|
395
|
-
return true;
|
|
396
|
-
}
|
|
397
|
-
if (!inputIsDifferent && this.props.noDecimal !== nextProps.noDecimal) {
|
|
398
|
-
return true;
|
|
399
|
-
}
|
|
400
|
-
if (!inputIsDifferent && this.state.equationEditor !== nextState.equationEditor) {
|
|
401
|
-
return true;
|
|
402
|
-
}
|
|
403
|
-
if (!inputIsDifferent && this.props.controlledKeypad) {
|
|
404
|
-
return this.props.showKeypad !== nextProps.showKeypad;
|
|
405
|
-
}
|
|
406
|
-
return inputIsDifferent;
|
|
407
|
-
}
|
|
408
|
-
}, {
|
|
409
|
-
key: "render",
|
|
410
|
-
value: function render() {
|
|
411
|
-
var _this3 = this;
|
|
412
|
-
var _this$props3 = this.props,
|
|
413
|
-
classNames = _this$props3.classNames,
|
|
414
|
-
keypadMode = _this$props3.keypadMode,
|
|
415
|
-
allowAnswerBlock = _this$props3.allowAnswerBlock,
|
|
416
|
-
additionalKeys = _this$props3.additionalKeys,
|
|
417
|
-
controlledKeypad = _this$props3.controlledKeypad,
|
|
418
|
-
controlledKeypadMode = _this$props3.controlledKeypadMode,
|
|
419
|
-
showKeypad = _this$props3.showKeypad,
|
|
420
|
-
setKeypadInteraction = _this$props3.setKeypadInteraction,
|
|
421
|
-
noDecimal = _this$props3.noDecimal,
|
|
422
|
-
hideInput = _this$props3.hideInput,
|
|
423
|
-
layoutForKeyPad = _this$props3.layoutForKeyPad,
|
|
424
|
-
latex = _this$props3.latex,
|
|
425
|
-
_onFocus = _this$props3.onFocus,
|
|
426
|
-
_onBlur = _this$props3.onBlur,
|
|
427
|
-
error = _this$props3.error;
|
|
428
|
-
var shouldShowKeypad = !controlledKeypad || controlledKeypad && showKeypad;
|
|
429
|
-
var addDisabled = this.state.addDisabled;
|
|
430
|
-
log('[render]', latex);
|
|
431
|
-
return /*#__PURE__*/_react["default"].createElement(MathToolbarContainer, {
|
|
432
|
-
className: classNames.mathToolbar
|
|
433
|
-
}, /*#__PURE__*/_react["default"].createElement(InputAndTypeContainer, {
|
|
434
|
-
hide: hideInput
|
|
435
|
-
}, controlledKeypadMode && /*#__PURE__*/_react["default"].createElement(StyledFormControl, {
|
|
436
|
-
variant: 'standard'
|
|
437
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledInputLabel, {
|
|
438
|
-
id: "equation-editor-label"
|
|
439
|
-
}, 'Equation Editor'), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
440
|
-
labelId: "equation-editor-label",
|
|
441
|
-
id: "equation-editor-select",
|
|
442
|
-
name: "equationEditor",
|
|
443
|
-
label: 'Equation Editor',
|
|
444
|
-
onChange: this.onEditorTypeChange,
|
|
445
|
-
value: this.state.equationEditor,
|
|
446
|
-
MenuProps: {
|
|
447
|
-
transitionDuration: {
|
|
448
|
-
enter: 225,
|
|
449
|
-
exit: 195
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
}, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
453
|
-
value: "non-negative-integers"
|
|
454
|
-
}, "Numeric - Non-Negative Integers"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
455
|
-
value: "integers"
|
|
456
|
-
}, "Numeric - Integers"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
457
|
-
value: "decimals"
|
|
458
|
-
}, "Numeric - Decimals"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
459
|
-
value: "fractions"
|
|
460
|
-
}, "Numeric - Fractions"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
461
|
-
value: 1
|
|
462
|
-
}, "Grade 1 - 2"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
463
|
-
value: 3
|
|
464
|
-
}, "Grade 3 - 5"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
465
|
-
value: 6
|
|
466
|
-
}, "Grade 6 - 7"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
467
|
-
value: 8
|
|
468
|
-
}, "Grade 8 - HS"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
469
|
-
value: 'geometry'
|
|
470
|
-
}, "Geometry"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
471
|
-
value: 'advanced-algebra'
|
|
472
|
-
}, "Advanced Algebra"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
473
|
-
value: 'statistics'
|
|
474
|
-
}, "Statistics"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
475
|
-
value: 'item-authoring'
|
|
476
|
-
}, "Item Authoring"))), /*#__PURE__*/_react["default"].createElement(InputContainerDiv, {
|
|
477
|
-
error: error
|
|
478
|
-
}, /*#__PURE__*/_react["default"].createElement(MathEditor, {
|
|
479
|
-
onFocus: function onFocus() {
|
|
480
|
-
_onFocus && _onFocus();
|
|
481
|
-
_this3.updateDisable(false);
|
|
482
|
-
},
|
|
483
|
-
onBlur: function onBlur(event) {
|
|
484
|
-
_this3.updateDisable(false);
|
|
485
|
-
_onBlur && _onBlur(event);
|
|
486
|
-
},
|
|
487
|
-
className: classNames && classNames.editor || '',
|
|
488
|
-
controlledKeypadMode: controlledKeypadMode,
|
|
489
|
-
ref: function ref(r) {
|
|
490
|
-
return _this3.input = r;
|
|
491
|
-
},
|
|
492
|
-
latex: latex,
|
|
493
|
-
onChange: this.onEditorChange
|
|
494
|
-
}))), allowAnswerBlock && /*#__PURE__*/_react["default"].createElement(AddAnswerBlockButton, {
|
|
495
|
-
type: "primary",
|
|
496
|
-
style: {
|
|
497
|
-
bottom: shouldShowKeypad ? '320px' : '20px'
|
|
498
|
-
},
|
|
499
|
-
onClick: this.onAnswerBlockClick,
|
|
500
|
-
disabled: addDisabled
|
|
501
|
-
}, "+ Response Area"), /*#__PURE__*/_react["default"].createElement(StyledHr, null), shouldShowKeypad && /*#__PURE__*/_react["default"].createElement(KeyboardContainer, {
|
|
502
|
-
mode: controlledKeypadMode ? this.state.equationEditor : keypadMode,
|
|
503
|
-
controlledKeypadMode: controlledKeypadMode,
|
|
504
|
-
layoutForKeyPad: layoutForKeyPad,
|
|
505
|
-
additionalKeys: additionalKeys,
|
|
506
|
-
onClick: this.onClick,
|
|
507
|
-
noDecimal: noDecimal,
|
|
508
|
-
setKeypadInteraction: setKeypadInteraction
|
|
509
|
-
}));
|
|
510
|
-
}
|
|
511
|
-
}]);
|
|
512
|
-
}(_react["default"].Component);
|
|
513
|
-
(0, _defineProperty2["default"])(EditorAndPad, "propTypes", {
|
|
514
|
-
classNames: _propTypes["default"].object,
|
|
515
|
-
keypadMode: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
516
|
-
autoFocus: _propTypes["default"].bool,
|
|
517
|
-
allowAnswerBlock: _propTypes["default"].bool,
|
|
518
|
-
showKeypad: _propTypes["default"].bool,
|
|
519
|
-
controlledKeypad: _propTypes["default"].bool,
|
|
520
|
-
controlledKeypadMode: _propTypes["default"].bool,
|
|
521
|
-
error: _propTypes["default"].string,
|
|
522
|
-
noDecimal: _propTypes["default"].bool,
|
|
523
|
-
hideInput: _propTypes["default"].bool,
|
|
524
|
-
noLatexHandling: _propTypes["default"].bool,
|
|
525
|
-
layoutForKeyPad: _propTypes["default"].object,
|
|
526
|
-
maxResponseAreas: _propTypes["default"].number,
|
|
527
|
-
additionalKeys: _propTypes["default"].array,
|
|
528
|
-
latex: _propTypes["default"].string.isRequired,
|
|
529
|
-
onAnswerBlockAdd: _propTypes["default"].func,
|
|
530
|
-
onFocus: _propTypes["default"].func,
|
|
531
|
-
onBlur: _propTypes["default"].func,
|
|
532
|
-
onChange: _propTypes["default"].func.isRequired,
|
|
533
|
-
setKeypadInteraction: _propTypes["default"].func
|
|
534
|
-
});
|
|
535
|
-
var _default = exports["default"] = EditorAndPad;
|
|
536
|
-
//# sourceMappingURL=editor-and-pad.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor-and-pad.js","names":["_react","_interopRequireDefault","require","_debug","_propTypes","_Button","_styles","_MenuItem","_Select","_lodashEs","_FormControl","_InputLabel","_mathInputMathlive","_renderUi","_utils","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","ownKeys","r","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_mq$CommonMqStyles","mq","CommonMqStyles","commonMqFontStyles","commonMqKeyboardStyles","longdivStyles","supsubStyles","log","debug","decimalRegex","MathToolbarContainer","styled","_ref","theme","zIndex","position","textAlign","width","border","outline","boxShadow","concat","palette","primary","main","borderRadius","paddingTop","display","borderTop","top","marginTop","minWidth","lineHeight","InputAndTypeContainer","_ref2","hide","alignItems","fontFamily","left","right","verticalAlign","padding","marginLeft","paddingLeft","paddingBottom","marginBottom","StyledFormControl","FormControl","flex","marginRight","StyledInputLabel","InputLabel","backgroundColor","InputContainerDiv","_ref3","error","maxWidth","minHeight","spacing","MathEditor","Input","_ref4","controlledKeypadMode","color","text","background","AddAnswerBlockButton","Button","StyledHr","_ref5","margin","height","borderBottom","KeyboardContainer","HorizontalKeypad","_ref6","mode","toNodeData","data","type","value","EditorAndPad","exports","_React$Component","props","_this","_classCallCheck2","_this$props","noDecimal","noLatexHandling","onChange","c","input","clear","command","keystroke","write","isEdit","maxResponseAreas","shouldDisable","checkResponseAreasNumber","setState","addDisabled","onAnswerBlockAdd","onClick","updateDisable","latex","_this$props2","updateSpans","markFractionBaseSuperscripts","indexOf","replace","regexMatch","match","console","toString","evt","equationEditor","target","_ref7","count","state","_inherits2","_createClass2","key","componentDidMount","_this2","autoFocus","setTimeout","focus","shouldComponentUpdate","nextProps","nextState","inputIsDifferent","isEqual","keypadMode","controlledKeypad","showKeypad","render","_this3","_this$props3","classNames","allowAnswerBlock","additionalKeys","setKeypadInteraction","hideInput","layoutForKeyPad","onFocus","onBlur","shouldShowKeypad","createElement","className","mathToolbar","variant","id","labelId","name","label","onEditorTypeChange","MenuProps","transitionDuration","enter","exit","event","editor","ref","onEditorChange","style","bottom","onAnswerBlockClick","disabled","React","Component","PropTypes","object","oneOfType","string","number","bool","array","isRequired","func","_default"],"sources":["../src/editor-and-pad.jsx"],"sourcesContent":["import React from 'react';\nimport debug from 'debug';\nimport PropTypes from 'prop-types';\nimport Button from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport { isEqual } from 'lodash-es';\nimport FormControl from '@mui/material/FormControl';\nimport InputLabel from '@mui/material/InputLabel';\n\nimport { HorizontalKeypad, mq, updateSpans } from '@pie-lib/math-input-mathlive';\nimport { color } from '@pie-lib/render-ui';\nimport { markFractionBaseSuperscripts } from './utils';\n\nconst { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles } = mq.CommonMqStyles;\nconst log = debug('@pie-lib:math-toolbar:editor-and-pad');\n\nconst decimalRegex = /\\.|,/g;\n\nconst MathToolbarContainer = styled('div')(({ theme }) => ({\n zIndex: 9,\n position: 'relative',\n textAlign: 'center',\n width: 'auto',\n '& > .mq-math-mode': {\n border: 'solid 1px lightgrey',\n },\n '& > .mq-focused': {\n outline: 'none',\n boxShadow: 'none',\n border: `dotted 1px ${theme.palette.primary.main}`,\n borderRadius: '0px',\n },\n '& .mq-overarrow-inner': {\n border: 'none !important',\n paddingTop: '0 !important',\n },\n '& .mq-overarrow-inner-right': {\n display: 'none !important',\n },\n '& .mq-overarrow-inner-left': {\n display: 'none !important',\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important',\n },\n '& .mq-overarrow.mq-arrow-both': {\n top: '7.8px',\n marginTop: '0px',\n minWidth: '1.23em',\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85,\n },\n}));\n\nconst InputAndTypeContainer = styled('div')(({ theme, hide }) => ({\n display: hide ? 'none' : 'flex',\n alignItems: 'center',\n '& .mq-editable-field .mq-cursor': {\n top: '-4px',\n },\n '& .mq-math-mode .mq-selection, .mq-editable-field .mq-selection': {\n paddingTop: '18px',\n },\n '& .mq-math-mode .mq-overarrow': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n },\n '& .mq-math-mode .mq-overline .mq-overline-inner': {\n paddingTop: '0.4em !important',\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em',\n '& *': {\n lineHeight: '1 !important',\n },\n '&:before': {\n top: '-0.45em',\n left: '-1px',\n },\n '&:after': {\n position: 'absolute !important',\n top: '0px !important',\n right: '-2px',\n },\n '&.mq-empty:after': {\n top: '-0.45em',\n },\n },\n '& .mq-overarrow.mq-arrow-right': {\n '&:before': {\n top: '-0.4em',\n right: '-1px',\n },\n },\n '& *': {\n ...commonMqFontStyles,\n ...supsubStyles,\n ...longdivStyles,\n '& .mq-math-mode .mq-sqrt-prefix': {\n verticalAlign: 'baseline !important',\n top: '1px !important',\n left: '-0.1em !important',\n },\n '& .mq-math-mode .mq-overarc ': {\n paddingTop: '0.45em !important',\n },\n '& .mq-math-mode .mq-empty': {\n padding: '9px 1px !important',\n },\n '& .mq-math-mode .mq-root-block': {\n paddingTop: '10px',\n },\n '& .mq-scaled .mq-sqrt-prefix': {\n top: '0 !important',\n },\n '& .mq-math-mode .mq-longdiv .mq-longdiv-inner': {\n marginLeft: '4px !important',\n paddingTop: '6px !important',\n paddingLeft: '6px !important',\n },\n '& .mq-math-mode .mq-paren': {\n verticalAlign: 'top !important',\n padding: '1px 0.1em !important',\n },\n '& .mq-math-mode .mq-sqrt-stem': {\n borderTop: '0.07em solid',\n marginLeft: '-1.5px',\n marginTop: '-2px !important',\n paddingTop: '5px !important',\n },\n '& .mq-math-mode .mq-denominator': {\n marginTop: '-5px !important',\n padding: '0.5em 0.1em 0.1em !important',\n },\n '& .mq-math-mode .mq-numerator, .mq-math-mode .mq-over': {\n padding: '0 0.1em !important',\n paddingBottom: '0 !important',\n marginBottom: '-2px',\n },\n },\n '& span[data-prime=\"true\"]': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n },\n}));\n\nconst StyledFormControl = styled(FormControl)({\n flex: 'initial',\n width: '25%',\n minWidth: '100px',\n marginLeft: '15px',\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px',\n '& label': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n },\n '& div': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n },\n});\n\nconst StyledInputLabel = styled(InputLabel)(() => ({\n backgroundColor: 'transparent',\n}));\n\nconst InputContainerDiv = styled('div')(({ theme, error }) => ({\n minWidth: '500px',\n maxWidth: '900px',\n minHeight: '30px',\n width: '100%',\n display: 'flex',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n ...(error && {\n border: '2px solid red',\n }),\n '& .mq-sqrt-prefix .mq-scaled': {\n verticalAlign: 'middle !important',\n },\n}));\n\nconst MathEditor = styled(mq.Input)(({ controlledKeypadMode }) => ({\n maxWidth: controlledKeypadMode ? '400px' : '500px',\n color: color.text(),\n backgroundColor: color.background(),\n padding: '2px',\n}));\n\nconst AddAnswerBlockButton = styled(Button)({\n position: 'absolute',\n right: '12px',\n border: '1px solid lightgrey',\n color: color.text(),\n});\n\nconst StyledHr = styled('hr')(({ theme }) => ({\n padding: 0,\n margin: 0,\n height: '1px',\n border: 'none',\n borderBottom: `solid 1px ${theme.palette.primary.main}`,\n}));\n\nconst KeyboardContainer = styled(HorizontalKeypad)(({ mode }) => ({\n ...commonMqKeyboardStyles,\n ...(mode === 'language' && {\n '& *': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',\n },\n }),\n}));\n\nconst toNodeData = (data) => {\n if (!data) {\n return;\n }\n\n const { type, value } = data;\n\n if (type === 'command' || type === 'cursor') {\n return data;\n } else if (type === 'answer') {\n return { type: 'answer', ...data };\n } else if (value === 'clear') {\n return { type: 'clear' };\n } else {\n return { type: 'write', value };\n }\n};\n\nexport class EditorAndPad extends React.Component {\n static propTypes = {\n classNames: PropTypes.object,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n autoFocus: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n showKeypad: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n error: PropTypes.string,\n noDecimal: PropTypes.bool,\n hideInput: PropTypes.bool,\n noLatexHandling: PropTypes.bool,\n layoutForKeyPad: PropTypes.object,\n maxResponseAreas: PropTypes.number,\n additionalKeys: PropTypes.array,\n latex: PropTypes.string.isRequired,\n onAnswerBlockAdd: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n setKeypadInteraction: PropTypes.func,\n };\n\n constructor(props) {\n super(props);\n\n this.state = { equationEditor: 'item-authoring', addDisabled: false };\n }\n\n componentDidMount() {\n if (this.input && this.props.autoFocus) {\n // adding a timeout to wait for other stuff related to focus to be finished\n setTimeout(() => this.input.focus(), 0);\n }\n }\n\n onClick = (data) => {\n const { noDecimal, noLatexHandling, onChange } = this.props;\n const c = toNodeData(data);\n log('mathChange: ', c);\n\n if (noLatexHandling) {\n onChange(c.value);\n return;\n }\n\n // if decimals are not allowed for this response, we discard the input\n if (noDecimal && (c.value === '.' || c.value === ',')) {\n return;\n }\n\n if (!c) {\n return;\n }\n\n if (c.type === 'clear') {\n log('call clear...');\n this.input.clear();\n } else if (c.type === 'command') {\n this.input.command(c.value);\n } else if (c.type === 'cursor') {\n this.input.keystroke(c.value);\n } else if (c.type === 'answer') {\n this.input.write('%response%');\n } else {\n this.input.write(c.value);\n }\n };\n\n updateDisable = (isEdit) => {\n const { maxResponseAreas } = this.props;\n\n if (maxResponseAreas) {\n const shouldDisable = this.checkResponseAreasNumber(maxResponseAreas, isEdit);\n\n this.setState({ addDisabled: shouldDisable });\n }\n };\n\n onAnswerBlockClick = () => {\n this.props.onAnswerBlockAdd();\n this.onClick({\n type: 'answer',\n });\n\n this.updateDisable(true);\n };\n\n onEditorChange = (latex) => {\n const { onChange, noDecimal } = this.props;\n\n updateSpans();\n markFractionBaseSuperscripts();\n\n this.updateDisable(true);\n\n // if no decimals are allowed and the last change is a decimal dot, discard the change\n if (noDecimal && (latex.indexOf('.') !== -1 || latex.indexOf(',') !== -1) && this.input) {\n this.input.clear();\n this.input.write(latex.replace(decimalRegex, ''));\n return;\n }\n\n // eslint-disable-next-line no-useless-escape\n const regexMatch = latex.match(/[0-9]\\\\ \\\\frac\\{[^\\{]*\\}\\{ \\}/);\n\n if (this.input && regexMatch && regexMatch?.length) {\n try {\n // Undo the empty fraction the editor just created after a digit.\n // MathQuill needed cursor surgery via `__controller`; MathLive has no\n // such internals, so use the public delete command. `keystroke` accepts\n // the MathQuill name and maps it to the engine's selector.\n this.input.keystroke('Backspace');\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(e.toString());\n }\n\n return;\n }\n\n onChange(latex);\n };\n\n /** Only render if the editor's latex is different\n * or the keypad state changed from one state to the other (shown / hidden) */\n shouldComponentUpdate(nextProps, nextState) {\n // `this.input` is set via a ref, and the underlying math engine loads\n // asynchronously, so neither is guaranteed to exist on early renders.\n // Treat \"not ready\" as different, so the first real render is not skipped.\n const inputIsDifferent = !this.input || this.input.latex() !== nextProps.latex;\n log('[shouldComponentUpdate] ', 'inputIsDifferent: ', inputIsDifferent);\n\n if (!isEqual(this.props.error, nextProps.error)) {\n return true;\n }\n\n if (!inputIsDifferent && this.props.keypadMode !== nextProps.keypadMode) {\n return true;\n }\n\n if (!inputIsDifferent && this.props.noDecimal !== nextProps.noDecimal) {\n return true;\n }\n\n if (!inputIsDifferent && this.state.equationEditor !== nextState.equationEditor) {\n return true;\n }\n\n if (!inputIsDifferent && this.props.controlledKeypad) {\n return this.props.showKeypad !== nextProps.showKeypad;\n }\n\n return inputIsDifferent;\n }\n\n onEditorTypeChange = (evt) => {\n this.setState({ equationEditor: evt.target.value });\n };\n\n checkResponseAreasNumber = (maxResponseAreas, isEdit) => {\n const { latex } = (this.input && this.input.props) || {};\n\n if (latex) {\n const count = (latex.match(/answerBlock/g) || []).length;\n\n return isEdit ? count === maxResponseAreas - 1 : count === maxResponseAreas;\n }\n\n return false;\n };\n\n render() {\n const {\n classNames,\n keypadMode,\n allowAnswerBlock,\n additionalKeys,\n controlledKeypad,\n controlledKeypadMode,\n showKeypad,\n setKeypadInteraction,\n noDecimal,\n hideInput,\n layoutForKeyPad,\n latex,\n onFocus,\n onBlur,\n error,\n } = this.props;\n const shouldShowKeypad = !controlledKeypad || (controlledKeypad && showKeypad);\n const { addDisabled } = this.state;\n\n log('[render]', latex);\n\n return (\n <MathToolbarContainer className={classNames.mathToolbar}>\n <InputAndTypeContainer hide={hideInput}>\n {controlledKeypadMode && (\n <StyledFormControl variant={'standard'}>\n <StyledInputLabel id=\"equation-editor-label\">{'Equation Editor'}</StyledInputLabel>\n <Select\n labelId=\"equation-editor-label\"\n id=\"equation-editor-select\"\n name=\"equationEditor\"\n label={'Equation Editor'}\n onChange={this.onEditorTypeChange}\n value={this.state.equationEditor}\n MenuProps={{ transitionDuration: { enter: 225, exit: 195 } }}\n >\n <MenuItem value=\"non-negative-integers\">Numeric - Non-Negative Integers</MenuItem>\n <MenuItem value=\"integers\">Numeric - Integers</MenuItem>\n <MenuItem value=\"decimals\">Numeric - Decimals</MenuItem>\n <MenuItem value=\"fractions\">Numeric - Fractions</MenuItem>\n <MenuItem value={1}>Grade 1 - 2</MenuItem>\n <MenuItem value={3}>Grade 3 - 5</MenuItem>\n <MenuItem value={6}>Grade 6 - 7</MenuItem>\n <MenuItem value={8}>Grade 8 - HS</MenuItem>\n <MenuItem value={'geometry'}>Geometry</MenuItem>\n <MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>\n <MenuItem value={'statistics'}>Statistics</MenuItem>\n <MenuItem value={'item-authoring'}>Item Authoring</MenuItem>\n </Select>\n </StyledFormControl>\n )}\n <InputContainerDiv error={error}>\n <MathEditor\n onFocus={() => {\n onFocus && onFocus();\n this.updateDisable(false);\n }}\n onBlur={(event) => {\n this.updateDisable(false);\n onBlur && onBlur(event);\n }}\n className={(classNames && classNames.editor) || ''}\n controlledKeypadMode={controlledKeypadMode}\n ref={(r) => (this.input = r)}\n latex={latex}\n onChange={this.onEditorChange}\n />\n </InputContainerDiv>\n </InputAndTypeContainer>\n {allowAnswerBlock && (\n <AddAnswerBlockButton\n type=\"primary\"\n style={{ bottom: shouldShowKeypad ? '320px' : '20px' }}\n onClick={this.onAnswerBlockClick}\n disabled={addDisabled}\n >\n + Response Area\n </AddAnswerBlockButton>\n )}\n <StyledHr />\n {shouldShowKeypad && (\n <KeyboardContainer\n mode={controlledKeypadMode ? this.state.equationEditor : keypadMode}\n controlledKeypadMode={controlledKeypadMode}\n layoutForKeyPad={layoutForKeyPad}\n additionalKeys={additionalKeys}\n onClick={this.onClick}\n noDecimal={noDecimal}\n setKeypadInteraction={setKeypadInteraction}\n />\n )}\n </MathToolbarContainer>\n );\n }\n}\n\nexport default EditorAndPad;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,WAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAAuD,SAAAa,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CA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