@pie-lib/math-toolbar 1.8.0 → 1.8.1-next.224
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.json +15 -0
- package/CHANGELOG.md +14 -248
- package/lib/done-button.js +3 -3
- package/lib/done-button.js.map +1 -1
- package/lib/editor-and-pad.js +51 -33
- package/lib/editor-and-pad.js.map +1 -1
- package/lib/index.js +25 -21
- package/lib/index.js.map +1 -1
- package/lib/math-preview.js +25 -15
- package/lib/math-preview.js.map +1 -1
- package/package.json +3 -3
- package/src/editor-and-pad.jsx +12 -2
- package/src/index.jsx +1 -1
- package/src/math-preview.jsx +6 -0
package/CHANGELOG.json
CHANGED
|
@@ -843,5 +843,20 @@
|
|
|
843
843
|
"committerDate": "2021-08-10 09:31:29 +0300",
|
|
844
844
|
"isTagged": true,
|
|
845
845
|
"tag": "@pie-lib/math-toolbar@1.8.0"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"type": "fix",
|
|
849
|
+
"scope": "math-toolbar",
|
|
850
|
+
"subject": "Fixed arrows for pits",
|
|
851
|
+
"merge": null,
|
|
852
|
+
"header": "fix(math-toolbar): Fixed arrows for pits",
|
|
853
|
+
"body": null,
|
|
854
|
+
"footer": null,
|
|
855
|
+
"notes": [],
|
|
856
|
+
"hash": "f22208b9b7a29eba20415c92833b1d1b71f7f8cf",
|
|
857
|
+
"gitTags": "",
|
|
858
|
+
"committerDate": "2021-09-06 16:06:43 +0300",
|
|
859
|
+
"isTagged": true,
|
|
860
|
+
"tag": "@pie-lib/math-toolbar@1.8.1"
|
|
846
861
|
}
|
|
847
862
|
]
|
package/CHANGELOG.md
CHANGED
|
@@ -27,484 +27,250 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
27
27
|
|
|
28
28
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
30
|
## [1.7.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.11...@pie-lib/math-toolbar@1.7.12) (2021-06-25)
|
|
35
31
|
|
|
36
32
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
34
|
## [1.7.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.10...@pie-lib/math-toolbar@1.7.11) (2021-04-06)
|
|
43
35
|
|
|
44
36
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
38
|
## [1.7.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.9...@pie-lib/math-toolbar@1.7.10) (2021-03-22)
|
|
51
39
|
|
|
52
40
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
53
41
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
42
|
## [1.7.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.8...@pie-lib/math-toolbar@1.7.9) (2021-03-15)
|
|
59
43
|
|
|
60
|
-
|
|
61
44
|
### Bug Fixes
|
|
62
45
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
46
|
+
- **math-toolbar:** override style for ray PD-48 ([b8492d5](https://github.com/pie-framework/pie-lib/commit/b8492d5))
|
|
68
47
|
|
|
69
48
|
## [1.7.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.7...@pie-lib/math-toolbar@1.7.8) (2021-03-03)
|
|
70
49
|
|
|
71
|
-
|
|
72
50
|
### Bug Fixes
|
|
73
51
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
52
|
+
- rename the 'Everything' math editor as the 'Miscellaneous' math editor ([6b5c0b3](https://github.com/pie-framework/pie-lib/commit/6b5c0b3))
|
|
79
53
|
|
|
80
54
|
## [1.7.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.6...@pie-lib/math-toolbar@1.7.7) (2021-03-02)
|
|
81
55
|
|
|
82
|
-
|
|
83
56
|
### Bug Fixes
|
|
84
57
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
58
|
+
- override math input and math toolbar style for ibx PD-774 ([0969756](https://github.com/pie-framework/pie-lib/commit/0969756))
|
|
90
59
|
|
|
91
60
|
## [1.7.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.5...@pie-lib/math-toolbar@1.7.6) (2021-03-01)
|
|
92
61
|
|
|
93
62
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
94
63
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
64
|
## [1.7.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.4...@pie-lib/math-toolbar@1.7.5) (2021-03-01)
|
|
100
65
|
|
|
101
66
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
102
67
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
68
|
## [1.7.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.3...@pie-lib/math-toolbar@1.7.4) (2021-02-15)
|
|
108
69
|
|
|
109
70
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
110
71
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
72
|
## [1.7.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.1...@pie-lib/math-toolbar@1.7.3) (2021-02-15)
|
|
116
73
|
|
|
117
74
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
118
75
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
76
|
## [1.7.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.7.0...@pie-lib/math-toolbar@1.7.1) (2021-02-01)
|
|
124
77
|
|
|
125
|
-
|
|
126
78
|
### Bug Fixes
|
|
127
79
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
80
|
+
- dont import InputContainer from config-ui ([9cb7b68](https://github.com/pie-framework/pie-lib/commit/9cb7b68))
|
|
133
81
|
|
|
134
82
|
# [1.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.6.0...@pie-lib/math-toolbar@1.7.0) (2021-01-11)
|
|
135
83
|
|
|
136
|
-
|
|
137
84
|
### Features
|
|
138
85
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
86
|
+
- **math-toolbar:** add better math keypad support - PD-355 ([2a67078](https://github.com/pie-framework/pie-lib/commit/2a67078))
|
|
144
87
|
|
|
145
88
|
# [1.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.9...@pie-lib/math-toolbar@1.6.0) (2020-10-07)
|
|
146
89
|
|
|
147
|
-
|
|
148
90
|
### Features
|
|
149
91
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
92
|
+
- **math-toolbar:** add color theme support ([732baf3](https://github.com/pie-framework/pie-lib/commit/732baf3))
|
|
155
93
|
|
|
156
94
|
## [1.5.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.8...@pie-lib/math-toolbar@1.5.9) (2020-08-11)
|
|
157
95
|
|
|
158
96
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
159
97
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
98
|
## [1.5.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.7...@pie-lib/math-toolbar@1.5.8) (2020-06-05)
|
|
165
99
|
|
|
166
100
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
167
101
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
102
|
## [1.5.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.6...@pie-lib/math-toolbar@1.5.7) (2020-05-15)
|
|
173
103
|
|
|
174
104
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
175
105
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
106
|
## [1.5.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.5...@pie-lib/math-toolbar@1.5.6) (2020-05-06)
|
|
181
107
|
|
|
182
108
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
183
109
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
110
|
## [1.5.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.4...@pie-lib/math-toolbar@1.5.5) (2020-05-05)
|
|
189
111
|
|
|
190
112
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
191
113
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
114
|
## [1.5.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.3...@pie-lib/math-toolbar@1.5.4) (2020-04-28)
|
|
197
115
|
|
|
198
116
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
199
117
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
118
|
## [1.5.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.2...@pie-lib/math-toolbar@1.5.3) (2020-04-27)
|
|
205
119
|
|
|
206
120
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
207
121
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
122
|
## [1.5.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.1...@pie-lib/math-toolbar@1.5.2) (2020-04-21)
|
|
213
123
|
|
|
214
124
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
215
125
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
126
|
## [1.5.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.5.0...@pie-lib/math-toolbar@1.5.1) (2020-04-14)
|
|
221
127
|
|
|
222
128
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
223
129
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
130
|
# [1.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.29...@pie-lib/math-toolbar@1.5.0) (2020-04-08)
|
|
229
131
|
|
|
230
|
-
|
|
231
132
|
### Features
|
|
232
133
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
134
|
+
- **math:** made sure that math is clickable inside table [ch3518](<[23185dd](https://github.com/pie-framework/pie-lib/commit/23185dd)>)
|
|
238
135
|
|
|
239
136
|
## [1.4.29](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.28...@pie-lib/math-toolbar@1.4.29) (2020-03-31)
|
|
240
137
|
|
|
241
138
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
242
139
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
140
|
## [1.4.28](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.27...@pie-lib/math-toolbar@1.4.28) (2020-03-31)
|
|
248
141
|
|
|
249
142
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
250
143
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
144
|
## [1.4.27](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.26...@pie-lib/math-toolbar@1.4.27) (2020-03-31)
|
|
256
145
|
|
|
257
|
-
|
|
258
146
|
### Bug Fixes
|
|
259
147
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
148
|
+
- correct module path ([589e9e3](https://github.com/pie-framework/pie-lib/commit/589e9e3))
|
|
265
149
|
|
|
266
150
|
## [1.4.26](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.25...@pie-lib/math-toolbar@1.4.26) (2020-03-31)
|
|
267
151
|
|
|
268
152
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
269
153
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
154
|
## [1.4.25](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.24...@pie-lib/math-toolbar@1.4.25) (2020-03-30)
|
|
275
155
|
|
|
276
156
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
277
157
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
158
|
## [1.4.24](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.23...@pie-lib/math-toolbar@1.4.24) (2020-03-30)
|
|
283
159
|
|
|
284
160
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
285
161
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
162
|
## [1.4.23](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.22...@pie-lib/math-toolbar@1.4.23) (2020-03-30)
|
|
291
163
|
|
|
292
164
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
293
165
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
166
|
## [1.4.22](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.21...@pie-lib/math-toolbar@1.4.22) (2020-03-30)
|
|
299
167
|
|
|
300
168
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
301
169
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
170
|
## [1.4.21](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.20...@pie-lib/math-toolbar@1.4.21) (2020-03-30)
|
|
307
171
|
|
|
308
172
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
309
173
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
174
|
## [1.4.20](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.19...@pie-lib/math-toolbar@1.4.20) (2020-03-30)
|
|
315
175
|
|
|
316
176
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
317
177
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
178
|
## [1.4.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.18...@pie-lib/math-toolbar@1.4.19) (2020-03-30)
|
|
323
179
|
|
|
324
|
-
|
|
325
180
|
### Bug Fixes
|
|
326
181
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
182
|
+
- add module prop to package.json ([dd549c5](https://github.com/pie-framework/pie-lib/commit/dd549c5))
|
|
332
183
|
|
|
333
184
|
## [1.4.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.17...@pie-lib/math-toolbar@1.4.18) (2020-03-18)
|
|
334
185
|
|
|
335
186
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
336
187
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
188
|
## [1.4.17](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.16...@pie-lib/math-toolbar@1.4.17) (2020-03-06)
|
|
342
189
|
|
|
343
190
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
344
191
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
192
|
## [1.4.16](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.15...@pie-lib/math-toolbar@1.4.16) (2020-02-11)
|
|
350
193
|
|
|
351
194
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
352
195
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
196
|
## [1.4.15](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.14...@pie-lib/math-toolbar@1.4.15) (2020-02-05)
|
|
358
197
|
|
|
359
198
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
360
199
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
200
|
## [1.4.14](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.13...@pie-lib/math-toolbar@1.4.14) (2020-01-27)
|
|
366
201
|
|
|
367
202
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
368
203
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
204
|
## [1.4.13](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.12...@pie-lib/math-toolbar@1.4.13) (2019-12-19)
|
|
374
205
|
|
|
375
206
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
376
207
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
208
|
## [1.4.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.11...@pie-lib/math-toolbar@1.4.12) (2019-12-18)
|
|
382
209
|
|
|
383
210
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
384
211
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
212
|
## [1.4.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.10...@pie-lib/math-toolbar@1.4.11) (2019-12-10)
|
|
390
213
|
|
|
391
214
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
392
215
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
216
|
## [1.4.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.9...@pie-lib/math-toolbar@1.4.10) (2019-12-10)
|
|
398
217
|
|
|
399
218
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
400
219
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
220
|
## [1.4.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.8...@pie-lib/math-toolbar@1.4.9) (2019-12-09)
|
|
406
221
|
|
|
407
|
-
|
|
408
222
|
### Bug Fixes
|
|
409
223
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
224
|
+
- ch4405: Added usage of onBlur function and hideDoneButton property for editor. ([24f072c](https://github.com/pie-framework/pie-lib/commit/24f072c))
|
|
415
225
|
|
|
416
226
|
## [1.4.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.7...@pie-lib/math-toolbar@1.4.8) (2019-11-05)
|
|
417
227
|
|
|
418
228
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
419
229
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
230
|
## [1.4.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.6...@pie-lib/math-toolbar@1.4.7) (2019-08-21)
|
|
425
231
|
|
|
426
232
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
427
233
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
234
|
## [1.4.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.5...@pie-lib/math-toolbar@1.4.6) (2019-08-21)
|
|
433
235
|
|
|
434
|
-
|
|
435
236
|
### Bug Fixes
|
|
436
237
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
238
|
+
- **math-toolbar:** un-initialized input problem fix in case of no decimal flow ([0794237](https://github.com/pie-framework/pie-lib/commit/0794237))
|
|
442
239
|
|
|
443
240
|
## [1.4.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.4...@pie-lib/math-toolbar@1.4.5) (2019-07-08)
|
|
444
241
|
|
|
445
|
-
|
|
446
242
|
### Bug Fixes
|
|
447
243
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
244
|
+
- save math changes when editor is re-focused ([7674a86](https://github.com/pie-framework/pie-lib/commit/7674a86))
|
|
453
245
|
|
|
454
246
|
## [1.4.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.3...@pie-lib/math-toolbar@1.4.4) (2019-07-05)
|
|
455
247
|
|
|
456
248
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
457
249
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
250
|
## [1.4.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.2...@pie-lib/math-toolbar@1.4.3) (2019-07-02)
|
|
463
251
|
|
|
464
252
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
465
253
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
254
|
## [1.4.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.1...@pie-lib/math-toolbar@1.4.2) (2019-07-02)
|
|
471
255
|
|
|
472
|
-
|
|
473
256
|
### Bug Fixes
|
|
474
257
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
258
|
+
- **math-toolbar:** fix width styling ([6b3788a](https://github.com/pie-framework/pie-lib/commit/6b3788a))
|
|
480
259
|
|
|
481
260
|
## [1.4.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.4.0...@pie-lib/math-toolbar@1.4.1) (2019-06-17)
|
|
482
261
|
|
|
483
262
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
484
263
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
264
|
# [1.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.3.1...@pie-lib/math-toolbar@1.4.0) (2019-06-12)
|
|
490
265
|
|
|
491
|
-
|
|
492
266
|
### Features
|
|
493
267
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
268
|
+
- version bumps ([23eb54f](https://github.com/pie-framework/pie-lib/commit/23eb54f))
|
|
499
269
|
|
|
500
270
|
## [1.3.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.3.0...@pie-lib/math-toolbar@1.3.1) (2019-06-05)
|
|
501
271
|
|
|
502
272
|
**Note:** Version bump only for package @pie-lib/math-toolbar
|
|
503
273
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
274
|
# [1.3.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-toolbar@1.2.4...@pie-lib/math-toolbar@1.3.0) (2019-05-15)
|
|
509
275
|
|
|
510
276
|
### Features
|
package/lib/done-button.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.RawDoneButton = exports.DoneButton = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -20,7 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
20
20
|
var RawDoneButton = function RawDoneButton(_ref) {
|
|
21
21
|
var classes = _ref.classes,
|
|
22
22
|
onClick = _ref.onClick;
|
|
23
|
-
return _react["default"].createElement(_IconButton["default"], {
|
|
23
|
+
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
24
24
|
"aria-label": "Done",
|
|
25
25
|
className: classes.iconRoot,
|
|
26
26
|
onClick: onClick,
|
|
@@ -28,7 +28,7 @@ var RawDoneButton = function RawDoneButton(_ref) {
|
|
|
28
28
|
label: classes.label,
|
|
29
29
|
root: classes.iconRoot
|
|
30
30
|
}
|
|
31
|
-
}, _react["default"].createElement(_Check["default"], null));
|
|
31
|
+
}, /*#__PURE__*/_react["default"].createElement(_Check["default"], null));
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
exports.RawDoneButton = RawDoneButton;
|
package/lib/done-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/done-button.jsx"],"names":["RawDoneButton","classes","onClick","iconRoot","label","root","propTypes","PropTypes","object","isRequired","func","styles","verticalAlign","width","height","color","position","top","DoneButton"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;AAEO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB;AAAA,MAAGC,OAAH,QAAGA,OAAH;AAAA,MAAYC,OAAZ,QAAYA,OAAZ;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/done-button.jsx"],"names":["RawDoneButton","classes","onClick","iconRoot","label","root","propTypes","PropTypes","object","isRequired","func","styles","verticalAlign","width","height","color","position","top","DoneButton"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;AAEO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB;AAAA,MAAGC,OAAH,QAAGA,OAAH;AAAA,MAAYC,OAAZ,QAAYA,OAAZ;AAAA,sBAC3B,gCAAC,sBAAD;AACE,kBAAW,MADb;AAEE,IAAA,SAAS,EAAED,OAAO,CAACE,QAFrB;AAGE,IAAA,OAAO,EAAED,OAHX;AAIE,IAAA,OAAO,EAAE;AACPE,MAAAA,KAAK,EAAEH,OAAO,CAACG,KADR;AAEPC,MAAAA,IAAI,EAAEJ,OAAO,CAACE;AAFP;AAJX,kBASE,gCAAC,iBAAD,OATF,CAD2B;AAAA,CAAtB;;;AAcPH,aAAa,CAACM,SAAd,GAA0B;AACxBL,EAAAA,OAAO,EAAEM,sBAAUC,MAAV,CAAiBC,UADF;AAExBP,EAAAA,OAAO,EAAEK,sBAAUG;AAFK,CAA1B;AAKA,IAAMC,MAAM,GAAG;AACbR,EAAAA,QAAQ,EAAE;AACRS,IAAAA,aAAa,EAAE,KADP;AAERC,IAAAA,KAAK,EAAE,MAFC;AAGRC,IAAAA,MAAM,EAAE,MAHA;AAIRC,IAAAA,KAAK,EAAE;AAJC,GADG;AAObX,EAAAA,KAAK,EAAE;AACLY,IAAAA,QAAQ,EAAE,UADL;AAELC,IAAAA,GAAG,EAAE;AAFA;AAPM,CAAf;AAYO,IAAMC,UAAU,GAAG,wBAAWP,MAAX,EAAmBX,aAAnB,CAAnB","sourcesContent":["import React from 'react';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport Check from '@material-ui/icons/Check';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\n\nexport const RawDoneButton = ({ classes, onClick }) => (\n <IconButton\n aria-label=\"Done\"\n className={classes.iconRoot}\n onClick={onClick}\n classes={{\n label: classes.label,\n root: classes.iconRoot\n }}\n >\n <Check />\n </IconButton>\n);\n\nRawDoneButton.propTypes = {\n classes: PropTypes.object.isRequired,\n onClick: PropTypes.func\n};\n\nconst styles = {\n iconRoot: {\n verticalAlign: 'top',\n width: '28px',\n height: '28px',\n color: '#00bb00'\n },\n label: {\n position: 'absolute',\n top: '2px'\n }\n};\nexport const DoneButton = withStyles(styles)(RawDoneButton);\n"],"file":"done-button.js"}
|
package/lib/editor-and-pad.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -27,27 +29,29 @@ var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
|
27
29
|
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
31
|
|
|
30
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
31
|
-
|
|
32
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
33
|
|
|
34
34
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
35
|
|
|
36
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
39
|
|
|
40
|
-
function
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
+
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
|
+
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
41
45
|
|
|
42
46
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
47
|
|
|
44
|
-
function
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
49
|
|
|
46
|
-
function
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
51
|
|
|
48
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
52
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
49
53
|
|
|
50
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
54
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
51
55
|
|
|
52
56
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
57
|
|
|
@@ -80,17 +84,17 @@ var toNodeData = function toNodeData(data) {
|
|
|
80
84
|
}
|
|
81
85
|
};
|
|
82
86
|
|
|
83
|
-
var EditorAndPad =
|
|
84
|
-
/*#__PURE__*/
|
|
85
|
-
function (_React$Component) {
|
|
87
|
+
var EditorAndPad = /*#__PURE__*/function (_React$Component) {
|
|
86
88
|
_inherits(EditorAndPad, _React$Component);
|
|
87
89
|
|
|
90
|
+
var _super = _createSuper(EditorAndPad);
|
|
91
|
+
|
|
88
92
|
function EditorAndPad(props) {
|
|
89
93
|
var _this;
|
|
90
94
|
|
|
91
95
|
_classCallCheck(this, EditorAndPad);
|
|
92
96
|
|
|
93
|
-
_this =
|
|
97
|
+
_this = _super.call(this, props);
|
|
94
98
|
|
|
95
99
|
_defineProperty(_assertThisInitialized(_this), "onClick", function (data) {
|
|
96
100
|
var noDecimal = _this.props.noDecimal;
|
|
@@ -148,7 +152,7 @@ function (_React$Component) {
|
|
|
148
152
|
});
|
|
149
153
|
|
|
150
154
|
_this.state = {
|
|
151
|
-
equationEditor:
|
|
155
|
+
equationEditor: 'item-authoring'
|
|
152
156
|
};
|
|
153
157
|
return _this;
|
|
154
158
|
}
|
|
@@ -162,10 +166,10 @@ function (_React$Component) {
|
|
|
162
166
|
}
|
|
163
167
|
}, {
|
|
164
168
|
key: "shouldComponentUpdate",
|
|
165
|
-
|
|
169
|
+
value:
|
|
166
170
|
/** Only render if the mathquill instance's latex is different
|
|
167
171
|
* or the keypad state changed from one state to the other (shown / hidden) */
|
|
168
|
-
|
|
172
|
+
function shouldComponentUpdate(nextProps, nextState) {
|
|
169
173
|
var inputIsDifferent = this.input.mathField.latex() !== nextProps.latex;
|
|
170
174
|
log('[shouldComponentUpdate] ', 'inputIsDifferent: ', inputIsDifferent);
|
|
171
175
|
|
|
@@ -207,34 +211,42 @@ function (_React$Component) {
|
|
|
207
211
|
classes = _this$props2.classes;
|
|
208
212
|
var shouldShowKeypad = !controlledKeypad || controlledKeypad && showKeypad;
|
|
209
213
|
log('[render]', latex);
|
|
210
|
-
return _react["default"].createElement("div", {
|
|
214
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
211
215
|
className: (0, _classnames["default"])(classes.mathToolbar, classNames.mathToolbar)
|
|
212
|
-
}, _react["default"].createElement("div", {
|
|
216
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
213
217
|
className: classes.inputAndTypeContainer
|
|
214
|
-
}, controlledKeypadMode && _react["default"].createElement(_renderUi.InputContainer, {
|
|
218
|
+
}, controlledKeypadMode && /*#__PURE__*/_react["default"].createElement(_renderUi.InputContainer, {
|
|
215
219
|
label: "Equation Editor",
|
|
216
220
|
className: classes.selectContainer
|
|
217
|
-
}, _react["default"].createElement(_Select["default"], {
|
|
221
|
+
}, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
218
222
|
className: classes.select,
|
|
219
223
|
onChange: this.onEditorTypeChange,
|
|
220
224
|
value: this.state.equationEditor
|
|
221
|
-
}, _react["default"].createElement(_MenuItem["default"], {
|
|
225
|
+
}, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
226
|
+
value: "non-negative-integers"
|
|
227
|
+
}, "Numeric - Non-Negative Integers"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
228
|
+
value: "integers"
|
|
229
|
+
}, "Numeric - Integers"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
230
|
+
value: "decimals"
|
|
231
|
+
}, "Numeric - Decimals"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
232
|
+
value: "fractions"
|
|
233
|
+
}, "Numeric - Fractions"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
222
234
|
value: 1
|
|
223
|
-
}, "Grade 1 - 2"), _react["default"].createElement(_MenuItem["default"], {
|
|
235
|
+
}, "Grade 1 - 2"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
224
236
|
value: 3
|
|
225
|
-
}, "Grade 3 - 5"), _react["default"].createElement(_MenuItem["default"], {
|
|
237
|
+
}, "Grade 3 - 5"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
226
238
|
value: 6
|
|
227
|
-
}, "Grade 6 - 7"), _react["default"].createElement(_MenuItem["default"], {
|
|
239
|
+
}, "Grade 6 - 7"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
228
240
|
value: 8
|
|
229
|
-
}, "Grade 8 - HS"), _react["default"].createElement(_MenuItem["default"], {
|
|
241
|
+
}, "Grade 8 - HS"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
230
242
|
value: 'geometry'
|
|
231
|
-
}, "Geometry"), _react["default"].createElement(_MenuItem["default"], {
|
|
243
|
+
}, "Geometry"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
232
244
|
value: 'advanced-algebra'
|
|
233
|
-
}, "Advanced Algebra"), _react["default"].createElement(_MenuItem["default"], {
|
|
245
|
+
}, "Advanced Algebra"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
234
246
|
value: 'statistics'
|
|
235
|
-
}, "Statistics"), _react["default"].createElement(_MenuItem["default"], {
|
|
236
|
-
value: '
|
|
237
|
-
}, "
|
|
247
|
+
}, "Statistics"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
248
|
+
value: 'item-authoring'
|
|
249
|
+
}, "Item Authoring"))), /*#__PURE__*/_react["default"].createElement(_mathInput.mq.Input, {
|
|
238
250
|
onFocus: onFocus,
|
|
239
251
|
onBlur: onBlur,
|
|
240
252
|
className: (0, _classnames["default"])(classes.mathEditor, classNames.editor, !controlledKeypadMode ? classes.longMathEditor : ''),
|
|
@@ -243,16 +255,16 @@ function (_React$Component) {
|
|
|
243
255
|
},
|
|
244
256
|
latex: latex,
|
|
245
257
|
onChange: this.onEditorChange
|
|
246
|
-
})), allowAnswerBlock && _react["default"].createElement(_Button["default"], {
|
|
258
|
+
})), allowAnswerBlock && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
247
259
|
className: classes.addAnswerBlockButton,
|
|
248
260
|
type: "primary",
|
|
249
261
|
style: {
|
|
250
262
|
bottom: shouldShowKeypad ? '320px' : '20px'
|
|
251
263
|
},
|
|
252
264
|
onClick: this.onAnswerBlockClick
|
|
253
|
-
}, "+ Response Area"), _react["default"].createElement("hr", {
|
|
265
|
+
}, "+ Response Area"), /*#__PURE__*/_react["default"].createElement("hr", {
|
|
254
266
|
className: classes.hr
|
|
255
|
-
}), shouldShowKeypad && _react["default"].createElement(_mathInput.HorizontalKeypad, {
|
|
267
|
+
}), shouldShowKeypad && /*#__PURE__*/_react["default"].createElement(_mathInput.HorizontalKeypad, {
|
|
256
268
|
additionalKeys: additionalKeys,
|
|
257
269
|
mode: controlledKeypadMode ? this.state.equationEditor : keypadMode,
|
|
258
270
|
onClick: this.onClick,
|
|
@@ -294,6 +306,9 @@ var styles = function styles(theme) {
|
|
|
294
306
|
},
|
|
295
307
|
'& .mq-overarrow.mq-arrow-both': {
|
|
296
308
|
minWidth: '1.23em',
|
|
309
|
+
'& *': {
|
|
310
|
+
lineHeight: '1 !important'
|
|
311
|
+
},
|
|
297
312
|
'&:before': {
|
|
298
313
|
top: '-0.4em',
|
|
299
314
|
left: '-1px'
|
|
@@ -375,6 +390,9 @@ var styles = function styles(theme) {
|
|
|
375
390
|
},
|
|
376
391
|
'& .mq-overarrow.mq-arrow-both': {
|
|
377
392
|
minWidth: '1.23em'
|
|
393
|
+
},
|
|
394
|
+
'& .mq-parallelogram': {
|
|
395
|
+
lineHeight: 0.85
|
|
378
396
|
}
|
|
379
397
|
}
|
|
380
398
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/editor-and-pad.jsx"],"names":["log","decimalRegex","toNodeData","data","type","value","EditorAndPad","props","noDecimal","c","input","clear","command","keystroke","write","onAnswerBlockAdd","onClick","latex","onChange","indexOf","replace","evt","setState","equationEditor","target","state","autoFocus","focus","nextProps","nextState","inputIsDifferent","mathField","keypadMode","controlledKeypad","showKeypad","classNames","allowAnswerBlock","additionalKeys","controlledKeypadMode","onFocus","onBlur","classes","shouldShowKeypad","mathToolbar","inputAndTypeContainer","selectContainer","select","onEditorTypeChange","mathEditor","editor","longMathEditor","r","onEditorChange","addAnswerBlockButton","bottom","onAnswerBlockClick","hr","React","Component","PropTypes","object","oneOfType","string","number","bool","array","isRequired","func","styles","theme","display","alignItems","fontFamily","minWidth","top","left","right","flex","width","marginLeft","marginTop","marginBottom","marginRight","maxWidth","color","text","backgroundColor","background","padding","spacing","unit","position","border","margin","height","borderBottom","palette","primary","main","zIndex","textAlign","outline","boxShadow","borderRadius","paddingTop","borderTop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M,EAAE;AADW,OALV;AAQX,yBAAmB;AACjBS,QAAAA,OAAO,EAAE,MADQ;AAEjBC,QAAAA,SAAS,EAAE,MAFM;AAGjBV,QAAAA,MAAM,uBAAgBvB,KAAK,CAAC2B,OAAN,CAAcC,OAAd,CAAsBC,IAAtC,CAHW;AAIjBK,QAAAA,YAAY,EAAE;AAJG,OARR;AAcX,+BAAyB;AACvBX,QAAAA,MAAM,EAAE,iBADe;AAEvBY,QAAAA,UAAU,EAAE;AAFW,OAdd;AAkBX,qCAA+B;AAC7BlC,QAAAA,OAAO,EAAE;AADoB,OAlBpB;AAqBX,oCAA8B;AAC5BA,QAAAA,OAAO,EAAE;AADmB,OArBnB;AAwBX,6BAAuB;AACrBmC,QAAAA,SAAS,EAAE,sBADU;AAErBD,QAAAA,UAAU,EAAE;AAFS,OAxBZ;AA4BX,uCAAiC;AAC/B/B,QAAAA,QAAQ,EAAE;AADqB;AA5BtB;AA5DU,GAAL;AAAA,CAApB;;eA8Fe,wBAAWL,MAAX,EAAmB9D,YAAnB,C","sourcesContent":["import { HorizontalKeypad, mq } from '@pie-lib/math-input';\nimport React from 'react';\nimport debug from 'debug';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport Button from '@material-ui/core/Button';\nimport { withStyles } from '@material-ui/core/styles';\nconst log = debug('@pie-lib:math-toolbar:editor-and-pad');\nimport { color, InputContainer } from '@pie-lib/render-ui';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport { updateSpans } from '@pie-lib/math-input';\n\nconst decimalRegex = /\\.|,/g;\n\nconst toNodeData = data => {\n if (!data) {\n return;\n }\n\n const { type, value } = data;\n\n if (type === 'command' || type === 'cursor') {\n return data;\n } else if (type === 'answer') {\n return { type: 'answer', ...data };\n } else if (value === 'clear') {\n return { type: 'clear' };\n } else {\n return { type: 'write', value };\n }\n};\n\nexport class EditorAndPad extends React.Component {\n static propTypes = {\n classNames: PropTypes.object,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n autoFocus: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n showKeypad: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array,\n latex: PropTypes.string.isRequired,\n onAnswerBlockAdd: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n classes: PropTypes.object\n };\n\n constructor(props) {\n super(props);\n\n this.state = { equationEditor: 8 };\n }\n\n componentDidMount() {\n if (this.input && this.props.autoFocus) {\n this.input.focus();\n }\n }\n\n onClick = data => {\n const { noDecimal } = this.props;\n const c = toNodeData(data);\n log('mathChange: ', c);\n\n // if decimals are not allowed for this response, we discard the input\n if (noDecimal && (c.value === '.' || c.value === ',')) {\n return;\n }\n\n if (c.type === 'clear') {\n log('call clear...');\n this.input.clear();\n } else if (c.type === 'command') {\n this.input.command(c.value);\n } else if (c.type === 'cursor') {\n this.input.keystroke(c.value);\n } else if (c.type === 'answer') {\n this.input.write('%response%');\n } else {\n this.input.write(c.value);\n }\n };\n\n onAnswerBlockClick = () => {\n this.props.onAnswerBlockAdd();\n this.onClick({\n type: 'answer'\n });\n };\n\n onEditorChange = latex => {\n const { onChange, noDecimal } = this.props;\n\n updateSpans();\n\n // if no decimals are allowed and the last change is a decimal dot, discard the change\n if (noDecimal && (latex.indexOf('.') !== -1 || latex.indexOf(',') !== -1) && this.input) {\n this.input.clear();\n this.input.write(latex.replace(decimalRegex, ''));\n return;\n }\n\n onChange(latex);\n };\n\n /** Only render if the mathquill instance's latex is different\n * or the keypad state changed from one state to the other (shown / hidden) */\n shouldComponentUpdate(nextProps, nextState) {\n const inputIsDifferent = this.input.mathField.latex() !== nextProps.latex;\n log('[shouldComponentUpdate] ', 'inputIsDifferent: ', inputIsDifferent);\n\n if (!inputIsDifferent && this.props.keypadMode !== nextProps.keypadMode) {\n return true;\n }\n\n if (!inputIsDifferent && this.props.noDecimal !== nextProps.noDecimal) {\n return true;\n }\n\n if (!inputIsDifferent && this.state.equationEditor !== nextState.equationEditor) {\n return true;\n }\n\n if (!inputIsDifferent && this.props.controlledKeypad) {\n return this.props.showKeypad !== nextProps.showKeypad;\n }\n\n return inputIsDifferent;\n }\n\n onEditorTypeChange = evt => {\n this.setState({ equationEditor: evt.target.value });\n };\n\n render() {\n const {\n classNames,\n keypadMode,\n allowAnswerBlock,\n additionalKeys,\n controlledKeypad,\n controlledKeypadMode,\n showKeypad,\n noDecimal,\n latex,\n onFocus,\n onBlur,\n classes\n } = this.props;\n const shouldShowKeypad = !controlledKeypad || (controlledKeypad && showKeypad);\n\n log('[render]', latex);\n\n return (\n <div className={cx(classes.mathToolbar, classNames.mathToolbar)}>\n <div className={classes.inputAndTypeContainer}>\n {controlledKeypadMode && (\n <InputContainer label=\"Equation Editor\" className={classes.selectContainer}>\n <Select\n className={classes.select}\n onChange={this.onEditorTypeChange}\n value={this.state.equationEditor}\n >\n <MenuItem value={1}>Grade 1 - 2</MenuItem>\n <MenuItem value={3}>Grade 3 - 5</MenuItem>\n <MenuItem value={6}>Grade 6 - 7</MenuItem>\n <MenuItem value={8}>Grade 8 - HS</MenuItem>\n <MenuItem value={'geometry'}>Geometry</MenuItem>\n <MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>\n <MenuItem value={'statistics'}>Statistics</MenuItem>\n <MenuItem value={'miscellaneous'}>Miscellaneous</MenuItem>\n </Select>\n </InputContainer>\n )}\n <mq.Input\n onFocus={onFocus}\n onBlur={onBlur}\n className={cx(\n classes.mathEditor,\n classNames.editor,\n !controlledKeypadMode ? classes.longMathEditor : ''\n )}\n innerRef={r => (this.input = r)}\n latex={latex}\n onChange={this.onEditorChange}\n />\n </div>\n {allowAnswerBlock && (\n <Button\n className={classes.addAnswerBlockButton}\n type=\"primary\"\n style={{ bottom: shouldShowKeypad ? '320px' : '20px' }}\n onClick={this.onAnswerBlockClick}\n >\n + Response Area\n </Button>\n )}\n <hr className={classes.hr} />\n {shouldShowKeypad && (\n <HorizontalKeypad\n additionalKeys={additionalKeys}\n mode={controlledKeypadMode ? this.state.equationEditor : keypadMode}\n onClick={this.onClick}\n noDecimal={noDecimal}\n />\n )}\n </div>\n );\n }\n}\n\nconst styles = theme => ({\n inputAndTypeContainer: {\n display: 'flex',\n alignItems: 'center',\n '& *': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em',\n '&:before': {\n top: '-0.4em',\n left: '-1px'\n },\n '&:after': {\n top: '-2.36em',\n right: '-1px'\n },\n '&.mq-empty:after': {\n top: '-0.45em'\n }\n },\n '& .mq-overarrow.mq-arrow-right': {\n '&:before': {\n top: '-0.4em',\n right: '-1px'\n }\n }\n },\n selectContainer: {\n flex: 'initial',\n width: '25%',\n minWidth: '100px',\n marginLeft: '15px',\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n mathEditor: {\n maxWidth: '400px',\n color: color.text(),\n backgroundColor: color.background(),\n padding: theme.spacing.unit,\n marginTop: theme.spacing.unit,\n marginBottom: theme.spacing.unit\n },\n longMathEditor: {\n maxWidth: '500px'\n },\n addAnswerBlockButton: {\n position: 'absolute',\n right: '12px',\n border: '1px solid lightgrey'\n },\n hr: {\n padding: 0,\n margin: 0,\n height: '1px',\n border: 'none',\n borderBottom: `solid 1px ${theme.palette.primary.main}`\n },\n mathToolbar: {\n zIndex: 9,\n position: 'relative',\n textAlign: 'center',\n width: 'auto',\n '& > .mq-math-mode': {\n border: 'solid 1px lightgrey'\n },\n '& > .mq-focused': {\n outline: 'none',\n boxShadow: 'none',\n border: `dotted 1px ${theme.palette.primary.main}`,\n borderRadius: '0px'\n },\n '& .mq-overarrow-inner': {\n border: 'none !important',\n paddingTop: '0 !important'\n },\n '& .mq-overarrow-inner-right': {\n display: 'none !important'\n },\n '& .mq-overarrow-inner-left': {\n display: 'none !important'\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important'\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em'\n }\n }\n});\n\nexport default withStyles(styles)(EditorAndPad);\n"],"file":"editor-and-pad.js"}
|
|
1
|
+
{"version":3,"sources":["../src/editor-and-pad.jsx"],"names":["log","decimalRegex","toNodeData","data","type","value","EditorAndPad","props","noDecimal","c","input","clear","command","keystroke","write","onAnswerBlockAdd","onClick","latex","onChange","indexOf","replace","evt","setState","equationEditor","target","state","autoFocus","focus","nextProps","nextState","inputIsDifferent","mathField","keypadMode","controlledKeypad","showKeypad","classNames","allowAnswerBlock","additionalKeys","controlledKeypadMode","onFocus","onBlur","classes","shouldShowKeypad","mathToolbar","inputAndTypeContainer","selectContainer","select","onEditorTypeChange","mathEditor","editor","longMathEditor","r","onEditorChange","addAnswerBlockButton","bottom","onAnswerBlockClick","hr","React","Component","PropTypes","object","oneOfType","string","number","bool","array","isRequired","func","styles","theme","display","alignItems","fontFamily","minWidth","lineHeight","top","left","right","flex","width","marginLeft","marginTop","marginBottom","marginRight","maxWidth","color","text","backgroundColor","background","padding","spacing","unit","position","border","margin","height","borderBottom","palette","primary","main","zIndex","textAlign","outline","boxShadow","borderRadius","paddingTop","borderTop"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHA,IAAMA,GAAG,GAAG,uBAAM,sCAAN,CAAZ;AAMA,IAAMC,YAAY,GAAG,OAArB;;AAEA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAAAC,IAAI,EAAI;AACzB,MAAI,CAACA,IAAL,EAAW;AACT;AACD;;AAED,MAAQC,IAAR,GAAwBD,IAAxB,CAAQC,IAAR;AAAA,MAAcC,KAAd,GAAwBF,IAAxB,CAAcE,KAAd;;AAEA,MAAID,IAAI,KAAK,SAAT,IAAsBA,IAAI,KAA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S,EAAE,MAFM;AAGjBV,QAAAA,MAAM,uBAAgBxB,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBC,IAAtC,CAHW;AAIjBK,QAAAA,YAAY,EAAE;AAJG,OARR;AAcX,+BAAyB;AACvBX,QAAAA,MAAM,EAAE,iBADe;AAEvBY,QAAAA,UAAU,EAAE;AAFW,OAdd;AAkBX,qCAA+B;AAC7BnC,QAAAA,OAAO,EAAE;AADoB,OAlBpB;AAqBX,oCAA8B;AAC5BA,QAAAA,OAAO,EAAE;AADmB,OArBnB;AAwBX,6BAAuB;AACrBoC,QAAAA,SAAS,EAAE,sBADU;AAErBD,QAAAA,UAAU,EAAE;AAFS,OAxBZ;AA4BX,uCAAiC;AAC/BhC,QAAAA,QAAQ,EAAE;AADqB,OA5BtB;AA+BX,6BAAuB;AACrBC,QAAAA,UAAU,EAAE;AADS;AA/BZ;AA/DU,GAAL;AAAA,CAApB;;eAoGe,wBAAWN,MAAX,EAAmB9D,YAAnB,C","sourcesContent":["import { HorizontalKeypad, mq } from '@pie-lib/math-input';\nimport React from 'react';\nimport debug from 'debug';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport Button from '@material-ui/core/Button';\nimport { withStyles } from '@material-ui/core/styles';\nconst log = debug('@pie-lib:math-toolbar:editor-and-pad');\nimport { color, InputContainer } from '@pie-lib/render-ui';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport { updateSpans } from '@pie-lib/math-input';\n\nconst decimalRegex = /\\.|,/g;\n\nconst toNodeData = data => {\n if (!data) {\n return;\n }\n\n const { type, value } = data;\n\n if (type === 'command' || type === 'cursor') {\n return data;\n } else if (type === 'answer') {\n return { type: 'answer', ...data };\n } else if (value === 'clear') {\n return { type: 'clear' };\n } else {\n return { type: 'write', value };\n }\n};\n\nexport class EditorAndPad extends React.Component {\n static propTypes = {\n classNames: PropTypes.object,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n autoFocus: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n showKeypad: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array,\n latex: PropTypes.string.isRequired,\n onAnswerBlockAdd: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n classes: PropTypes.object\n };\n\n constructor(props) {\n super(props);\n\n this.state = { equationEditor: 'item-authoring' };\n }\n\n componentDidMount() {\n if (this.input && this.props.autoFocus) {\n this.input.focus();\n }\n }\n\n onClick = data => {\n const { noDecimal } = this.props;\n const c = toNodeData(data);\n log('mathChange: ', c);\n\n // if decimals are not allowed for this response, we discard the input\n if (noDecimal && (c.value === '.' || c.value === ',')) {\n return;\n }\n\n if (c.type === 'clear') {\n log('call clear...');\n this.input.clear();\n } else if (c.type === 'command') {\n this.input.command(c.value);\n } else if (c.type === 'cursor') {\n this.input.keystroke(c.value);\n } else if (c.type === 'answer') {\n this.input.write('%response%');\n } else {\n this.input.write(c.value);\n }\n };\n\n onAnswerBlockClick = () => {\n this.props.onAnswerBlockAdd();\n this.onClick({\n type: 'answer'\n });\n };\n\n onEditorChange = latex => {\n const { onChange, noDecimal } = this.props;\n\n updateSpans();\n\n // if no decimals are allowed and the last change is a decimal dot, discard the change\n if (noDecimal && (latex.indexOf('.') !== -1 || latex.indexOf(',') !== -1) && this.input) {\n this.input.clear();\n this.input.write(latex.replace(decimalRegex, ''));\n return;\n }\n\n onChange(latex);\n };\n\n /** Only render if the mathquill instance's latex is different\n * or the keypad state changed from one state to the other (shown / hidden) */\n shouldComponentUpdate(nextProps, nextState) {\n const inputIsDifferent = this.input.mathField.latex() !== nextProps.latex;\n log('[shouldComponentUpdate] ', 'inputIsDifferent: ', inputIsDifferent);\n\n if (!inputIsDifferent && this.props.keypadMode !== nextProps.keypadMode) {\n return true;\n }\n\n if (!inputIsDifferent && this.props.noDecimal !== nextProps.noDecimal) {\n return true;\n }\n\n if (!inputIsDifferent && this.state.equationEditor !== nextState.equationEditor) {\n return true;\n }\n\n if (!inputIsDifferent && this.props.controlledKeypad) {\n return this.props.showKeypad !== nextProps.showKeypad;\n }\n\n return inputIsDifferent;\n }\n\n onEditorTypeChange = evt => {\n this.setState({ equationEditor: evt.target.value });\n };\n\n render() {\n const {\n classNames,\n keypadMode,\n allowAnswerBlock,\n additionalKeys,\n controlledKeypad,\n controlledKeypadMode,\n showKeypad,\n noDecimal,\n latex,\n onFocus,\n onBlur,\n classes\n } = this.props;\n const shouldShowKeypad = !controlledKeypad || (controlledKeypad && showKeypad);\n\n log('[render]', latex);\n\n return (\n <div className={cx(classes.mathToolbar, classNames.mathToolbar)}>\n <div className={classes.inputAndTypeContainer}>\n {controlledKeypadMode && (\n <InputContainer label=\"Equation Editor\" className={classes.selectContainer}>\n <Select\n className={classes.select}\n onChange={this.onEditorTypeChange}\n value={this.state.equationEditor}\n >\n <MenuItem value=\"non-negative-integers\">Numeric - Non-Negative Integers</MenuItem>\n <MenuItem value=\"integers\">Numeric - Integers</MenuItem>\n <MenuItem value=\"decimals\">Numeric - Decimals</MenuItem>\n <MenuItem value=\"fractions\">Numeric - Fractions</MenuItem>\n <MenuItem value={1}>Grade 1 - 2</MenuItem>\n <MenuItem value={3}>Grade 3 - 5</MenuItem>\n <MenuItem value={6}>Grade 6 - 7</MenuItem>\n <MenuItem value={8}>Grade 8 - HS</MenuItem>\n <MenuItem value={'geometry'}>Geometry</MenuItem>\n <MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>\n <MenuItem value={'statistics'}>Statistics</MenuItem>\n <MenuItem value={'item-authoring'}>Item Authoring</MenuItem>\n </Select>\n </InputContainer>\n )}\n <mq.Input\n onFocus={onFocus}\n onBlur={onBlur}\n className={cx(\n classes.mathEditor,\n classNames.editor,\n !controlledKeypadMode ? classes.longMathEditor : ''\n )}\n innerRef={r => (this.input = r)}\n latex={latex}\n onChange={this.onEditorChange}\n />\n </div>\n {allowAnswerBlock && (\n <Button\n className={classes.addAnswerBlockButton}\n type=\"primary\"\n style={{ bottom: shouldShowKeypad ? '320px' : '20px' }}\n onClick={this.onAnswerBlockClick}\n >\n + Response Area\n </Button>\n )}\n <hr className={classes.hr} />\n {shouldShowKeypad && (\n <HorizontalKeypad\n additionalKeys={additionalKeys}\n mode={controlledKeypadMode ? this.state.equationEditor : keypadMode}\n onClick={this.onClick}\n noDecimal={noDecimal}\n />\n )}\n </div>\n );\n }\n}\n\nconst styles = theme => ({\n inputAndTypeContainer: {\n display: 'flex',\n alignItems: 'center',\n '& *': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em',\n '& *': {\n lineHeight: '1 !important'\n },\n '&:before': {\n top: '-0.4em',\n left: '-1px'\n },\n '&:after': {\n top: '-2.36em',\n right: '-1px'\n },\n '&.mq-empty:after': {\n top: '-0.45em'\n }\n },\n '& .mq-overarrow.mq-arrow-right': {\n '&:before': {\n top: '-0.4em',\n right: '-1px'\n }\n }\n },\n selectContainer: {\n flex: 'initial',\n width: '25%',\n minWidth: '100px',\n marginLeft: '15px',\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n mathEditor: {\n maxWidth: '400px',\n color: color.text(),\n backgroundColor: color.background(),\n padding: theme.spacing.unit,\n marginTop: theme.spacing.unit,\n marginBottom: theme.spacing.unit\n },\n longMathEditor: {\n maxWidth: '500px'\n },\n addAnswerBlockButton: {\n position: 'absolute',\n right: '12px',\n border: '1px solid lightgrey'\n },\n hr: {\n padding: 0,\n margin: 0,\n height: '1px',\n border: 'none',\n borderBottom: `solid 1px ${theme.palette.primary.main}`\n },\n mathToolbar: {\n zIndex: 9,\n position: 'relative',\n textAlign: 'center',\n width: 'auto',\n '& > .mq-math-mode': {\n border: 'solid 1px lightgrey'\n },\n '& > .mq-focused': {\n outline: 'none',\n boxShadow: 'none',\n border: `dotted 1px ${theme.palette.primary.main}`,\n borderRadius: '0px'\n },\n '& .mq-overarrow-inner': {\n border: 'none !important',\n paddingTop: '0 !important'\n },\n '& .mq-overarrow-inner-right': {\n display: 'none !important'\n },\n '& .mq-overarrow-inner-left': {\n display: 'none !important'\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important'\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em'\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85\n }\n }\n});\n\nexport default withStyles(styles)(EditorAndPad);\n"],"file":"editor-and-pad.js"}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -9,7 +11,7 @@ Object.defineProperty(exports, "MathPreview", {
|
|
|
9
11
|
return _mathPreview["default"];
|
|
10
12
|
}
|
|
11
13
|
});
|
|
12
|
-
exports.
|
|
14
|
+
exports.RawPureToolbar = exports.PureToolbar = exports.MathToolbar = void 0;
|
|
13
15
|
|
|
14
16
|
var _react = _interopRequireDefault(require("react"));
|
|
15
17
|
|
|
@@ -27,37 +29,39 @@ var _mathPreview = _interopRequireDefault(require("./math-preview"));
|
|
|
27
29
|
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
31
|
|
|
30
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
31
|
-
|
|
32
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
33
|
|
|
34
34
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
35
|
|
|
36
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
39
|
|
|
40
|
-
function
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
+
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
|
+
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
41
45
|
|
|
42
46
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
47
|
|
|
44
|
-
function
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
49
|
|
|
46
|
-
function
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
51
|
|
|
48
52
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
49
53
|
|
|
50
|
-
var MathToolbar =
|
|
51
|
-
/*#__PURE__*/
|
|
52
|
-
function (_React$Component) {
|
|
54
|
+
var MathToolbar = /*#__PURE__*/function (_React$Component) {
|
|
53
55
|
_inherits(MathToolbar, _React$Component);
|
|
54
56
|
|
|
57
|
+
var _super = _createSuper(MathToolbar);
|
|
58
|
+
|
|
55
59
|
function MathToolbar(props) {
|
|
56
60
|
var _this;
|
|
57
61
|
|
|
58
62
|
_classCallCheck(this, MathToolbar);
|
|
59
63
|
|
|
60
|
-
_this =
|
|
64
|
+
_this = _super.call(this, props);
|
|
61
65
|
|
|
62
66
|
_defineProperty(_assertThisInitialized(_this), "done", function () {
|
|
63
67
|
_this.props.onDone(_this.state.latex);
|
|
@@ -102,7 +106,7 @@ function (_React$Component) {
|
|
|
102
106
|
onFocus = _this$props.onFocus,
|
|
103
107
|
onBlur = _this$props.onBlur,
|
|
104
108
|
hideDoneButton = _this$props.hideDoneButton;
|
|
105
|
-
return _react["default"].createElement(PureToolbar, {
|
|
109
|
+
return /*#__PURE__*/_react["default"].createElement(PureToolbar, {
|
|
106
110
|
autoFocus: autoFocus,
|
|
107
111
|
classNames: classNames,
|
|
108
112
|
onAnswerBlockAdd: onAnswerBlockAdd,
|
|
@@ -149,7 +153,7 @@ _defineProperty(MathToolbar, "propTypes", {
|
|
|
149
153
|
|
|
150
154
|
_defineProperty(MathToolbar, "defaultProps", {
|
|
151
155
|
classNames: {},
|
|
152
|
-
keypadMode: '
|
|
156
|
+
keypadMode: 'item-authoring',
|
|
153
157
|
autoFocus: false,
|
|
154
158
|
allowAnswerBlock: false,
|
|
155
159
|
controlledKeypad: false,
|
|
@@ -163,15 +167,15 @@ _defineProperty(MathToolbar, "defaultProps", {
|
|
|
163
167
|
hideDoneButton: false
|
|
164
168
|
});
|
|
165
169
|
|
|
166
|
-
var RawPureToolbar =
|
|
167
|
-
/*#__PURE__*/
|
|
168
|
-
function (_React$Component2) {
|
|
170
|
+
var RawPureToolbar = /*#__PURE__*/function (_React$Component2) {
|
|
169
171
|
_inherits(RawPureToolbar, _React$Component2);
|
|
170
172
|
|
|
173
|
+
var _super2 = _createSuper(RawPureToolbar);
|
|
174
|
+
|
|
171
175
|
function RawPureToolbar() {
|
|
172
176
|
_classCallCheck(this, RawPureToolbar);
|
|
173
177
|
|
|
174
|
-
return
|
|
178
|
+
return _super2.apply(this, arguments);
|
|
175
179
|
}
|
|
176
180
|
|
|
177
181
|
_createClass(RawPureToolbar, [{
|
|
@@ -195,9 +199,9 @@ function (_React$Component2) {
|
|
|
195
199
|
onBlur = _this$props2.onBlur,
|
|
196
200
|
hideDoneButton = _this$props2.hideDoneButton,
|
|
197
201
|
classes = _this$props2.classes;
|
|
198
|
-
return _react["default"].createElement("div", {
|
|
202
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
199
203
|
className: (0, _classnames["default"])(classes.pureToolbar, (classNames || {}).toolbar)
|
|
200
|
-
}, _react["default"].createElement("div", null), _react["default"].createElement(_editorAndPad["default"], {
|
|
204
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null), /*#__PURE__*/_react["default"].createElement(_editorAndPad["default"], {
|
|
201
205
|
autoFocus: autoFocus,
|
|
202
206
|
keypadMode: keypadMode,
|
|
203
207
|
classNames: classNames || {},
|
|
@@ -212,7 +216,7 @@ function (_React$Component2) {
|
|
|
212
216
|
onChange: onChange,
|
|
213
217
|
onFocus: onFocus,
|
|
214
218
|
onBlur: onBlur
|
|
215
|
-
}), (!controlledKeypad || controlledKeypad && showKeypad) && !hideDoneButton && _react["default"].createElement(_doneButton.DoneButton, {
|
|
219
|
+
}), (!controlledKeypad || controlledKeypad && showKeypad) && !hideDoneButton && /*#__PURE__*/_react["default"].createElement(_doneButton.DoneButton, {
|
|
216
220
|
onClick: onDone
|
|
217
221
|
}));
|
|
218
222
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.jsx"],"names":["MathToolbar","props","onDone","state","latex","setState","onChange","nextProps","classNames","autoFocus","allowAnswerBlock","onAnswerBlockAdd","controlledKeypad","controlledKeypadMode","keypadMode","noDecimal","additionalKeys","showKeypad","onFocus","onBlur","hideDoneButton","done","React","Component","PropTypes","bool","oneOfType","string","number","object","array","isRequired","func","RawPureToolbar","classes","pureToolbar","toolbar","styles","display","width","zIndex","alignItems","PureToolbar"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;IAIaA,W;;;;;AAoCX,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,qFAAMA,KAAN;;AADiB,2DAOZ,YAAM;AACX,YAAKA,KAAL,CAAWC,MAAX,CAAkB,MAAKC,KAAL,CAAWC,KAA7B;AACD,KATkB;;AAAA,+DAeR,UAAAA,KAAK,EAA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A,gBAAgB,EAAEY,sBAAUC,IAdX;AAejBZ,EAAAA,oBAAoB,EAAEW,sBAAUC,IAff;AAgBjBR,EAAAA,UAAU,EAAEO,sBAAUC,IAhBL;AAiBjBL,EAAAA,cAAc,EAAEI,sBAAUC;AAjBT,C;;AAmErB,IAAMY,MAAM,GAAG,SAATA,MAAS;AAAA,SAAO;AACpBF,IAAAA,WAAW,EAAE;AACXG,MAAAA,OAAO,EAAE,MADE;AAEXC,MAAAA,KAAK,EAAE,MAFI;AAGXC,MAAAA,MAAM,EAAE,CAHG;AAIXC,MAAAA,UAAU,EAAE;AAJD;AADO,GAAP;AAAA,CAAf;;AASO,IAAMC,WAAW,GAAG,wBAAWL,MAAX,EAAmBJ,cAAnB,CAApB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport EditorAndPad from './editor-and-pad';\nimport { DoneButton } from './done-button';\nimport { withStyles } from '@material-ui/core/styles';\nimport MathPreview from './math-preview';\n\nexport { MathPreview };\n\nexport class MathToolbar extends React.Component {\n static propTypes = {\n autoFocus: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n classNames: PropTypes.object,\n showKeypad: PropTypes.bool,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array,\n latex: PropTypes.string.isRequired,\n onAnswerBlockAdd: PropTypes.func,\n onChange: PropTypes.func,\n onDone: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n hideDoneButton: PropTypes.bool\n };\n\n static defaultProps = {\n classNames: {},\n keypadMode: 'miscellaneous',\n autoFocus: false,\n allowAnswerBlock: false,\n controlledKeypad: false,\n controlledKeypadMode: false,\n noDecimal: false,\n showKeypad: true,\n additionalKeys: [],\n onChange: () => {},\n onAnswerBlockAdd: () => {},\n onFocus: () => {},\n hideDoneButton: false\n };\n\n constructor(props) {\n super(props);\n this.state = {\n latex: props.latex\n };\n }\n\n done = () => {\n this.props.onDone(this.state.latex);\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n this.setState({ latex: nextProps.latex });\n }\n\n onChange = latex => {\n this.setState({ latex });\n this.props.onChange(latex);\n };\n\n render() {\n const { latex } = this.state;\n const {\n classNames,\n autoFocus,\n allowAnswerBlock,\n onAnswerBlockAdd,\n controlledKeypad,\n controlledKeypadMode,\n keypadMode,\n noDecimal,\n additionalKeys,\n showKeypad,\n onFocus,\n onBlur,\n hideDoneButton\n } = this.props;\n\n return (\n <PureToolbar\n autoFocus={autoFocus}\n classNames={classNames}\n onAnswerBlockAdd={onAnswerBlockAdd}\n allowAnswerBlock={allowAnswerBlock}\n latex={latex}\n additionalKeys={additionalKeys}\n noDecimal={noDecimal}\n keypadMode={keypadMode}\n onChange={this.onChange}\n onDone={this.done}\n onFocus={onFocus}\n onBlur={onBlur}\n showKeypad={showKeypad}\n controlledKeypad={controlledKeypad}\n controlledKeypadMode={controlledKeypadMode}\n hideDoneButton={hideDoneButton}\n />\n );\n }\n}\n\nexport class RawPureToolbar extends React.Component {\n static propTypes = {\n classNames: PropTypes.object,\n latex: PropTypes.string.isRequired,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onChange: PropTypes.func.isRequired,\n onDone: PropTypes.func.isRequired,\n onBlur: PropTypes.func,\n onAnswerBlockAdd: PropTypes.func,\n additionalKeys: PropTypes.array,\n onFocus: PropTypes.func,\n classes: PropTypes.object.isRequired,\n autoFocus: PropTypes.bool,\n noDecimal: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n showKeypad: PropTypes.bool,\n hideDoneButton: PropTypes.bool\n };\n\n render() {\n const {\n classNames,\n autoFocus,\n allowAnswerBlock,\n onAnswerBlockAdd,\n controlledKeypad,\n controlledKeypadMode,\n additionalKeys,\n showKeypad,\n keypadMode,\n noDecimal,\n latex,\n onChange,\n onDone,\n onFocus,\n onBlur,\n hideDoneButton,\n classes\n } = this.props;\n\n return (\n <div className={cx(classes.pureToolbar, (classNames || {}).toolbar)}>\n <div />\n <EditorAndPad\n autoFocus={autoFocus}\n keypadMode={keypadMode}\n classNames={classNames || {}}\n controlledKeypad={controlledKeypad}\n controlledKeypadMode={controlledKeypadMode}\n noDecimal={noDecimal}\n showKeypad={showKeypad}\n additionalKeys={additionalKeys}\n allowAnswerBlock={allowAnswerBlock}\n onAnswerBlockAdd={onAnswerBlockAdd}\n latex={latex}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n {(!controlledKeypad || (controlledKeypad && showKeypad)) && !hideDoneButton && (\n <DoneButton onClick={onDone} />\n )}\n </div>\n );\n }\n}\nconst styles = () => ({\n pureToolbar: {\n display: 'flex',\n width: '100%',\n zIndex: 8,\n alignItems: 'center'\n }\n});\n\nexport const PureToolbar = withStyles(styles)(RawPureToolbar);\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../src/index.jsx"],"names":["MathToolbar","props","onDone","state","latex","setState","onChange","nextProps","classNames","autoFocus","allowAnswerBlock","onAnswerBlockAdd","controlledKeypad","controlledKeypadMode","keypadMode","noDecimal","additionalKeys","showKeypad","onFocus","onBlur","hideDoneButton","done","React","Component","PropTypes","bool","oneOfType","string","number","object","array","isRequired","func","RawPureToolbar","classes","pureToolbar","toolbar","styles","display","width","zIndex","alignItems","PureToolbar"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAIaA,W;;;;;AAoCX,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,8BAAMA,KAAN;;AADiB,2DAOZ,YAAM;AACX,YAAKA,KAAL,CAAWC,MAAX,CAAkB,MAAKC,KAAL,CAAWC,KAA7B;AACD,KATkB;;AAAA,+DAeR,UAAAA,KAAK,EAA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,sBAAUC,IAbX;AAcjBb,EAAAA,gBAAgB,EAAEY,sBAAUC,IAdX;AAejBZ,EAAAA,oBAAoB,EAAEW,sBAAUC,IAff;AAgBjBR,EAAAA,UAAU,EAAEO,sBAAUC,IAhBL;AAiBjBL,EAAAA,cAAc,EAAEI,sBAAUC;AAjBT,C;;AAmErB,IAAMY,MAAM,GAAG,SAATA,MAAS;AAAA,SAAO;AACpBF,IAAAA,WAAW,EAAE;AACXG,MAAAA,OAAO,EAAE,MADE;AAEXC,MAAAA,KAAK,EAAE,MAFI;AAGXC,MAAAA,MAAM,EAAE,CAHG;AAIXC,MAAAA,UAAU,EAAE;AAJD;AADO,GAAP;AAAA,CAAf;;AASO,IAAMC,WAAW,GAAG,wBAAWL,MAAX,EAAmBJ,cAAnB,CAApB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport EditorAndPad from './editor-and-pad';\nimport { DoneButton } from './done-button';\nimport { withStyles } from '@material-ui/core/styles';\nimport MathPreview from './math-preview';\n\nexport { MathPreview };\n\nexport class MathToolbar extends React.Component {\n static propTypes = {\n autoFocus: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n classNames: PropTypes.object,\n showKeypad: PropTypes.bool,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array,\n latex: PropTypes.string.isRequired,\n onAnswerBlockAdd: PropTypes.func,\n onChange: PropTypes.func,\n onDone: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n hideDoneButton: PropTypes.bool\n };\n\n static defaultProps = {\n classNames: {},\n keypadMode: 'item-authoring',\n autoFocus: false,\n allowAnswerBlock: false,\n controlledKeypad: false,\n controlledKeypadMode: false,\n noDecimal: false,\n showKeypad: true,\n additionalKeys: [],\n onChange: () => {},\n onAnswerBlockAdd: () => {},\n onFocus: () => {},\n hideDoneButton: false\n };\n\n constructor(props) {\n super(props);\n this.state = {\n latex: props.latex\n };\n }\n\n done = () => {\n this.props.onDone(this.state.latex);\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n this.setState({ latex: nextProps.latex });\n }\n\n onChange = latex => {\n this.setState({ latex });\n this.props.onChange(latex);\n };\n\n render() {\n const { latex } = this.state;\n const {\n classNames,\n autoFocus,\n allowAnswerBlock,\n onAnswerBlockAdd,\n controlledKeypad,\n controlledKeypadMode,\n keypadMode,\n noDecimal,\n additionalKeys,\n showKeypad,\n onFocus,\n onBlur,\n hideDoneButton\n } = this.props;\n\n return (\n <PureToolbar\n autoFocus={autoFocus}\n classNames={classNames}\n onAnswerBlockAdd={onAnswerBlockAdd}\n allowAnswerBlock={allowAnswerBlock}\n latex={latex}\n additionalKeys={additionalKeys}\n noDecimal={noDecimal}\n keypadMode={keypadMode}\n onChange={this.onChange}\n onDone={this.done}\n onFocus={onFocus}\n onBlur={onBlur}\n showKeypad={showKeypad}\n controlledKeypad={controlledKeypad}\n controlledKeypadMode={controlledKeypadMode}\n hideDoneButton={hideDoneButton}\n />\n );\n }\n}\n\nexport class RawPureToolbar extends React.Component {\n static propTypes = {\n classNames: PropTypes.object,\n latex: PropTypes.string.isRequired,\n keypadMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onChange: PropTypes.func.isRequired,\n onDone: PropTypes.func.isRequired,\n onBlur: PropTypes.func,\n onAnswerBlockAdd: PropTypes.func,\n additionalKeys: PropTypes.array,\n onFocus: PropTypes.func,\n classes: PropTypes.object.isRequired,\n autoFocus: PropTypes.bool,\n noDecimal: PropTypes.bool,\n allowAnswerBlock: PropTypes.bool,\n controlledKeypad: PropTypes.bool,\n controlledKeypadMode: PropTypes.bool,\n showKeypad: PropTypes.bool,\n hideDoneButton: PropTypes.bool\n };\n\n render() {\n const {\n classNames,\n autoFocus,\n allowAnswerBlock,\n onAnswerBlockAdd,\n controlledKeypad,\n controlledKeypadMode,\n additionalKeys,\n showKeypad,\n keypadMode,\n noDecimal,\n latex,\n onChange,\n onDone,\n onFocus,\n onBlur,\n hideDoneButton,\n classes\n } = this.props;\n\n return (\n <div className={cx(classes.pureToolbar, (classNames || {}).toolbar)}>\n <div />\n <EditorAndPad\n autoFocus={autoFocus}\n keypadMode={keypadMode}\n classNames={classNames || {}}\n controlledKeypad={controlledKeypad}\n controlledKeypadMode={controlledKeypadMode}\n noDecimal={noDecimal}\n showKeypad={showKeypad}\n additionalKeys={additionalKeys}\n allowAnswerBlock={allowAnswerBlock}\n onAnswerBlockAdd={onAnswerBlockAdd}\n latex={latex}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n {(!controlledKeypad || (controlledKeypad && showKeypad)) && !hideDoneButton && (\n <DoneButton onClick={onDone} />\n )}\n </div>\n );\n }\n}\nconst styles = () => ({\n pureToolbar: {\n display: 'flex',\n width: '100%',\n zIndex: 8,\n alignItems: 'center'\n }\n});\n\nexport const PureToolbar = withStyles(styles)(RawPureToolbar);\n"],"file":"index.js"}
|
package/lib/math-preview.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -19,37 +21,39 @@ var _mathInput = require("@pie-lib/math-input");
|
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
23
|
|
|
22
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
23
|
-
|
|
24
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
25
|
|
|
26
26
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
27
27
|
|
|
28
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
29
|
|
|
30
|
-
function
|
|
30
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
35
|
|
|
36
|
-
function
|
|
36
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
+
|
|
40
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
+
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
43
|
|
|
40
44
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
45
|
|
|
42
46
|
var log = (0, _debug["default"])('@pie-lib:math-toolbar:math-preview');
|
|
43
47
|
|
|
44
|
-
var RawMathPreview =
|
|
45
|
-
/*#__PURE__*/
|
|
46
|
-
function (_React$Component) {
|
|
48
|
+
var RawMathPreview = /*#__PURE__*/function (_React$Component) {
|
|
47
49
|
_inherits(RawMathPreview, _React$Component);
|
|
48
50
|
|
|
51
|
+
var _super = _createSuper(RawMathPreview);
|
|
52
|
+
|
|
49
53
|
function RawMathPreview() {
|
|
50
54
|
_classCallCheck(this, RawMathPreview);
|
|
51
55
|
|
|
52
|
-
return
|
|
56
|
+
return _super.apply(this, arguments);
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
_createClass(RawMathPreview, [{
|
|
@@ -62,11 +66,11 @@ function (_React$Component) {
|
|
|
62
66
|
isSelected = _this$props.isSelected,
|
|
63
67
|
onFocus = _this$props.onFocus,
|
|
64
68
|
onBlur = _this$props.onBlur;
|
|
65
|
-
return _react["default"].createElement("div", {
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
70
|
className: (0, _classnames["default"])(classes.root, isSelected && classes.selected)
|
|
67
|
-
}, ' ', _react["default"].createElement("span", {
|
|
71
|
+
}, ' ', /*#__PURE__*/_react["default"].createElement("span", {
|
|
68
72
|
className: classes.insideOverlay
|
|
69
|
-
}), _react["default"].createElement(_mathInput.mq.Static, {
|
|
73
|
+
}), /*#__PURE__*/_react["default"].createElement(_mathInput.mq.Static, {
|
|
70
74
|
latex: latex,
|
|
71
75
|
onFocus: onFocus,
|
|
72
76
|
onBlur: onBlur
|
|
@@ -112,6 +116,9 @@ var mp = function mp(theme) {
|
|
|
112
116
|
},
|
|
113
117
|
'& .mq-overarrow.mq-arrow-both': {
|
|
114
118
|
minWidth: '1.23em',
|
|
119
|
+
'& *': {
|
|
120
|
+
lineHeight: '1 !important'
|
|
121
|
+
},
|
|
115
122
|
'&:before': {
|
|
116
123
|
top: '-0.4em',
|
|
117
124
|
left: '-1px'
|
|
@@ -139,6 +146,9 @@ var mp = function mp(theme) {
|
|
|
139
146
|
'& .mq-longdiv-inner': {
|
|
140
147
|
borderTop: '1px solid !important',
|
|
141
148
|
paddingTop: '1.5px !important'
|
|
149
|
+
},
|
|
150
|
+
'& .mq-parallelogram': {
|
|
151
|
+
lineHeight: 0.85
|
|
142
152
|
}
|
|
143
153
|
},
|
|
144
154
|
selected: {
|
package/lib/math-preview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math-preview.jsx"],"names":["log","RawMathPreview","props","node","data","latex","get","classes","isSelected","onFocus","onBlur","root","selected","insideOverlay","React","Component","PropTypes","string","object","bool","func","mp","theme","display","alignItems","position","border","outline","boxShadow","borderRadius","fontFamily","paddingTop","minWidth","top","left","right","borderTop","palette","primary","main","bottom"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/math-preview.jsx"],"names":["log","RawMathPreview","props","node","data","latex","get","classes","isSelected","onFocus","onBlur","root","selected","insideOverlay","React","Component","PropTypes","string","object","bool","func","mp","theme","display","alignItems","position","border","outline","boxShadow","borderRadius","fontFamily","paddingTop","minWidth","lineHeight","top","left","right","borderTop","palette","primary","main","bottom"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,oCAAN,CAAZ;;IAEaC,c;;;;;;;;;;;;;WAUX,kBAAS;AACPD,MAAAA,GAAG,CAAC,iBAAD,EAAoB,KAAKE,KAAL,CAAWC,IAAX,CAAgBC,IAApC,CAAH;AACA,UAAMC,KAAK,GAAG,KAAKH,KAAL,CAAWC,IAAX,CAAgBC,IAAhB,CAAqBE,GAArB,CAAyB,OAAzB,CAAd;AACA,wBAAiD,KAAKJ,KAAtD;AAAA,UAAQK,OAAR,eAAQA,OAAR;AAAA,UAAiBC,UAAjB,eAAiBA,UAAjB;AAAA,UAA6BC,OAA7B,eAA6BA,OAA7B;AAAA,UAAsCC,MAAtC,eAAsCA,MAAtC;AACA,0BACE;AAAK,QAAA,SAAS,EAAE,4BAAWH,OAAO,CAACI,IAAnB,EAAyBH,UAAU,IAAID,OAAO,CAACK,QAA/C;AAAhB,SACG,GADH,eAEE;AAAM,QAAA,SAAS,EAAEL,OAAO,CAACM;AAAzB,QAFF,eAGE,gCAAC,aAAD,CAAI,MAAJ;AAAW,QAAA,KAAK,EAAER,KAAlB;AAAyB,QAAA,OAAO,EAAEI,OAAlC;AAA2C,QAAA,MAAM,EAAEC;AAAnD,QAHF,CADF;AAOD;;;;EArBiCI,kBAAMC,S;;;;gBAA7Bd,c,eACQ;AACjBI,EAAAA,KAAK,EAAEW,sBAAUC,MADA;AAEjBd,EAAAA,IAA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8CJ,oCAA8B;AAC5BA,QAAAA,OAAO,EAAE;AADmB,OA9C1B;AAiDJ,6BAAuB;AACrBc,QAAAA,SAAS,EAAE,sBADU;AAErBN,QAAAA,UAAU,EAAE;AAFS,OAjDnB;AAqDJ,6BAAuB;AACrBE,QAAAA,UAAU,EAAE;AADS;AArDnB,KADa;AA0DnBrB,IAAAA,QAAQ,EAAE;AACRc,MAAAA,MAAM,sBAAeJ,KAAK,CAACgB,OAAN,CAAcC,OAAd,CAAsBC,IAArC,CADE;AAER,2BAAqB;AACnBd,QAAAA,MAAM,EAAE;AADW;AAFb,KA1DS;AAgEnBb,IAAAA,aAAa,EAAE;AACbY,MAAAA,QAAQ,EAAE,UADG;AAEbgB,MAAAA,MAAM,EAAE,CAFK;AAGbN,MAAAA,IAAI,EAAE,CAHO;AAIbC,MAAAA,KAAK,EAAE,CAJM;AAKbF,MAAAA,GAAG,EAAE;AALQ;AAhEI,GAAL;AAAA,CAAhB;;eAyEe,wBAAWb,EAAX,EAAepB,cAAf,C","sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport debug from 'debug';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\nimport { mq } from '@pie-lib/math-input';\n\nconst log = debug('@pie-lib:math-toolbar:math-preview');\n\nexport class RawMathPreview extends React.Component {\n static propTypes = {\n latex: PropTypes.string,\n node: PropTypes.object,\n classes: PropTypes.object,\n isSelected: PropTypes.bool,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func\n };\n\n render() {\n log('[render] data: ', this.props.node.data);\n const latex = this.props.node.data.get('latex');\n const { classes, isSelected, onFocus, onBlur } = this.props;\n return (\n <div className={classNames(classes.root, isSelected && classes.selected)}>\n {' '}\n <span className={classes.insideOverlay} />\n <mq.Static latex={latex} onFocus={onFocus} onBlur={onBlur} />\n </div>\n );\n }\n}\n\nconst mp = theme => ({\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n position: 'relative',\n '& > .mq-math-mode': {\n border: 'solid 1px lightgrey'\n },\n '& > .mq-focused': {\n outline: 'none',\n boxShadow: 'none',\n border: 'solid 1px black',\n borderRadius: '0px'\n },\n '& *': {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important'\n },\n '& .mq-overarrow-inner': {\n paddingTop: '0 !important',\n border: 'none !important'\n },\n '& .mq-overarrow.mq-arrow-both': {\n minWidth: '1.23em',\n '& *': {\n lineHeight: '1 !important'\n },\n '&:before': {\n top: '-0.4em',\n left: '-1px'\n },\n '&:after': {\n top: '-2.36em',\n right: '-1px'\n },\n '&.mq-empty:after': {\n top: '-0.45em'\n }\n },\n '& .mq-overarrow.mq-arrow-right': {\n '&:before': {\n top: '-0.4em',\n right: '-1px'\n }\n },\n '& .mq-overarrow-inner-right': {\n display: 'none !important'\n },\n '& .mq-overarrow-inner-left': {\n display: 'none !important'\n },\n '& .mq-longdiv-inner': {\n borderTop: '1px solid !important',\n paddingTop: '1.5px !important'\n },\n '& .mq-parallelogram': {\n lineHeight: 0.85\n }\n },\n selected: {\n border: `solid 1px ${theme.palette.primary.main}`,\n '& > .mq-math-mode': {\n border: 'solid 0px lightgrey'\n }\n },\n insideOverlay: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n top: 0\n }\n});\n\nexport default withStyles(mp)(RawMathPreview);\n"],"file":"math-preview.js"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.1-next.224+22dc9c41",
|
|
7
7
|
"description": "Math toolbar for editing math equations",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"math",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@material-ui/core": "^3.8.3",
|
|
21
21
|
"@material-ui/icons": "^3.0.2",
|
|
22
|
-
"@pie-lib/math-input": "^6.6.
|
|
22
|
+
"@pie-lib/math-input": "^6.6.1-next.224+22dc9c41",
|
|
23
23
|
"classnames": "^2.2.6",
|
|
24
24
|
"debug": "^4.1.1",
|
|
25
25
|
"keycode": "^2.2.0"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"@pie-lib/test-utils": "^0.2.19"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "22dc9c41eb55defc603cbf89e58cfae81c667a26"
|
|
36
36
|
}
|
package/src/editor-and-pad.jsx
CHANGED
|
@@ -53,7 +53,7 @@ export class EditorAndPad extends React.Component {
|
|
|
53
53
|
constructor(props) {
|
|
54
54
|
super(props);
|
|
55
55
|
|
|
56
|
-
this.state = { equationEditor:
|
|
56
|
+
this.state = { equationEditor: 'item-authoring' };
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
componentDidMount() {
|
|
@@ -166,6 +166,10 @@ export class EditorAndPad extends React.Component {
|
|
|
166
166
|
onChange={this.onEditorTypeChange}
|
|
167
167
|
value={this.state.equationEditor}
|
|
168
168
|
>
|
|
169
|
+
<MenuItem value="non-negative-integers">Numeric - Non-Negative Integers</MenuItem>
|
|
170
|
+
<MenuItem value="integers">Numeric - Integers</MenuItem>
|
|
171
|
+
<MenuItem value="decimals">Numeric - Decimals</MenuItem>
|
|
172
|
+
<MenuItem value="fractions">Numeric - Fractions</MenuItem>
|
|
169
173
|
<MenuItem value={1}>Grade 1 - 2</MenuItem>
|
|
170
174
|
<MenuItem value={3}>Grade 3 - 5</MenuItem>
|
|
171
175
|
<MenuItem value={6}>Grade 6 - 7</MenuItem>
|
|
@@ -173,7 +177,7 @@ export class EditorAndPad extends React.Component {
|
|
|
173
177
|
<MenuItem value={'geometry'}>Geometry</MenuItem>
|
|
174
178
|
<MenuItem value={'advanced-algebra'}>Advanced Algebra</MenuItem>
|
|
175
179
|
<MenuItem value={'statistics'}>Statistics</MenuItem>
|
|
176
|
-
<MenuItem value={'
|
|
180
|
+
<MenuItem value={'item-authoring'}>Item Authoring</MenuItem>
|
|
177
181
|
</Select>
|
|
178
182
|
</InputContainer>
|
|
179
183
|
)}
|
|
@@ -223,6 +227,9 @@ const styles = theme => ({
|
|
|
223
227
|
},
|
|
224
228
|
'& .mq-overarrow.mq-arrow-both': {
|
|
225
229
|
minWidth: '1.23em',
|
|
230
|
+
'& *': {
|
|
231
|
+
lineHeight: '1 !important'
|
|
232
|
+
},
|
|
226
233
|
'&:before': {
|
|
227
234
|
top: '-0.4em',
|
|
228
235
|
left: '-1px'
|
|
@@ -304,6 +311,9 @@ const styles = theme => ({
|
|
|
304
311
|
},
|
|
305
312
|
'& .mq-overarrow.mq-arrow-both': {
|
|
306
313
|
minWidth: '1.23em'
|
|
314
|
+
},
|
|
315
|
+
'& .mq-parallelogram': {
|
|
316
|
+
lineHeight: 0.85
|
|
307
317
|
}
|
|
308
318
|
}
|
|
309
319
|
});
|
package/src/index.jsx
CHANGED
package/src/math-preview.jsx
CHANGED
|
@@ -54,6 +54,9 @@ const mp = theme => ({
|
|
|
54
54
|
},
|
|
55
55
|
'& .mq-overarrow.mq-arrow-both': {
|
|
56
56
|
minWidth: '1.23em',
|
|
57
|
+
'& *': {
|
|
58
|
+
lineHeight: '1 !important'
|
|
59
|
+
},
|
|
57
60
|
'&:before': {
|
|
58
61
|
top: '-0.4em',
|
|
59
62
|
left: '-1px'
|
|
@@ -81,6 +84,9 @@ const mp = theme => ({
|
|
|
81
84
|
'& .mq-longdiv-inner': {
|
|
82
85
|
borderTop: '1px solid !important',
|
|
83
86
|
paddingTop: '1.5px !important'
|
|
87
|
+
},
|
|
88
|
+
'& .mq-parallelogram': {
|
|
89
|
+
lineHeight: 0.85
|
|
84
90
|
}
|
|
85
91
|
},
|
|
86
92
|
selected: {
|