@pie-element/math-inline 5.9.9 → 5.9.10
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 +8 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/general-config-block.js +50 -6
- package/configure/lib/general-config-block.js.map +1 -1
- package/configure/lib/response.js +19 -5
- package/configure/lib/response.js.map +1 -1
- package/configure/lib/utils.js +18 -1
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +8 -0
- package/controller/lib/index.js +70 -1
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/docs/config-schema.json +5 -0
- package/docs/config-schema.json.md +4 -0
- package/module/configure.js +169 -74
- package/module/controller.js +53 -1
- package/module/element.js +18 -805
- package/module/index.html +1 -1
- package/module/manifest.json +4 -4
- package/module/print.html +1 -1
- package/module/print.js +4 -804
- package/package.json +3 -3
package/module/print.js
CHANGED
|
@@ -1,816 +1,16 @@
|
|
|
1
|
-
import {_dll_react,
|
|
2
|
-
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.1.
|
|
3
|
-
import {_dll_pie_lib__math_input, _dll_pie_framework__mathquill} from "../../../@pie-lib/math-edit-module@^1.2.
|
|
1
|
+
import {_dll_react, _dll_classnames, _dll_material_ui__core_styles, _dll_prop_types, _dll_pie_lib__render_ui, _dll_pie_lib__correct_answer_toggle, _dll_material_ui__core, _dll_lodash, _dll_react_dom, _dll_debug} from "../../../@pie-lib/shared-module@^1.4.17/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.1.5/module/index.js";
|
|
3
|
+
import {_dll_pie_lib__math_toolbar, _dll_pie_lib__math_input, _dll_pie_framework__mathquill} from "../../../@pie-lib/math-edit-module@^1.2.4/module/index.js";
|
|
4
4
|
const ResponseTypes = {
|
|
5
5
|
advanced: 'Advanced Multi',
|
|
6
6
|
simple: 'Simple'
|
|
7
7
|
};
|
|
8
|
-
const {HorizontalKeypad: HorizontalKeypad$1} = _dll_pie_lib__math_input;
|
|
9
|
-
const {mq: mq$3} = _dll_pie_lib__math_input;
|
|
10
|
-
const {updateSpans: updateSpans$1} = _dll_pie_lib__math_input;
|
|
11
|
-
const React$6 = _dll_react;
|
|
12
|
-
const debug$2 = _dll_debug;
|
|
13
|
-
const PropTypes$5 = _dll_prop_types;
|
|
14
|
-
const cx$3 = _dll_classnames;
|
|
15
|
-
const {Button: Button} = _dll_material_ui__core;
|
|
16
|
-
const {MenuItem: MenuItem} = _dll_material_ui__core;
|
|
17
|
-
const {Select: Select} = _dll_material_ui__core;
|
|
18
|
-
const {withStyles: withStyles$5} = _dll_material_ui__core_styles;
|
|
19
|
-
const {color: color$2} = _dll_pie_lib__render_ui;
|
|
20
|
-
const {InputContainer: InputContainer} = _dll_pie_lib__render_ui;
|
|
21
|
-
const _jsxFileName$5 = "/home/circleci/repo/node_modules/@pie-lib/math-toolbar/src/editor-and-pad.jsx";
|
|
22
|
-
const log$2 = debug$2('@pie-lib:math-toolbar:editor-and-pad');
|
|
23
|
-
const decimalRegex = /\.|,/g;
|
|
24
|
-
const toNodeData = data => {
|
|
25
|
-
if (!data) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const {type, value} = data;
|
|
29
|
-
if (type === 'command' || type === 'cursor') {
|
|
30
|
-
return data;
|
|
31
|
-
} else if (type === 'answer') {
|
|
32
|
-
return {
|
|
33
|
-
type: 'answer',
|
|
34
|
-
...data
|
|
35
|
-
};
|
|
36
|
-
} else if (value === 'clear') {
|
|
37
|
-
return {
|
|
38
|
-
type: 'clear'
|
|
39
|
-
};
|
|
40
|
-
} else {
|
|
41
|
-
return {
|
|
42
|
-
type: 'write',
|
|
43
|
-
value
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
class EditorAndPad extends React$6.Component {
|
|
48
|
-
static __initStatic() {
|
|
49
|
-
this.propTypes = {
|
|
50
|
-
classNames: PropTypes$5.object,
|
|
51
|
-
keypadMode: PropTypes$5.oneOfType([PropTypes$5.string, PropTypes$5.number]),
|
|
52
|
-
autoFocus: PropTypes$5.bool,
|
|
53
|
-
allowAnswerBlock: PropTypes$5.bool,
|
|
54
|
-
showKeypad: PropTypes$5.bool,
|
|
55
|
-
controlledKeypad: PropTypes$5.bool,
|
|
56
|
-
controlledKeypadMode: PropTypes$5.bool,
|
|
57
|
-
noDecimal: PropTypes$5.bool,
|
|
58
|
-
additionalKeys: PropTypes$5.array,
|
|
59
|
-
latex: PropTypes$5.string.isRequired,
|
|
60
|
-
onAnswerBlockAdd: PropTypes$5.func,
|
|
61
|
-
onFocus: PropTypes$5.func,
|
|
62
|
-
onBlur: PropTypes$5.func,
|
|
63
|
-
onChange: PropTypes$5.func.isRequired,
|
|
64
|
-
classes: PropTypes$5.object
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
constructor(props) {
|
|
68
|
-
super(props);
|
|
69
|
-
EditorAndPad.prototype.__init.call(this);
|
|
70
|
-
EditorAndPad.prototype.__init2.call(this);
|
|
71
|
-
EditorAndPad.prototype.__init3.call(this);
|
|
72
|
-
EditorAndPad.prototype.__init4.call(this);
|
|
73
|
-
EditorAndPad.prototype.__init5.call(this);
|
|
74
|
-
EditorAndPad.prototype.__init6.call(this);
|
|
75
|
-
this.state = {
|
|
76
|
-
equationEditor: 'item-authoring',
|
|
77
|
-
addDisabled: false
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
componentDidMount() {
|
|
81
|
-
if (this.input && this.props.autoFocus) {
|
|
82
|
-
this.input.focus();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
__init() {
|
|
86
|
-
this.onClick = data => {
|
|
87
|
-
const {noDecimal} = this.props;
|
|
88
|
-
const c = toNodeData(data);
|
|
89
|
-
log$2('mathChange: ', c);
|
|
90
|
-
if (noDecimal && (c.value === '.' || c.value === ',')) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (c.type === 'clear') {
|
|
94
|
-
log$2('call clear...');
|
|
95
|
-
this.input.clear();
|
|
96
|
-
} else if (c.type === 'command') {
|
|
97
|
-
this.input.command(c.value);
|
|
98
|
-
} else if (c.type === 'cursor') {
|
|
99
|
-
this.input.keystroke(c.value);
|
|
100
|
-
} else if (c.type === 'answer') {
|
|
101
|
-
this.input.write('%response%');
|
|
102
|
-
} else {
|
|
103
|
-
this.input.write(c.value);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
__init2() {
|
|
108
|
-
this.updateDisable = isEdit => {
|
|
109
|
-
const {maxResponseAreas} = this.props;
|
|
110
|
-
if (maxResponseAreas) {
|
|
111
|
-
const shouldDisable = this.checkResponseAreasNumber(maxResponseAreas, isEdit);
|
|
112
|
-
this.setState({
|
|
113
|
-
addDisabled: shouldDisable
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
__init3() {
|
|
119
|
-
this.onAnswerBlockClick = () => {
|
|
120
|
-
this.props.onAnswerBlockAdd();
|
|
121
|
-
this.onClick({
|
|
122
|
-
type: 'answer'
|
|
123
|
-
});
|
|
124
|
-
this.updateDisable(true);
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
__init4() {
|
|
128
|
-
this.onEditorChange = latex => {
|
|
129
|
-
const {onChange, noDecimal} = this.props;
|
|
130
|
-
updateSpans$1();
|
|
131
|
-
this.updateDisable(true);
|
|
132
|
-
if (noDecimal && (latex.indexOf('.') !== -1 || latex.indexOf(',') !== -1) && this.input) {
|
|
133
|
-
this.input.clear();
|
|
134
|
-
this.input.write(latex.replace(decimalRegex, ''));
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
onChange(latex);
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
141
|
-
const inputIsDifferent = this.input.mathField.latex() !== nextProps.latex;
|
|
142
|
-
log$2('[shouldComponentUpdate] ', 'inputIsDifferent: ', inputIsDifferent);
|
|
143
|
-
if (!inputIsDifferent && this.props.keypadMode !== nextProps.keypadMode) {
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
if (!inputIsDifferent && this.props.noDecimal !== nextProps.noDecimal) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
if (!inputIsDifferent && this.state.equationEditor !== nextState.equationEditor) {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
if (!inputIsDifferent && this.props.controlledKeypad) {
|
|
153
|
-
return this.props.showKeypad !== nextProps.showKeypad;
|
|
154
|
-
}
|
|
155
|
-
return inputIsDifferent;
|
|
156
|
-
}
|
|
157
|
-
__init5() {
|
|
158
|
-
this.onEditorTypeChange = evt => {
|
|
159
|
-
this.setState({
|
|
160
|
-
equationEditor: evt.target.value
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
__init6() {
|
|
165
|
-
this.checkResponseAreasNumber = (maxResponseAreas, isEdit) => {
|
|
166
|
-
const {latex} = this.input && this.input.props || ({});
|
|
167
|
-
if (latex) {
|
|
168
|
-
const count = (latex.match(/answerBlock/g) || []).length;
|
|
169
|
-
return isEdit ? count === maxResponseAreas - 1 : count === maxResponseAreas;
|
|
170
|
-
}
|
|
171
|
-
return false;
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
render() {
|
|
175
|
-
const {classNames, keypadMode, allowAnswerBlock, additionalKeys, controlledKeypad, controlledKeypadMode, showKeypad, noDecimal, latex, onFocus, onBlur, classes, error} = this.props;
|
|
176
|
-
const shouldShowKeypad = !controlledKeypad || controlledKeypad && showKeypad;
|
|
177
|
-
const {addDisabled} = this.state;
|
|
178
|
-
log$2('[render]', latex);
|
|
179
|
-
return React$6.createElement('div', {
|
|
180
|
-
className: cx$3(classes.mathToolbar, classNames.mathToolbar),
|
|
181
|
-
__self: this,
|
|
182
|
-
__source: {
|
|
183
|
-
fileName: _jsxFileName$5,
|
|
184
|
-
lineNumber: 188
|
|
185
|
-
}
|
|
186
|
-
}, React$6.createElement('div', {
|
|
187
|
-
className: classes.inputAndTypeContainer,
|
|
188
|
-
__self: this,
|
|
189
|
-
__source: {
|
|
190
|
-
fileName: _jsxFileName$5,
|
|
191
|
-
lineNumber: 189
|
|
192
|
-
}
|
|
193
|
-
}, controlledKeypadMode && React$6.createElement(InputContainer, {
|
|
194
|
-
label: "Equation Editor",
|
|
195
|
-
className: classes.selectContainer,
|
|
196
|
-
__self: this,
|
|
197
|
-
__source: {
|
|
198
|
-
fileName: _jsxFileName$5,
|
|
199
|
-
lineNumber: 191
|
|
200
|
-
}
|
|
201
|
-
}, React$6.createElement(Select, {
|
|
202
|
-
className: classes.select,
|
|
203
|
-
onChange: this.onEditorTypeChange,
|
|
204
|
-
value: this.state.equationEditor,
|
|
205
|
-
__self: this,
|
|
206
|
-
__source: {
|
|
207
|
-
fileName: _jsxFileName$5,
|
|
208
|
-
lineNumber: 192
|
|
209
|
-
}
|
|
210
|
-
}, React$6.createElement(MenuItem, {
|
|
211
|
-
value: "non-negative-integers",
|
|
212
|
-
__self: this,
|
|
213
|
-
__source: {
|
|
214
|
-
fileName: _jsxFileName$5,
|
|
215
|
-
lineNumber: 197
|
|
216
|
-
}
|
|
217
|
-
}, "Numeric - Non-Negative Integers"), React$6.createElement(MenuItem, {
|
|
218
|
-
value: "integers",
|
|
219
|
-
__self: this,
|
|
220
|
-
__source: {
|
|
221
|
-
fileName: _jsxFileName$5,
|
|
222
|
-
lineNumber: 198
|
|
223
|
-
}
|
|
224
|
-
}, "Numeric - Integers"), React$6.createElement(MenuItem, {
|
|
225
|
-
value: "decimals",
|
|
226
|
-
__self: this,
|
|
227
|
-
__source: {
|
|
228
|
-
fileName: _jsxFileName$5,
|
|
229
|
-
lineNumber: 199
|
|
230
|
-
}
|
|
231
|
-
}, "Numeric - Decimals"), React$6.createElement(MenuItem, {
|
|
232
|
-
value: "fractions",
|
|
233
|
-
__self: this,
|
|
234
|
-
__source: {
|
|
235
|
-
fileName: _jsxFileName$5,
|
|
236
|
-
lineNumber: 200
|
|
237
|
-
}
|
|
238
|
-
}, "Numeric - Fractions"), React$6.createElement(MenuItem, {
|
|
239
|
-
value: 1,
|
|
240
|
-
__self: this,
|
|
241
|
-
__source: {
|
|
242
|
-
fileName: _jsxFileName$5,
|
|
243
|
-
lineNumber: 201
|
|
244
|
-
}
|
|
245
|
-
}, "Grade 1 - 2"), React$6.createElement(MenuItem, {
|
|
246
|
-
value: 3,
|
|
247
|
-
__self: this,
|
|
248
|
-
__source: {
|
|
249
|
-
fileName: _jsxFileName$5,
|
|
250
|
-
lineNumber: 202
|
|
251
|
-
}
|
|
252
|
-
}, "Grade 3 - 5"), React$6.createElement(MenuItem, {
|
|
253
|
-
value: 6,
|
|
254
|
-
__self: this,
|
|
255
|
-
__source: {
|
|
256
|
-
fileName: _jsxFileName$5,
|
|
257
|
-
lineNumber: 203
|
|
258
|
-
}
|
|
259
|
-
}, "Grade 6 - 7"), React$6.createElement(MenuItem, {
|
|
260
|
-
value: 8,
|
|
261
|
-
__self: this,
|
|
262
|
-
__source: {
|
|
263
|
-
fileName: _jsxFileName$5,
|
|
264
|
-
lineNumber: 204
|
|
265
|
-
}
|
|
266
|
-
}, "Grade 8 - HS"), React$6.createElement(MenuItem, {
|
|
267
|
-
value: 'geometry',
|
|
268
|
-
__self: this,
|
|
269
|
-
__source: {
|
|
270
|
-
fileName: _jsxFileName$5,
|
|
271
|
-
lineNumber: 205
|
|
272
|
-
}
|
|
273
|
-
}, "Geometry"), React$6.createElement(MenuItem, {
|
|
274
|
-
value: 'advanced-algebra',
|
|
275
|
-
__self: this,
|
|
276
|
-
__source: {
|
|
277
|
-
fileName: _jsxFileName$5,
|
|
278
|
-
lineNumber: 206
|
|
279
|
-
}
|
|
280
|
-
}, "Advanced Algebra"), React$6.createElement(MenuItem, {
|
|
281
|
-
value: 'statistics',
|
|
282
|
-
__self: this,
|
|
283
|
-
__source: {
|
|
284
|
-
fileName: _jsxFileName$5,
|
|
285
|
-
lineNumber: 207
|
|
286
|
-
}
|
|
287
|
-
}, "Statistics"), React$6.createElement(MenuItem, {
|
|
288
|
-
value: 'item-authoring',
|
|
289
|
-
__self: this,
|
|
290
|
-
__source: {
|
|
291
|
-
fileName: _jsxFileName$5,
|
|
292
|
-
lineNumber: 208
|
|
293
|
-
}
|
|
294
|
-
}, "Item Authoring"))), React$6.createElement('div', {
|
|
295
|
-
className: cx$3(classes.inputContainer, error ? classes.error : ''),
|
|
296
|
-
__self: this,
|
|
297
|
-
__source: {
|
|
298
|
-
fileName: _jsxFileName$5,
|
|
299
|
-
lineNumber: 212
|
|
300
|
-
}
|
|
301
|
-
}, React$6.createElement(mq$3.Input, {
|
|
302
|
-
onFocus: () => {
|
|
303
|
-
onFocus && onFocus();
|
|
304
|
-
this.updateDisable(false);
|
|
305
|
-
},
|
|
306
|
-
onBlur: event => {
|
|
307
|
-
this.updateDisable(false);
|
|
308
|
-
onBlur && onBlur(event);
|
|
309
|
-
},
|
|
310
|
-
className: cx$3(classes.mathEditor, classNames.editor, !controlledKeypadMode ? classes.longMathEditor : ''),
|
|
311
|
-
innerRef: r => this.input = r,
|
|
312
|
-
latex: latex,
|
|
313
|
-
onChange: this.onEditorChange,
|
|
314
|
-
__self: this,
|
|
315
|
-
__source: {
|
|
316
|
-
fileName: _jsxFileName$5,
|
|
317
|
-
lineNumber: 213
|
|
318
|
-
}
|
|
319
|
-
}))), allowAnswerBlock && React$6.createElement(Button, {
|
|
320
|
-
className: classes.addAnswerBlockButton,
|
|
321
|
-
type: "primary",
|
|
322
|
-
style: {
|
|
323
|
-
bottom: shouldShowKeypad ? '320px' : '20px'
|
|
324
|
-
},
|
|
325
|
-
onClick: this.onAnswerBlockClick,
|
|
326
|
-
disabled: addDisabled,
|
|
327
|
-
__self: this,
|
|
328
|
-
__source: {
|
|
329
|
-
fileName: _jsxFileName$5,
|
|
330
|
-
lineNumber: 234
|
|
331
|
-
}
|
|
332
|
-
}, "+ Response Area"), React$6.createElement('hr', {
|
|
333
|
-
className: classes.hr,
|
|
334
|
-
__self: this,
|
|
335
|
-
__source: {
|
|
336
|
-
fileName: _jsxFileName$5,
|
|
337
|
-
lineNumber: 244
|
|
338
|
-
}
|
|
339
|
-
}), shouldShowKeypad && React$6.createElement(HorizontalKeypad$1, {
|
|
340
|
-
additionalKeys: additionalKeys,
|
|
341
|
-
mode: controlledKeypadMode ? this.state.equationEditor : keypadMode,
|
|
342
|
-
onClick: this.onClick,
|
|
343
|
-
noDecimal: noDecimal,
|
|
344
|
-
__self: this,
|
|
345
|
-
__source: {
|
|
346
|
-
fileName: _jsxFileName$5,
|
|
347
|
-
lineNumber: 246
|
|
348
|
-
}
|
|
349
|
-
}));
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
EditorAndPad.__initStatic();
|
|
353
|
-
const styles$3 = theme => ({
|
|
354
|
-
inputAndTypeContainer: {
|
|
355
|
-
display: 'flex',
|
|
356
|
-
alignItems: 'center',
|
|
357
|
-
'& *': {
|
|
358
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
359
|
-
},
|
|
360
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
361
|
-
minWidth: '1.23em',
|
|
362
|
-
'& *': {
|
|
363
|
-
lineHeight: '1 !important'
|
|
364
|
-
},
|
|
365
|
-
'&:before': {
|
|
366
|
-
top: '-0.4em',
|
|
367
|
-
left: '-1px'
|
|
368
|
-
},
|
|
369
|
-
'&:after': {
|
|
370
|
-
top: '-2.36em',
|
|
371
|
-
right: '-1px'
|
|
372
|
-
},
|
|
373
|
-
'&.mq-empty:after': {
|
|
374
|
-
top: '-0.45em'
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
'& .mq-overarrow.mq-arrow-right': {
|
|
378
|
-
'&:before': {
|
|
379
|
-
top: '-0.4em',
|
|
380
|
-
right: '-1px'
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
selectContainer: {
|
|
385
|
-
flex: 'initial',
|
|
386
|
-
width: '25%',
|
|
387
|
-
minWidth: '100px',
|
|
388
|
-
marginLeft: '15px',
|
|
389
|
-
marginTop: '5px',
|
|
390
|
-
marginBottom: '5px',
|
|
391
|
-
marginRight: '5px'
|
|
392
|
-
},
|
|
393
|
-
mathEditor: {
|
|
394
|
-
maxWidth: '400px',
|
|
395
|
-
color: color$2.text(),
|
|
396
|
-
backgroundColor: color$2.background(),
|
|
397
|
-
padding: theme.spacing.unit
|
|
398
|
-
},
|
|
399
|
-
longMathEditor: {
|
|
400
|
-
maxWidth: '500px'
|
|
401
|
-
},
|
|
402
|
-
addAnswerBlockButton: {
|
|
403
|
-
position: 'absolute',
|
|
404
|
-
right: '12px',
|
|
405
|
-
border: '1px solid lightgrey'
|
|
406
|
-
},
|
|
407
|
-
hr: {
|
|
408
|
-
padding: 0,
|
|
409
|
-
margin: 0,
|
|
410
|
-
height: '1px',
|
|
411
|
-
border: 'none',
|
|
412
|
-
borderBottom: `solid 1px ${theme.palette.primary.main}`
|
|
413
|
-
},
|
|
414
|
-
mathToolbar: {
|
|
415
|
-
zIndex: 9,
|
|
416
|
-
position: 'relative',
|
|
417
|
-
textAlign: 'center',
|
|
418
|
-
width: 'auto',
|
|
419
|
-
'& > .mq-math-mode': {
|
|
420
|
-
border: 'solid 1px lightgrey'
|
|
421
|
-
},
|
|
422
|
-
'& > .mq-focused': {
|
|
423
|
-
outline: 'none',
|
|
424
|
-
boxShadow: 'none',
|
|
425
|
-
border: `dotted 1px ${theme.palette.primary.main}`,
|
|
426
|
-
borderRadius: '0px'
|
|
427
|
-
},
|
|
428
|
-
'& .mq-overarrow-inner': {
|
|
429
|
-
border: 'none !important',
|
|
430
|
-
paddingTop: '0 !important'
|
|
431
|
-
},
|
|
432
|
-
'& .mq-overarrow-inner-right': {
|
|
433
|
-
display: 'none !important'
|
|
434
|
-
},
|
|
435
|
-
'& .mq-overarrow-inner-left': {
|
|
436
|
-
display: 'none !important'
|
|
437
|
-
},
|
|
438
|
-
'& .mq-longdiv-inner': {
|
|
439
|
-
borderTop: '1px solid !important',
|
|
440
|
-
paddingTop: '1.5px !important'
|
|
441
|
-
},
|
|
442
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
443
|
-
minWidth: '1.23em'
|
|
444
|
-
},
|
|
445
|
-
'& .mq-parallelogram': {
|
|
446
|
-
lineHeight: 0.85
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
inputContainer: {
|
|
450
|
-
minWidth: '500px',
|
|
451
|
-
maxWidth: '900px',
|
|
452
|
-
minHeight: '40px',
|
|
453
|
-
width: '100%',
|
|
454
|
-
display: 'flex',
|
|
455
|
-
marginTop: theme.spacing.unit,
|
|
456
|
-
marginBottom: theme.spacing.unit
|
|
457
|
-
},
|
|
458
|
-
error: {
|
|
459
|
-
border: '2px solid red'
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
var EditorAndPad$1 = withStyles$5(styles$3)(EditorAndPad);
|
|
463
|
-
const React$5 = _dll_react;
|
|
464
|
-
const {IconButton: IconButton} = _dll_material_ui__core;
|
|
465
|
-
const {Check: Check} = _dll_material_ui__icons;
|
|
466
|
-
const {withStyles: withStyles$4} = _dll_material_ui__core_styles;
|
|
467
|
-
const PropTypes$4 = _dll_prop_types;
|
|
468
|
-
const _jsxFileName$4 = "/home/circleci/repo/node_modules/@pie-lib/math-toolbar/src/done-button.jsx";
|
|
469
|
-
const RawDoneButton = ({classes, onClick}) => React$5.createElement(IconButton, {
|
|
470
|
-
'aria-label': "Done",
|
|
471
|
-
className: classes.iconRoot,
|
|
472
|
-
onClick: onClick,
|
|
473
|
-
classes: {
|
|
474
|
-
label: classes.label,
|
|
475
|
-
root: classes.iconRoot
|
|
476
|
-
},
|
|
477
|
-
__self: undefined,
|
|
478
|
-
__source: {
|
|
479
|
-
fileName: _jsxFileName$4,
|
|
480
|
-
lineNumber: 9
|
|
481
|
-
}
|
|
482
|
-
}, React$5.createElement(Check, {
|
|
483
|
-
__self: undefined,
|
|
484
|
-
__source: {
|
|
485
|
-
fileName: _jsxFileName$4,
|
|
486
|
-
lineNumber: 18
|
|
487
|
-
}
|
|
488
|
-
}));
|
|
489
|
-
RawDoneButton.propTypes = {
|
|
490
|
-
classes: PropTypes$4.object.isRequired,
|
|
491
|
-
onClick: PropTypes$4.func
|
|
492
|
-
};
|
|
493
|
-
const styles$2 = {
|
|
494
|
-
iconRoot: {
|
|
495
|
-
verticalAlign: 'top',
|
|
496
|
-
width: '28px',
|
|
497
|
-
height: '28px',
|
|
498
|
-
color: '#00bb00'
|
|
499
|
-
},
|
|
500
|
-
label: {
|
|
501
|
-
position: 'absolute',
|
|
502
|
-
top: '2px'
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
const DoneButton = withStyles$4(styles$2)(RawDoneButton);
|
|
506
|
-
const React$4 = _dll_react;
|
|
507
|
-
const classNames = _dll_classnames;
|
|
508
|
-
const debug$1 = _dll_debug;
|
|
509
|
-
const {withStyles: withStyles$3} = _dll_material_ui__core_styles;
|
|
510
|
-
const PropTypes$3 = _dll_prop_types;
|
|
511
|
-
const {mq: mq$2} = _dll_pie_lib__math_input;
|
|
512
|
-
const _jsxFileName$3 = "/home/circleci/repo/node_modules/@pie-lib/math-toolbar/src/math-preview.jsx";
|
|
513
|
-
const log$1 = debug$1('@pie-lib:math-toolbar:math-preview');
|
|
514
|
-
class RawMathPreview extends React$4.Component {
|
|
515
|
-
static __initStatic() {
|
|
516
|
-
this.propTypes = {
|
|
517
|
-
latex: PropTypes$3.string,
|
|
518
|
-
node: PropTypes$3.object,
|
|
519
|
-
classes: PropTypes$3.object,
|
|
520
|
-
isSelected: PropTypes$3.bool,
|
|
521
|
-
onFocus: PropTypes$3.func,
|
|
522
|
-
onBlur: PropTypes$3.func
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
render() {
|
|
526
|
-
log$1('[render] data: ', this.props.node.data);
|
|
527
|
-
const latex = this.props.node.data.get('latex');
|
|
528
|
-
const {classes, isSelected, onFocus, onBlur} = this.props;
|
|
529
|
-
return React$4.createElement('div', {
|
|
530
|
-
className: classNames(classes.root, isSelected && classes.selected),
|
|
531
|
-
__self: this,
|
|
532
|
-
__source: {
|
|
533
|
-
fileName: _jsxFileName$3,
|
|
534
|
-
lineNumber: 25
|
|
535
|
-
}
|
|
536
|
-
}, ' ', React$4.createElement('span', {
|
|
537
|
-
className: classes.insideOverlay,
|
|
538
|
-
__self: this,
|
|
539
|
-
__source: {
|
|
540
|
-
fileName: _jsxFileName$3,
|
|
541
|
-
lineNumber: 27
|
|
542
|
-
}
|
|
543
|
-
}), React$4.createElement(mq$2.Static, {
|
|
544
|
-
latex: latex,
|
|
545
|
-
onFocus: onFocus,
|
|
546
|
-
onBlur: onBlur,
|
|
547
|
-
__self: this,
|
|
548
|
-
__source: {
|
|
549
|
-
fileName: _jsxFileName$3,
|
|
550
|
-
lineNumber: 28
|
|
551
|
-
}
|
|
552
|
-
}));
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
RawMathPreview.__initStatic();
|
|
556
|
-
const mp = theme => ({
|
|
557
|
-
root: {
|
|
558
|
-
display: 'inline-flex',
|
|
559
|
-
alignItems: 'center',
|
|
560
|
-
position: 'relative',
|
|
561
|
-
'& > .mq-math-mode': {
|
|
562
|
-
border: 'solid 1px lightgrey'
|
|
563
|
-
},
|
|
564
|
-
'& > .mq-focused': {
|
|
565
|
-
outline: 'none',
|
|
566
|
-
boxShadow: 'none',
|
|
567
|
-
border: 'solid 1px black',
|
|
568
|
-
borderRadius: '0px'
|
|
569
|
-
},
|
|
570
|
-
'& *': {
|
|
571
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
572
|
-
},
|
|
573
|
-
'& .mq-overarrow-inner': {
|
|
574
|
-
paddingTop: '0 !important',
|
|
575
|
-
border: 'none !important'
|
|
576
|
-
},
|
|
577
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
578
|
-
minWidth: '1.23em',
|
|
579
|
-
'& *': {
|
|
580
|
-
lineHeight: '1 !important'
|
|
581
|
-
},
|
|
582
|
-
'&:before': {
|
|
583
|
-
top: '-0.4em',
|
|
584
|
-
left: '-1px'
|
|
585
|
-
},
|
|
586
|
-
'&:after': {
|
|
587
|
-
top: '-2.36em',
|
|
588
|
-
right: '-1px'
|
|
589
|
-
},
|
|
590
|
-
'&.mq-empty:after': {
|
|
591
|
-
top: '-0.45em'
|
|
592
|
-
}
|
|
593
|
-
},
|
|
594
|
-
'& .mq-overarrow.mq-arrow-right': {
|
|
595
|
-
'&:before': {
|
|
596
|
-
top: '-0.4em',
|
|
597
|
-
right: '-1px'
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
|
-
'& .mq-overarrow-inner-right': {
|
|
601
|
-
display: 'none !important'
|
|
602
|
-
},
|
|
603
|
-
'& .mq-overarrow-inner-left': {
|
|
604
|
-
display: 'none !important'
|
|
605
|
-
},
|
|
606
|
-
'& .mq-longdiv-inner': {
|
|
607
|
-
borderTop: '1px solid !important',
|
|
608
|
-
paddingTop: '1.5px !important'
|
|
609
|
-
},
|
|
610
|
-
'& .mq-parallelogram': {
|
|
611
|
-
lineHeight: 0.85
|
|
612
|
-
}
|
|
613
|
-
},
|
|
614
|
-
selected: {
|
|
615
|
-
border: `solid 1px ${theme.palette.primary.main}`,
|
|
616
|
-
'& > .mq-math-mode': {
|
|
617
|
-
border: 'solid 0px lightgrey'
|
|
618
|
-
}
|
|
619
|
-
},
|
|
620
|
-
insideOverlay: {
|
|
621
|
-
position: 'absolute',
|
|
622
|
-
bottom: 0,
|
|
623
|
-
left: 0,
|
|
624
|
-
right: 0,
|
|
625
|
-
top: 0
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
withStyles$3(mp)(RawMathPreview);
|
|
629
|
-
const React$3 = _dll_react;
|
|
630
|
-
const PropTypes$2 = _dll_prop_types;
|
|
631
|
-
const cx$2 = _dll_classnames;
|
|
632
|
-
const {withStyles: withStyles$2} = _dll_material_ui__core_styles;
|
|
633
|
-
const _jsxFileName$2 = "/home/circleci/repo/node_modules/@pie-lib/math-toolbar/src/index.jsx";
|
|
634
|
-
class MathToolbar extends React$3.Component {
|
|
635
|
-
static __initStatic() {
|
|
636
|
-
this.propTypes = {
|
|
637
|
-
autoFocus: PropTypes$2.bool,
|
|
638
|
-
allowAnswerBlock: PropTypes$2.bool,
|
|
639
|
-
controlledKeypad: PropTypes$2.bool,
|
|
640
|
-
controlledKeypadMode: PropTypes$2.bool,
|
|
641
|
-
keypadMode: PropTypes$2.oneOfType([PropTypes$2.string, PropTypes$2.number]),
|
|
642
|
-
classNames: PropTypes$2.object,
|
|
643
|
-
showKeypad: PropTypes$2.bool,
|
|
644
|
-
noDecimal: PropTypes$2.bool,
|
|
645
|
-
additionalKeys: PropTypes$2.array,
|
|
646
|
-
latex: PropTypes$2.string.isRequired,
|
|
647
|
-
onAnswerBlockAdd: PropTypes$2.func,
|
|
648
|
-
onChange: PropTypes$2.func,
|
|
649
|
-
onDone: PropTypes$2.func.isRequired,
|
|
650
|
-
onFocus: PropTypes$2.func,
|
|
651
|
-
onBlur: PropTypes$2.func,
|
|
652
|
-
hideDoneButton: PropTypes$2.bool
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
static __initStatic2() {
|
|
656
|
-
this.defaultProps = {
|
|
657
|
-
classNames: {},
|
|
658
|
-
keypadMode: 'item-authoring',
|
|
659
|
-
autoFocus: false,
|
|
660
|
-
allowAnswerBlock: false,
|
|
661
|
-
controlledKeypad: false,
|
|
662
|
-
controlledKeypadMode: false,
|
|
663
|
-
noDecimal: false,
|
|
664
|
-
showKeypad: true,
|
|
665
|
-
additionalKeys: [],
|
|
666
|
-
onChange: () => {},
|
|
667
|
-
onAnswerBlockAdd: () => {},
|
|
668
|
-
onFocus: () => {},
|
|
669
|
-
hideDoneButton: false
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
constructor(props) {
|
|
673
|
-
super(props);
|
|
674
|
-
MathToolbar.prototype.__init.call(this);
|
|
675
|
-
MathToolbar.prototype.__init2.call(this);
|
|
676
|
-
this.state = {
|
|
677
|
-
latex: props.latex
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
__init() {
|
|
681
|
-
this.done = () => {
|
|
682
|
-
this.props.onDone(this.state.latex);
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
686
|
-
this.setState({
|
|
687
|
-
latex: nextProps.latex
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
__init2() {
|
|
691
|
-
this.onChange = latex => {
|
|
692
|
-
this.setState({
|
|
693
|
-
latex
|
|
694
|
-
});
|
|
695
|
-
this.props.onChange(latex);
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
render() {
|
|
699
|
-
const {latex} = this.state;
|
|
700
|
-
const {classNames, autoFocus, allowAnswerBlock, onAnswerBlockAdd, controlledKeypad, controlledKeypadMode, keypadMode, noDecimal, additionalKeys, showKeypad, onFocus, onBlur, hideDoneButton, error, maxResponseAreas} = this.props;
|
|
701
|
-
return React$3.createElement(PureToolbar, {
|
|
702
|
-
autoFocus: autoFocus,
|
|
703
|
-
classNames: classNames,
|
|
704
|
-
onAnswerBlockAdd: onAnswerBlockAdd,
|
|
705
|
-
allowAnswerBlock: allowAnswerBlock,
|
|
706
|
-
latex: latex,
|
|
707
|
-
additionalKeys: additionalKeys,
|
|
708
|
-
noDecimal: noDecimal,
|
|
709
|
-
keypadMode: keypadMode,
|
|
710
|
-
onChange: this.onChange,
|
|
711
|
-
onDone: this.done,
|
|
712
|
-
onFocus: onFocus,
|
|
713
|
-
onBlur: onBlur,
|
|
714
|
-
showKeypad: showKeypad,
|
|
715
|
-
controlledKeypad: controlledKeypad,
|
|
716
|
-
controlledKeypadMode: controlledKeypadMode,
|
|
717
|
-
hideDoneButton: hideDoneButton,
|
|
718
|
-
error: error,
|
|
719
|
-
maxResponseAreas: maxResponseAreas,
|
|
720
|
-
__self: this,
|
|
721
|
-
__source: {
|
|
722
|
-
fileName: _jsxFileName$2,
|
|
723
|
-
lineNumber: 88
|
|
724
|
-
}
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
MathToolbar.__initStatic();
|
|
729
|
-
MathToolbar.__initStatic2();
|
|
730
|
-
class RawPureToolbar extends React$3.Component {
|
|
731
|
-
static __initStatic3() {
|
|
732
|
-
this.propTypes = {
|
|
733
|
-
classNames: PropTypes$2.object,
|
|
734
|
-
latex: PropTypes$2.string.isRequired,
|
|
735
|
-
keypadMode: PropTypes$2.oneOfType([PropTypes$2.string, PropTypes$2.number]),
|
|
736
|
-
onChange: PropTypes$2.func.isRequired,
|
|
737
|
-
onDone: PropTypes$2.func.isRequired,
|
|
738
|
-
onBlur: PropTypes$2.func,
|
|
739
|
-
onAnswerBlockAdd: PropTypes$2.func,
|
|
740
|
-
additionalKeys: PropTypes$2.array,
|
|
741
|
-
onFocus: PropTypes$2.func,
|
|
742
|
-
classes: PropTypes$2.object.isRequired,
|
|
743
|
-
autoFocus: PropTypes$2.bool,
|
|
744
|
-
noDecimal: PropTypes$2.bool,
|
|
745
|
-
allowAnswerBlock: PropTypes$2.bool,
|
|
746
|
-
controlledKeypad: PropTypes$2.bool,
|
|
747
|
-
controlledKeypadMode: PropTypes$2.bool,
|
|
748
|
-
showKeypad: PropTypes$2.bool,
|
|
749
|
-
hideDoneButton: PropTypes$2.bool
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
render() {
|
|
753
|
-
const {classNames, autoFocus, allowAnswerBlock, onAnswerBlockAdd, controlledKeypad, controlledKeypadMode, additionalKeys, showKeypad, keypadMode, noDecimal, latex, onChange, onDone, onFocus, onBlur, hideDoneButton, classes, error, maxResponseAreas} = this.props;
|
|
754
|
-
return React$3.createElement('div', {
|
|
755
|
-
className: cx$2(classes.pureToolbar, (classNames || ({})).toolbar),
|
|
756
|
-
__self: this,
|
|
757
|
-
__source: {
|
|
758
|
-
fileName: _jsxFileName$2,
|
|
759
|
-
lineNumber: 157
|
|
760
|
-
}
|
|
761
|
-
}, React$3.createElement('div', {
|
|
762
|
-
__self: this,
|
|
763
|
-
__source: {
|
|
764
|
-
fileName: _jsxFileName$2,
|
|
765
|
-
lineNumber: 158
|
|
766
|
-
}
|
|
767
|
-
}), React$3.createElement(EditorAndPad$1, {
|
|
768
|
-
autoFocus: autoFocus,
|
|
769
|
-
keypadMode: keypadMode,
|
|
770
|
-
classNames: classNames || ({}),
|
|
771
|
-
controlledKeypad: controlledKeypad,
|
|
772
|
-
controlledKeypadMode: controlledKeypadMode,
|
|
773
|
-
noDecimal: noDecimal,
|
|
774
|
-
showKeypad: showKeypad,
|
|
775
|
-
additionalKeys: additionalKeys,
|
|
776
|
-
allowAnswerBlock: allowAnswerBlock,
|
|
777
|
-
onAnswerBlockAdd: onAnswerBlockAdd,
|
|
778
|
-
latex: latex,
|
|
779
|
-
onChange: onChange,
|
|
780
|
-
onFocus: onFocus,
|
|
781
|
-
onBlur: onBlur,
|
|
782
|
-
error: error,
|
|
783
|
-
maxResponseAreas: maxResponseAreas,
|
|
784
|
-
__self: this,
|
|
785
|
-
__source: {
|
|
786
|
-
fileName: _jsxFileName$2,
|
|
787
|
-
lineNumber: 159
|
|
788
|
-
}
|
|
789
|
-
}), (!controlledKeypad || controlledKeypad && showKeypad) && !hideDoneButton && React$3.createElement(DoneButton, {
|
|
790
|
-
onClick: onDone,
|
|
791
|
-
__self: this,
|
|
792
|
-
__source: {
|
|
793
|
-
fileName: _jsxFileName$2,
|
|
794
|
-
lineNumber: 178
|
|
795
|
-
}
|
|
796
|
-
}));
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
RawPureToolbar.__initStatic3();
|
|
800
|
-
const styles$1 = () => ({
|
|
801
|
-
pureToolbar: {
|
|
802
|
-
display: 'flex',
|
|
803
|
-
width: '100%',
|
|
804
|
-
zIndex: 8,
|
|
805
|
-
alignItems: 'center'
|
|
806
|
-
}
|
|
807
|
-
});
|
|
808
|
-
const PureToolbar = withStyles$2(styles$1)(RawPureToolbar);
|
|
809
8
|
const React$2 = _dll_react;
|
|
810
9
|
const cx$1 = _dll_classnames;
|
|
811
10
|
const {withStyles: withStyles$1} = _dll_material_ui__core_styles;
|
|
812
11
|
const PropTypes$1 = _dll_prop_types;
|
|
813
12
|
const {color: color$1} = _dll_pie_lib__render_ui;
|
|
13
|
+
const {MathToolbar: MathToolbar} = _dll_pie_lib__math_toolbar;
|
|
814
14
|
const {mq: mq$1} = _dll_pie_lib__math_input;
|
|
815
15
|
const _jsxFileName$1 = "/home/circleci/repo/packages/math-inline/src/simple-question-block.jsx";
|
|
816
16
|
class SimpleQuestionBlockRaw extends React$2.Component {
|