@pie-element/math-inline 5.6.4-next.772 → 5.6.4-next.779
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 +75 -0
- package/configure/CHANGELOG.md +62 -0
- package/configure/package.json +5 -5
- package/controller/CHANGELOG.md +24 -0
- package/controller/package.json +1 -1
- package/module/configure.js +4 -4
- package/module/element.js +34 -1507
- package/module/index.html +1 -1
- package/module/manifest.json +4 -4
- package/module/print.html +1 -1
- package/module/print.js +34 -1507
- package/package.json +4 -4
package/module/print.js
CHANGED
|
@@ -1,1493 +1,6 @@
|
|
|
1
|
-
import {_dll_lodash, _dll_react, _dll_prop_types, _dll_material_ui__core_styles, _dll_debug, _dll_classnames, _dll_material_ui__core, _dll_material_ui__core_styles_color_manipulator, _dll_pie_lib__render_ui, _dll_material_ui__icons, _dll_pie_lib__correct_answer_toggle, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.
|
|
2
|
-
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.
|
|
3
|
-
import {_dll_pie_framework__mathquill} from "../../../@pie-lib/math-edit-module@^1.1.
|
|
4
|
-
const set$v = o => ({
|
|
5
|
-
...o,
|
|
6
|
-
category: 'comparison'
|
|
7
|
-
});
|
|
8
|
-
const lessThan$1 = set$v({
|
|
9
|
-
name: 'Less than',
|
|
10
|
-
latex: '<',
|
|
11
|
-
command: '\\lt'
|
|
12
|
-
});
|
|
13
|
-
const greaterThan$1 = set$v({
|
|
14
|
-
name: 'Greater than',
|
|
15
|
-
latex: '>',
|
|
16
|
-
command: '\\gt'
|
|
17
|
-
});
|
|
18
|
-
const lessThanEqual$1 = set$v({
|
|
19
|
-
name: 'Less than or equal',
|
|
20
|
-
latex: '\\le',
|
|
21
|
-
symbol: '<=',
|
|
22
|
-
command: '\\le'
|
|
23
|
-
});
|
|
24
|
-
const greaterThanEqual$1 = set$v({
|
|
25
|
-
name: 'Greater than or equal',
|
|
26
|
-
symbol: '>=',
|
|
27
|
-
command: '\\ge',
|
|
28
|
-
latex: '\\ge'
|
|
29
|
-
});
|
|
30
|
-
var comparison$1 = Object.freeze({
|
|
31
|
-
__proto__: null,
|
|
32
|
-
lessThan: lessThan$1,
|
|
33
|
-
greaterThan: greaterThan$1,
|
|
34
|
-
lessThanEqual: lessThanEqual$1,
|
|
35
|
-
greaterThanEqual: greaterThanEqual$1
|
|
36
|
-
});
|
|
37
|
-
const _$5 = _dll_lodash;
|
|
38
|
-
const mkSet$1 = category => o => ({
|
|
39
|
-
...o,
|
|
40
|
-
category
|
|
41
|
-
});
|
|
42
|
-
const transformToKeySetStructure$1 = (data = []) => {
|
|
43
|
-
const structure = [];
|
|
44
|
-
_$5.times(5, () => {
|
|
45
|
-
structure.push([]);
|
|
46
|
-
});
|
|
47
|
-
let ln = data.length;
|
|
48
|
-
let i = 0;
|
|
49
|
-
let j = 0;
|
|
50
|
-
while (j < ln) {
|
|
51
|
-
structure[i++].push(data[j++]);
|
|
52
|
-
if (i === 5) {
|
|
53
|
-
i = 0;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return structure;
|
|
57
|
-
};
|
|
58
|
-
const latexAndNameDontExist$1 = base => k => {
|
|
59
|
-
const flattened = _$5.flatten(base);
|
|
60
|
-
const latexExists = flattened.some(b => b.latex === k.latex);
|
|
61
|
-
const nameExists = flattened.some(b => b.name === k.name);
|
|
62
|
-
return !latexExists && !nameExists;
|
|
63
|
-
};
|
|
64
|
-
const extendKeySet$1 = (base = [], keySetData = []) => {
|
|
65
|
-
keySetData = keySetData.filter(latexAndNameDontExist$1(base));
|
|
66
|
-
const final = [];
|
|
67
|
-
_$5.times(5 - base.length, () => {
|
|
68
|
-
base.push([]);
|
|
69
|
-
});
|
|
70
|
-
_$5.times(5, () => {
|
|
71
|
-
final.push([]);
|
|
72
|
-
});
|
|
73
|
-
const extra = transformToKeySetStructure$1(keySetData);
|
|
74
|
-
for (let i = 0; i < 5; i++) {
|
|
75
|
-
final[i] = [...base[i], ...extra[i]];
|
|
76
|
-
}
|
|
77
|
-
return final;
|
|
78
|
-
};
|
|
79
|
-
const set$u = mkSet$1('vars');
|
|
80
|
-
const x$1 = set$u({
|
|
81
|
-
name: 'X',
|
|
82
|
-
latex: 'x',
|
|
83
|
-
write: 'x'
|
|
84
|
-
});
|
|
85
|
-
const y$1 = set$u({
|
|
86
|
-
name: 'Y',
|
|
87
|
-
latex: 'y',
|
|
88
|
-
write: 'y'
|
|
89
|
-
});
|
|
90
|
-
const theta$1 = set$u({
|
|
91
|
-
name: 'Theta',
|
|
92
|
-
latex: '\\theta',
|
|
93
|
-
write: '\\theta'
|
|
94
|
-
});
|
|
95
|
-
var vars$1 = Object.freeze({
|
|
96
|
-
__proto__: null,
|
|
97
|
-
x: x$1,
|
|
98
|
-
y: y$1,
|
|
99
|
-
theta: theta$1
|
|
100
|
-
});
|
|
101
|
-
const set$t = mkSet$1('fractions');
|
|
102
|
-
const blankOverBlank$1 = set$t({
|
|
103
|
-
name: 'blank/blank',
|
|
104
|
-
latex: '\\frac{}{}',
|
|
105
|
-
command: '\\frac'
|
|
106
|
-
});
|
|
107
|
-
const xOverBlank$1 = set$t({
|
|
108
|
-
latex: '\\frac{x}{ }',
|
|
109
|
-
name: 'X/blank',
|
|
110
|
-
label: 'x/[]',
|
|
111
|
-
command: '/'
|
|
112
|
-
});
|
|
113
|
-
const xBlankBlank$1 = set$t({
|
|
114
|
-
name: 'X (blank/blank)',
|
|
115
|
-
latex: 'x\\frac{}{}',
|
|
116
|
-
label: 'x([]/[])',
|
|
117
|
-
command: '\\frac'
|
|
118
|
-
});
|
|
119
|
-
var fractions$1 = Object.freeze({
|
|
120
|
-
__proto__: null,
|
|
121
|
-
blankOverBlank: blankOverBlank$1,
|
|
122
|
-
xOverBlank: xOverBlank$1,
|
|
123
|
-
xBlankBlank: xBlankBlank$1
|
|
124
|
-
});
|
|
125
|
-
const set$s = mkSet$1('exponent');
|
|
126
|
-
const squared$1 = set$s({
|
|
127
|
-
name: 'Squared',
|
|
128
|
-
latex: 'x^2',
|
|
129
|
-
write: '^2'
|
|
130
|
-
});
|
|
131
|
-
const xToPowerOfN$1 = set$s({
|
|
132
|
-
name: 'X to the power of n',
|
|
133
|
-
latex: 'x^{}',
|
|
134
|
-
command: '^'
|
|
135
|
-
});
|
|
136
|
-
const squareRoot$1 = set$s({
|
|
137
|
-
name: 'Square root',
|
|
138
|
-
latex: '\\sqrt{}',
|
|
139
|
-
command: '\\sqrt'
|
|
140
|
-
});
|
|
141
|
-
const nthRoot$1 = set$s({
|
|
142
|
-
name: 'Nth root',
|
|
143
|
-
latex: '\\sqrt[{}]{}',
|
|
144
|
-
command: '\\nthroot'
|
|
145
|
-
});
|
|
146
|
-
var exponent$1 = Object.freeze({
|
|
147
|
-
__proto__: null,
|
|
148
|
-
squared: squared$1,
|
|
149
|
-
xToPowerOfN: xToPowerOfN$1,
|
|
150
|
-
squareRoot: squareRoot$1,
|
|
151
|
-
nthRoot: nthRoot$1
|
|
152
|
-
});
|
|
153
|
-
const set$r = mkSet$1('misc');
|
|
154
|
-
const plusMinus$1 = set$r({
|
|
155
|
-
name: 'Plus/Minus',
|
|
156
|
-
latex: '\\pm',
|
|
157
|
-
write: '\\pm'
|
|
158
|
-
});
|
|
159
|
-
const absValue$1 = set$r({
|
|
160
|
-
name: 'Absolute Value',
|
|
161
|
-
latex: '\\abs{}',
|
|
162
|
-
symbol: '| |',
|
|
163
|
-
command: '|'
|
|
164
|
-
});
|
|
165
|
-
const parenthesis$1 = set$r({
|
|
166
|
-
name: 'Parenthesis',
|
|
167
|
-
latex: '\\left(\\right)',
|
|
168
|
-
symbol: '( )',
|
|
169
|
-
command: '('
|
|
170
|
-
});
|
|
171
|
-
const brackets$1 = set$r({
|
|
172
|
-
name: 'Brackets',
|
|
173
|
-
latex: '\\left[\\right]',
|
|
174
|
-
symbol: '[ ]',
|
|
175
|
-
command: '['
|
|
176
|
-
});
|
|
177
|
-
const percentage$1 = set$r({
|
|
178
|
-
name: 'Percentage',
|
|
179
|
-
latex: '%',
|
|
180
|
-
command: '%'
|
|
181
|
-
});
|
|
182
|
-
const approx$1 = set$r({
|
|
183
|
-
latex: '\\approx',
|
|
184
|
-
command: '\\approx'
|
|
185
|
-
});
|
|
186
|
-
const nApprox$1 = set$r({
|
|
187
|
-
latex: '\\napprox',
|
|
188
|
-
command: '\\napprox'
|
|
189
|
-
});
|
|
190
|
-
const notEqual$1 = set$r({
|
|
191
|
-
latex: '\\neq',
|
|
192
|
-
command: '\\neq'
|
|
193
|
-
});
|
|
194
|
-
const similar$1 = set$r({
|
|
195
|
-
latex: '\\sim',
|
|
196
|
-
command: '\\sim'
|
|
197
|
-
});
|
|
198
|
-
const notSimilar$1 = set$r({
|
|
199
|
-
latex: '\\nsim',
|
|
200
|
-
command: '\\nsim'
|
|
201
|
-
});
|
|
202
|
-
var misc$1 = Object.freeze({
|
|
203
|
-
__proto__: null,
|
|
204
|
-
plusMinus: plusMinus$1,
|
|
205
|
-
absValue: absValue$1,
|
|
206
|
-
parenthesis: parenthesis$1,
|
|
207
|
-
brackets: brackets$1,
|
|
208
|
-
percentage: percentage$1,
|
|
209
|
-
approx: approx$1,
|
|
210
|
-
nApprox: nApprox$1,
|
|
211
|
-
notEqual: notEqual$1,
|
|
212
|
-
similar: similar$1,
|
|
213
|
-
notSimilar: notSimilar$1
|
|
214
|
-
});
|
|
215
|
-
const set$q = mkSet$1('constants');
|
|
216
|
-
const pi$1 = set$q({
|
|
217
|
-
name: 'Pi',
|
|
218
|
-
label: 'π',
|
|
219
|
-
latex: '\\pi',
|
|
220
|
-
command: '\\pi',
|
|
221
|
-
category: 'constants'
|
|
222
|
-
});
|
|
223
|
-
const eulers$1 = set$q({
|
|
224
|
-
name: 'Eulers',
|
|
225
|
-
label: 'e',
|
|
226
|
-
latex: 'e',
|
|
227
|
-
command: 'e',
|
|
228
|
-
category: 'constants'
|
|
229
|
-
});
|
|
230
|
-
const infinity$1 = set$q({
|
|
231
|
-
name: 'Infinity',
|
|
232
|
-
label: '\\infty',
|
|
233
|
-
latex: '\\infty',
|
|
234
|
-
command: '\\infty',
|
|
235
|
-
category: 'constants'
|
|
236
|
-
});
|
|
237
|
-
const halfInfinity$1 = set$q({
|
|
238
|
-
name: 'Half Infinity',
|
|
239
|
-
label: '\\propto',
|
|
240
|
-
latex: '\\propto',
|
|
241
|
-
command: '\\propto',
|
|
242
|
-
category: 'constants'
|
|
243
|
-
});
|
|
244
|
-
var constants$1 = Object.freeze({
|
|
245
|
-
__proto__: null,
|
|
246
|
-
pi: pi$1,
|
|
247
|
-
eulers: eulers$1,
|
|
248
|
-
infinity: infinity$1,
|
|
249
|
-
halfInfinity: halfInfinity$1
|
|
250
|
-
});
|
|
251
|
-
const set$p = mkSet$1('trigonometry');
|
|
252
|
-
const sin$1 = set$p({
|
|
253
|
-
name: 'sin',
|
|
254
|
-
label: 'sin',
|
|
255
|
-
command: '\\sin',
|
|
256
|
-
latex: '\\sin'
|
|
257
|
-
});
|
|
258
|
-
const cos$1 = set$p({
|
|
259
|
-
name: 'cos',
|
|
260
|
-
label: 'cos',
|
|
261
|
-
command: '\\cos',
|
|
262
|
-
latex: '\\cos'
|
|
263
|
-
});
|
|
264
|
-
const tan$1 = set$p({
|
|
265
|
-
name: 'tan',
|
|
266
|
-
label: 'tan',
|
|
267
|
-
command: '\\tan',
|
|
268
|
-
latex: '\\tan'
|
|
269
|
-
});
|
|
270
|
-
const sec$1 = set$p({
|
|
271
|
-
name: 'sec',
|
|
272
|
-
label: 'sec',
|
|
273
|
-
command: '\\sec',
|
|
274
|
-
latex: '\\sec'
|
|
275
|
-
});
|
|
276
|
-
const csc$1 = set$p({
|
|
277
|
-
name: 'csc',
|
|
278
|
-
label: 'csc',
|
|
279
|
-
command: '\\csc',
|
|
280
|
-
latex: '\\csc'
|
|
281
|
-
});
|
|
282
|
-
const cot$1 = set$p({
|
|
283
|
-
name: 'cot',
|
|
284
|
-
label: 'cot',
|
|
285
|
-
command: '\\cot',
|
|
286
|
-
latex: '\\cot'
|
|
287
|
-
});
|
|
288
|
-
var trigonometry$1 = Object.freeze({
|
|
289
|
-
__proto__: null,
|
|
290
|
-
sin: sin$1,
|
|
291
|
-
cos: cos$1,
|
|
292
|
-
tan: tan$1,
|
|
293
|
-
sec: sec$1,
|
|
294
|
-
csc: csc$1,
|
|
295
|
-
cot: cot$1
|
|
296
|
-
});
|
|
297
|
-
const set$o = o => ({
|
|
298
|
-
...o,
|
|
299
|
-
category: 'geometry'
|
|
300
|
-
});
|
|
301
|
-
const overline$1 = set$o({
|
|
302
|
-
name: 'Overline',
|
|
303
|
-
latex: '\\overline{}',
|
|
304
|
-
command: '\\overline'
|
|
305
|
-
});
|
|
306
|
-
const overRightArrow$1 = set$o({
|
|
307
|
-
name: 'Overline',
|
|
308
|
-
latex: '\\overrightarrow{}',
|
|
309
|
-
command: '\\overrightarrow'
|
|
310
|
-
});
|
|
311
|
-
const overLeftRightArrow$1 = set$o({
|
|
312
|
-
name: 'Overline',
|
|
313
|
-
latex: '\\overleftrightarrow{\\overline{}}',
|
|
314
|
-
symbol: 'AB',
|
|
315
|
-
command: '\\overleftrightarrow'
|
|
316
|
-
});
|
|
317
|
-
const segment$1 = set$o({
|
|
318
|
-
name: 'Segment',
|
|
319
|
-
latex: '\\overleftrightarrow{AB}',
|
|
320
|
-
write: '\\overleftrightarrow{AB}',
|
|
321
|
-
label: 'AB'
|
|
322
|
-
});
|
|
323
|
-
const parallel$1 = set$o({
|
|
324
|
-
name: 'Parallel',
|
|
325
|
-
latex: '\\parallel',
|
|
326
|
-
command: '\\parallel'
|
|
327
|
-
});
|
|
328
|
-
const notParallel$1 = set$o({
|
|
329
|
-
name: 'Not Parallel',
|
|
330
|
-
latex: '\\nparallel',
|
|
331
|
-
command: '\\nparallel'
|
|
332
|
-
});
|
|
333
|
-
const perpindicular$1 = set$o({
|
|
334
|
-
name: 'Perpendicular',
|
|
335
|
-
latex: '\\perp',
|
|
336
|
-
command: '\\perpendicular'
|
|
337
|
-
});
|
|
338
|
-
const angle$1 = set$o({
|
|
339
|
-
name: 'Angle',
|
|
340
|
-
latex: '\\angle',
|
|
341
|
-
command: '\\angle'
|
|
342
|
-
});
|
|
343
|
-
const overArc$1 = set$o({
|
|
344
|
-
name: 'Over arc',
|
|
345
|
-
latex: '\\overarc{\\overline{}}',
|
|
346
|
-
command: '\\overarc'
|
|
347
|
-
});
|
|
348
|
-
const measureOfAngle$1 = set$o({
|
|
349
|
-
name: 'Measure Of Angle',
|
|
350
|
-
latex: '\\measuredangle',
|
|
351
|
-
command: ['m', '\\angle']
|
|
352
|
-
});
|
|
353
|
-
const triangle$1 = set$o({
|
|
354
|
-
name: 'Triangle',
|
|
355
|
-
latex: '\\triangle',
|
|
356
|
-
command: '\\triangle'
|
|
357
|
-
});
|
|
358
|
-
const square$1 = set$o({
|
|
359
|
-
name: 'Square',
|
|
360
|
-
latex: '\\square',
|
|
361
|
-
command: '\\square'
|
|
362
|
-
});
|
|
363
|
-
const parallelogram$1 = set$o({
|
|
364
|
-
name: 'Parallelogram',
|
|
365
|
-
latex: '\\parallelogram',
|
|
366
|
-
command: '\\parallelogram'
|
|
367
|
-
});
|
|
368
|
-
const circledDot$1 = set$o({
|
|
369
|
-
name: 'Circled Dot',
|
|
370
|
-
latex: '\\odot',
|
|
371
|
-
command: '\\odot'
|
|
372
|
-
});
|
|
373
|
-
const degree$1 = set$o({
|
|
374
|
-
name: 'Degree',
|
|
375
|
-
latex: '\\degree',
|
|
376
|
-
command: '\\degree'
|
|
377
|
-
});
|
|
378
|
-
const similarTo$1 = set$o({
|
|
379
|
-
name: 'Similar To',
|
|
380
|
-
command: '\\sim',
|
|
381
|
-
latex: '\\sim'
|
|
382
|
-
});
|
|
383
|
-
const congruentTo$1 = set$o({
|
|
384
|
-
name: 'Congruent To',
|
|
385
|
-
command: '\\cong',
|
|
386
|
-
latex: '\\cong'
|
|
387
|
-
});
|
|
388
|
-
const notCongruentTo$1 = set$o({
|
|
389
|
-
name: 'Not Congruent To',
|
|
390
|
-
command: '\\ncong',
|
|
391
|
-
latex: '\\ncong'
|
|
392
|
-
});
|
|
393
|
-
const primeArcminute$1 = set$o({
|
|
394
|
-
name: 'Prime',
|
|
395
|
-
label: 'pam',
|
|
396
|
-
latex: "'",
|
|
397
|
-
write: "'"
|
|
398
|
-
});
|
|
399
|
-
const doublePrimeArcSecond$1 = set$o({
|
|
400
|
-
name: 'Double Prime/Arcsecond',
|
|
401
|
-
latex: '"',
|
|
402
|
-
write: '"'
|
|
403
|
-
});
|
|
404
|
-
const leftArrow$1 = set$o({
|
|
405
|
-
name: 'Left Arrow',
|
|
406
|
-
latex: '\\leftarrow',
|
|
407
|
-
command: '\\leftarrow'
|
|
408
|
-
});
|
|
409
|
-
const rightArrow$1 = set$o({
|
|
410
|
-
name: 'Right Arrow',
|
|
411
|
-
latex: '\\rightarrow',
|
|
412
|
-
command: '\\rightarrow'
|
|
413
|
-
});
|
|
414
|
-
const leftrightArrow$1 = set$o({
|
|
415
|
-
name: 'Left Right Arrow',
|
|
416
|
-
latex: '\\leftrightarrow',
|
|
417
|
-
command: '\\leftrightarrow'
|
|
418
|
-
});
|
|
419
|
-
var geometry$1 = Object.freeze({
|
|
420
|
-
__proto__: null,
|
|
421
|
-
overline: overline$1,
|
|
422
|
-
overRightArrow: overRightArrow$1,
|
|
423
|
-
overLeftRightArrow: overLeftRightArrow$1,
|
|
424
|
-
segment: segment$1,
|
|
425
|
-
parallel: parallel$1,
|
|
426
|
-
notParallel: notParallel$1,
|
|
427
|
-
perpindicular: perpindicular$1,
|
|
428
|
-
angle: angle$1,
|
|
429
|
-
overArc: overArc$1,
|
|
430
|
-
measureOfAngle: measureOfAngle$1,
|
|
431
|
-
triangle: triangle$1,
|
|
432
|
-
square: square$1,
|
|
433
|
-
parallelogram: parallelogram$1,
|
|
434
|
-
circledDot: circledDot$1,
|
|
435
|
-
degree: degree$1,
|
|
436
|
-
similarTo: similarTo$1,
|
|
437
|
-
congruentTo: congruentTo$1,
|
|
438
|
-
notCongruentTo: notCongruentTo$1,
|
|
439
|
-
primeArcminute: primeArcminute$1,
|
|
440
|
-
doublePrimeArcSecond: doublePrimeArcSecond$1,
|
|
441
|
-
leftArrow: leftArrow$1,
|
|
442
|
-
rightArrow: rightArrow$1,
|
|
443
|
-
leftrightArrow: leftrightArrow$1
|
|
444
|
-
});
|
|
445
|
-
const set$n = mkSet$1('operators');
|
|
446
|
-
const circleDot$1 = set$n({
|
|
447
|
-
name: 'CircleDot',
|
|
448
|
-
label: '⋅',
|
|
449
|
-
write: '\\cdot'
|
|
450
|
-
});
|
|
451
|
-
var operators$1 = Object.freeze({
|
|
452
|
-
__proto__: null,
|
|
453
|
-
circleDot: circleDot$1
|
|
454
|
-
});
|
|
455
|
-
const set$m = mkSet$1('log');
|
|
456
|
-
const log$b = set$m({
|
|
457
|
-
name: 'Log',
|
|
458
|
-
label: 'log',
|
|
459
|
-
command: '\\log',
|
|
460
|
-
latex: '\\log'
|
|
461
|
-
});
|
|
462
|
-
const logSubscript$1 = set$m({
|
|
463
|
-
name: 'Log with subscript',
|
|
464
|
-
label: 'log s',
|
|
465
|
-
latex: '\\log_{}',
|
|
466
|
-
command: ['\\log', '_', ' ']
|
|
467
|
-
});
|
|
468
|
-
const ln$1 = set$m({
|
|
469
|
-
name: 'Ln',
|
|
470
|
-
label: 'ln',
|
|
471
|
-
command: '\\ln',
|
|
472
|
-
latex: '\\ln'
|
|
473
|
-
});
|
|
474
|
-
var log$c = Object.freeze({
|
|
475
|
-
__proto__: null,
|
|
476
|
-
log: log$b,
|
|
477
|
-
logSubscript: logSubscript$1,
|
|
478
|
-
ln: ln$1
|
|
479
|
-
});
|
|
480
|
-
const set$l = mkSet$1('sub-sup');
|
|
481
|
-
const superscript$1 = set$l({
|
|
482
|
-
name: 'Superscript',
|
|
483
|
-
latex: 'x^{}',
|
|
484
|
-
command: '^'
|
|
485
|
-
});
|
|
486
|
-
const subscript$1 = set$l({
|
|
487
|
-
name: 'Subscript',
|
|
488
|
-
latex: 'x_{}',
|
|
489
|
-
command: '_'
|
|
490
|
-
});
|
|
491
|
-
var subSup$1 = Object.freeze({
|
|
492
|
-
__proto__: null,
|
|
493
|
-
superscript: superscript$1,
|
|
494
|
-
subscript: subscript$1
|
|
495
|
-
});
|
|
496
|
-
const set$k = mkSet$1('statistics');
|
|
497
|
-
const xBar$1 = set$k({
|
|
498
|
-
name: 'X Bar',
|
|
499
|
-
label: 'x̄',
|
|
500
|
-
latex: '\\overline{x}',
|
|
501
|
-
write: '\\overline{x}'
|
|
502
|
-
});
|
|
503
|
-
const yBar$1 = set$k({
|
|
504
|
-
name: 'Y Bar',
|
|
505
|
-
latex: '\\overline{y}',
|
|
506
|
-
write: '\\overline{y}'
|
|
507
|
-
});
|
|
508
|
-
const mu$1 = set$k({
|
|
509
|
-
name: 'mu',
|
|
510
|
-
label: 'mu',
|
|
511
|
-
latex: '\\mu',
|
|
512
|
-
write: '\\mu'
|
|
513
|
-
});
|
|
514
|
-
const sigma$1 = set$k({
|
|
515
|
-
name: 'Sigma',
|
|
516
|
-
label: '\\Sigma',
|
|
517
|
-
latex: '\\Sigma',
|
|
518
|
-
write: '\\Sigma'
|
|
519
|
-
});
|
|
520
|
-
const smallSigma$1 = set$k({
|
|
521
|
-
name: 'sigma',
|
|
522
|
-
label: '\\sigma',
|
|
523
|
-
latex: '\\sigma',
|
|
524
|
-
write: '\\sigma'
|
|
525
|
-
});
|
|
526
|
-
var statistics$1 = Object.freeze({
|
|
527
|
-
__proto__: null,
|
|
528
|
-
xBar: xBar$1,
|
|
529
|
-
yBar: yBar$1,
|
|
530
|
-
mu: mu$1,
|
|
531
|
-
sigma: sigma$1,
|
|
532
|
-
smallSigma: smallSigma$1
|
|
533
|
-
});
|
|
534
|
-
const DELETE$1 = '\u232B';
|
|
535
|
-
const LEFT_ARROW$1 = '◀';
|
|
536
|
-
const RIGHT_ARROW$1 = '▶';
|
|
537
|
-
const DIVIDE$1 = '\u00F7';
|
|
538
|
-
const MULTIPLY$1 = '\u00D7';
|
|
539
|
-
const set$j = mkSet$1('operators');
|
|
540
|
-
const equals$1 = set$j({
|
|
541
|
-
write: '=',
|
|
542
|
-
label: '='
|
|
543
|
-
});
|
|
544
|
-
const plus$1 = set$j({
|
|
545
|
-
write: '+',
|
|
546
|
-
label: '+'
|
|
547
|
-
});
|
|
548
|
-
const minus$1 = set$j({
|
|
549
|
-
write: '−',
|
|
550
|
-
label: '−'
|
|
551
|
-
});
|
|
552
|
-
const divide$1 = set$j({
|
|
553
|
-
name: 'divide',
|
|
554
|
-
label: DIVIDE$1,
|
|
555
|
-
command: '\\divide',
|
|
556
|
-
otherNotation: '\\div'
|
|
557
|
-
});
|
|
558
|
-
const multiply$1 = set$j({
|
|
559
|
-
name: 'multiply',
|
|
560
|
-
label: MULTIPLY$1,
|
|
561
|
-
command: '\\times'
|
|
562
|
-
});
|
|
563
|
-
var basicOperators$1 = Object.freeze({
|
|
564
|
-
__proto__: null,
|
|
565
|
-
equals: equals$1,
|
|
566
|
-
plus: plus$1,
|
|
567
|
-
minus: minus$1,
|
|
568
|
-
divide: divide$1,
|
|
569
|
-
multiply: multiply$1
|
|
570
|
-
});
|
|
571
|
-
const set$i = mkSet$1('matrices');
|
|
572
|
-
const singleCellMatrix$1 = set$i({
|
|
573
|
-
name: 'Single Cell Matrix',
|
|
574
|
-
label: '[ ]',
|
|
575
|
-
write: '\\begin{pmatrix}\\end{pmatrix}'
|
|
576
|
-
});
|
|
577
|
-
const doubleCellMatrix$1 = set$i({
|
|
578
|
-
name: 'Double Cell Matrix',
|
|
579
|
-
label: '[ ] [ ] \\\\newline [ ] [ ]',
|
|
580
|
-
write: '\\begin{bmatrix}&\\\\&\\end{bmatrix}'
|
|
581
|
-
});
|
|
582
|
-
var matrices$1 = Object.freeze({
|
|
583
|
-
__proto__: null,
|
|
584
|
-
singleCellMatrix: singleCellMatrix$1,
|
|
585
|
-
doubleCellMatrix: doubleCellMatrix$1
|
|
586
|
-
});
|
|
587
|
-
const {times: times$1} = _dll_lodash;
|
|
588
|
-
const digitMap$1 = {
|
|
589
|
-
0: 'zero',
|
|
590
|
-
1: 'one',
|
|
591
|
-
2: 'two',
|
|
592
|
-
3: 'three',
|
|
593
|
-
4: 'four',
|
|
594
|
-
5: 'five',
|
|
595
|
-
6: 'six',
|
|
596
|
-
7: 'seven',
|
|
597
|
-
8: 'eight',
|
|
598
|
-
9: 'nine'
|
|
599
|
-
};
|
|
600
|
-
const comma$3 = {
|
|
601
|
-
name: 'comma',
|
|
602
|
-
label: ',',
|
|
603
|
-
write: ',',
|
|
604
|
-
category: 'digit'
|
|
605
|
-
};
|
|
606
|
-
const decimalPoint$3 = {
|
|
607
|
-
name: 'decimal-point',
|
|
608
|
-
label: '.',
|
|
609
|
-
write: '.',
|
|
610
|
-
category: 'digit'
|
|
611
|
-
};
|
|
612
|
-
var digits$1 = times$1(10, String).map(n => {
|
|
613
|
-
return {
|
|
614
|
-
name: digitMap$1[n],
|
|
615
|
-
write: n,
|
|
616
|
-
label: n,
|
|
617
|
-
category: 'digit'
|
|
618
|
-
};
|
|
619
|
-
}).reduce((acc, o) => {
|
|
620
|
-
acc[o.name] = o;
|
|
621
|
-
return acc;
|
|
622
|
-
}, {
|
|
623
|
-
comma: comma$3,
|
|
624
|
-
decimalPoint: decimalPoint$3
|
|
625
|
-
});
|
|
626
|
-
const set$h = mkSet$1('logic');
|
|
627
|
-
const therefore$1 = set$h({
|
|
628
|
-
name: 'Therefore',
|
|
629
|
-
label: '∴',
|
|
630
|
-
write: '∴'
|
|
631
|
-
});
|
|
632
|
-
const longDivision$1 = set$h({
|
|
633
|
-
name: 'Long division',
|
|
634
|
-
latex: '\\longdiv{}',
|
|
635
|
-
command: '\\longdiv'
|
|
636
|
-
});
|
|
637
|
-
const set$g = mkSet$1('navigation');
|
|
638
|
-
const left$1 = set$g({
|
|
639
|
-
label: LEFT_ARROW$1,
|
|
640
|
-
keystroke: 'Left'
|
|
641
|
-
});
|
|
642
|
-
const right$1 = set$g({
|
|
643
|
-
label: RIGHT_ARROW$1,
|
|
644
|
-
keystroke: 'Right'
|
|
645
|
-
});
|
|
646
|
-
const del$1 = {
|
|
647
|
-
label: DELETE$1,
|
|
648
|
-
category: 'edit',
|
|
649
|
-
keystroke: 'Backspace'
|
|
650
|
-
};
|
|
651
|
-
const hs$1 = [[blankOverBlank$1, percentage$1, x$1, squared$1, squareRoot$1], [circleDot$1, y$1, subscript$1, xToPowerOfN$1, nthRoot$1], [plusMinus$1, lessThan$1, greaterThan$1, lessThanEqual$1, greaterThanEqual$1], [pi$1, theta$1, parenthesis$1, brackets$1, absValue$1], [notEqual$1, sin$1, cos$1, tan$1, degree$1]];
|
|
652
|
-
const advancedAlgebra$1 = (() => {
|
|
653
|
-
const out = [...hs$1.map(arr => [...arr])];
|
|
654
|
-
out[0].push({
|
|
655
|
-
name: 'i',
|
|
656
|
-
latex: 'i',
|
|
657
|
-
write: 'i'
|
|
658
|
-
});
|
|
659
|
-
out[1].push(log$b);
|
|
660
|
-
out[2].push(logSubscript$1);
|
|
661
|
-
out[3].push(ln$1);
|
|
662
|
-
out[4].push(eulers$1);
|
|
663
|
-
return out;
|
|
664
|
-
})();
|
|
665
|
-
const statisticsSet$1 = (() => {
|
|
666
|
-
const out = [...hs$1.map(arr => [...arr])];
|
|
667
|
-
out[0].push(mu$1);
|
|
668
|
-
out[1].push(xBar$1);
|
|
669
|
-
out[2].push(yBar$1);
|
|
670
|
-
out[3].push(sigma$1);
|
|
671
|
-
out[4].push(smallSigma$1);
|
|
672
|
-
return out;
|
|
673
|
-
})();
|
|
674
|
-
const gradeSets$1 = [{
|
|
675
|
-
predicate: n => n >= 3 && n <= 5,
|
|
676
|
-
set: [[lessThan$1, greaterThan$1], [xOverBlank$1, xBlankBlank$1], [x$1, longDivision$1]]
|
|
677
|
-
}, {
|
|
678
|
-
predicate: n => n >= 6 && n <= 7,
|
|
679
|
-
set: [[degree$1, lessThan$1, greaterThan$1], [circleDot$1, lessThanEqual$1, greaterThanEqual$1], [x$1, y$1, squared$1, xToPowerOfN$1], [plusMinus$1, xOverBlank$1, xBlankBlank$1, squareRoot$1], [pi$1, parenthesis$1, absValue$1, nthRoot$1]]
|
|
680
|
-
}, {
|
|
681
|
-
predicate: n => n >= 8 || n === 'HS',
|
|
682
|
-
set: hs$1
|
|
683
|
-
}, {
|
|
684
|
-
predicate: 'non-negative-integers',
|
|
685
|
-
set: [[digits$1.seven, digits$1.eight, digits$1.nine], [digits$1.four, digits$1.five, digits$1.six], [digits$1.one, digits$1.two, digits$1.three], [digits$1.zero, {
|
|
686
|
-
name: '',
|
|
687
|
-
latex: '',
|
|
688
|
-
write: ''
|
|
689
|
-
}, {
|
|
690
|
-
name: '',
|
|
691
|
-
latex: '',
|
|
692
|
-
write: ''
|
|
693
|
-
}], [left$1, right$1, del$1]]
|
|
694
|
-
}, {
|
|
695
|
-
predicate: 'integers',
|
|
696
|
-
set: [[digits$1.seven, digits$1.eight, digits$1.nine], [digits$1.four, digits$1.five, digits$1.six], [digits$1.one, digits$1.two, digits$1.three], [digits$1.zero, {
|
|
697
|
-
name: '',
|
|
698
|
-
latex: '',
|
|
699
|
-
write: ''
|
|
700
|
-
}, minus$1], [left$1, right$1, del$1]]
|
|
701
|
-
}, {
|
|
702
|
-
predicate: 'decimals',
|
|
703
|
-
set: [[digits$1.seven, digits$1.eight, digits$1.nine], [digits$1.four, digits$1.five, digits$1.six], [digits$1.one, digits$1.two, digits$1.three], [digits$1.zero, digits$1.decimalPoint, minus$1], [left$1, right$1, del$1]]
|
|
704
|
-
}, {
|
|
705
|
-
predicate: 'fractions',
|
|
706
|
-
set: [[digits$1.seven, digits$1.eight, digits$1.nine], [digits$1.four, digits$1.five, digits$1.six], [digits$1.one, digits$1.two, digits$1.three], [digits$1.zero, blankOverBlank$1, minus$1], [left$1, right$1, del$1]]
|
|
707
|
-
}, {
|
|
708
|
-
predicate: 'geometry',
|
|
709
|
-
set: [[blankOverBlank$1, degree$1, primeArcminute$1, doublePrimeArcSecond$1, congruentTo$1, similarTo$1], [circleDot$1, angle$1, measureOfAngle$1, triangle$1, notCongruentTo$1, notSimilar$1], [sin$1, cos$1, tan$1, pi$1, squareRoot$1, nthRoot$1], [csc$1, sec$1, cot$1, theta$1, subscript$1, xToPowerOfN$1], [overline$1, overRightArrow$1, overLeftRightArrow$1, overArc$1, perpindicular$1, parallel$1]]
|
|
710
|
-
}, {
|
|
711
|
-
predicate: 'advanced-algebra',
|
|
712
|
-
set: advancedAlgebra$1
|
|
713
|
-
}, {
|
|
714
|
-
predicate: 'statistics',
|
|
715
|
-
set: statisticsSet$1
|
|
716
|
-
}, {
|
|
717
|
-
predicate: 'item-authoring',
|
|
718
|
-
set: [[divide$1, blankOverBlank$1, longDivision$1, halfInfinity$1, squared$1, squareRoot$1, overline$1, overRightArrow$1, overLeftRightArrow$1, log$b], [multiply$1, circleDot$1, {
|
|
719
|
-
name: '',
|
|
720
|
-
latex: '',
|
|
721
|
-
write: ''
|
|
722
|
-
}, subscript$1, xToPowerOfN$1, nthRoot$1, perpindicular$1, parallel$1, overArc$1, logSubscript$1], [plusMinus$1, pi$1, theta$1, degree$1, angle$1, leftArrow$1, rightArrow$1, triangle$1, square$1, ln$1], [notEqual$1, absValue$1, smallSigma$1, mu$1, therefore$1, sigma$1, leftrightArrow$1, sin$1, cos$1, tan$1], [lessThanEqual$1, greaterThanEqual$1, {
|
|
723
|
-
name: '',
|
|
724
|
-
latex: '',
|
|
725
|
-
write: ''
|
|
726
|
-
}, {
|
|
727
|
-
name: '',
|
|
728
|
-
latex: '',
|
|
729
|
-
write: ''
|
|
730
|
-
}, infinity$1, {
|
|
731
|
-
name: '',
|
|
732
|
-
latex: '',
|
|
733
|
-
write: ''
|
|
734
|
-
}, {
|
|
735
|
-
name: '',
|
|
736
|
-
latex: '',
|
|
737
|
-
write: ''
|
|
738
|
-
}, csc$1, sec$1, cot$1]]
|
|
739
|
-
}];
|
|
740
|
-
const keysForGrade$1 = n => {
|
|
741
|
-
const number = parseInt(n, 10);
|
|
742
|
-
n = isNaN(number) ? n : number;
|
|
743
|
-
if (!n) {
|
|
744
|
-
return [];
|
|
745
|
-
}
|
|
746
|
-
const match = gradeSets$1.find(gs => {
|
|
747
|
-
if (typeof gs.predicate === 'string') {
|
|
748
|
-
return gs.predicate === n;
|
|
749
|
-
} else {
|
|
750
|
-
return gs.predicate(n);
|
|
751
|
-
}
|
|
752
|
-
});
|
|
753
|
-
if (match) {
|
|
754
|
-
return match.set || [];
|
|
755
|
-
}
|
|
756
|
-
};
|
|
757
|
-
const ALL_KEYS$1 = [...Object.values(basicOperators$1), ...Object.values(comparison$1), ...Object.values(constants$1), ...Object.values(digits$1), ...Object.values(exponent$1), ...Object.values(fractions$1), ...Object.values(geometry$1), ...Object.values(log$c), ...Object.values(matrices$1), ...Object.values(misc$1), ...Object.values(operators$1), ...Object.values(statistics$1), ...Object.values(subSup$1), ...Object.values(trigonometry$1), ...Object.values(vars$1)];
|
|
758
|
-
const normalizeAdditionalKeys$1 = additionalKeys => {
|
|
759
|
-
return (additionalKeys || []).map(additionalkey => {
|
|
760
|
-
const {latex} = additionalkey;
|
|
761
|
-
const predefinedKey = (ALL_KEYS$1 || []).find(key => latex === key.latex || latex === key.write || latex === key.command || latex === key.otherNotation);
|
|
762
|
-
return predefinedKey || additionalkey;
|
|
763
|
-
});
|
|
764
|
-
};
|
|
765
|
-
const {one: one$1, two: two$1, three: three$1, four: four$1, five: five$1, six: six$1, seven: seven$1, eight: eight$1, nine: nine$1, zero: zero$1, comma: comma$2, decimalPoint: decimalPoint$2} = digits$1;
|
|
766
|
-
const baseSet$1 = [[seven$1, eight$1, nine$1, divide$1], [four$1, five$1, six$1, multiply$1], [one$1, two$1, three$1, minus$1], [zero$1, decimalPoint$2, comma$2, plus$1], [left$1, right$1, del$1, equals$1]];
|
|
767
|
-
const _$4 = _dll_lodash;
|
|
768
|
-
const sortKeys$1 = keys => {
|
|
769
|
-
_$4.times(5 - keys.length, () => {
|
|
770
|
-
keys.push([]);
|
|
771
|
-
});
|
|
772
|
-
const out = _$4.zip.apply(null, keys);
|
|
773
|
-
return out;
|
|
774
|
-
};
|
|
775
|
-
const registerLineBreak$1 = function (MQ) {
|
|
776
|
-
MQ.registerEmbed('newLine', () => {
|
|
777
|
-
return {
|
|
778
|
-
htmlString: '<div class="newLine"></div>',
|
|
779
|
-
text: () => 'testText',
|
|
780
|
-
latex: () => '\\embed{newLine}[]'
|
|
781
|
-
};
|
|
782
|
-
});
|
|
783
|
-
};
|
|
784
|
-
const React$e = _dll_react;
|
|
785
|
-
const PropTypes$d = _dll_prop_types;
|
|
786
|
-
const {withStyles: withStyles$9} = _dll_material_ui__core_styles;
|
|
787
|
-
const debug$8 = _dll_debug;
|
|
788
|
-
const classNames$4 = _dll_classnames;
|
|
789
|
-
const MathQuill$5 = _dll_pie_framework__mathquill;
|
|
790
|
-
const _jsxFileName$d = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/mq/input.jsx";
|
|
791
|
-
let MQ$3;
|
|
792
|
-
if (typeof window !== 'undefined') {
|
|
793
|
-
MQ$3 = MathQuill$5.getInterface(2);
|
|
794
|
-
if (MQ$3 && MQ$3.registerEmbed) {
|
|
795
|
-
registerLineBreak$1(MQ$3);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
const log$a = debug$8('math-input:mq:input');
|
|
799
|
-
class Input$1 extends React$e.Component {
|
|
800
|
-
constructor(...args) {
|
|
801
|
-
super(...args);
|
|
802
|
-
Input$1.prototype.__init.call(this);
|
|
803
|
-
Input$1.prototype.__init2.call(this);
|
|
804
|
-
Input$1.prototype.__init3.call(this);
|
|
805
|
-
}
|
|
806
|
-
static __initStatic() {
|
|
807
|
-
this.propTypes = {
|
|
808
|
-
className: PropTypes$d.string,
|
|
809
|
-
classes: PropTypes$d.object.isRequired,
|
|
810
|
-
onClick: PropTypes$d.func,
|
|
811
|
-
onChange: PropTypes$d.func,
|
|
812
|
-
latex: PropTypes$d.string,
|
|
813
|
-
onFocus: PropTypes$d.func,
|
|
814
|
-
onBlur: PropTypes$d.func
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
componentDidMount() {
|
|
818
|
-
if (!MQ$3) {
|
|
819
|
-
throw new Error('MQ is not defined - but component has mounted?');
|
|
820
|
-
}
|
|
821
|
-
this.mathField = MQ$3.MathField(this.input, {
|
|
822
|
-
handlers: {
|
|
823
|
-
edit: this.onInputEdit.bind(this)
|
|
824
|
-
}
|
|
825
|
-
});
|
|
826
|
-
this.updateLatex();
|
|
827
|
-
}
|
|
828
|
-
componentDidUpdate() {
|
|
829
|
-
this.updateLatex();
|
|
830
|
-
}
|
|
831
|
-
updateLatex() {
|
|
832
|
-
if (!this.mathField) {
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
const {latex} = this.props;
|
|
836
|
-
if (latex) {
|
|
837
|
-
this.mathField.latex(latex);
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
clear() {
|
|
841
|
-
this.mathField.latex('');
|
|
842
|
-
return '';
|
|
843
|
-
}
|
|
844
|
-
blur() {
|
|
845
|
-
log$a('blur mathfield');
|
|
846
|
-
this.mathField.blur();
|
|
847
|
-
}
|
|
848
|
-
focus() {
|
|
849
|
-
log$a('focus mathfield...');
|
|
850
|
-
this.mathField.focus();
|
|
851
|
-
}
|
|
852
|
-
command(v) {
|
|
853
|
-
log$a('command: ', v);
|
|
854
|
-
if (Array.isArray(v)) {
|
|
855
|
-
v.forEach(vv => {
|
|
856
|
-
this.mathField.cmd(vv);
|
|
857
|
-
});
|
|
858
|
-
} else {
|
|
859
|
-
this.mathField.cmd(v);
|
|
860
|
-
}
|
|
861
|
-
this.mathField.focus();
|
|
862
|
-
return this.mathField.latex();
|
|
863
|
-
}
|
|
864
|
-
keystroke(v) {
|
|
865
|
-
this.mathField.keystroke(v);
|
|
866
|
-
this.mathField.focus();
|
|
867
|
-
return this.mathField.latex();
|
|
868
|
-
}
|
|
869
|
-
write(v) {
|
|
870
|
-
log$a('write: ', v);
|
|
871
|
-
this.mathField.write(v);
|
|
872
|
-
this.mathField.focus();
|
|
873
|
-
return this.mathField.latex();
|
|
874
|
-
}
|
|
875
|
-
__init() {
|
|
876
|
-
this.onInputEdit = () => {
|
|
877
|
-
log$a('[onInputEdit] ...');
|
|
878
|
-
const {onChange} = this.props;
|
|
879
|
-
if (!this.mathField) {
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
if (onChange) {
|
|
883
|
-
onChange(this.mathField.latex());
|
|
884
|
-
}
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
|
-
__init2() {
|
|
888
|
-
this.refresh = () => {
|
|
889
|
-
this.blur();
|
|
890
|
-
this.focus();
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
|
-
__init3() {
|
|
894
|
-
this.onKeyPress = event => {
|
|
895
|
-
const keys = Object.keys(this.mathField.__controller.options);
|
|
896
|
-
if (keys.indexOf('ignoreNextMousedown') < 0) {
|
|
897
|
-
this.refresh();
|
|
898
|
-
}
|
|
899
|
-
if (event.charCode === 13) {
|
|
900
|
-
this.write('\\embed{newLine}[]');
|
|
901
|
-
this.onInputEdit();
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
}
|
|
905
|
-
shouldComponentUpdate(nextProps) {
|
|
906
|
-
log$a('next: ', nextProps.latex);
|
|
907
|
-
log$a('current: ', this.mathField.latex());
|
|
908
|
-
return nextProps.latex !== this.mathField.latex();
|
|
909
|
-
}
|
|
910
|
-
render() {
|
|
911
|
-
const {onClick, onFocus, onBlur, classes, className} = this.props;
|
|
912
|
-
return React$e.createElement('span', {
|
|
913
|
-
className: classNames$4(classes.input, className),
|
|
914
|
-
onKeyPress: this.onKeyPress,
|
|
915
|
-
onClick: onClick,
|
|
916
|
-
onFocus: onFocus,
|
|
917
|
-
onBlur: onBlur,
|
|
918
|
-
ref: r => this.input = r,
|
|
919
|
-
__self: this,
|
|
920
|
-
__source: {
|
|
921
|
-
fileName: _jsxFileName$d,
|
|
922
|
-
lineNumber: 149
|
|
923
|
-
}
|
|
924
|
-
});
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
Input$1.__initStatic();
|
|
928
|
-
const styles$7 = () => ({});
|
|
929
|
-
withStyles$9(styles$7)(Input$1);
|
|
930
|
-
const PropTypes$c = _dll_prop_types;
|
|
931
|
-
const React$d = _dll_react;
|
|
932
|
-
const debug$7 = _dll_debug;
|
|
933
|
-
const MathQuill$4 = _dll_pie_framework__mathquill;
|
|
934
|
-
const _jsxFileName$c = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/mq/static.jsx";
|
|
935
|
-
let MQ$2;
|
|
936
|
-
if (typeof window !== 'undefined') {
|
|
937
|
-
MQ$2 = MathQuill$4.getInterface(2);
|
|
938
|
-
}
|
|
939
|
-
const log$9 = debug$7('pie-lib:math-input:mq:static');
|
|
940
|
-
const REGEX$2 = /\\MathQuillMathField\[r\d*\]\{(.*?)\}/g;
|
|
941
|
-
const WHITESPACE_REGEX$1 = / /g;
|
|
942
|
-
function stripSpaces$1(string = '') {
|
|
943
|
-
return string.replace(WHITESPACE_REGEX$1, '');
|
|
944
|
-
}
|
|
945
|
-
class Static$1 extends React$d.Component {
|
|
946
|
-
constructor(...args) {
|
|
947
|
-
super(...args);
|
|
948
|
-
Static$1.prototype.__init.call(this);
|
|
949
|
-
}
|
|
950
|
-
static __initStatic() {
|
|
951
|
-
this.propTypes = {
|
|
952
|
-
latex: PropTypes$c.string.isRequired,
|
|
953
|
-
onFocus: PropTypes$c.func,
|
|
954
|
-
onBlur: PropTypes$c.func,
|
|
955
|
-
className: PropTypes$c.string,
|
|
956
|
-
getFieldName: PropTypes$c.func,
|
|
957
|
-
onSubFieldChange: PropTypes$c.func,
|
|
958
|
-
onSubFieldFocus: PropTypes$c.func,
|
|
959
|
-
setInput: PropTypes$c.func
|
|
960
|
-
};
|
|
961
|
-
}
|
|
962
|
-
componentDidMount() {
|
|
963
|
-
this.update();
|
|
964
|
-
updateSpans$1();
|
|
965
|
-
}
|
|
966
|
-
componentDidUpdate() {
|
|
967
|
-
this.update();
|
|
968
|
-
updateSpans$1();
|
|
969
|
-
}
|
|
970
|
-
onInputEdit(field) {
|
|
971
|
-
if (!this.mathField) {
|
|
972
|
-
return;
|
|
973
|
-
}
|
|
974
|
-
const name = this.props.getFieldName(field, this.mathField.innerFields);
|
|
975
|
-
if (this.props.onSubFieldChange) {
|
|
976
|
-
this.props.onSubFieldChange(name, field.latex());
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
update() {
|
|
980
|
-
if (!MQ$2) {
|
|
981
|
-
throw new Error('MQ is not defined - but component has mounted?');
|
|
982
|
-
}
|
|
983
|
-
if (!this.mathField) {
|
|
984
|
-
this.mathField = MQ$2.StaticMath(this.input, {
|
|
985
|
-
handlers: {
|
|
986
|
-
edit: this.onInputEdit.bind(this)
|
|
987
|
-
}
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
try {
|
|
991
|
-
this.mathField.parseLatex(this.props.latex);
|
|
992
|
-
this.mathField.latex(this.props.latex);
|
|
993
|
-
} catch (e) {
|
|
994
|
-
this.mathField.latex('\\MathQuillMathField[r1]{}');
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
blur() {
|
|
998
|
-
log$9('blur mathfield');
|
|
999
|
-
this.mathField.blur();
|
|
1000
|
-
}
|
|
1001
|
-
focus() {
|
|
1002
|
-
log$9('focus mathfield...');
|
|
1003
|
-
this.mathField.focus();
|
|
1004
|
-
}
|
|
1005
|
-
shouldComponentUpdate(nextProps) {
|
|
1006
|
-
try {
|
|
1007
|
-
const parsedLatex = this.mathField.parseLatex(nextProps.latex);
|
|
1008
|
-
const stripped = stripSpaces$1(parsedLatex);
|
|
1009
|
-
const newFieldCount = (nextProps.latex.match(REGEX$2) || []).length;
|
|
1010
|
-
const out = stripped !== stripSpaces$1(this.mathField.latex().trim()) || newFieldCount !== Object.keys(this.mathField.innerFields).length / 2;
|
|
1011
|
-
log$9('[shouldComponentUpdate] ', out);
|
|
1012
|
-
return out;
|
|
1013
|
-
} catch (e) {
|
|
1014
|
-
console.warn('Error parsing latex:', e.message, 'skip update');
|
|
1015
|
-
console.warn(e);
|
|
1016
|
-
return false;
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
__init() {
|
|
1020
|
-
this.onFocus = e => {
|
|
1021
|
-
try {
|
|
1022
|
-
let rootBlock = e.target.parentElement.nextSibling;
|
|
1023
|
-
let id = parseInt(rootBlock.getAttribute('mathquill-block-id'), 10);
|
|
1024
|
-
if (!id) {
|
|
1025
|
-
rootBlock = rootBlock.parentElement;
|
|
1026
|
-
id = parseInt(rootBlock.getAttribute('mathquill-block-id'), 10);
|
|
1027
|
-
}
|
|
1028
|
-
const innerField = this.mathField.innerFields.find(f => f.id === id);
|
|
1029
|
-
if (innerField) {
|
|
1030
|
-
const name = this.props.getFieldName(innerField, this.mathField.innerFields);
|
|
1031
|
-
if (this.props.setInput) {
|
|
1032
|
-
this.props.setInput(innerField);
|
|
1033
|
-
}
|
|
1034
|
-
this.props.onSubFieldFocus(name, innerField);
|
|
1035
|
-
}
|
|
1036
|
-
} catch (err) {
|
|
1037
|
-
console.error('error finding root block', err.message);
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
}
|
|
1041
|
-
render() {
|
|
1042
|
-
const {onBlur, className} = this.props;
|
|
1043
|
-
return React$d.createElement('span', {
|
|
1044
|
-
className: className,
|
|
1045
|
-
onFocus: this.onFocus,
|
|
1046
|
-
onBlur: onBlur,
|
|
1047
|
-
ref: r => this.input = r,
|
|
1048
|
-
__self: this,
|
|
1049
|
-
__source: {
|
|
1050
|
-
fileName: _jsxFileName$c,
|
|
1051
|
-
lineNumber: 137
|
|
1052
|
-
}
|
|
1053
|
-
});
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
Static$1.__initStatic();
|
|
1057
|
-
const React$c = _dll_react;
|
|
1058
|
-
const PropTypes$b = _dll_prop_types;
|
|
1059
|
-
const {Button: Button$2} = _dll_material_ui__core;
|
|
1060
|
-
const {IconButton: IconButton$2} = _dll_material_ui__core;
|
|
1061
|
-
const {colors: {green: green$1}} = _dll_material_ui__core;
|
|
1062
|
-
const {withStyles: withStyles$8} = _dll_material_ui__core_styles;
|
|
1063
|
-
const classNames$3 = _dll_classnames;
|
|
1064
|
-
const {lighten: lighten$1} = _dll_material_ui__core_styles_color_manipulator;
|
|
1065
|
-
const {fade: fade$1} = _dll_material_ui__core_styles_color_manipulator;
|
|
1066
|
-
const debug$6 = _dll_debug;
|
|
1067
|
-
const _$3 = _dll_lodash;
|
|
1068
|
-
const _jsxFileName$b = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/keypad/index.jsx";
|
|
1069
|
-
const log$8 = debug$6('pie-lib:math-inline:keypad');
|
|
1070
|
-
const LatexButton$1 = withStyles$8(theme => ({
|
|
1071
|
-
root: {
|
|
1072
|
-
textTransform: 'none',
|
|
1073
|
-
padding: 0,
|
|
1074
|
-
margin: 0,
|
|
1075
|
-
fontSize: '110% !important'
|
|
1076
|
-
},
|
|
1077
|
-
latexButton: {
|
|
1078
|
-
pointerEvents: 'none',
|
|
1079
|
-
textTransform: 'none !important',
|
|
1080
|
-
'& .mq-scaled.mq-sqrt-prefix': {
|
|
1081
|
-
transform: 'scale(1, 0.9) !important'
|
|
1082
|
-
},
|
|
1083
|
-
'& .mq-sup-only .mq-sup': {
|
|
1084
|
-
marginBottom: '0.9px !important'
|
|
1085
|
-
},
|
|
1086
|
-
'& .mq-empty': {
|
|
1087
|
-
backgroundColor: `${fade$1(theme.palette.secondary.main, 0.4)} !important`
|
|
1088
|
-
},
|
|
1089
|
-
'& .mq-overline .mq-overline-inner': {
|
|
1090
|
-
borderTop: '2px solid black'
|
|
1091
|
-
},
|
|
1092
|
-
'& .mq-overarrow': {
|
|
1093
|
-
width: '30px',
|
|
1094
|
-
marginTop: '0 !important',
|
|
1095
|
-
borderTop: '2px solid black',
|
|
1096
|
-
'&.mq-arrow-both': {
|
|
1097
|
-
'& *': {
|
|
1098
|
-
lineHeight: '1 !important'
|
|
1099
|
-
},
|
|
1100
|
-
'&:before': {
|
|
1101
|
-
fontSize: '80%',
|
|
1102
|
-
left: 'calc(-13%)',
|
|
1103
|
-
top: '-0.25em'
|
|
1104
|
-
},
|
|
1105
|
-
'&:after': {
|
|
1106
|
-
fontSize: '80% !important',
|
|
1107
|
-
right: 'calc(-13%) !important',
|
|
1108
|
-
top: '-1.5em'
|
|
1109
|
-
},
|
|
1110
|
-
'&.mq-empty:before': {
|
|
1111
|
-
fontSize: '80%',
|
|
1112
|
-
left: 'calc(-13%)',
|
|
1113
|
-
top: '-0.25em'
|
|
1114
|
-
},
|
|
1115
|
-
'&.mq-empty:after': {
|
|
1116
|
-
fontSize: '80%',
|
|
1117
|
-
right: 'calc(-13%)',
|
|
1118
|
-
top: '-0.25em'
|
|
1119
|
-
},
|
|
1120
|
-
'&.mq-empty': {
|
|
1121
|
-
minHeight: '1.4em'
|
|
1122
|
-
}
|
|
1123
|
-
},
|
|
1124
|
-
'&.mq-arrow-right:before': {
|
|
1125
|
-
fontSize: '80%',
|
|
1126
|
-
right: 'calc(-13%)',
|
|
1127
|
-
top: '-0.25em'
|
|
1128
|
-
},
|
|
1129
|
-
'& .mq-overarrow-inner': {
|
|
1130
|
-
border: 'none !important'
|
|
1131
|
-
},
|
|
1132
|
-
'& .mq-overarrow-inner .mq-overarrow-inner-right': {
|
|
1133
|
-
display: 'none !important'
|
|
1134
|
-
}
|
|
1135
|
-
},
|
|
1136
|
-
'& .mq-root-block': {
|
|
1137
|
-
padding: '5px'
|
|
1138
|
-
},
|
|
1139
|
-
'& .mq-overarrow.mq-arrow-both.mq-empty:after': {
|
|
1140
|
-
right: '-6px',
|
|
1141
|
-
fontSize: '80% !important',
|
|
1142
|
-
top: '-3px'
|
|
1143
|
-
},
|
|
1144
|
-
'& .mq-overarrow.mq-arrow-right.mq-empty:before': {
|
|
1145
|
-
right: '-5px',
|
|
1146
|
-
fontSize: '80% !important',
|
|
1147
|
-
top: '-3px'
|
|
1148
|
-
},
|
|
1149
|
-
'& .mq-overarrow.mq-arrow-both.mq-empty:before': {
|
|
1150
|
-
left: '-6px',
|
|
1151
|
-
fontSize: '80% !important',
|
|
1152
|
-
top: '-3px'
|
|
1153
|
-
},
|
|
1154
|
-
'& .mq-longdiv-inner': {
|
|
1155
|
-
borderTop: '1px solid !important',
|
|
1156
|
-
paddingTop: '1.5px !important'
|
|
1157
|
-
},
|
|
1158
|
-
'& .mq-parallelogram': {
|
|
1159
|
-
lineHeight: 0.85
|
|
1160
|
-
},
|
|
1161
|
-
'& .mq-overarc': {
|
|
1162
|
-
borderTop: '2px solid black !important',
|
|
1163
|
-
'& .mq-overline-inner': {
|
|
1164
|
-
borderTop: 'none !important',
|
|
1165
|
-
paddingTop: '0 !important'
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
},
|
|
1169
|
-
parallelButton: {
|
|
1170
|
-
fontStyle: 'italic'
|
|
1171
|
-
},
|
|
1172
|
-
leftRightArrowButton: {
|
|
1173
|
-
'& .mq-overarrow.mq-arrow-both': {
|
|
1174
|
-
'& .mq-overline-inner': {
|
|
1175
|
-
borderTop: 'none !important',
|
|
1176
|
-
paddingTop: '0 !important'
|
|
1177
|
-
},
|
|
1178
|
-
'&:after': {
|
|
1179
|
-
top: '-1.64em !important'
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
}))(props => {
|
|
1184
|
-
let buttonClass;
|
|
1185
|
-
if (props.latex === '\\parallel') {
|
|
1186
|
-
buttonClass = classNames$3(props.classes.latexButton, props.mqClassName, props.classes.parallelButton);
|
|
1187
|
-
} else if (props.latex === '\\overleftrightarrow{\\overline{}}') {
|
|
1188
|
-
buttonClass = classNames$3(props.classes.latexButton, props.mqClassName, props.classes.leftRightArrowButton);
|
|
1189
|
-
} else {
|
|
1190
|
-
buttonClass = classNames$3(props.classes.latexButton, props.mqClassName);
|
|
1191
|
-
}
|
|
1192
|
-
try {
|
|
1193
|
-
const MQ = MathQuill.getInterface(2);
|
|
1194
|
-
const span = document.createElement('span');
|
|
1195
|
-
span.innerHTML = '';
|
|
1196
|
-
const mathField = MQ.StaticMath(span);
|
|
1197
|
-
mathField.parseLatex(props.latex);
|
|
1198
|
-
mathField.latex(props.latex);
|
|
1199
|
-
} catch (e) {
|
|
1200
|
-
return React$c.createElement(React$c.Fragment, null);
|
|
1201
|
-
}
|
|
1202
|
-
return React$c.createElement(Button$2, {
|
|
1203
|
-
className: classNames$3(props.classes.root, props.className),
|
|
1204
|
-
onClick: props.onClick,
|
|
1205
|
-
__self: undefined,
|
|
1206
|
-
__source: {
|
|
1207
|
-
fileName: _jsxFileName$b,
|
|
1208
|
-
lineNumber: 163
|
|
1209
|
-
}
|
|
1210
|
-
}, React$c.createElement(Static$1, {
|
|
1211
|
-
className: buttonClass,
|
|
1212
|
-
latex: props.latex,
|
|
1213
|
-
__self: undefined,
|
|
1214
|
-
__source: {
|
|
1215
|
-
fileName: _jsxFileName$b,
|
|
1216
|
-
lineNumber: 164
|
|
1217
|
-
}
|
|
1218
|
-
}));
|
|
1219
|
-
});
|
|
1220
|
-
class KeyPad$1 extends React$c.Component {
|
|
1221
|
-
constructor(...args) {
|
|
1222
|
-
super(...args);
|
|
1223
|
-
KeyPad$1.prototype.__init.call(this);
|
|
1224
|
-
KeyPad$1.prototype.__init2.call(this);
|
|
1225
|
-
KeyPad$1.prototype.__init3.call(this);
|
|
1226
|
-
}
|
|
1227
|
-
static __initStatic() {
|
|
1228
|
-
this.propTypes = {
|
|
1229
|
-
classes: PropTypes$b.object.isRequired,
|
|
1230
|
-
className: PropTypes$b.string,
|
|
1231
|
-
baseSet: PropTypes$b.array,
|
|
1232
|
-
additionalKeys: PropTypes$b.array,
|
|
1233
|
-
onPress: PropTypes$b.func.isRequired,
|
|
1234
|
-
onFocus: PropTypes$b.func,
|
|
1235
|
-
noDecimal: PropTypes$b.bool,
|
|
1236
|
-
mode: PropTypes$b.string
|
|
1237
|
-
};
|
|
1238
|
-
}
|
|
1239
|
-
static __initStatic2() {
|
|
1240
|
-
this.defaultProps = {
|
|
1241
|
-
baseSet: baseSet$1,
|
|
1242
|
-
noDecimal: false
|
|
1243
|
-
};
|
|
1244
|
-
}
|
|
1245
|
-
__init() {
|
|
1246
|
-
this.buttonClick = key => {
|
|
1247
|
-
log$8('[buttonClick]', key);
|
|
1248
|
-
const {onPress} = this.props;
|
|
1249
|
-
onPress(key);
|
|
1250
|
-
};
|
|
1251
|
-
}
|
|
1252
|
-
__init2() {
|
|
1253
|
-
this.flowKeys = (base, extras) => {
|
|
1254
|
-
const transposed = [...sortKeys$1(base), ...sortKeys$1(extras)];
|
|
1255
|
-
return _$3.flatten(transposed);
|
|
1256
|
-
};
|
|
1257
|
-
}
|
|
1258
|
-
__init3() {
|
|
1259
|
-
this.keyIsNotAllowed = key => {
|
|
1260
|
-
const {noDecimal} = this.props;
|
|
1261
|
-
if ((key.write === '.' && key.label === '.' || key.write === ',' && key.label === ',') && noDecimal) {
|
|
1262
|
-
return true;
|
|
1263
|
-
}
|
|
1264
|
-
return false;
|
|
1265
|
-
};
|
|
1266
|
-
}
|
|
1267
|
-
render() {
|
|
1268
|
-
const {classes, className, baseSet, additionalKeys, onFocus, mode} = this.props;
|
|
1269
|
-
const noBaseSet = ['non-negative-integers', 'integers', 'decimals', 'fractions', 'item-authoring'];
|
|
1270
|
-
const keysWithoutBaseSet = noBaseSet.includes(mode);
|
|
1271
|
-
const allKeys = keysWithoutBaseSet ? this.flowKeys([], additionalKeys || []) : this.flowKeys(baseSet, additionalKeys || []);
|
|
1272
|
-
const shift = allKeys.length % 5 ? 1 : 0;
|
|
1273
|
-
const style = {
|
|
1274
|
-
gridTemplateColumns: `repeat(${Math.floor(allKeys.length / 5) + shift}, minmax(min-content, 150px))`
|
|
1275
|
-
};
|
|
1276
|
-
return React$c.createElement('div', {
|
|
1277
|
-
className: classNames$3(classes.keys, className),
|
|
1278
|
-
style: style,
|
|
1279
|
-
onFocus: onFocus,
|
|
1280
|
-
__self: this,
|
|
1281
|
-
__source: {
|
|
1282
|
-
fileName: _jsxFileName$b,
|
|
1283
|
-
lineNumber: 231
|
|
1284
|
-
}
|
|
1285
|
-
}, allKeys.map((k, index) => {
|
|
1286
|
-
const onClick = this.buttonClick.bind(this, k);
|
|
1287
|
-
if (!k) {
|
|
1288
|
-
return React$c.createElement('span', {
|
|
1289
|
-
key: `empty-${index}`,
|
|
1290
|
-
__self: this,
|
|
1291
|
-
__source: {
|
|
1292
|
-
fileName: _jsxFileName$b,
|
|
1293
|
-
lineNumber: 236
|
|
1294
|
-
}
|
|
1295
|
-
});
|
|
1296
|
-
}
|
|
1297
|
-
const common = {
|
|
1298
|
-
onClick,
|
|
1299
|
-
className: classNames$3(classes.labelButton, !keysWithoutBaseSet && classes[k.category], k.label === ',' && classes.comma, k.label === '.' && classes.dot),
|
|
1300
|
-
disabled: this.keyIsNotAllowed(k),
|
|
1301
|
-
key: `${k.label || k.latex || k.command}-${index}`
|
|
1302
|
-
};
|
|
1303
|
-
if (k.latex) {
|
|
1304
|
-
return React$c.createElement(LatexButton$1, {
|
|
1305
|
-
latex: k.latex,
|
|
1306
|
-
...common,
|
|
1307
|
-
className: classes.latexButton,
|
|
1308
|
-
__self: this,
|
|
1309
|
-
__source: {
|
|
1310
|
-
fileName: _jsxFileName$b,
|
|
1311
|
-
lineNumber: 252
|
|
1312
|
-
}
|
|
1313
|
-
});
|
|
1314
|
-
}
|
|
1315
|
-
if (k.label) {
|
|
1316
|
-
return React$c.createElement(Button$2, {
|
|
1317
|
-
...common,
|
|
1318
|
-
__self: this,
|
|
1319
|
-
__source: {
|
|
1320
|
-
fileName: _jsxFileName$b,
|
|
1321
|
-
lineNumber: 256
|
|
1322
|
-
}
|
|
1323
|
-
}, k.label);
|
|
1324
|
-
} else {
|
|
1325
|
-
const Icon = k.icon ? k.icon : 'div';
|
|
1326
|
-
return React$c.createElement(IconButton$2, {
|
|
1327
|
-
tabIndex: '-1',
|
|
1328
|
-
...common,
|
|
1329
|
-
__self: this,
|
|
1330
|
-
__source: {
|
|
1331
|
-
fileName: _jsxFileName$b,
|
|
1332
|
-
lineNumber: 261
|
|
1333
|
-
}
|
|
1334
|
-
}, React$c.createElement(Icon, {
|
|
1335
|
-
className: classes.icon,
|
|
1336
|
-
__self: this,
|
|
1337
|
-
__source: {
|
|
1338
|
-
fileName: _jsxFileName$b,
|
|
1339
|
-
lineNumber: 262
|
|
1340
|
-
}
|
|
1341
|
-
}));
|
|
1342
|
-
}
|
|
1343
|
-
}));
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
KeyPad$1.__initStatic();
|
|
1347
|
-
KeyPad$1.__initStatic2();
|
|
1348
|
-
const styles$6 = theme => ({
|
|
1349
|
-
keys: {
|
|
1350
|
-
'& *': {
|
|
1351
|
-
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'
|
|
1352
|
-
},
|
|
1353
|
-
width: '100%',
|
|
1354
|
-
display: 'grid',
|
|
1355
|
-
gridTemplateRows: 'repeat(5, minmax(40px, 60px))',
|
|
1356
|
-
gridRowGap: '0px',
|
|
1357
|
-
gridColumnGap: '0px',
|
|
1358
|
-
gridAutoFlow: 'column'
|
|
1359
|
-
},
|
|
1360
|
-
holder: {
|
|
1361
|
-
position: 'relative',
|
|
1362
|
-
width: '100%',
|
|
1363
|
-
height: '100%',
|
|
1364
|
-
backgroundColor: '#cef',
|
|
1365
|
-
borderRadius: 0,
|
|
1366
|
-
padding: `${theme.spacing.unit}px 0 ${theme.spacing.unit}px 0`
|
|
1367
|
-
},
|
|
1368
|
-
labelButton: {
|
|
1369
|
-
minWidth: 'auto',
|
|
1370
|
-
fontSize: '140% !important',
|
|
1371
|
-
backgroundColor: lighten$1(theme.palette.primary.light, 0.5),
|
|
1372
|
-
'&:hover': {
|
|
1373
|
-
backgroundColor: lighten$1(theme.palette.primary.light, 0.7)
|
|
1374
|
-
},
|
|
1375
|
-
borderRadius: 0
|
|
1376
|
-
},
|
|
1377
|
-
latexButton: {
|
|
1378
|
-
minWidth: 'auto',
|
|
1379
|
-
borderRadius: 0,
|
|
1380
|
-
backgroundColor: lighten$1(theme.palette.primary.light, 0.5),
|
|
1381
|
-
'&:hover': {
|
|
1382
|
-
backgroundColor: lighten$1(theme.palette.primary.light, 0.7)
|
|
1383
|
-
}
|
|
1384
|
-
},
|
|
1385
|
-
base: {},
|
|
1386
|
-
operators: {
|
|
1387
|
-
backgroundColor: lighten$1(theme.palette.secondary.light, 0.5),
|
|
1388
|
-
'&:hover': {
|
|
1389
|
-
backgroundColor: lighten$1(theme.palette.secondary.light, 0.7)
|
|
1390
|
-
}
|
|
1391
|
-
},
|
|
1392
|
-
comparison: {
|
|
1393
|
-
backgroundColor: lighten$1(green$1[500], 0.5),
|
|
1394
|
-
'&:hover': {
|
|
1395
|
-
backgroundColor: lighten$1(green$1[500], 0.7)
|
|
1396
|
-
}
|
|
1397
|
-
},
|
|
1398
|
-
comma: {
|
|
1399
|
-
fontSize: '200% !important',
|
|
1400
|
-
lineHeight: '100%'
|
|
1401
|
-
},
|
|
1402
|
-
dot: {
|
|
1403
|
-
fontSize: '200% !important',
|
|
1404
|
-
lineHeight: '100%'
|
|
1405
|
-
},
|
|
1406
|
-
icon: {
|
|
1407
|
-
height: '30px'
|
|
1408
|
-
}
|
|
1409
|
-
});
|
|
1410
|
-
var Keypad$1 = withStyles$8(styles$6)(KeyPad$1);
|
|
1411
|
-
const React$b = _dll_react;
|
|
1412
|
-
const PropTypes$a = _dll_prop_types;
|
|
1413
|
-
const _jsxFileName$a = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/horizontal-keypad.jsx";
|
|
1414
|
-
const toOldModel$1 = d => {
|
|
1415
|
-
if (d.command) {
|
|
1416
|
-
return {
|
|
1417
|
-
value: d.command,
|
|
1418
|
-
type: 'command'
|
|
1419
|
-
};
|
|
1420
|
-
} else if (d.write) {
|
|
1421
|
-
return {
|
|
1422
|
-
value: d.write
|
|
1423
|
-
};
|
|
1424
|
-
} else if (d.keystroke) {
|
|
1425
|
-
return {
|
|
1426
|
-
type: 'cursor',
|
|
1427
|
-
value: d.keystroke
|
|
1428
|
-
};
|
|
1429
|
-
}
|
|
1430
|
-
};
|
|
1431
|
-
class HorizontalKeypad$1 extends React$b.Component {
|
|
1432
|
-
constructor(...args) {
|
|
1433
|
-
super(...args);
|
|
1434
|
-
HorizontalKeypad$1.prototype.__init.call(this);
|
|
1435
|
-
}
|
|
1436
|
-
static __initStatic() {
|
|
1437
|
-
this.propTypes = {
|
|
1438
|
-
className: PropTypes$a.string,
|
|
1439
|
-
mode: PropTypes$a.oneOfType([PropTypes$a.string, PropTypes$a.number]),
|
|
1440
|
-
onClick: PropTypes$a.func.isRequired,
|
|
1441
|
-
onFocus: PropTypes$a.func,
|
|
1442
|
-
noDecimal: PropTypes$a.bool,
|
|
1443
|
-
additionalKeys: PropTypes$a.array
|
|
1444
|
-
};
|
|
1445
|
-
}
|
|
1446
|
-
static __initStatic2() {
|
|
1447
|
-
this.defaultProps = {
|
|
1448
|
-
mode: 'scientific',
|
|
1449
|
-
noDecimal: false,
|
|
1450
|
-
additionalKeys: []
|
|
1451
|
-
};
|
|
1452
|
-
}
|
|
1453
|
-
__init() {
|
|
1454
|
-
this.keypadPress = data => {
|
|
1455
|
-
const {onClick} = this.props;
|
|
1456
|
-
onClick(toOldModel$1(data));
|
|
1457
|
-
};
|
|
1458
|
-
}
|
|
1459
|
-
render() {
|
|
1460
|
-
const {mode, onFocus, noDecimal, className, additionalKeys} = this.props;
|
|
1461
|
-
const normalizedKeys = normalizeAdditionalKeys$1(additionalKeys);
|
|
1462
|
-
return React$b.createElement(Keypad$1, {
|
|
1463
|
-
className: className,
|
|
1464
|
-
onFocus: onFocus,
|
|
1465
|
-
noDecimal: noDecimal,
|
|
1466
|
-
additionalKeys: extendKeySet$1(keysForGrade$1(mode), normalizedKeys),
|
|
1467
|
-
onPress: this.keypadPress,
|
|
1468
|
-
mode: mode,
|
|
1469
|
-
__self: this,
|
|
1470
|
-
__source: {
|
|
1471
|
-
fileName: _jsxFileName$a,
|
|
1472
|
-
lineNumber: 44
|
|
1473
|
-
}
|
|
1474
|
-
});
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
HorizontalKeypad$1.__initStatic();
|
|
1478
|
-
HorizontalKeypad$1.__initStatic2();
|
|
1479
|
-
const updateSpans$1 = () => {
|
|
1480
|
-
const spans = Array.from(document.querySelectorAll('span[mathquill-command-id]'));
|
|
1481
|
-
(spans || []).forEach(span => {
|
|
1482
|
-
if (span && span.innerText === '∥' && span.className !== 'mq-editable-field') {
|
|
1483
|
-
span.style.fontSize = '32px';
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1486
|
-
};
|
|
1487
|
-
const ResponseTypes = {
|
|
1488
|
-
advanced: 'Advanced Multi',
|
|
1489
|
-
simple: 'Simple'
|
|
1490
|
-
};
|
|
1
|
+
import {_dll_lodash, _dll_react, _dll_prop_types, _dll_material_ui__core_styles, _dll_debug, _dll_classnames, _dll_material_ui__core, _dll_material_ui__core_styles_color_manipulator, _dll_pie_lib__render_ui, _dll_material_ui__icons, _dll_pie_lib__correct_answer_toggle, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.10/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.35/module/index.js";
|
|
3
|
+
import {_dll_pie_framework__mathquill} from "../../../@pie-lib/math-edit-module@^1.1.31/module/index.js";
|
|
1491
4
|
const set$f = o => ({
|
|
1492
5
|
...o,
|
|
1493
6
|
category: 'comparison'
|
|
@@ -2274,7 +787,7 @@ const {withStyles: withStyles$7} = _dll_material_ui__core_styles;
|
|
|
2274
787
|
const debug$5 = _dll_debug;
|
|
2275
788
|
const classNames$2 = _dll_classnames;
|
|
2276
789
|
const MathQuill$3 = _dll_pie_framework__mathquill;
|
|
2277
|
-
const _jsxFileName$9 = "/home/circleci/repo/node_modules/@pie-lib/math-
|
|
790
|
+
const _jsxFileName$9 = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/mq/input.jsx";
|
|
2278
791
|
let MQ$1;
|
|
2279
792
|
if (typeof window !== 'undefined') {
|
|
2280
793
|
MQ$1 = MathQuill$3.getInterface(2);
|
|
@@ -2418,7 +931,7 @@ const PropTypes$8 = _dll_prop_types;
|
|
|
2418
931
|
const React$9 = _dll_react;
|
|
2419
932
|
const debug$4 = _dll_debug;
|
|
2420
933
|
const MathQuill$2 = _dll_pie_framework__mathquill;
|
|
2421
|
-
const _jsxFileName$8 = "/home/circleci/repo/node_modules/@pie-lib/math-
|
|
934
|
+
const _jsxFileName$8 = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/mq/static.jsx";
|
|
2422
935
|
let MQ;
|
|
2423
936
|
if (typeof window !== 'undefined') {
|
|
2424
937
|
MQ = MathQuill$2.getInterface(2);
|
|
@@ -2552,7 +1065,7 @@ const {lighten: lighten} = _dll_material_ui__core_styles_color_manipulator;
|
|
|
2552
1065
|
const {fade: fade} = _dll_material_ui__core_styles_color_manipulator;
|
|
2553
1066
|
const debug$3 = _dll_debug;
|
|
2554
1067
|
const _ = _dll_lodash;
|
|
2555
|
-
const _jsxFileName$7 = "/home/circleci/repo/node_modules/@pie-lib/math-
|
|
1068
|
+
const _jsxFileName$7 = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/keypad/index.jsx";
|
|
2556
1069
|
const log$3 = debug$3('pie-lib:math-inline:keypad');
|
|
2557
1070
|
const LatexButton = withStyles$6(theme => ({
|
|
2558
1071
|
root: {
|
|
@@ -2676,13 +1189,23 @@ const LatexButton = withStyles$6(theme => ({
|
|
|
2676
1189
|
} else {
|
|
2677
1190
|
buttonClass = classNames$1(props.classes.latexButton, props.mqClassName);
|
|
2678
1191
|
}
|
|
1192
|
+
try {
|
|
1193
|
+
const MQ = MathQuill.getInterface(2);
|
|
1194
|
+
const span = document.createElement('span');
|
|
1195
|
+
span.innerHTML = '';
|
|
1196
|
+
const mathField = MQ.StaticMath(span);
|
|
1197
|
+
mathField.parseLatex(props.latex);
|
|
1198
|
+
mathField.latex(props.latex);
|
|
1199
|
+
} catch (e) {
|
|
1200
|
+
return React$8.createElement(React$8.Fragment, null);
|
|
1201
|
+
}
|
|
2679
1202
|
return React$8.createElement(Button$1, {
|
|
2680
1203
|
className: classNames$1(props.classes.root, props.className),
|
|
2681
1204
|
onClick: props.onClick,
|
|
2682
1205
|
__self: undefined,
|
|
2683
1206
|
__source: {
|
|
2684
1207
|
fileName: _jsxFileName$7,
|
|
2685
|
-
lineNumber:
|
|
1208
|
+
lineNumber: 163
|
|
2686
1209
|
}
|
|
2687
1210
|
}, React$8.createElement(Static, {
|
|
2688
1211
|
className: buttonClass,
|
|
@@ -2690,7 +1213,7 @@ const LatexButton = withStyles$6(theme => ({
|
|
|
2690
1213
|
__self: undefined,
|
|
2691
1214
|
__source: {
|
|
2692
1215
|
fileName: _jsxFileName$7,
|
|
2693
|
-
lineNumber:
|
|
1216
|
+
lineNumber: 164
|
|
2694
1217
|
}
|
|
2695
1218
|
}));
|
|
2696
1219
|
});
|
|
@@ -2757,7 +1280,7 @@ class KeyPad extends React$8.Component {
|
|
|
2757
1280
|
__self: this,
|
|
2758
1281
|
__source: {
|
|
2759
1282
|
fileName: _jsxFileName$7,
|
|
2760
|
-
lineNumber:
|
|
1283
|
+
lineNumber: 231
|
|
2761
1284
|
}
|
|
2762
1285
|
}, allKeys.map((k, index) => {
|
|
2763
1286
|
const onClick = this.buttonClick.bind(this, k);
|
|
@@ -2767,7 +1290,7 @@ class KeyPad extends React$8.Component {
|
|
|
2767
1290
|
__self: this,
|
|
2768
1291
|
__source: {
|
|
2769
1292
|
fileName: _jsxFileName$7,
|
|
2770
|
-
lineNumber:
|
|
1293
|
+
lineNumber: 236
|
|
2771
1294
|
}
|
|
2772
1295
|
});
|
|
2773
1296
|
}
|
|
@@ -2785,7 +1308,7 @@ class KeyPad extends React$8.Component {
|
|
|
2785
1308
|
__self: this,
|
|
2786
1309
|
__source: {
|
|
2787
1310
|
fileName: _jsxFileName$7,
|
|
2788
|
-
lineNumber:
|
|
1311
|
+
lineNumber: 252
|
|
2789
1312
|
}
|
|
2790
1313
|
});
|
|
2791
1314
|
}
|
|
@@ -2795,7 +1318,7 @@ class KeyPad extends React$8.Component {
|
|
|
2795
1318
|
__self: this,
|
|
2796
1319
|
__source: {
|
|
2797
1320
|
fileName: _jsxFileName$7,
|
|
2798
|
-
lineNumber:
|
|
1321
|
+
lineNumber: 256
|
|
2799
1322
|
}
|
|
2800
1323
|
}, k.label);
|
|
2801
1324
|
} else {
|
|
@@ -2806,14 +1329,14 @@ class KeyPad extends React$8.Component {
|
|
|
2806
1329
|
__self: this,
|
|
2807
1330
|
__source: {
|
|
2808
1331
|
fileName: _jsxFileName$7,
|
|
2809
|
-
lineNumber:
|
|
1332
|
+
lineNumber: 261
|
|
2810
1333
|
}
|
|
2811
1334
|
}, React$8.createElement(Icon, {
|
|
2812
1335
|
className: classes.icon,
|
|
2813
1336
|
__self: this,
|
|
2814
1337
|
__source: {
|
|
2815
1338
|
fileName: _jsxFileName$7,
|
|
2816
|
-
lineNumber:
|
|
1339
|
+
lineNumber: 262
|
|
2817
1340
|
}
|
|
2818
1341
|
}));
|
|
2819
1342
|
}
|
|
@@ -2887,7 +1410,7 @@ const styles$4 = theme => ({
|
|
|
2887
1410
|
var Keypad = withStyles$6(styles$4)(KeyPad);
|
|
2888
1411
|
const React$7 = _dll_react;
|
|
2889
1412
|
const PropTypes$6 = _dll_prop_types;
|
|
2890
|
-
const _jsxFileName$6 = "/home/circleci/repo/node_modules/@pie-lib/math-
|
|
1413
|
+
const _jsxFileName$6 = "/home/circleci/repo/node_modules/@pie-lib/math-input/src/horizontal-keypad.jsx";
|
|
2891
1414
|
const toOldModel = d => {
|
|
2892
1415
|
if (d.command) {
|
|
2893
1416
|
return {
|
|
@@ -2961,6 +1484,10 @@ const updateSpans = () => {
|
|
|
2961
1484
|
}
|
|
2962
1485
|
});
|
|
2963
1486
|
};
|
|
1487
|
+
const ResponseTypes = {
|
|
1488
|
+
advanced: 'Advanced Multi',
|
|
1489
|
+
simple: 'Simple'
|
|
1490
|
+
};
|
|
2964
1491
|
const React$6 = _dll_react;
|
|
2965
1492
|
const debug$2 = _dll_debug;
|
|
2966
1493
|
const PropTypes$5 = _dll_prop_types;
|
|
@@ -3771,7 +2298,7 @@ class SimpleQuestionBlockRaw extends React$2.Component {
|
|
|
3771
2298
|
fileName: _jsxFileName$1,
|
|
3772
2299
|
lineNumber: 56
|
|
3773
2300
|
}
|
|
3774
|
-
}, React$2.createElement(Static
|
|
2301
|
+
}, React$2.createElement(Static, {
|
|
3775
2302
|
latex: showCorrect ? responses && responses.length && responses[0].answer : session.response || '',
|
|
3776
2303
|
__self: this,
|
|
3777
2304
|
__source: {
|
|
@@ -4141,7 +2668,7 @@ class Main extends React$1.Component {
|
|
|
4141
2668
|
}
|
|
4142
2669
|
__init10() {
|
|
4143
2670
|
this.subFieldChanged = (name, subfieldValue) => {
|
|
4144
|
-
updateSpans
|
|
2671
|
+
updateSpans();
|
|
4145
2672
|
if (name) {
|
|
4146
2673
|
this.setState(state => ({
|
|
4147
2674
|
session: {
|
|
@@ -4215,7 +2742,7 @@ class Main extends React$1.Component {
|
|
|
4215
2742
|
fileName: _jsxFileName,
|
|
4216
2743
|
lineNumber: 411
|
|
4217
2744
|
}
|
|
4218
|
-
}, React$1.createElement(Static
|
|
2745
|
+
}, React$1.createElement(Static, {
|
|
4219
2746
|
ref: mqStatic => this.mqStatic = mqStatic || this.mqStatic,
|
|
4220
2747
|
latex: staticLatex,
|
|
4221
2748
|
onSubFieldChange: this.subFieldChanged,
|
|
@@ -4308,7 +2835,7 @@ class Main extends React$1.Component {
|
|
|
4308
2835
|
fileName: _jsxFileName,
|
|
4309
2836
|
lineNumber: 463
|
|
4310
2837
|
}
|
|
4311
|
-
}, React$1.createElement(HorizontalKeypad
|
|
2838
|
+
}, React$1.createElement(HorizontalKeypad, {
|
|
4312
2839
|
additionalKeys: additionalKeys,
|
|
4313
2840
|
mode: equationEditor || DEFAULT_KEYPAD_VARIANT,
|
|
4314
2841
|
onClick: this.onClick,
|
|
@@ -4323,7 +2850,7 @@ class Main extends React$1.Component {
|
|
|
4323
2850
|
fileName: _jsxFileName,
|
|
4324
2851
|
lineNumber: 451
|
|
4325
2852
|
}
|
|
4326
|
-
}, React$1.createElement(Static
|
|
2853
|
+
}, React$1.createElement(Static, {
|
|
4327
2854
|
ref: mqStatic => this.mqStatic = mqStatic || this.mqStatic,
|
|
4328
2855
|
latex: staticLatex,
|
|
4329
2856
|
onSubFieldChange: this.subFieldChanged,
|