@pie-element/math-inline 5.9.11 → 6.1.0

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/module/print.js DELETED
@@ -1,5045 +0,0 @@
1
- import {_dll_prop_types, _dll_react, _dll_material_ui__core_styles, _dll_classnames, _dll_react_dom, _dll_material_ui__core, _dll_debug, _dll_material_ui__core_collapse_index, _dll_lodash} from "../../../@pie-lib/shared-module@^1.4.19/module/index.js";
2
- import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.1.7/module/index.js";
3
- import {_dll_pie_lib__math_toolbar, _dll_pie_lib__math_input, _dll_pie_framework__mathquill} from "../../../@pie-lib/math-edit-module@^1.2.6/module/index.js";
4
- const React$n = _dll_react;
5
- const PropTypes$p = _dll_prop_types;
6
- const _jsxFileName$l = "/home/circleci/repo/node_modules/@pie-lib/icons/src/sized.jsx";
7
- const normalizeSize = size => {
8
- return typeof size === 'string' ? size : typeof size === 'number' ? `${size}px` : '30px';
9
- };
10
- const Sized = ({size, children}) => {
11
- size = normalizeSize(size);
12
- const style = {
13
- height: size,
14
- width: size,
15
- display: 'inline-block',
16
- position: 'relative'
17
- };
18
- return React$n.createElement('div', {
19
- style: style,
20
- __self: undefined,
21
- __source: {
22
- fileName: _jsxFileName$l,
23
- lineNumber: 18
24
- }
25
- }, children);
26
- };
27
- Sized.propTypes = {
28
- size: PropTypes$p.number,
29
- children: PropTypes$p.oneOfType([PropTypes$p.arrayOf(PropTypes$p.node), PropTypes$p.node]).isRequired
30
- };
31
- const React$m = _dll_react;
32
- const PropTypes$o = _dll_prop_types;
33
- const _jsxFileName$k = "/home/circleci/repo/node_modules/@pie-lib/icons/src/icon-root.jsx";
34
- const IconRoot = ({size, children}) => React$m.createElement(Sized, {
35
- size: size,
36
- __self: undefined,
37
- __source: {
38
- fileName: _jsxFileName$k,
39
- lineNumber: 10
40
- }
41
- }, React$m.createElement('svg', {
42
- preserveAspectRatio: "xMinYMin meet",
43
- version: "1.1",
44
- x: "0px",
45
- y: "0px",
46
- viewBox: "0 0 44 40",
47
- style: {
48
- enableBackground: 'new 0 0 44 40'
49
- },
50
- __self: undefined,
51
- __source: {
52
- fileName: _jsxFileName$k,
53
- lineNumber: 11
54
- }
55
- }, ' ', children));
56
- IconRoot.propTypes = {
57
- size: PropTypes$o.oneOf([PropTypes$o.string, PropTypes$o.number]),
58
- children: PropTypes$o.oneOfType([PropTypes$o.arrayOf(PropTypes$o.node), PropTypes$o.node]).isRequired
59
- };
60
- const getStyles = (name, fg, bg) => ({
61
- bg: {
62
- fill: `var(--icons-${name}-bg, ${bg})`
63
- },
64
- fg: {
65
- fill: `var(--icons-${name}-fg, ${fg})`
66
- }
67
- });
68
- ({
69
- className: PropTypes$o.string
70
- });
71
- const SquareFeedbackBox = ({className}) => React$m.createElement('polygon', {
72
- transform: "translate(2, 0)",
73
- className: className,
74
- points: "34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",
75
- __self: undefined,
76
- __source: {
77
- fileName: _jsxFileName$k,
78
- lineNumber: 51
79
- }
80
- });
81
- SquareFeedbackBox.propTypes = {
82
- className: PropTypes$o.string
83
- };
84
- const RoundFeedbackBox = ({className}) => React$m.createElement('path', {
85
- transform: "translate(1, 0)",
86
- className: className,
87
- d: "M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",
88
- __self: undefined,
89
- __source: {
90
- fileName: _jsxFileName$k,
91
- lineNumber: 62
92
- }
93
- });
94
- RoundFeedbackBox.propTypes = {
95
- className: PropTypes$o.string
96
- };
97
- const Circle$1 = ({className}) => React$m.createElement('circle', {
98
- transform: "translate(-3, 0)",
99
- className: className,
100
- cx: "23",
101
- cy: "20.4",
102
- r: "16",
103
- __self: undefined,
104
- __source: {
105
- fileName: _jsxFileName$k,
106
- lineNumber: 73
107
- }
108
- });
109
- Circle$1.propTypes = {
110
- className: PropTypes$o.string
111
- };
112
- const Square = ({className}) => React$m.createElement('rect', {
113
- x: "3.6",
114
- y: "4.1",
115
- className: className,
116
- width: "32",
117
- height: "32",
118
- __self: undefined,
119
- __source: {
120
- fileName: _jsxFileName$k,
121
- lineNumber: 81
122
- }
123
- });
124
- Square.propTypes = {
125
- className: PropTypes$o.string
126
- };
127
- const PropTypes$n = _dll_prop_types;
128
- const React$l = _dll_react;
129
- const _jsxFileName$j = "/home/circleci/repo/node_modules/@pie-lib/icons/src/icon-base.jsx";
130
- var IconBase = (Action, Emoji) => {
131
- class IconBase extends React$l.Component {
132
- static __initStatic() {
133
- this.propTypes = {
134
- classes: PropTypes$n.object.isRequired,
135
- size: PropTypes$n.number
136
- };
137
- }
138
- constructor(props) {
139
- super(props);
140
- const {classes, size} = this.props;
141
- this.icons = {
142
- feedback: {
143
- round: {
144
- check: React$l.createElement(IconRoot, {
145
- size: size,
146
- __self: this,
147
- __source: {
148
- fileName: _jsxFileName$j,
149
- lineNumber: 20
150
- }
151
- }, React$l.createElement(RoundFeedbackBox, {
152
- className: classes.bg,
153
- __self: this,
154
- __source: {
155
- fileName: _jsxFileName$j,
156
- lineNumber: 21
157
- }
158
- }), React$l.createElement(Action, {
159
- className: classes.fg,
160
- __self: this,
161
- __source: {
162
- fileName: _jsxFileName$j,
163
- lineNumber: 22
164
- }
165
- })),
166
- emoji: React$l.createElement(IconRoot, {
167
- size: size,
168
- __self: this,
169
- __source: {
170
- fileName: _jsxFileName$j,
171
- lineNumber: 26
172
- }
173
- }, React$l.createElement(RoundFeedbackBox, {
174
- className: classes.bg,
175
- __self: this,
176
- __source: {
177
- fileName: _jsxFileName$j,
178
- lineNumber: 27
179
- }
180
- }), React$l.createElement(Emoji, {
181
- className: classes.fg,
182
- __self: this,
183
- __source: {
184
- fileName: _jsxFileName$j,
185
- lineNumber: 28
186
- }
187
- })),
188
- open: {
189
- check: React$l.createElement(IconRoot, {
190
- size: size,
191
- __self: this,
192
- __source: {
193
- fileName: _jsxFileName$j,
194
- lineNumber: 33
195
- }
196
- }, React$l.createElement(Action, {
197
- className: classes.bg,
198
- __self: this,
199
- __source: {
200
- fileName: _jsxFileName$j,
201
- lineNumber: 34
202
- }
203
- })),
204
- emoji: React$l.createElement(IconRoot, {
205
- size: size,
206
- __self: this,
207
- __source: {
208
- fileName: _jsxFileName$j,
209
- lineNumber: 38
210
- }
211
- }, React$l.createElement(Emoji, {
212
- className: classes.bg,
213
- __self: this,
214
- __source: {
215
- fileName: _jsxFileName$j,
216
- lineNumber: 39
217
- }
218
- }))
219
- }
220
- },
221
- square: {
222
- check: React$l.createElement(IconRoot, {
223
- size: size,
224
- __self: this,
225
- __source: {
226
- fileName: _jsxFileName$j,
227
- lineNumber: 46
228
- }
229
- }, React$l.createElement(SquareFeedbackBox, {
230
- className: classes.bg,
231
- __self: this,
232
- __source: {
233
- fileName: _jsxFileName$j,
234
- lineNumber: 47
235
- }
236
- }), React$l.createElement(Action, {
237
- className: classes.fg,
238
- __self: this,
239
- __source: {
240
- fileName: _jsxFileName$j,
241
- lineNumber: 48
242
- }
243
- })),
244
- emoji: React$l.createElement(IconRoot, {
245
- size: size,
246
- __self: this,
247
- __source: {
248
- fileName: _jsxFileName$j,
249
- lineNumber: 52
250
- }
251
- }, React$l.createElement(SquareFeedbackBox, {
252
- className: classes.bg,
253
- __self: this,
254
- __source: {
255
- fileName: _jsxFileName$j,
256
- lineNumber: 53
257
- }
258
- }), React$l.createElement(Emoji, {
259
- className: classes.fg,
260
- __self: this,
261
- __source: {
262
- fileName: _jsxFileName$j,
263
- lineNumber: 54
264
- }
265
- })),
266
- open: {
267
- check: React$l.createElement(IconRoot, {
268
- size: size,
269
- __self: this,
270
- __source: {
271
- fileName: _jsxFileName$j,
272
- lineNumber: 59
273
- }
274
- }, React$l.createElement(Action, {
275
- className: classes.bg,
276
- __self: this,
277
- __source: {
278
- fileName: _jsxFileName$j,
279
- lineNumber: 60
280
- }
281
- })),
282
- emoji: React$l.createElement(IconRoot, {
283
- size: size,
284
- __self: this,
285
- __source: {
286
- fileName: _jsxFileName$j,
287
- lineNumber: 64
288
- }
289
- }, React$l.createElement(Emoji, {
290
- className: classes.bg,
291
- __self: this,
292
- __source: {
293
- fileName: _jsxFileName$j,
294
- lineNumber: 65
295
- }
296
- }))
297
- }
298
- }
299
- },
300
- round: {
301
- check: React$l.createElement(IconRoot, {
302
- size: size,
303
- __self: this,
304
- __source: {
305
- fileName: _jsxFileName$j,
306
- lineNumber: 73
307
- }
308
- }, React$l.createElement(Circle$1, {
309
- className: classes.bg,
310
- __self: this,
311
- __source: {
312
- fileName: _jsxFileName$j,
313
- lineNumber: 74
314
- }
315
- }), React$l.createElement(Action, {
316
- className: classes.fg,
317
- __self: this,
318
- __source: {
319
- fileName: _jsxFileName$j,
320
- lineNumber: 75
321
- }
322
- })),
323
- emoji: React$l.createElement(IconRoot, {
324
- size: size,
325
- __self: this,
326
- __source: {
327
- fileName: _jsxFileName$j,
328
- lineNumber: 79
329
- }
330
- }, React$l.createElement(Circle$1, {
331
- className: classes.bg,
332
- __self: this,
333
- __source: {
334
- fileName: _jsxFileName$j,
335
- lineNumber: 80
336
- }
337
- }), React$l.createElement(Emoji, {
338
- className: classes.fg,
339
- __self: this,
340
- __source: {
341
- fileName: _jsxFileName$j,
342
- lineNumber: 81
343
- }
344
- })),
345
- open: {
346
- check: React$l.createElement(IconRoot, {
347
- size: size,
348
- __self: this,
349
- __source: {
350
- fileName: _jsxFileName$j,
351
- lineNumber: 86
352
- }
353
- }, React$l.createElement(Action, {
354
- className: classes.bg,
355
- __self: this,
356
- __source: {
357
- fileName: _jsxFileName$j,
358
- lineNumber: 87
359
- }
360
- })),
361
- emoji: React$l.createElement(IconRoot, {
362
- size: size,
363
- __self: this,
364
- __source: {
365
- fileName: _jsxFileName$j,
366
- lineNumber: 91
367
- }
368
- }, React$l.createElement(Emoji, {
369
- className: classes.bg,
370
- __self: this,
371
- __source: {
372
- fileName: _jsxFileName$j,
373
- lineNumber: 92
374
- }
375
- }))
376
- }
377
- },
378
- square: {
379
- check: React$l.createElement(IconRoot, {
380
- size: size,
381
- __self: this,
382
- __source: {
383
- fileName: _jsxFileName$j,
384
- lineNumber: 99
385
- }
386
- }, React$l.createElement(Square, {
387
- className: classes.bg,
388
- __self: this,
389
- __source: {
390
- fileName: _jsxFileName$j,
391
- lineNumber: 100
392
- }
393
- }), React$l.createElement(Action, {
394
- className: classes.fg,
395
- __self: this,
396
- __source: {
397
- fileName: _jsxFileName$j,
398
- lineNumber: 101
399
- }
400
- })),
401
- emoji: React$l.createElement(IconRoot, {
402
- size: size,
403
- __self: this,
404
- __source: {
405
- fileName: _jsxFileName$j,
406
- lineNumber: 105
407
- }
408
- }, React$l.createElement(Square, {
409
- className: classes.bg,
410
- __self: this,
411
- __source: {
412
- fileName: _jsxFileName$j,
413
- lineNumber: 106
414
- }
415
- }), React$l.createElement(Emoji, {
416
- className: classes.fg,
417
- __self: this,
418
- __source: {
419
- fileName: _jsxFileName$j,
420
- lineNumber: 107
421
- }
422
- })),
423
- open: {
424
- check: React$l.createElement(IconRoot, {
425
- size: size,
426
- __self: this,
427
- __source: {
428
- fileName: _jsxFileName$j,
429
- lineNumber: 112
430
- }
431
- }, React$l.createElement(Action, {
432
- className: classes.bg,
433
- __self: this,
434
- __source: {
435
- fileName: _jsxFileName$j,
436
- lineNumber: 113
437
- }
438
- })),
439
- emoji: React$l.createElement(IconRoot, {
440
- size: size,
441
- __self: this,
442
- __source: {
443
- fileName: _jsxFileName$j,
444
- lineNumber: 117
445
- }
446
- }, React$l.createElement(Emoji, {
447
- className: classes.bg,
448
- __self: this,
449
- __source: {
450
- fileName: _jsxFileName$j,
451
- lineNumber: 118
452
- }
453
- }))
454
- }
455
- }
456
- };
457
- }
458
- render() {
459
- if (this.props.category === undefined) {
460
- if (this.props.open === true) {
461
- return this.icons[this.props.shape].open[this.props.iconSet];
462
- } else {
463
- return this.icons[this.props.shape][this.props.iconSet];
464
- }
465
- } else {
466
- if (this.props.open === true) {
467
- return this.icons.feedback[this.props.shape].open[this.props.iconSet];
468
- } else {
469
- return this.icons.feedback[this.props.shape][this.props.iconSet];
470
- }
471
- }
472
- }
473
- }
474
- IconBase.__initStatic();
475
- IconBase.propTypes = {
476
- iconSet: PropTypes$n.oneOf(['emoji', 'check']),
477
- shape: PropTypes$n.oneOf(['round', 'square']),
478
- category: PropTypes$n.oneOf(['feedback', undefined]),
479
- open: PropTypes$n.bool
480
- };
481
- IconBase.defaultProps = {
482
- iconSet: 'check',
483
- shape: 'round',
484
- category: undefined,
485
- open: false
486
- };
487
- return IconBase;
488
- };
489
- const PropTypes$m = _dll_prop_types;
490
- const React$k = _dll_react;
491
- const {withStyles: withStyles$g} = _dll_material_ui__core_styles;
492
- const _jsxFileName$i = "/home/circleci/repo/node_modules/@pie-lib/icons/src/correct-icon.jsx";
493
- const styles$b = getStyles('correct', '#f8ffe2', '#4aaf46');
494
- const Emoji$3 = ({className}) => React$k.createElement('g', {
495
- transform: 'translate(1, 0)',
496
- __self: undefined,
497
- __source: {
498
- fileName: _jsxFileName$i,
499
- lineNumber: 10
500
- }
501
- }, React$k.createElement('path', {
502
- className: className,
503
- d: "M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",
504
- __self: undefined,
505
- __source: {
506
- fileName: _jsxFileName$i,
507
- lineNumber: 11
508
- }
509
- }), React$k.createElement('rect', {
510
- x: "21.1",
511
- y: "13.1",
512
- className: className,
513
- width: "3.7",
514
- height: "4.7",
515
- __self: undefined,
516
- __source: {
517
- fileName: _jsxFileName$i,
518
- lineNumber: 16
519
- }
520
- }), React$k.createElement('rect', {
521
- x: "12.7",
522
- y: "13.1",
523
- className: className,
524
- width: "3.7",
525
- height: "4.7",
526
- __self: undefined,
527
- __source: {
528
- fileName: _jsxFileName$i,
529
- lineNumber: 17
530
- }
531
- }));
532
- Emoji$3.propTypes = {
533
- className: PropTypes$m.string
534
- };
535
- Emoji$3.defaultProps = {
536
- x: 0
537
- };
538
- const Check$1 = ({className, x, y}) => React$k.createElement('polygon', {
539
- transform: `translate(${x}, ${y})`,
540
- className: className,
541
- points: "19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",
542
- __self: undefined,
543
- __source: {
544
- fileName: _jsxFileName$i,
545
- lineNumber: 30
546
- }
547
- });
548
- Check$1.propTypes = {
549
- x: PropTypes$m.number,
550
- y: PropTypes$m.number,
551
- className: PropTypes$m.string
552
- };
553
- Check$1.defaultProps = {
554
- x: 0,
555
- y: 0
556
- };
557
- const Correct = IconBase(Check$1, Emoji$3);
558
- Correct.propTypes = {
559
- iconSet: PropTypes$m.oneOf(['emoji', 'check']),
560
- shape: PropTypes$m.oneOf(['round', 'square']),
561
- category: PropTypes$m.oneOf(['feedback', undefined]),
562
- open: PropTypes$m.bool
563
- };
564
- Correct.defaultProps = {
565
- iconSet: 'check',
566
- shape: 'round',
567
- category: undefined,
568
- open: false
569
- };
570
- var correctIcon = withStyles$g(styles$b)(Correct);
571
- const PropTypes$l = _dll_prop_types;
572
- const React$j = _dll_react;
573
- const classNames$3 = _dll_classnames;
574
- const {withStyles: withStyles$f} = _dll_material_ui__core_styles;
575
- const _jsxFileName$h = "/home/circleci/repo/node_modules/@pie-lib/icons/src/correct-response-icon.jsx";
576
- const OpenIcon = ({bg, fg}) => React$j.createElement('svg', {
577
- preserveAspectRatio: "xMinYMin meet",
578
- version: "1.1",
579
- id: "Layer_1",
580
- x: "0px",
581
- y: "0px",
582
- viewBox: "-283 359 34 35",
583
- style: {
584
- enableBackground: 'new -283 359 34 35'
585
- },
586
- __self: undefined,
587
- __source: {
588
- fileName: _jsxFileName$h,
589
- lineNumber: 7
590
- }
591
- }, React$j.createElement('circle', {
592
- className: bg,
593
- cx: "-266",
594
- cy: "375.9",
595
- r: "14",
596
- __self: undefined,
597
- __source: {
598
- fileName: _jsxFileName$h,
599
- lineNumber: 16
600
- }
601
- }), React$j.createElement('path', {
602
- className: bg,
603
- d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
604
- __self: undefined,
605
- __source: {
606
- fileName: _jsxFileName$h,
607
- lineNumber: 17
608
- }
609
- }), React$j.createElement('polygon', {
610
- className: fg,
611
- points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6 ",
612
- __self: undefined,
613
- __source: {
614
- fileName: _jsxFileName$h,
615
- lineNumber: 22
616
- }
617
- }));
618
- OpenIcon.propTypes = {
619
- bg: PropTypes$l.string,
620
- fg: PropTypes$l.string
621
- };
622
- const CloseIcon = ({bg, fg, border}) => React$j.createElement('svg', {
623
- preserveAspectRatio: "xMinYMin meet",
624
- version: "1.1",
625
- x: "0px",
626
- y: "0px",
627
- viewBox: "-129.5 127 34 35",
628
- style: {
629
- enableBackground: 'new -129.5 127 34 35'
630
- },
631
- __self: undefined,
632
- __source: {
633
- fileName: _jsxFileName$h,
634
- lineNumber: 35
635
- }
636
- }, React$j.createElement('path', {
637
- style: {
638
- fill: '#D0CAC5',
639
- stroke: '#E6E3E0',
640
- strokeWidth: 0.75,
641
- strokeMiterlimit: 10
642
- },
643
- d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z",
644
- __self: undefined,
645
- __source: {
646
- fileName: _jsxFileName$h,
647
- lineNumber: 43
648
- }
649
- }), React$j.createElement('path', {
650
- style: {
651
- fill: '#B3ABA4',
652
- stroke: '#CDC7C2',
653
- strokeWidth: 0.5,
654
- strokeMiterlimit: 10
655
- },
656
- d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z",
657
- __self: undefined,
658
- __source: {
659
- fileName: _jsxFileName$h,
660
- lineNumber: 53
661
- }
662
- }), React$j.createElement('circle', {
663
- className: bg,
664
- cx: "-114.2",
665
- cy: "143.5",
666
- r: "14",
667
- __self: undefined,
668
- __source: {
669
- fileName: _jsxFileName$h,
670
- lineNumber: 62
671
- }
672
- }), React$j.createElement('path', {
673
- className: border,
674
- d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
675
- __self: undefined,
676
- __source: {
677
- fileName: _jsxFileName$h,
678
- lineNumber: 63
679
- }
680
- }), React$j.createElement('polygon', {
681
- className: fg,
682
- points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
683
- __self: undefined,
684
- __source: {
685
- fileName: _jsxFileName$h,
686
- lineNumber: 68
687
- }
688
- }));
689
- CloseIcon.propTypes = {
690
- bg: PropTypes$l.string,
691
- fg: PropTypes$l.string,
692
- border: PropTypes$l.string
693
- };
694
- const styles$a = {
695
- root: {
696
- width: props => props.size || '25px',
697
- height: props => props.size || '25px'
698
- },
699
- hideIconBg: {
700
- fill: '#bce2ff'
701
- },
702
- hideIconFg: {
703
- fill: '#1a9cff'
704
- },
705
- showIconBg: {
706
- fill: 'white'
707
- },
708
- showIconFg: {
709
- fill: '#1a9cff'
710
- },
711
- showIconBorder: {
712
- fill: '#bce2ff'
713
- }
714
- };
715
- const CorrectResponse = ({open, classes, className}) => React$j.createElement('div', {
716
- className: classNames$3(className, classes.root),
717
- __self: undefined,
718
- __source: {
719
- fileName: _jsxFileName$h,
720
- lineNumber: 104
721
- }
722
- }, open ? React$j.createElement(OpenIcon, {
723
- bg: classes.hideIconBg,
724
- fg: classes.hideIconFg,
725
- __self: undefined,
726
- __source: {
727
- fileName: _jsxFileName$h,
728
- lineNumber: 106
729
- }
730
- }) : React$j.createElement(CloseIcon, {
731
- bg: classes.showIconBg,
732
- border: classes.showIconBorder,
733
- fg: classes.showIconFg,
734
- __self: undefined,
735
- __source: {
736
- fileName: _jsxFileName$h,
737
- lineNumber: 108
738
- }
739
- }));
740
- CorrectResponse.propTypes = {
741
- classes: PropTypes$l.object.isRequired,
742
- open: PropTypes$l.bool,
743
- size: PropTypes$l.string,
744
- className: PropTypes$l.string
745
- };
746
- CorrectResponse.defaultProps = {
747
- open: false
748
- };
749
- var CorrectResponse$1 = withStyles$f(styles$a)(CorrectResponse);
750
- const PropTypes$k = _dll_prop_types;
751
- const React$i = _dll_react;
752
- const {withStyles: withStyles$e} = _dll_material_ui__core_styles;
753
- const _jsxFileName$g = "/home/circleci/repo/node_modules/@pie-lib/icons/src/incorrect-icon.jsx";
754
- const Ex = ({className}) => React$i.createElement('g', {
755
- transform: 'translate(0.5, 0.5)',
756
- __self: undefined,
757
- __source: {
758
- fileName: _jsxFileName$g,
759
- lineNumber: 8
760
- }
761
- }, React$i.createElement('rect', {
762
- x: "11",
763
- y: "17.3",
764
- transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",
765
- className: className,
766
- width: "16.6",
767
- height: "3.7",
768
- __self: undefined,
769
- __source: {
770
- fileName: _jsxFileName$g,
771
- lineNumber: 9
772
- }
773
- }), React$i.createElement('rect', {
774
- x: "17.4",
775
- y: "10.7",
776
- transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",
777
- className: className,
778
- width: "3.7",
779
- height: "16.6",
780
- __self: undefined,
781
- __source: {
782
- fileName: _jsxFileName$g,
783
- lineNumber: 17
784
- }
785
- }));
786
- Ex.propTypes = {
787
- className: PropTypes$k.string
788
- };
789
- const Emoji$2 = ({className}) => React$i.createElement('g', {
790
- transform: 'translate(1,0)',
791
- __self: undefined,
792
- __source: {
793
- fileName: _jsxFileName$g,
794
- lineNumber: 32
795
- }
796
- }, React$i.createElement('rect', {
797
- x: "21",
798
- y: "12.9",
799
- className: className,
800
- width: "3.7",
801
- height: "4.7",
802
- __self: undefined,
803
- __source: {
804
- fileName: _jsxFileName$g,
805
- lineNumber: 33
806
- }
807
- }), React$i.createElement('rect', {
808
- x: "12.7",
809
- y: "12.9",
810
- className: className,
811
- width: "3.7",
812
- height: "4.7",
813
- __self: undefined,
814
- __source: {
815
- fileName: _jsxFileName$g,
816
- lineNumber: 34
817
- }
818
- }), React$i.createElement('rect', {
819
- x: "12.2",
820
- y: "22.5",
821
- className: className,
822
- width: "13",
823
- height: "3.3",
824
- __self: undefined,
825
- __source: {
826
- fileName: _jsxFileName$g,
827
- lineNumber: 35
828
- }
829
- }));
830
- Emoji$2.propTypes = {
831
- className: PropTypes$k.string
832
- };
833
- const styles$9 = getStyles('incorrect', '#fbf2e3', '#fcb733');
834
- const Incorrect = IconBase(Ex, Emoji$2);
835
- var incorrectIcon = withStyles$e(styles$9)(Incorrect);
836
- Incorrect.propTypes = {
837
- iconSet: PropTypes$k.oneOf(['emoji', 'check']),
838
- shape: PropTypes$k.oneOf(['round', 'square']),
839
- category: PropTypes$k.oneOf(['feedback', undefined]),
840
- open: PropTypes$k.bool
841
- };
842
- Incorrect.defaultProps = {
843
- iconSet: 'check',
844
- shape: 'round',
845
- category: undefined,
846
- open: false
847
- };
848
- const PropTypes$j = _dll_prop_types;
849
- const React$h = _dll_react;
850
- const _jsxFileName$f = "/home/circleci/repo/node_modules/@pie-lib/icons/src/instructions-icon.jsx";
851
- const Lines = () => {
852
- const style = {
853
- fill: 'none',
854
- stroke: '#BCE2FF',
855
- strokeWidth: 2,
856
- strokeMiterlimit: 10
857
- };
858
- return React$h.createElement('g', {
859
- __self: undefined,
860
- __source: {
861
- fileName: _jsxFileName$f,
862
- lineNumber: 13
863
- }
864
- }, React$h.createElement('line', {
865
- style: style,
866
- x1: "-98",
867
- y1: "142",
868
- x2: "-114.6",
869
- y2: "142",
870
- __self: undefined,
871
- __source: {
872
- fileName: _jsxFileName$f,
873
- lineNumber: 14
874
- }
875
- }), React$h.createElement('line', {
876
- style: style,
877
- x1: "-98",
878
- y1: "146.3",
879
- x2: "-114.6",
880
- y2: "146.3",
881
- __self: undefined,
882
- __source: {
883
- fileName: _jsxFileName$f,
884
- lineNumber: 15
885
- }
886
- }), React$h.createElement('line', {
887
- style: style,
888
- x1: "-104",
889
- y1: "150.7",
890
- x2: "-114.6",
891
- y2: "150.7",
892
- __self: undefined,
893
- __source: {
894
- fileName: _jsxFileName$f,
895
- lineNumber: 16
896
- }
897
- }));
898
- };
899
- const Root$1 = ({children, size}) => React$h.createElement(Sized, {
900
- size: size,
901
- __self: undefined,
902
- __source: {
903
- fileName: _jsxFileName$f,
904
- lineNumber: 22
905
- }
906
- }, React$h.createElement('svg', {
907
- version: "1.1",
908
- viewBox: "-128 129 31 31",
909
- style: {
910
- enableBackground: 'new -128 129 31 31'
911
- },
912
- __self: undefined,
913
- __source: {
914
- fileName: _jsxFileName$f,
915
- lineNumber: 23
916
- }
917
- }, children));
918
- Root$1.propTypes = {
919
- children: PropTypes$j.oneOfType([PropTypes$j.arrayOf(PropTypes$j.node), PropTypes$j.node]).isRequired,
920
- size: PropTypes$j.number
921
- };
922
- const GreyInfo = () => {
923
- return React$h.createElement('g', {
924
- __self: undefined,
925
- __source: {
926
- fileName: _jsxFileName$f,
927
- lineNumber: 36
928
- }
929
- }, React$h.createElement('rect', {
930
- x: "-123.9",
931
- y: "135.3",
932
- style: {
933
- fill: '#D0CAC5',
934
- stroke: '#E6E3E0',
935
- strokeWidth: 0.75,
936
- strokeLinejoin: 'round',
937
- strokeMiterlimit: 10
938
- },
939
- width: "4.1",
940
- height: "4.1",
941
- __self: undefined,
942
- __source: {
943
- fileName: _jsxFileName$f,
944
- lineNumber: 37
945
- }
946
- }), React$h.createElement('polygon', {
947
- style: {
948
- fill: '#D0CAC5',
949
- stroke: '#E6E3E0',
950
- strokeWidth: 0.75,
951
- strokeLinejoin: 'round',
952
- strokeMiterlimit: 10
953
- },
954
- points: "-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 ",
955
- __self: undefined,
956
- __source: {
957
- fileName: _jsxFileName$f,
958
- lineNumber: 50
959
- }
960
- }), React$h.createElement('rect', {
961
- x: "-124.7",
962
- y: "134.7",
963
- style: {
964
- fill: '#B3ABA4',
965
- stroke: '#CDC7C2',
966
- strokeWidth: 0.5,
967
- strokeLinecap: 'round',
968
- strokeLinejoin: 'round',
969
- strokeMiterlimit: 10
970
- },
971
- width: "4.1",
972
- height: "4.1",
973
- __self: undefined,
974
- __source: {
975
- fileName: _jsxFileName$f,
976
- lineNumber: 61
977
- }
978
- }), React$h.createElement('polygon', {
979
- style: {
980
- fill: '#B3ABA4',
981
- stroke: '#CDC7C2',
982
- strokeWidth: 0.5,
983
- strokeLinecap: 'round',
984
- strokeLinejoin: 'round',
985
- strokeMiterlimit: 10
986
- },
987
- points: "-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 ",
988
- __self: undefined,
989
- __source: {
990
- fileName: _jsxFileName$f,
991
- lineNumber: 76
992
- }
993
- }), React$h.createElement('rect', {
994
- x: "-125.5",
995
- y: "134",
996
- style: {
997
- fill: '#7FABC6'
998
- },
999
- width: "4.1",
1000
- height: "4.1",
1001
- __self: undefined,
1002
- __source: {
1003
- fileName: _jsxFileName$f,
1004
- lineNumber: 88
1005
- }
1006
- }), React$h.createElement('polygon', {
1007
- style: {
1008
- fill: '#7FABC6'
1009
- },
1010
- points: "-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 ",
1011
- __self: undefined,
1012
- __source: {
1013
- fileName: _jsxFileName$f,
1014
- lineNumber: 89
1015
- }
1016
- }));
1017
- };
1018
- const BlueInfo = () => React$h.createElement('g', {
1019
- __self: undefined,
1020
- __source: {
1021
- fileName: _jsxFileName$f,
1022
- lineNumber: 99
1023
- }
1024
- }, React$h.createElement('rect', {
1025
- x: "-123.9",
1026
- y: "135.3",
1027
- style: {
1028
- fill: '#D0CAC5',
1029
- stroke: '#E6E3E0',
1030
- strokeWidth: 0.75,
1031
- strokeLinejoin: 'round',
1032
- strokeMiterlimit: 10
1033
- },
1034
- width: "4.1",
1035
- height: "4.1",
1036
- __self: undefined,
1037
- __source: {
1038
- fileName: _jsxFileName$f,
1039
- lineNumber: 100
1040
- }
1041
- }), React$h.createElement('polygon', {
1042
- style: {
1043
- fill: '#D0CAC5',
1044
- stroke: '#E6E3E0',
1045
- strokeWidth: 0.75,
1046
- strokeLinejoin: 'round',
1047
- strokeMiterlimit: 10
1048
- },
1049
- points: "-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 ",
1050
- __self: undefined,
1051
- __source: {
1052
- fileName: _jsxFileName$f,
1053
- lineNumber: 113
1054
- }
1055
- }), React$h.createElement('rect', {
1056
- x: "-124.7",
1057
- y: "134.7",
1058
- style: {
1059
- fill: '#B3ABA4',
1060
- stroke: '#CDC7C2',
1061
- strokeWidth: 0.5,
1062
- strokeLinecap: 'round',
1063
- strokeLinejoin: 'round',
1064
- strokeMiterlimit: 10
1065
- },
1066
- width: "4.1",
1067
- height: "4.1",
1068
- __self: undefined,
1069
- __source: {
1070
- fileName: _jsxFileName$f,
1071
- lineNumber: 124
1072
- }
1073
- }), React$h.createElement('polygon', {
1074
- style: {
1075
- fill: '#B3ABA4',
1076
- stroke: '#CDC7C2',
1077
- strokeWidth: 0.5,
1078
- strokeLinecap: 'round',
1079
- strokeLinejoin: 'round',
1080
- strokeMiterlimit: 10
1081
- },
1082
- points: "-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 ",
1083
- __self: undefined,
1084
- __source: {
1085
- fileName: _jsxFileName$f,
1086
- lineNumber: 138
1087
- }
1088
- }), React$h.createElement('rect', {
1089
- x: "-125.5",
1090
- y: "134",
1091
- style: {
1092
- fill: '#1A9CFF'
1093
- },
1094
- width: "4.1",
1095
- height: "4.1",
1096
- __self: undefined,
1097
- __source: {
1098
- fileName: _jsxFileName$f,
1099
- lineNumber: 150
1100
- }
1101
- }), React$h.createElement('polygon', {
1102
- style: {
1103
- fill: '#1A9CFF'
1104
- },
1105
- points: "-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 ",
1106
- __self: undefined,
1107
- __source: {
1108
- fileName: _jsxFileName$f,
1109
- lineNumber: 151
1110
- }
1111
- }));
1112
- class Instructions extends React$h.Component {
1113
- constructor(props) {
1114
- super(props);
1115
- }
1116
- render() {
1117
- if (this.props.open === true) {
1118
- return React$h.createElement(Root$1, {
1119
- __self: this,
1120
- __source: {
1121
- fileName: _jsxFileName$f,
1122
- lineNumber: 167
1123
- }
1124
- }, React$h.createElement(GreyInfo, {
1125
- __self: this,
1126
- __source: {
1127
- fileName: _jsxFileName$f,
1128
- lineNumber: 168
1129
- }
1130
- }), React$h.createElement(Lines, {
1131
- __self: this,
1132
- __source: {
1133
- fileName: _jsxFileName$f,
1134
- lineNumber: 169
1135
- }
1136
- }));
1137
- } else {
1138
- return React$h.createElement(Root$1, {
1139
- __self: this,
1140
- __source: {
1141
- fileName: _jsxFileName$f,
1142
- lineNumber: 174
1143
- }
1144
- }, React$h.createElement(BlueInfo, {
1145
- __self: this,
1146
- __source: {
1147
- fileName: _jsxFileName$f,
1148
- lineNumber: 175
1149
- }
1150
- }), React$h.createElement(Lines, {
1151
- __self: this,
1152
- __source: {
1153
- fileName: _jsxFileName$f,
1154
- lineNumber: 176
1155
- }
1156
- }));
1157
- }
1158
- }
1159
- }
1160
- Instructions.propTypes = {
1161
- open: PropTypes$j.bool
1162
- };
1163
- Instructions.defaultProps = {
1164
- open: false
1165
- };
1166
- const PropTypes$i = _dll_prop_types;
1167
- const React$g = _dll_react;
1168
- const {withStyles: withStyles$d} = _dll_material_ui__core_styles;
1169
- const _jsxFileName$e = "/home/circleci/repo/node_modules/@pie-lib/icons/src/learn-more-icon.jsx";
1170
- const Glint = ({fill}) => React$g.createElement('path', {
1171
- fill: fill,
1172
- d: "M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z",
1173
- __self: undefined,
1174
- __source: {
1175
- fileName: _jsxFileName$e,
1176
- lineNumber: 7
1177
- }
1178
- });
1179
- Glint.propTypes = {
1180
- fill: PropTypes$i.string
1181
- };
1182
- class LearnMore extends React$g.Component {
1183
- static __initStatic() {
1184
- this.propTypes = {
1185
- classes: PropTypes$i.object.isRequired,
1186
- size: PropTypes$i.number
1187
- };
1188
- }
1189
- render() {
1190
- const {classes, size} = this.props;
1191
- if (this.props.open === true) {
1192
- return React$g.createElement(Sized, {
1193
- size: size,
1194
- __self: this,
1195
- __source: {
1196
- fileName: _jsxFileName$e,
1197
- lineNumber: 28
1198
- }
1199
- }, React$g.createElement('svg', {
1200
- preserveAspectRatio: "xMinYMin meet",
1201
- viewBox: "-135 129 16 32",
1202
- __self: this,
1203
- __source: {
1204
- fileName: _jsxFileName$e,
1205
- lineNumber: 29
1206
- }
1207
- }, React$g.createElement('path', {
1208
- className: classes.hideBg,
1209
- d: "M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z",
1210
- __self: this,
1211
- __source: {
1212
- fileName: _jsxFileName$e,
1213
- lineNumber: 30
1214
- }
1215
- }), React$g.createElement('path', {
1216
- className: classes.hideBg,
1217
- d: "M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z",
1218
- __self: this,
1219
- __source: {
1220
- fileName: _jsxFileName$e,
1221
- lineNumber: 34
1222
- }
1223
- }), React$g.createElement(Glint, {
1224
- fill: classes.hideFg.fill,
1225
- __self: this,
1226
- __source: {
1227
- fileName: _jsxFileName$e,
1228
- lineNumber: 38
1229
- }
1230
- })));
1231
- } else {
1232
- return React$g.createElement(Sized, {
1233
- size: size,
1234
- __self: this,
1235
- __source: {
1236
- fileName: _jsxFileName$e,
1237
- lineNumber: 44
1238
- }
1239
- }, React$g.createElement('svg', {
1240
- preserveAspectRatio: "xMinYMin meet",
1241
- viewBox: "-135 129 16 31",
1242
- __self: this,
1243
- __source: {
1244
- fileName: _jsxFileName$e,
1245
- lineNumber: 45
1246
- }
1247
- }, React$g.createElement('path', {
1248
- fill: "#D0CAC5",
1249
- stroke: "#E6E3E0",
1250
- className: "st0",
1251
- d: "M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z",
1252
- __self: this,
1253
- __source: {
1254
- fileName: _jsxFileName$e,
1255
- lineNumber: 46
1256
- }
1257
- }), React$g.createElement('path', {
1258
- fill: "#D0CAC5",
1259
- stroke: "#E6E3E0",
1260
- className: "st0",
1261
- d: "M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z",
1262
- __self: this,
1263
- __source: {
1264
- fileName: _jsxFileName$e,
1265
- lineNumber: 52
1266
- }
1267
- }), React$g.createElement('path', {
1268
- fill: "#B3ABA4",
1269
- stroke: "#CDC7C2",
1270
- className: "st1",
1271
- d: "M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z",
1272
- __self: this,
1273
- __source: {
1274
- fileName: _jsxFileName$e,
1275
- lineNumber: 58
1276
- }
1277
- }), ",", React$g.createElement('path', {
1278
- fill: "#B3ABA4",
1279
- stroke: "#CDC7C2",
1280
- className: "st1",
1281
- d: "M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z",
1282
- __self: this,
1283
- __source: {
1284
- fileName: _jsxFileName$e,
1285
- lineNumber: 65
1286
- }
1287
- }), React$g.createElement('path', {
1288
- className: classes.showBg,
1289
- d: "M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z",
1290
- __self: this,
1291
- __source: {
1292
- fileName: _jsxFileName$e,
1293
- lineNumber: 71
1294
- }
1295
- }), React$g.createElement('path', {
1296
- className: classes.showBg,
1297
- d: "M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z",
1298
- __self: this,
1299
- __source: {
1300
- fileName: _jsxFileName$e,
1301
- lineNumber: 75
1302
- }
1303
- }), React$g.createElement(Glint, {
1304
- fill: classes.hideFg.fill,
1305
- __self: this,
1306
- __source: {
1307
- fileName: _jsxFileName$e,
1308
- lineNumber: 79
1309
- }
1310
- })));
1311
- }
1312
- }
1313
- }
1314
- LearnMore.__initStatic();
1315
- const styles$8 = {
1316
- showBg: {
1317
- fill: '#1a9cff'
1318
- },
1319
- hideFg: {
1320
- fill: '#1a9cff'
1321
- },
1322
- hideBg: {
1323
- fill: '#bce2ff'
1324
- }
1325
- };
1326
- LearnMore.propTypes = {
1327
- open: PropTypes$i.bool
1328
- };
1329
- LearnMore.defaultProps = {
1330
- open: false
1331
- };
1332
- withStyles$d(styles$8)(LearnMore);
1333
- const PropTypes$h = _dll_prop_types;
1334
- const React$f = _dll_react;
1335
- const {withStyles: withStyles$c} = _dll_material_ui__core_styles;
1336
- const _jsxFileName$d = "/home/circleci/repo/node_modules/@pie-lib/icons/src/nothing-submitted-icon.jsx";
1337
- const Exclamation = ({className}) => React$f.createElement('g', {
1338
- __self: undefined,
1339
- __source: {
1340
- fileName: _jsxFileName$d,
1341
- lineNumber: 8
1342
- }
1343
- }, React$f.createElement('rect', {
1344
- x: "19.3",
1345
- y: "10.3",
1346
- className: className,
1347
- width: "4.5",
1348
- height: "12.7",
1349
- __self: undefined,
1350
- __source: {
1351
- fileName: _jsxFileName$d,
1352
- lineNumber: 9
1353
- }
1354
- }), React$f.createElement('rect', {
1355
- x: "19.3",
1356
- y: "26.2",
1357
- className: className,
1358
- width: "4.5",
1359
- height: "4.5",
1360
- __self: undefined,
1361
- __source: {
1362
- fileName: _jsxFileName$d,
1363
- lineNumber: 10
1364
- }
1365
- }));
1366
- const Octagon = ({className}) => React$f.createElement('polygon', {
1367
- className: className,
1368
- points: "14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",
1369
- __self: undefined,
1370
- __source: {
1371
- fileName: _jsxFileName$d,
1372
- lineNumber: 15
1373
- }
1374
- });
1375
- const Emoji$1 = ({className}) => React$f.createElement('g', {
1376
- __self: undefined,
1377
- __source: {
1378
- fileName: _jsxFileName$d,
1379
- lineNumber: 22
1380
- }
1381
- }, React$f.createElement('rect', {
1382
- x: "23.8",
1383
- y: "15",
1384
- className: className,
1385
- width: "3.5",
1386
- height: "4.4",
1387
- __self: undefined,
1388
- __source: {
1389
- fileName: _jsxFileName$d,
1390
- lineNumber: 23
1391
- }
1392
- }), React$f.createElement('rect', {
1393
- x: "16",
1394
- y: "15",
1395
- className: className,
1396
- width: "3.5",
1397
- height: "4.4",
1398
- __self: undefined,
1399
- __source: {
1400
- fileName: _jsxFileName$d,
1401
- lineNumber: 24
1402
- }
1403
- }), React$f.createElement('path', {
1404
- className: className,
1405
- d: "M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",
1406
- __self: undefined,
1407
- __source: {
1408
- fileName: _jsxFileName$d,
1409
- lineNumber: 25
1410
- }
1411
- }));
1412
- Emoji$1.propTypes = Octagon.propTypes = Exclamation.propTypes = {
1413
- className: PropTypes$h.string
1414
- };
1415
- const styles$7 = getStyles('nothing-submitted', 'white', '#464146');
1416
- class NothingSubmitted extends React$f.Component {
1417
- static __initStatic() {
1418
- this.propTypes = {
1419
- classes: PropTypes$h.object.isRequired
1420
- };
1421
- }
1422
- constructor(props) {
1423
- super(props);
1424
- const {classes} = this.props;
1425
- this.icons = {
1426
- check: React$f.createElement(IconRoot, {
1427
- __self: this,
1428
- __source: {
1429
- fileName: _jsxFileName$d,
1430
- lineNumber: 48
1431
- }
1432
- }, React$f.createElement(Octagon, {
1433
- className: classes.bg,
1434
- __self: this,
1435
- __source: {
1436
- fileName: _jsxFileName$d,
1437
- lineNumber: 49
1438
- }
1439
- }), React$f.createElement(Exclamation, {
1440
- className: classes.fg,
1441
- __self: this,
1442
- __source: {
1443
- fileName: _jsxFileName$d,
1444
- lineNumber: 50
1445
- }
1446
- })),
1447
- emoji: React$f.createElement(IconRoot, {
1448
- __self: this,
1449
- __source: {
1450
- fileName: _jsxFileName$d,
1451
- lineNumber: 54
1452
- }
1453
- }, React$f.createElement(Octagon, {
1454
- className: classes.bg,
1455
- __self: this,
1456
- __source: {
1457
- fileName: _jsxFileName$d,
1458
- lineNumber: 55
1459
- }
1460
- }), React$f.createElement(Emoji$1, {
1461
- className: classes.fg,
1462
- __self: this,
1463
- __source: {
1464
- fileName: _jsxFileName$d,
1465
- lineNumber: 56
1466
- }
1467
- })),
1468
- feedback: {
1469
- check: React$f.createElement(IconRoot, {
1470
- __self: this,
1471
- __source: {
1472
- fileName: _jsxFileName$d,
1473
- lineNumber: 61
1474
- }
1475
- }, React$f.createElement(Octagon, {
1476
- className: classes.bg,
1477
- __self: this,
1478
- __source: {
1479
- fileName: _jsxFileName$d,
1480
- lineNumber: 62
1481
- }
1482
- }), React$f.createElement(Emoji$1, {
1483
- className: classes.fg,
1484
- __self: this,
1485
- __source: {
1486
- fileName: _jsxFileName$d,
1487
- lineNumber: 63
1488
- }
1489
- })),
1490
- emoji: React$f.createElement(IconRoot, {
1491
- __self: this,
1492
- __source: {
1493
- fileName: _jsxFileName$d,
1494
- lineNumber: 67
1495
- }
1496
- }, React$f.createElement(Octagon, {
1497
- className: classes.bg,
1498
- __self: this,
1499
- __source: {
1500
- fileName: _jsxFileName$d,
1501
- lineNumber: 68
1502
- }
1503
- }), React$f.createElement(Emoji$1, {
1504
- className: classes.fg,
1505
- __self: this,
1506
- __source: {
1507
- fileName: _jsxFileName$d,
1508
- lineNumber: 69
1509
- }
1510
- })),
1511
- square: {
1512
- check: React$f.createElement(IconRoot, {
1513
- __self: this,
1514
- __source: {
1515
- fileName: _jsxFileName$d,
1516
- lineNumber: 74
1517
- }
1518
- }, React$f.createElement(Octagon, {
1519
- className: classes.bg,
1520
- __self: this,
1521
- __source: {
1522
- fileName: _jsxFileName$d,
1523
- lineNumber: 75
1524
- }
1525
- }), React$f.createElement(Exclamation, {
1526
- className: classes.fg,
1527
- __self: this,
1528
- __source: {
1529
- fileName: _jsxFileName$d,
1530
- lineNumber: 76
1531
- }
1532
- })),
1533
- emoji: React$f.createElement(IconRoot, {
1534
- __self: this,
1535
- __source: {
1536
- fileName: _jsxFileName$d,
1537
- lineNumber: 80
1538
- }
1539
- }, React$f.createElement(Octagon, {
1540
- className: classes.bg,
1541
- __self: this,
1542
- __source: {
1543
- fileName: _jsxFileName$d,
1544
- lineNumber: 81
1545
- }
1546
- }), React$f.createElement(Emoji$1, {
1547
- className: classes.fg,
1548
- __self: this,
1549
- __source: {
1550
- fileName: _jsxFileName$d,
1551
- lineNumber: 82
1552
- }
1553
- })),
1554
- open: {
1555
- check: React$f.createElement(IconRoot, {
1556
- __self: this,
1557
- __source: {
1558
- fileName: _jsxFileName$d,
1559
- lineNumber: 87
1560
- }
1561
- }, React$f.createElement(Exclamation, {
1562
- className: classes.bg,
1563
- __self: this,
1564
- __source: {
1565
- fileName: _jsxFileName$d,
1566
- lineNumber: 88
1567
- }
1568
- })),
1569
- emoji: React$f.createElement(IconRoot, {
1570
- __self: this,
1571
- __source: {
1572
- fileName: _jsxFileName$d,
1573
- lineNumber: 92
1574
- }
1575
- }, React$f.createElement(Emoji$1, {
1576
- className: classes.bg,
1577
- __self: this,
1578
- __source: {
1579
- fileName: _jsxFileName$d,
1580
- lineNumber: 93
1581
- }
1582
- }))
1583
- }
1584
- }
1585
- }
1586
- };
1587
- }
1588
- render() {
1589
- if (this.props.category === undefined) {
1590
- return this.icons[this.props.iconSet];
1591
- } else {
1592
- if (this.props.shape === undefined) {
1593
- return this.icons.feedback[this.props.iconSet];
1594
- } else {
1595
- if (this.props.open === true) {
1596
- return this.icons.feedback.square.open[this.props.iconSet];
1597
- } else {
1598
- return this.icons.feedback.square[this.props.iconSet];
1599
- }
1600
- }
1601
- }
1602
- }
1603
- }
1604
- NothingSubmitted.__initStatic();
1605
- NothingSubmitted.propTypes = {
1606
- iconSet: PropTypes$h.oneOf(['emoji', 'check', undefined]),
1607
- shape: PropTypes$h.oneOf(['square', undefined]),
1608
- category: PropTypes$h.oneOf(['feedback', undefined]),
1609
- open: PropTypes$h.bool
1610
- };
1611
- NothingSubmitted.defaultProps = {
1612
- iconSet: 'check',
1613
- shape: undefined,
1614
- category: undefined,
1615
- open: false
1616
- };
1617
- var nothingSubmittedIcon = withStyles$c(styles$7)(NothingSubmitted);
1618
- const PropTypes$g = _dll_prop_types;
1619
- const React$e = _dll_react;
1620
- const {withStyles: withStyles$b} = _dll_material_ui__core_styles;
1621
- const _jsxFileName$c = "/home/circleci/repo/node_modules/@pie-lib/icons/src/partially-correct-icon.jsx";
1622
- const styles$6 = getStyles('partially-correct', '#4aaf46', '#c1e1ac');
1623
- const Check = ({className}) => React$e.createElement('g', {
1624
- transform: 'translate(0, 0)',
1625
- __self: undefined,
1626
- __source: {
1627
- fileName: _jsxFileName$c,
1628
- lineNumber: 10
1629
- }
1630
- }, React$e.createElement('polygon', {
1631
- className: className,
1632
- points: "27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",
1633
- __self: undefined,
1634
- __source: {
1635
- fileName: _jsxFileName$c,
1636
- lineNumber: 11
1637
- }
1638
- }), React$e.createElement('polygon', {
1639
- className: className,
1640
- points: "16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",
1641
- __self: undefined,
1642
- __source: {
1643
- fileName: _jsxFileName$c,
1644
- lineNumber: 12
1645
- }
1646
- }));
1647
- const Emoji = ({className}) => React$e.createElement('g', {
1648
- transform: 'translate(2, 0)',
1649
- __self: undefined,
1650
- __source: {
1651
- fileName: _jsxFileName$c,
1652
- lineNumber: 17
1653
- }
1654
- }, React$e.createElement('rect', {
1655
- x: "20.6",
1656
- y: "11.8",
1657
- className: className,
1658
- width: "4",
1659
- height: "5",
1660
- __self: undefined,
1661
- __source: {
1662
- fileName: _jsxFileName$c,
1663
- lineNumber: 18
1664
- }
1665
- }), React$e.createElement('rect', {
1666
- x: "11.5",
1667
- y: "11.8",
1668
- className: className,
1669
- width: "4",
1670
- height: "5",
1671
- __self: undefined,
1672
- __source: {
1673
- fileName: _jsxFileName$c,
1674
- lineNumber: 19
1675
- }
1676
- }), React$e.createElement('rect', {
1677
- x: "10.9",
1678
- y: "22.9",
1679
- transform: "matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",
1680
- className: className,
1681
- width: "14.3",
1682
- height: "3.7",
1683
- __self: undefined,
1684
- __source: {
1685
- fileName: _jsxFileName$c,
1686
- lineNumber: 20
1687
- }
1688
- }));
1689
- Emoji.propTypes = Check.propTypes = {
1690
- className: PropTypes$g.string
1691
- };
1692
- const PartiallyCorrect = IconBase(Check, Emoji);
1693
- PartiallyCorrect.propTypes = {
1694
- iconSet: PropTypes$g.oneOf(['emoji', 'check']),
1695
- shape: PropTypes$g.oneOf(['round', 'square']),
1696
- category: PropTypes$g.oneOf(['feedback', undefined]),
1697
- open: PropTypes$g.bool
1698
- };
1699
- PartiallyCorrect.defaultProps = {
1700
- iconSet: 'check',
1701
- shape: 'round',
1702
- category: undefined,
1703
- open: false
1704
- };
1705
- var partiallyCorrectIcon = withStyles$b(styles$6)(PartiallyCorrect);
1706
- const PropTypes$f = _dll_prop_types;
1707
- const React$d = _dll_react;
1708
- const {withStyles: withStyles$a} = _dll_material_ui__core_styles;
1709
- const _jsxFileName$b = "/home/circleci/repo/node_modules/@pie-lib/icons/src/show-rationale-icon.jsx";
1710
- const Info = ({fg}) => React$d.createElement('g', {
1711
- __self: undefined,
1712
- __source: {
1713
- fileName: _jsxFileName$b,
1714
- lineNumber: 7
1715
- }
1716
- }, React$d.createElement('rect', {
1717
- x: "-115",
1718
- y: "136.7",
1719
- className: fg,
1720
- width: "3",
1721
- height: "3",
1722
- __self: undefined,
1723
- __source: {
1724
- fileName: _jsxFileName$b,
1725
- lineNumber: 8
1726
- }
1727
- }), React$d.createElement('polygon', {
1728
- className: fg,
1729
- points: "-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",
1730
- __self: undefined,
1731
- __source: {
1732
- fileName: _jsxFileName$b,
1733
- lineNumber: 9
1734
- }
1735
- }));
1736
- Info.propTypes = {
1737
- fg: PropTypes$f.string
1738
- };
1739
- const Border = ({className}) => React$d.createElement('path', {
1740
- className: className,
1741
- d: "M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5zM-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",
1742
- __self: undefined,
1743
- __source: {
1744
- fileName: _jsxFileName$b,
1745
- lineNumber: 21
1746
- }
1747
- });
1748
- Border.propTypes = {
1749
- className: PropTypes$f.string
1750
- };
1751
- const Circle = () => React$d.createElement('g', {
1752
- __self: undefined,
1753
- __source: {
1754
- fileName: _jsxFileName$b,
1755
- lineNumber: 30
1756
- }
1757
- }, React$d.createElement('path', {
1758
- style: {
1759
- fill: '#D0CAC5',
1760
- stroke: '#E6E3E0',
1761
- strokeWidth: 0.75,
1762
- strokeMiterlimit: 10
1763
- },
1764
- d: "M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z",
1765
- __self: undefined,
1766
- __source: {
1767
- fileName: _jsxFileName$b,
1768
- lineNumber: 31
1769
- }
1770
- }), React$d.createElement('path', {
1771
- style: {
1772
- fill: '#B3ABA4',
1773
- stroke: '#CDC7C2',
1774
- strokeWidth: 0.5,
1775
- strokeMiterlimit: 10
1776
- },
1777
- d: "M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z",
1778
- __self: undefined,
1779
- __source: {
1780
- fileName: _jsxFileName$b,
1781
- lineNumber: 40
1782
- }
1783
- }), React$d.createElement('circle', {
1784
- style: {
1785
- fill: '#FFFFFF'
1786
- },
1787
- cx: "-113",
1788
- cy: "144",
1789
- r: "14",
1790
- __self: undefined,
1791
- __source: {
1792
- fileName: _jsxFileName$b,
1793
- lineNumber: 49
1794
- }
1795
- }));
1796
- const Root = ({children, size}) => {
1797
- size = normalizeSize(size);
1798
- const style = {
1799
- height: size,
1800
- width: size,
1801
- display: 'inline-block',
1802
- position: 'relative'
1803
- };
1804
- return React$d.createElement('div', {
1805
- style: style,
1806
- __self: undefined,
1807
- __source: {
1808
- fileName: _jsxFileName$b,
1809
- lineNumber: 63
1810
- }
1811
- }, React$d.createElement('svg', {
1812
- preserveAspectRatio: "xMinYMin meet",
1813
- viewBox: "-129 128 34 34",
1814
- __self: undefined,
1815
- __source: {
1816
- fileName: _jsxFileName$b,
1817
- lineNumber: 64
1818
- }
1819
- }, children));
1820
- };
1821
- Root.propTypes = {
1822
- children: PropTypes$f.oneOfType([PropTypes$f.arrayOf(PropTypes$f.node), PropTypes$f.node]).isRequired,
1823
- size: PropTypes$f.number
1824
- };
1825
- const styles$5 = {
1826
- fg: {
1827
- fill: '#1a9cff'
1828
- },
1829
- bg: {
1830
- fill: '#bce2ff'
1831
- },
1832
- border: {
1833
- fill: '#bbe3fd'
1834
- },
1835
- whiteBorder: {
1836
- fill: 'white'
1837
- }
1838
- };
1839
- class ShowRationale extends React$d.Component {
1840
- static __initStatic() {
1841
- this.propTypes = {
1842
- classes: PropTypes$f.object.isRequired
1843
- };
1844
- }
1845
- constructor(props) {
1846
- super(props);
1847
- }
1848
- render() {
1849
- const {classes} = this.props;
1850
- const info = React$d.createElement(Info, {
1851
- fg: classes.fg,
1852
- __self: this,
1853
- __source: {
1854
- fileName: _jsxFileName$b,
1855
- lineNumber: 102
1856
- }
1857
- });
1858
- const icons = {
1859
- check: React$d.createElement(Root, {
1860
- __self: this,
1861
- __source: {
1862
- fileName: _jsxFileName$b,
1863
- lineNumber: 105
1864
- }
1865
- }, React$d.createElement(Circle, {
1866
- __self: this,
1867
- __source: {
1868
- fileName: _jsxFileName$b,
1869
- lineNumber: 106
1870
- }
1871
- }), info, React$d.createElement(Border, {
1872
- className: classes.border,
1873
- __self: this,
1874
- __source: {
1875
- fileName: _jsxFileName$b,
1876
- lineNumber: 108
1877
- }
1878
- })),
1879
- emoji: React$d.createElement(Root, {
1880
- __self: this,
1881
- __source: {
1882
- fileName: _jsxFileName$b,
1883
- lineNumber: 112
1884
- }
1885
- }, React$d.createElement(Circle, {
1886
- __self: this,
1887
- __source: {
1888
- fileName: _jsxFileName$b,
1889
- lineNumber: 113
1890
- }
1891
- }), info, React$d.createElement(Border, {
1892
- className: classes.border,
1893
- __self: this,
1894
- __source: {
1895
- fileName: _jsxFileName$b,
1896
- lineNumber: 115
1897
- }
1898
- })),
1899
- open: {
1900
- check: React$d.createElement(Root, {
1901
- __self: this,
1902
- __source: {
1903
- fileName: _jsxFileName$b,
1904
- lineNumber: 120
1905
- }
1906
- }, React$d.createElement('circle', {
1907
- style: {
1908
- fill: '#FFFFFF'
1909
- },
1910
- cx: "-113",
1911
- cy: "144",
1912
- r: "14",
1913
- __self: this,
1914
- __source: {
1915
- fileName: _jsxFileName$b,
1916
- lineNumber: 121
1917
- }
1918
- }), React$d.createElement(Info, {
1919
- fg: classes.bg,
1920
- border: classes.whiteBorder,
1921
- __self: this,
1922
- __source: {
1923
- fileName: _jsxFileName$b,
1924
- lineNumber: 122
1925
- }
1926
- })),
1927
- emoji: React$d.createElement(Root, {
1928
- __self: this,
1929
- __source: {
1930
- fileName: _jsxFileName$b,
1931
- lineNumber: 126
1932
- }
1933
- }, React$d.createElement('circle', {
1934
- style: {
1935
- fill: '#FFFFFF'
1936
- },
1937
- cx: "-113",
1938
- cy: "144",
1939
- r: "14",
1940
- __self: this,
1941
- __source: {
1942
- fileName: _jsxFileName$b,
1943
- lineNumber: 127
1944
- }
1945
- }), React$d.createElement(Info, {
1946
- fg: classes.bg,
1947
- border: classes.border,
1948
- __self: this,
1949
- __source: {
1950
- fileName: _jsxFileName$b,
1951
- lineNumber: 128
1952
- }
1953
- }))
1954
- }
1955
- };
1956
- if (this.props.open === true) {
1957
- return icons.open[this.props.iconSet];
1958
- } else {
1959
- return icons[this.props.iconSet];
1960
- }
1961
- }
1962
- }
1963
- ShowRationale.__initStatic();
1964
- ShowRationale.propTypes = {
1965
- iconSet: PropTypes$f.oneOf(['emoji', 'check']),
1966
- open: PropTypes$f.bool
1967
- };
1968
- ShowRationale.defaultProps = {
1969
- iconSet: 'check',
1970
- open: false
1971
- };
1972
- withStyles$a(styles$5)(ShowRationale);
1973
- function getDefaultExportFromCjs(x) {
1974
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1975
- }
1976
- function getAugmentedNamespace(n) {
1977
- if (n.__esModule) return n;
1978
- var a = Object.defineProperty({}, '__esModule', {
1979
- value: true
1980
- });
1981
- Object.keys(n).forEach(function (k) {
1982
- var d = Object.getOwnPropertyDescriptor(n, k);
1983
- Object.defineProperty(a, k, d.get ? d : {
1984
- enumerable: true,
1985
- get: function () {
1986
- return n[k];
1987
- }
1988
- });
1989
- });
1990
- return a;
1991
- }
1992
- var CSSTransition$1 = {
1993
- exports: {}
1994
- };
1995
- var addClass = {
1996
- exports: {}
1997
- };
1998
- var interopRequireDefault = {
1999
- exports: {}
2000
- };
2001
- (function (module) {
2002
- function _interopRequireDefault(obj) {
2003
- return obj && obj.__esModule ? obj : {
2004
- "default": obj
2005
- };
2006
- }
2007
- (module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports);
2008
- })(interopRequireDefault);
2009
- getDefaultExportFromCjs(interopRequireDefault.exports);
2010
- var hasClass = {
2011
- exports: {}
2012
- };
2013
- (function (module, exports) {
2014
- exports.__esModule = true;
2015
- exports.default = hasClass;
2016
- function hasClass(element, className) {
2017
- if (element.classList) return !!className && element.classList.contains(className); else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
2018
- }
2019
- module.exports = exports["default"];
2020
- })(hasClass, hasClass.exports);
2021
- getDefaultExportFromCjs(hasClass.exports);
2022
- (function (module, exports) {
2023
- var _interopRequireDefault = interopRequireDefault.exports;
2024
- exports.__esModule = true;
2025
- exports.default = addClass;
2026
- var _hasClass = _interopRequireDefault(hasClass.exports);
2027
- function addClass(element, className) {
2028
- if (element.classList) element.classList.add(className); else if (!(0, _hasClass.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className; else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);
2029
- }
2030
- module.exports = exports["default"];
2031
- })(addClass, addClass.exports);
2032
- getDefaultExportFromCjs(addClass.exports);
2033
- function replaceClassName(origClass, classToRemove) {
2034
- return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
2035
- }
2036
- var removeClass = function removeClass(element, className) {
2037
- if (element.classList) element.classList.remove(className); else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className); else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
2038
- };
2039
- var Transition$1 = {};
2040
- function componentWillMount() {
2041
- var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
2042
- if (state !== null && state !== undefined) {
2043
- this.setState(state);
2044
- }
2045
- }
2046
- function componentWillReceiveProps(nextProps) {
2047
- function updater(prevState) {
2048
- var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
2049
- return state !== null && state !== undefined ? state : null;
2050
- }
2051
- this.setState(updater.bind(this));
2052
- }
2053
- function componentWillUpdate(nextProps, nextState) {
2054
- try {
2055
- var prevProps = this.props;
2056
- var prevState = this.state;
2057
- this.props = nextProps;
2058
- this.state = nextState;
2059
- this.__reactInternalSnapshotFlag = true;
2060
- this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
2061
- } finally {
2062
- this.props = prevProps;
2063
- this.state = prevState;
2064
- }
2065
- }
2066
- componentWillMount.__suppressDeprecationWarning = true;
2067
- componentWillReceiveProps.__suppressDeprecationWarning = true;
2068
- componentWillUpdate.__suppressDeprecationWarning = true;
2069
- function polyfill(Component) {
2070
- var prototype = Component.prototype;
2071
- if (!prototype || !prototype.isReactComponent) {
2072
- throw new Error('Can only polyfill class components');
2073
- }
2074
- if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
2075
- return Component;
2076
- }
2077
- var foundWillMountName = null;
2078
- var foundWillReceivePropsName = null;
2079
- var foundWillUpdateName = null;
2080
- if (typeof prototype.componentWillMount === 'function') {
2081
- foundWillMountName = 'componentWillMount';
2082
- } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
2083
- foundWillMountName = 'UNSAFE_componentWillMount';
2084
- }
2085
- if (typeof prototype.componentWillReceiveProps === 'function') {
2086
- foundWillReceivePropsName = 'componentWillReceiveProps';
2087
- } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
2088
- foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
2089
- }
2090
- if (typeof prototype.componentWillUpdate === 'function') {
2091
- foundWillUpdateName = 'componentWillUpdate';
2092
- } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
2093
- foundWillUpdateName = 'UNSAFE_componentWillUpdate';
2094
- }
2095
- if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
2096
- var componentName = Component.displayName || Component.name;
2097
- var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
2098
- throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
2099
- }
2100
- if (typeof Component.getDerivedStateFromProps === 'function') {
2101
- prototype.componentWillMount = componentWillMount;
2102
- prototype.componentWillReceiveProps = componentWillReceiveProps;
2103
- }
2104
- if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
2105
- if (typeof prototype.componentDidUpdate !== 'function') {
2106
- throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
2107
- }
2108
- prototype.componentWillUpdate = componentWillUpdate;
2109
- var componentDidUpdate = prototype.componentDidUpdate;
2110
- prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
2111
- var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
2112
- componentDidUpdate.call(this, prevProps, prevState, snapshot);
2113
- };
2114
- }
2115
- return Component;
2116
- }
2117
- var reactLifecyclesCompat_es = Object.freeze({
2118
- __proto__: null,
2119
- polyfill: polyfill
2120
- });
2121
- var require$$2$2 = getAugmentedNamespace(reactLifecyclesCompat_es);
2122
- var PropTypes$e = {};
2123
- const require$$0$5 = _dll_prop_types;
2124
- PropTypes$e.__esModule = true;
2125
- PropTypes$e.classNamesShape = PropTypes$e.timeoutsShape = void 0;
2126
- var _propTypes = _interopRequireDefault$2(require$$0$5);
2127
- function _interopRequireDefault$2(obj) {
2128
- return obj && obj.__esModule ? obj : {
2129
- default: obj
2130
- };
2131
- }
2132
- var timeoutsShape = _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
2133
- enter: _propTypes.default.number,
2134
- exit: _propTypes.default.number,
2135
- appear: _propTypes.default.number
2136
- }).isRequired]);
2137
- PropTypes$e.timeoutsShape = timeoutsShape;
2138
- var classNamesShape = _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
2139
- enter: _propTypes.default.string,
2140
- exit: _propTypes.default.string,
2141
- active: _propTypes.default.string
2142
- }), _propTypes.default.shape({
2143
- enter: _propTypes.default.string,
2144
- enterDone: _propTypes.default.string,
2145
- enterActive: _propTypes.default.string,
2146
- exit: _propTypes.default.string,
2147
- exitDone: _propTypes.default.string,
2148
- exitActive: _propTypes.default.string
2149
- })]);
2150
- PropTypes$e.classNamesShape = classNamesShape;
2151
- const require$$0$4 = _dll_prop_types;
2152
- const require$$1$2 = _dll_react;
2153
- const require$$2$1 = _dll_react_dom;
2154
- Transition$1.__esModule = true;
2155
- Transition$1.default = Transition$1.EXITING = Transition$1.ENTERED = Transition$1.ENTERING = Transition$1.EXITED = Transition$1.UNMOUNTED = void 0;
2156
- var PropTypes$d = _interopRequireWildcard(require$$0$4);
2157
- var _react$1 = _interopRequireDefault$1(require$$1$2);
2158
- var _reactDom = _interopRequireDefault$1(require$$2$1);
2159
- var _reactLifecyclesCompat = require$$2$2;
2160
- var _PropTypes = PropTypes$e;
2161
- function _interopRequireDefault$1(obj) {
2162
- return obj && obj.__esModule ? obj : {
2163
- default: obj
2164
- };
2165
- }
2166
- function _interopRequireWildcard(obj) {
2167
- if (obj && obj.__esModule) {
2168
- return obj;
2169
- } else {
2170
- var newObj = {};
2171
- if (obj != null) {
2172
- for (var key in obj) {
2173
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2174
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
2175
- if (desc.get || desc.set) {
2176
- Object.defineProperty(newObj, key, desc);
2177
- } else {
2178
- newObj[key] = obj[key];
2179
- }
2180
- }
2181
- }
2182
- }
2183
- newObj.default = obj;
2184
- return newObj;
2185
- }
2186
- }
2187
- function _objectWithoutPropertiesLoose(source, excluded) {
2188
- if (source == null) return {};
2189
- var target = {};
2190
- var sourceKeys = Object.keys(source);
2191
- var key, i;
2192
- for (i = 0; i < sourceKeys.length; i++) {
2193
- key = sourceKeys[i];
2194
- if (excluded.indexOf(key) >= 0) continue;
2195
- target[key] = source[key];
2196
- }
2197
- return target;
2198
- }
2199
- function _inheritsLoose(subClass, superClass) {
2200
- subClass.prototype = Object.create(superClass.prototype);
2201
- subClass.prototype.constructor = subClass;
2202
- subClass.__proto__ = superClass;
2203
- }
2204
- var UNMOUNTED = 'unmounted';
2205
- Transition$1.UNMOUNTED = UNMOUNTED;
2206
- var EXITED = 'exited';
2207
- Transition$1.EXITED = EXITED;
2208
- var ENTERING = 'entering';
2209
- Transition$1.ENTERING = ENTERING;
2210
- var ENTERED = 'entered';
2211
- Transition$1.ENTERED = ENTERED;
2212
- var EXITING = 'exiting';
2213
- Transition$1.EXITING = EXITING;
2214
- var Transition = (function (_React$Component) {
2215
- _inheritsLoose(Transition, _React$Component);
2216
- function Transition(props, context) {
2217
- var _this;
2218
- _this = _React$Component.call(this, props, context) || this;
2219
- var parentGroup = context.transitionGroup;
2220
- var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
2221
- var initialStatus;
2222
- _this.appearStatus = null;
2223
- if (props.in) {
2224
- if (appear) {
2225
- initialStatus = EXITED;
2226
- _this.appearStatus = ENTERING;
2227
- } else {
2228
- initialStatus = ENTERED;
2229
- }
2230
- } else {
2231
- if (props.unmountOnExit || props.mountOnEnter) {
2232
- initialStatus = UNMOUNTED;
2233
- } else {
2234
- initialStatus = EXITED;
2235
- }
2236
- }
2237
- _this.state = {
2238
- status: initialStatus
2239
- };
2240
- _this.nextCallback = null;
2241
- return _this;
2242
- }
2243
- var _proto = Transition.prototype;
2244
- _proto.getChildContext = function getChildContext() {
2245
- return {
2246
- transitionGroup: null
2247
- };
2248
- };
2249
- Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
2250
- var nextIn = _ref.in;
2251
- if (nextIn && prevState.status === UNMOUNTED) {
2252
- return {
2253
- status: EXITED
2254
- };
2255
- }
2256
- return null;
2257
- };
2258
- _proto.componentDidMount = function componentDidMount() {
2259
- this.updateStatus(true, this.appearStatus);
2260
- };
2261
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
2262
- var nextStatus = null;
2263
- if (prevProps !== this.props) {
2264
- var status = this.state.status;
2265
- if (this.props.in) {
2266
- if (status !== ENTERING && status !== ENTERED) {
2267
- nextStatus = ENTERING;
2268
- }
2269
- } else {
2270
- if (status === ENTERING || status === ENTERED) {
2271
- nextStatus = EXITING;
2272
- }
2273
- }
2274
- }
2275
- this.updateStatus(false, nextStatus);
2276
- };
2277
- _proto.componentWillUnmount = function componentWillUnmount() {
2278
- this.cancelNextCallback();
2279
- };
2280
- _proto.getTimeouts = function getTimeouts() {
2281
- var timeout = this.props.timeout;
2282
- var exit, enter, appear;
2283
- exit = enter = appear = timeout;
2284
- if (timeout != null && typeof timeout !== 'number') {
2285
- exit = timeout.exit;
2286
- enter = timeout.enter;
2287
- appear = timeout.appear !== undefined ? timeout.appear : enter;
2288
- }
2289
- return {
2290
- exit: exit,
2291
- enter: enter,
2292
- appear: appear
2293
- };
2294
- };
2295
- _proto.updateStatus = function updateStatus(mounting, nextStatus) {
2296
- if (mounting === void 0) {
2297
- mounting = false;
2298
- }
2299
- if (nextStatus !== null) {
2300
- this.cancelNextCallback();
2301
- var node = _reactDom.default.findDOMNode(this);
2302
- if (nextStatus === ENTERING) {
2303
- this.performEnter(node, mounting);
2304
- } else {
2305
- this.performExit(node);
2306
- }
2307
- } else if (this.props.unmountOnExit && this.state.status === EXITED) {
2308
- this.setState({
2309
- status: UNMOUNTED
2310
- });
2311
- }
2312
- };
2313
- _proto.performEnter = function performEnter(node, mounting) {
2314
- var _this2 = this;
2315
- var enter = this.props.enter;
2316
- var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
2317
- var timeouts = this.getTimeouts();
2318
- var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
2319
- if (!mounting && !enter) {
2320
- this.safeSetState({
2321
- status: ENTERED
2322
- }, function () {
2323
- _this2.props.onEntered(node);
2324
- });
2325
- return;
2326
- }
2327
- this.props.onEnter(node, appearing);
2328
- this.safeSetState({
2329
- status: ENTERING
2330
- }, function () {
2331
- _this2.props.onEntering(node, appearing);
2332
- _this2.onTransitionEnd(node, enterTimeout, function () {
2333
- _this2.safeSetState({
2334
- status: ENTERED
2335
- }, function () {
2336
- _this2.props.onEntered(node, appearing);
2337
- });
2338
- });
2339
- });
2340
- };
2341
- _proto.performExit = function performExit(node) {
2342
- var _this3 = this;
2343
- var exit = this.props.exit;
2344
- var timeouts = this.getTimeouts();
2345
- if (!exit) {
2346
- this.safeSetState({
2347
- status: EXITED
2348
- }, function () {
2349
- _this3.props.onExited(node);
2350
- });
2351
- return;
2352
- }
2353
- this.props.onExit(node);
2354
- this.safeSetState({
2355
- status: EXITING
2356
- }, function () {
2357
- _this3.props.onExiting(node);
2358
- _this3.onTransitionEnd(node, timeouts.exit, function () {
2359
- _this3.safeSetState({
2360
- status: EXITED
2361
- }, function () {
2362
- _this3.props.onExited(node);
2363
- });
2364
- });
2365
- });
2366
- };
2367
- _proto.cancelNextCallback = function cancelNextCallback() {
2368
- if (this.nextCallback !== null) {
2369
- this.nextCallback.cancel();
2370
- this.nextCallback = null;
2371
- }
2372
- };
2373
- _proto.safeSetState = function safeSetState(nextState, callback) {
2374
- callback = this.setNextCallback(callback);
2375
- this.setState(nextState, callback);
2376
- };
2377
- _proto.setNextCallback = function setNextCallback(callback) {
2378
- var _this4 = this;
2379
- var active = true;
2380
- this.nextCallback = function (event) {
2381
- if (active) {
2382
- active = false;
2383
- _this4.nextCallback = null;
2384
- callback(event);
2385
- }
2386
- };
2387
- this.nextCallback.cancel = function () {
2388
- active = false;
2389
- };
2390
- return this.nextCallback;
2391
- };
2392
- _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
2393
- this.setNextCallback(handler);
2394
- var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
2395
- if (!node || doesNotHaveTimeoutOrListener) {
2396
- setTimeout(this.nextCallback, 0);
2397
- return;
2398
- }
2399
- if (this.props.addEndListener) {
2400
- this.props.addEndListener(node, this.nextCallback);
2401
- }
2402
- if (timeout != null) {
2403
- setTimeout(this.nextCallback, timeout);
2404
- }
2405
- };
2406
- _proto.render = function render() {
2407
- var status = this.state.status;
2408
- if (status === UNMOUNTED) {
2409
- return null;
2410
- }
2411
- var _this$props = this.props, children = _this$props.children, childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]);
2412
- delete childProps.in;
2413
- delete childProps.mountOnEnter;
2414
- delete childProps.unmountOnExit;
2415
- delete childProps.appear;
2416
- delete childProps.enter;
2417
- delete childProps.exit;
2418
- delete childProps.timeout;
2419
- delete childProps.addEndListener;
2420
- delete childProps.onEnter;
2421
- delete childProps.onEntering;
2422
- delete childProps.onEntered;
2423
- delete childProps.onExit;
2424
- delete childProps.onExiting;
2425
- delete childProps.onExited;
2426
- if (typeof children === 'function') {
2427
- return children(status, childProps);
2428
- }
2429
- var child = _react$1.default.Children.only(children);
2430
- return _react$1.default.cloneElement(child, childProps);
2431
- };
2432
- return Transition;
2433
- })(_react$1.default.Component);
2434
- Transition.contextTypes = {
2435
- transitionGroup: PropTypes$d.object
2436
- };
2437
- Transition.childContextTypes = {
2438
- transitionGroup: function transitionGroup() {}
2439
- };
2440
- Transition.propTypes = {
2441
- children: PropTypes$d.oneOfType([PropTypes$d.func.isRequired, PropTypes$d.element.isRequired]).isRequired,
2442
- in: PropTypes$d.bool,
2443
- mountOnEnter: PropTypes$d.bool,
2444
- unmountOnExit: PropTypes$d.bool,
2445
- appear: PropTypes$d.bool,
2446
- enter: PropTypes$d.bool,
2447
- exit: PropTypes$d.bool,
2448
- timeout: function timeout(props) {
2449
- var pt = _PropTypes.timeoutsShape;
2450
- if (!props.addEndListener) pt = pt.isRequired;
2451
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2452
- args[_key - 1] = arguments[_key];
2453
- }
2454
- return pt.apply(void 0, [props].concat(args));
2455
- },
2456
- addEndListener: PropTypes$d.func,
2457
- onEnter: PropTypes$d.func,
2458
- onEntering: PropTypes$d.func,
2459
- onEntered: PropTypes$d.func,
2460
- onExit: PropTypes$d.func,
2461
- onExiting: PropTypes$d.func,
2462
- onExited: PropTypes$d.func
2463
- };
2464
- function noop() {}
2465
- Transition.defaultProps = {
2466
- in: false,
2467
- mountOnEnter: false,
2468
- unmountOnExit: false,
2469
- appear: false,
2470
- enter: true,
2471
- exit: true,
2472
- onEnter: noop,
2473
- onEntering: noop,
2474
- onEntered: noop,
2475
- onExit: noop,
2476
- onExiting: noop,
2477
- onExited: noop
2478
- };
2479
- Transition.UNMOUNTED = 0;
2480
- Transition.EXITED = 1;
2481
- Transition.ENTERING = 2;
2482
- Transition.ENTERED = 3;
2483
- Transition.EXITING = 4;
2484
- var _default = (0, _reactLifecyclesCompat.polyfill)(Transition);
2485
- Transition$1.default = _default;
2486
- const require$$0$3 = _dll_prop_types;
2487
- const require$$3 = _dll_react;
2488
- (function (module, exports) {
2489
- exports.__esModule = true;
2490
- exports.default = void 0;
2491
- var PropTypes = _interopRequireWildcard(require$$0$3);
2492
- var _addClass = _interopRequireDefault(addClass.exports);
2493
- var _removeClass = _interopRequireDefault(removeClass);
2494
- var _react = _interopRequireDefault(require$$3);
2495
- var _Transition = _interopRequireDefault(Transition$1);
2496
- var _PropTypes = PropTypes$e;
2497
- function _interopRequireDefault(obj) {
2498
- return obj && obj.__esModule ? obj : {
2499
- default: obj
2500
- };
2501
- }
2502
- function _interopRequireWildcard(obj) {
2503
- if (obj && obj.__esModule) {
2504
- return obj;
2505
- } else {
2506
- var newObj = {};
2507
- if (obj != null) {
2508
- for (var key in obj) {
2509
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2510
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
2511
- if (desc.get || desc.set) {
2512
- Object.defineProperty(newObj, key, desc);
2513
- } else {
2514
- newObj[key] = obj[key];
2515
- }
2516
- }
2517
- }
2518
- }
2519
- newObj.default = obj;
2520
- return newObj;
2521
- }
2522
- }
2523
- function _extends() {
2524
- _extends = Object.assign || (function (target) {
2525
- for (var i = 1; i < arguments.length; i++) {
2526
- var source = arguments[i];
2527
- for (var key in source) {
2528
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2529
- target[key] = source[key];
2530
- }
2531
- }
2532
- }
2533
- return target;
2534
- });
2535
- return _extends.apply(this, arguments);
2536
- }
2537
- function _inheritsLoose(subClass, superClass) {
2538
- subClass.prototype = Object.create(superClass.prototype);
2539
- subClass.prototype.constructor = subClass;
2540
- subClass.__proto__ = superClass;
2541
- }
2542
- var addClass$1 = function addClass(node, classes) {
2543
- return node && classes && classes.split(' ').forEach(function (c) {
2544
- return (0, _addClass.default)(node, c);
2545
- });
2546
- };
2547
- var removeClass$1 = function removeClass(node, classes) {
2548
- return node && classes && classes.split(' ').forEach(function (c) {
2549
- return (0, _removeClass.default)(node, c);
2550
- });
2551
- };
2552
- var CSSTransition = (function (_React$Component) {
2553
- _inheritsLoose(CSSTransition, _React$Component);
2554
- function CSSTransition() {
2555
- var _this;
2556
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2557
- args[_key] = arguments[_key];
2558
- }
2559
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2560
- _this.onEnter = function (node, appearing) {
2561
- var _this$getClassNames = _this.getClassNames(appearing ? 'appear' : 'enter'), className = _this$getClassNames.className;
2562
- _this.removeClasses(node, 'exit');
2563
- addClass$1(node, className);
2564
- if (_this.props.onEnter) {
2565
- _this.props.onEnter(node, appearing);
2566
- }
2567
- };
2568
- _this.onEntering = function (node, appearing) {
2569
- var _this$getClassNames2 = _this.getClassNames(appearing ? 'appear' : 'enter'), activeClassName = _this$getClassNames2.activeClassName;
2570
- _this.reflowAndAddClass(node, activeClassName);
2571
- if (_this.props.onEntering) {
2572
- _this.props.onEntering(node, appearing);
2573
- }
2574
- };
2575
- _this.onEntered = function (node, appearing) {
2576
- var appearClassName = _this.getClassNames('appear').doneClassName;
2577
- var enterClassName = _this.getClassNames('enter').doneClassName;
2578
- var doneClassName = appearing ? appearClassName + " " + enterClassName : enterClassName;
2579
- _this.removeClasses(node, appearing ? 'appear' : 'enter');
2580
- addClass$1(node, doneClassName);
2581
- if (_this.props.onEntered) {
2582
- _this.props.onEntered(node, appearing);
2583
- }
2584
- };
2585
- _this.onExit = function (node) {
2586
- var _this$getClassNames3 = _this.getClassNames('exit'), className = _this$getClassNames3.className;
2587
- _this.removeClasses(node, 'appear');
2588
- _this.removeClasses(node, 'enter');
2589
- addClass$1(node, className);
2590
- if (_this.props.onExit) {
2591
- _this.props.onExit(node);
2592
- }
2593
- };
2594
- _this.onExiting = function (node) {
2595
- var _this$getClassNames4 = _this.getClassNames('exit'), activeClassName = _this$getClassNames4.activeClassName;
2596
- _this.reflowAndAddClass(node, activeClassName);
2597
- if (_this.props.onExiting) {
2598
- _this.props.onExiting(node);
2599
- }
2600
- };
2601
- _this.onExited = function (node) {
2602
- var _this$getClassNames5 = _this.getClassNames('exit'), doneClassName = _this$getClassNames5.doneClassName;
2603
- _this.removeClasses(node, 'exit');
2604
- addClass$1(node, doneClassName);
2605
- if (_this.props.onExited) {
2606
- _this.props.onExited(node);
2607
- }
2608
- };
2609
- _this.getClassNames = function (type) {
2610
- var classNames = _this.props.classNames;
2611
- var isStringClassNames = typeof classNames === 'string';
2612
- var prefix = isStringClassNames && classNames ? classNames + '-' : '';
2613
- var className = isStringClassNames ? prefix + type : classNames[type];
2614
- var activeClassName = isStringClassNames ? className + '-active' : classNames[type + 'Active'];
2615
- var doneClassName = isStringClassNames ? className + '-done' : classNames[type + 'Done'];
2616
- return {
2617
- className: className,
2618
- activeClassName: activeClassName,
2619
- doneClassName: doneClassName
2620
- };
2621
- };
2622
- return _this;
2623
- }
2624
- var _proto = CSSTransition.prototype;
2625
- _proto.removeClasses = function removeClasses(node, type) {
2626
- var _this$getClassNames6 = this.getClassNames(type), className = _this$getClassNames6.className, activeClassName = _this$getClassNames6.activeClassName, doneClassName = _this$getClassNames6.doneClassName;
2627
- className && removeClass$1(node, className);
2628
- activeClassName && removeClass$1(node, activeClassName);
2629
- doneClassName && removeClass$1(node, doneClassName);
2630
- };
2631
- _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {
2632
- if (className) {
2633
- node && node.scrollTop;
2634
- addClass$1(node, className);
2635
- }
2636
- };
2637
- _proto.render = function render() {
2638
- var props = _extends({}, this.props);
2639
- delete props.classNames;
2640
- return _react.default.createElement(_Transition.default, _extends({}, props, {
2641
- onEnter: this.onEnter,
2642
- onEntered: this.onEntered,
2643
- onEntering: this.onEntering,
2644
- onExit: this.onExit,
2645
- onExiting: this.onExiting,
2646
- onExited: this.onExited
2647
- }));
2648
- };
2649
- return CSSTransition;
2650
- })(_react.default.Component);
2651
- CSSTransition.defaultProps = {
2652
- classNames: ''
2653
- };
2654
- CSSTransition.propTypes = _extends({}, _Transition.default.propTypes, {
2655
- classNames: _PropTypes.classNamesShape,
2656
- onEnter: PropTypes.func,
2657
- onEntering: PropTypes.func,
2658
- onEntered: PropTypes.func,
2659
- onExit: PropTypes.func,
2660
- onExiting: PropTypes.func,
2661
- onExited: PropTypes.func
2662
- });
2663
- var _default = CSSTransition;
2664
- exports.default = _default;
2665
- module.exports = exports["default"];
2666
- })(CSSTransition$1, CSSTransition$1.exports);
2667
- var CSSTransition = getDefaultExportFromCjs(CSSTransition$1.exports);
2668
- var ReplaceTransition = {
2669
- exports: {}
2670
- };
2671
- var TransitionGroup = {
2672
- exports: {}
2673
- };
2674
- var ChildMapping = {};
2675
- const require$$0$2 = _dll_react;
2676
- ChildMapping.__esModule = true;
2677
- ChildMapping.getChildMapping = getChildMapping;
2678
- ChildMapping.mergeChildMappings = mergeChildMappings;
2679
- ChildMapping.getInitialChildMapping = getInitialChildMapping;
2680
- ChildMapping.getNextChildMapping = getNextChildMapping;
2681
- var _react = require$$0$2;
2682
- function getChildMapping(children, mapFn) {
2683
- var mapper = function mapper(child) {
2684
- return mapFn && (0, _react.isValidElement)(child) ? mapFn(child) : child;
2685
- };
2686
- var result = Object.create(null);
2687
- if (children) _react.Children.map(children, function (c) {
2688
- return c;
2689
- }).forEach(function (child) {
2690
- result[child.key] = mapper(child);
2691
- });
2692
- return result;
2693
- }
2694
- function mergeChildMappings(prev, next) {
2695
- prev = prev || ({});
2696
- next = next || ({});
2697
- function getValueForKey(key) {
2698
- return (key in next) ? next[key] : prev[key];
2699
- }
2700
- var nextKeysPending = Object.create(null);
2701
- var pendingKeys = [];
2702
- for (var prevKey in prev) {
2703
- if ((prevKey in next)) {
2704
- if (pendingKeys.length) {
2705
- nextKeysPending[prevKey] = pendingKeys;
2706
- pendingKeys = [];
2707
- }
2708
- } else {
2709
- pendingKeys.push(prevKey);
2710
- }
2711
- }
2712
- var i;
2713
- var childMapping = {};
2714
- for (var nextKey in next) {
2715
- if (nextKeysPending[nextKey]) {
2716
- for (i = 0; i < nextKeysPending[nextKey].length; i++) {
2717
- var pendingNextKey = nextKeysPending[nextKey][i];
2718
- childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
2719
- }
2720
- }
2721
- childMapping[nextKey] = getValueForKey(nextKey);
2722
- }
2723
- for (i = 0; i < pendingKeys.length; i++) {
2724
- childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
2725
- }
2726
- return childMapping;
2727
- }
2728
- function getProp(child, prop, props) {
2729
- return props[prop] != null ? props[prop] : child.props[prop];
2730
- }
2731
- function getInitialChildMapping(props, onExited) {
2732
- return getChildMapping(props.children, function (child) {
2733
- return (0, _react.cloneElement)(child, {
2734
- onExited: onExited.bind(null, child),
2735
- in: true,
2736
- appear: getProp(child, 'appear', props),
2737
- enter: getProp(child, 'enter', props),
2738
- exit: getProp(child, 'exit', props)
2739
- });
2740
- });
2741
- }
2742
- function getNextChildMapping(nextProps, prevChildMapping, onExited) {
2743
- var nextChildMapping = getChildMapping(nextProps.children);
2744
- var children = mergeChildMappings(prevChildMapping, nextChildMapping);
2745
- Object.keys(children).forEach(function (key) {
2746
- var child = children[key];
2747
- if (!(0, _react.isValidElement)(child)) return;
2748
- var hasPrev = (key in prevChildMapping);
2749
- var hasNext = (key in nextChildMapping);
2750
- var prevChild = prevChildMapping[key];
2751
- var isLeaving = (0, _react.isValidElement)(prevChild) && !prevChild.props.in;
2752
- if (hasNext && (!hasPrev || isLeaving)) {
2753
- children[key] = (0, _react.cloneElement)(child, {
2754
- onExited: onExited.bind(null, child),
2755
- in: true,
2756
- exit: getProp(child, 'exit', nextProps),
2757
- enter: getProp(child, 'enter', nextProps)
2758
- });
2759
- } else if (!hasNext && hasPrev && !isLeaving) {
2760
- children[key] = (0, _react.cloneElement)(child, {
2761
- in: false
2762
- });
2763
- } else if (hasNext && hasPrev && (0, _react.isValidElement)(prevChild)) {
2764
- children[key] = (0, _react.cloneElement)(child, {
2765
- onExited: onExited.bind(null, child),
2766
- in: prevChild.props.in,
2767
- exit: getProp(child, 'exit', nextProps),
2768
- enter: getProp(child, 'enter', nextProps)
2769
- });
2770
- }
2771
- });
2772
- return children;
2773
- }
2774
- const require$$0$1 = _dll_prop_types;
2775
- const require$$1$1 = _dll_react;
2776
- (function (module, exports) {
2777
- exports.__esModule = true;
2778
- exports.default = void 0;
2779
- var _propTypes = _interopRequireDefault(require$$0$1);
2780
- var _react = _interopRequireDefault(require$$1$1);
2781
- var _reactLifecyclesCompat = require$$2$2;
2782
- var _ChildMapping = ChildMapping;
2783
- function _interopRequireDefault(obj) {
2784
- return obj && obj.__esModule ? obj : {
2785
- default: obj
2786
- };
2787
- }
2788
- function _objectWithoutPropertiesLoose(source, excluded) {
2789
- if (source == null) return {};
2790
- var target = {};
2791
- var sourceKeys = Object.keys(source);
2792
- var key, i;
2793
- for (i = 0; i < sourceKeys.length; i++) {
2794
- key = sourceKeys[i];
2795
- if (excluded.indexOf(key) >= 0) continue;
2796
- target[key] = source[key];
2797
- }
2798
- return target;
2799
- }
2800
- function _extends() {
2801
- _extends = Object.assign || (function (target) {
2802
- for (var i = 1; i < arguments.length; i++) {
2803
- var source = arguments[i];
2804
- for (var key in source) {
2805
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2806
- target[key] = source[key];
2807
- }
2808
- }
2809
- }
2810
- return target;
2811
- });
2812
- return _extends.apply(this, arguments);
2813
- }
2814
- function _inheritsLoose(subClass, superClass) {
2815
- subClass.prototype = Object.create(superClass.prototype);
2816
- subClass.prototype.constructor = subClass;
2817
- subClass.__proto__ = superClass;
2818
- }
2819
- function _assertThisInitialized(self) {
2820
- if (self === void 0) {
2821
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2822
- }
2823
- return self;
2824
- }
2825
- var values = Object.values || (function (obj) {
2826
- return Object.keys(obj).map(function (k) {
2827
- return obj[k];
2828
- });
2829
- });
2830
- var defaultProps = {
2831
- component: 'div',
2832
- childFactory: function childFactory(child) {
2833
- return child;
2834
- }
2835
- };
2836
- var TransitionGroup = (function (_React$Component) {
2837
- _inheritsLoose(TransitionGroup, _React$Component);
2838
- function TransitionGroup(props, context) {
2839
- var _this;
2840
- _this = _React$Component.call(this, props, context) || this;
2841
- var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
2842
- _this.state = {
2843
- handleExited: handleExited,
2844
- firstRender: true
2845
- };
2846
- return _this;
2847
- }
2848
- var _proto = TransitionGroup.prototype;
2849
- _proto.getChildContext = function getChildContext() {
2850
- return {
2851
- transitionGroup: {
2852
- isMounting: !this.appeared
2853
- }
2854
- };
2855
- };
2856
- _proto.componentDidMount = function componentDidMount() {
2857
- this.appeared = true;
2858
- this.mounted = true;
2859
- };
2860
- _proto.componentWillUnmount = function componentWillUnmount() {
2861
- this.mounted = false;
2862
- };
2863
- TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
2864
- var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
2865
- return {
2866
- children: firstRender ? (0, _ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, _ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
2867
- firstRender: false
2868
- };
2869
- };
2870
- _proto.handleExited = function handleExited(child, node) {
2871
- var currentChildMapping = (0, _ChildMapping.getChildMapping)(this.props.children);
2872
- if ((child.key in currentChildMapping)) return;
2873
- if (child.props.onExited) {
2874
- child.props.onExited(node);
2875
- }
2876
- if (this.mounted) {
2877
- this.setState(function (state) {
2878
- var children = _extends({}, state.children);
2879
- delete children[child.key];
2880
- return {
2881
- children: children
2882
- };
2883
- });
2884
- }
2885
- };
2886
- _proto.render = function render() {
2887
- var _this$props = this.props, Component = _this$props.component, childFactory = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
2888
- var children = values(this.state.children).map(childFactory);
2889
- delete props.appear;
2890
- delete props.enter;
2891
- delete props.exit;
2892
- if (Component === null) {
2893
- return children;
2894
- }
2895
- return _react.default.createElement(Component, props, children);
2896
- };
2897
- return TransitionGroup;
2898
- })(_react.default.Component);
2899
- TransitionGroup.childContextTypes = {
2900
- transitionGroup: _propTypes.default.object.isRequired
2901
- };
2902
- TransitionGroup.propTypes = {
2903
- component: _propTypes.default.any,
2904
- children: _propTypes.default.node,
2905
- appear: _propTypes.default.bool,
2906
- enter: _propTypes.default.bool,
2907
- exit: _propTypes.default.bool,
2908
- childFactory: _propTypes.default.func
2909
- };
2910
- TransitionGroup.defaultProps = defaultProps;
2911
- var _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup);
2912
- exports.default = _default;
2913
- module.exports = exports["default"];
2914
- })(TransitionGroup, TransitionGroup.exports);
2915
- getDefaultExportFromCjs(TransitionGroup.exports);
2916
- const require$$0 = _dll_prop_types;
2917
- const require$$1 = _dll_react;
2918
- const require$$2 = _dll_react_dom;
2919
- (function (module, exports) {
2920
- exports.__esModule = true;
2921
- exports.default = void 0;
2922
- var _propTypes = _interopRequireDefault(require$$0);
2923
- var _react = _interopRequireDefault(require$$1);
2924
- var _reactDom = require$$2;
2925
- var _TransitionGroup = _interopRequireDefault(TransitionGroup.exports);
2926
- function _interopRequireDefault(obj) {
2927
- return obj && obj.__esModule ? obj : {
2928
- default: obj
2929
- };
2930
- }
2931
- function _objectWithoutPropertiesLoose(source, excluded) {
2932
- if (source == null) return {};
2933
- var target = {};
2934
- var sourceKeys = Object.keys(source);
2935
- var key, i;
2936
- for (i = 0; i < sourceKeys.length; i++) {
2937
- key = sourceKeys[i];
2938
- if (excluded.indexOf(key) >= 0) continue;
2939
- target[key] = source[key];
2940
- }
2941
- return target;
2942
- }
2943
- function _inheritsLoose(subClass, superClass) {
2944
- subClass.prototype = Object.create(superClass.prototype);
2945
- subClass.prototype.constructor = subClass;
2946
- subClass.__proto__ = superClass;
2947
- }
2948
- var ReplaceTransition = (function (_React$Component) {
2949
- _inheritsLoose(ReplaceTransition, _React$Component);
2950
- function ReplaceTransition() {
2951
- var _this;
2952
- for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
2953
- _args[_key] = arguments[_key];
2954
- }
2955
- _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
2956
- _this.handleEnter = function () {
2957
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2958
- args[_key2] = arguments[_key2];
2959
- }
2960
- return _this.handleLifecycle('onEnter', 0, args);
2961
- };
2962
- _this.handleEntering = function () {
2963
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2964
- args[_key3] = arguments[_key3];
2965
- }
2966
- return _this.handleLifecycle('onEntering', 0, args);
2967
- };
2968
- _this.handleEntered = function () {
2969
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2970
- args[_key4] = arguments[_key4];
2971
- }
2972
- return _this.handleLifecycle('onEntered', 0, args);
2973
- };
2974
- _this.handleExit = function () {
2975
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
2976
- args[_key5] = arguments[_key5];
2977
- }
2978
- return _this.handleLifecycle('onExit', 1, args);
2979
- };
2980
- _this.handleExiting = function () {
2981
- for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
2982
- args[_key6] = arguments[_key6];
2983
- }
2984
- return _this.handleLifecycle('onExiting', 1, args);
2985
- };
2986
- _this.handleExited = function () {
2987
- for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
2988
- args[_key7] = arguments[_key7];
2989
- }
2990
- return _this.handleLifecycle('onExited', 1, args);
2991
- };
2992
- return _this;
2993
- }
2994
- var _proto = ReplaceTransition.prototype;
2995
- _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
2996
- var _child$props;
2997
- var children = this.props.children;
2998
- var child = _react.default.Children.toArray(children)[idx];
2999
- if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
3000
- if (this.props[handler]) this.props[handler]((0, _reactDom.findDOMNode)(this));
3001
- };
3002
- _proto.render = function render() {
3003
- var _this$props = this.props, children = _this$props.children, inProp = _this$props.in, props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
3004
- var _React$Children$toArr = _react.default.Children.toArray(children), first = _React$Children$toArr[0], second = _React$Children$toArr[1];
3005
- delete props.onEnter;
3006
- delete props.onEntering;
3007
- delete props.onEntered;
3008
- delete props.onExit;
3009
- delete props.onExiting;
3010
- delete props.onExited;
3011
- return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
3012
- key: 'first',
3013
- onEnter: this.handleEnter,
3014
- onEntering: this.handleEntering,
3015
- onEntered: this.handleEntered
3016
- }) : _react.default.cloneElement(second, {
3017
- key: 'second',
3018
- onEnter: this.handleExit,
3019
- onEntering: this.handleExiting,
3020
- onEntered: this.handleExited
3021
- }));
3022
- };
3023
- return ReplaceTransition;
3024
- })(_react.default.Component);
3025
- ReplaceTransition.propTypes = {
3026
- in: _propTypes.default.bool.isRequired,
3027
- children: function children(props, propName) {
3028
- if (_react.default.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
3029
- return null;
3030
- }
3031
- };
3032
- var _default = ReplaceTransition;
3033
- exports.default = _default;
3034
- module.exports = exports["default"];
3035
- })(ReplaceTransition, ReplaceTransition.exports);
3036
- getDefaultExportFromCjs(ReplaceTransition.exports);
3037
- var _CSSTransition = _interopRequireDefault(CSSTransition$1.exports);
3038
- var _ReplaceTransition = _interopRequireDefault(ReplaceTransition.exports);
3039
- var _TransitionGroup = _interopRequireDefault(TransitionGroup.exports);
3040
- var _Transition = _interopRequireDefault(Transition$1);
3041
- function _interopRequireDefault(obj) {
3042
- return obj && obj.__esModule ? obj : {
3043
- default: obj
3044
- };
3045
- }
3046
- var reactTransitionGroup = {
3047
- Transition: _Transition.default,
3048
- TransitionGroup: _TransitionGroup.default,
3049
- ReplaceTransition: _ReplaceTransition.default,
3050
- CSSTransition: _CSSTransition.default
3051
- };
3052
- const {colors: {green: green}} = _dll_material_ui__core;
3053
- const {colors: {orange: orange}} = _dll_material_ui__core;
3054
- const {colors: {pink: pink}} = _dll_material_ui__core;
3055
- const {colors: {indigo: indigo}} = _dll_material_ui__core;
3056
- const defaults = {
3057
- TEXT: 'black',
3058
- DISABLED: 'grey',
3059
- CORRECT: green[500],
3060
- INCORRECT: orange[500],
3061
- PRIMARY: indigo[500],
3062
- PRIMARY_LIGHT: indigo[200],
3063
- PRIMARY_DARK: indigo[800],
3064
- SECONDARY: pink.A400,
3065
- SECONDARY_LIGHT: pink[200],
3066
- SECONDARY_DARK: pink[900],
3067
- BACKGROUND: 'rgba(255,255,255,0)',
3068
- SECONDARY_BACKGROUND: 'rgba(241,241,241,1)'
3069
- };
3070
- Object.freeze(defaults);
3071
- const v = prefix => (...args) => {
3072
- const fallback = args.pop();
3073
- return args.reduceRight((acc, v) => {
3074
- return `var(--${prefix}-${v}, ${acc})`;
3075
- }, fallback);
3076
- };
3077
- const pv = v('pie');
3078
- const text = () => pv('text', defaults.TEXT);
3079
- const disabled = () => pv('disabled', defaults.DISABLED);
3080
- const correct = () => pv('correct', defaults.CORRECT);
3081
- const incorrect = () => pv('incorrect', defaults.INCORRECT);
3082
- const primaryLight = () => pv('primary-light', defaults.PRIMARY_LIGHT);
3083
- const secondary = () => pv('secondary', defaults.SECONDARY);
3084
- const background = () => pv('background', defaults.BACKGROUND);
3085
- const {withStyles: withStyles$9} = _dll_material_ui__core_styles;
3086
- const React$c = _dll_react;
3087
- const classNames$2 = _dll_classnames;
3088
- const PropTypes$c = _dll_prop_types;
3089
- const _jsxFileName$a = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/feedback.jsx";
3090
- const styleSheet = {
3091
- corespringFeedback: {
3092
- transformOrigin: '0% 0px 0px',
3093
- width: '100%',
3094
- display: 'block',
3095
- overflow: 'hidden',
3096
- '&:.incorrect': {
3097
- color: '#946202'
3098
- }
3099
- },
3100
- content: {
3101
- '-webkit-font-smoothing': 'antialiased',
3102
- backgroundColor: `var(--feedback-bg-color, ${disabled()})`,
3103
- borderRadius: '4px',
3104
- fontFamily: '"Roboto", "Noto", sans-serif',
3105
- fontSize: '12px',
3106
- lineHeight: '25px',
3107
- margin: '0px',
3108
- padding: '10px',
3109
- verticalAlign: 'middle',
3110
- color: 'var(--feedback-color, white)'
3111
- },
3112
- correct: {
3113
- backgroundColor: `var(--feedback-correct-bg-color, ${correct()})`
3114
- },
3115
- incorrect: {
3116
- backgroundColor: `var(--feedback-incorrect-bg-color, ${incorrect()})`
3117
- },
3118
- feedbackEnter: {
3119
- height: '1px'
3120
- },
3121
- feedbackEnterActive: {
3122
- height: '45px',
3123
- transition: 'height 500ms'
3124
- },
3125
- feedbackLeave: {
3126
- height: '45px'
3127
- },
3128
- feedbackLeaveActive: {
3129
- height: '1px',
3130
- transition: 'height 200ms'
3131
- }
3132
- };
3133
- class Feedback extends React$c.Component {
3134
- static __initStatic() {
3135
- this.propTypes = {
3136
- correctness: PropTypes$c.string,
3137
- feedback: PropTypes$c.string,
3138
- classes: PropTypes$c.object.isRequired
3139
- };
3140
- }
3141
- render() {
3142
- const {correctness, feedback, classes} = this.props;
3143
- function chooseFeedback(correctness) {
3144
- if (correctness && feedback) {
3145
- return React$c.createElement(reactTransitionGroup.CSSTransition, {
3146
- classNames: {
3147
- enter: classes.feedbackEnter,
3148
- enterActive: classes.feedbackEnterActive,
3149
- leave: classes.feedbackLeave,
3150
- leaveActive: classes.feedbackLeaveActive
3151
- },
3152
- key: "hasFeedback",
3153
- timeout: {
3154
- enter: 500,
3155
- exit: 300
3156
- },
3157
- __self: this,
3158
- __source: {
3159
- fileName: _jsxFileName$a,
3160
- lineNumber: 69
3161
- }
3162
- }, React$c.createElement('div', {
3163
- className: classes.corespringFeedback,
3164
- __self: this,
3165
- __source: {
3166
- fileName: _jsxFileName$a,
3167
- lineNumber: 79
3168
- }
3169
- }, React$c.createElement('div', {
3170
- className: classNames$2(classes.content, classes[correctness]),
3171
- dangerouslySetInnerHTML: {
3172
- __html: feedback
3173
- },
3174
- __self: this,
3175
- __source: {
3176
- fileName: _jsxFileName$a,
3177
- lineNumber: 80
3178
- }
3179
- })));
3180
- } else {
3181
- return null;
3182
- }
3183
- }
3184
- return React$c.createElement('div', {
3185
- __self: this,
3186
- __source: {
3187
- fileName: _jsxFileName$a,
3188
- lineNumber: 93
3189
- }
3190
- }, React$c.createElement(reactTransitionGroup.TransitionGroup, {
3191
- __self: this,
3192
- __source: {
3193
- fileName: _jsxFileName$a,
3194
- lineNumber: 94
3195
- }
3196
- }, chooseFeedback(correctness)));
3197
- }
3198
- }
3199
- Feedback.__initStatic();
3200
- var Feedback$1 = withStyles$9(styleSheet, {
3201
- name: 'Feedback'
3202
- })(Feedback);
3203
- const React$b = _dll_react;
3204
- const PropTypes$b = _dll_prop_types;
3205
- const {Popover: Popover} = _dll_material_ui__core;
3206
- const {withStyles: withStyles$8} = _dll_material_ui__core_styles;
3207
- const debug$1 = _dll_debug;
3208
- const _jsxFileName$9 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/response-indicators.jsx";
3209
- const log$1 = debug$1('pie-libs:render-ui:response-indicators');
3210
- const styles$4 = () => ({
3211
- responseIndicator: {
3212
- cursor: 'pointer'
3213
- },
3214
- paper: {
3215
- padding: '0',
3216
- borderRadius: '4px'
3217
- },
3218
- popover: {
3219
- cursor: 'pointer'
3220
- },
3221
- popperClose: {
3222
- cursor: 'pointer'
3223
- }
3224
- });
3225
- const BuildIndicator = (Icon, correctness) => {
3226
- class RawIndicator extends React$b.Component {
3227
- constructor(props) {
3228
- super(props);
3229
- RawIndicator.prototype.__init.call(this);
3230
- RawIndicator.prototype.__init2.call(this);
3231
- this.state = {};
3232
- }
3233
- __init() {
3234
- this.handlePopoverOpen = event => {
3235
- log$1('[handlePopoverOpen]', event.target);
3236
- this.setState({
3237
- anchorEl: event.target
3238
- });
3239
- };
3240
- }
3241
- __init2() {
3242
- this.handlePopoverClose = () => {
3243
- this.setState({
3244
- anchorEl: null
3245
- });
3246
- };
3247
- }
3248
- render() {
3249
- const {feedback, classes} = this.props;
3250
- const {anchorEl} = this.state;
3251
- return React$b.createElement('div', {
3252
- className: feedback && classes.responseIndicator,
3253
- __self: this,
3254
- __source: {
3255
- fileName: _jsxFileName$9,
3256
- lineNumber: 47
3257
- }
3258
- }, React$b.createElement('span', {
3259
- ref: r => this.icon = r,
3260
- onClick: this.handlePopoverOpen,
3261
- __self: this,
3262
- __source: {
3263
- fileName: _jsxFileName$9,
3264
- lineNumber: 48
3265
- }
3266
- }, React$b.createElement(Icon, {
3267
- __self: this,
3268
- __source: {
3269
- fileName: _jsxFileName$9,
3270
- lineNumber: 49
3271
- }
3272
- })), feedback && React$b.createElement(Popover, {
3273
- className: classes.popover,
3274
- classes: {
3275
- paper: classes.paper
3276
- },
3277
- open: !!anchorEl,
3278
- anchorEl: anchorEl,
3279
- anchorOrigin: {
3280
- vertical: 'bottom',
3281
- horizontal: 'left'
3282
- },
3283
- transformOrigin: {
3284
- vertical: 'top',
3285
- horizontal: 'left'
3286
- },
3287
- onClose: this.handlePopoverClose,
3288
- __self: this,
3289
- __source: {
3290
- fileName: _jsxFileName$9,
3291
- lineNumber: 53
3292
- }
3293
- }, React$b.createElement(Feedback$1, {
3294
- feedback: feedback,
3295
- correctness: correctness,
3296
- __self: this,
3297
- __source: {
3298
- fileName: _jsxFileName$9,
3299
- lineNumber: 70
3300
- }
3301
- })));
3302
- }
3303
- }
3304
- RawIndicator.propTypes = {
3305
- feedback: PropTypes$b.string,
3306
- classes: PropTypes$b.object.isRequired
3307
- };
3308
- return withStyles$8(styles$4)(RawIndicator);
3309
- };
3310
- BuildIndicator(correctIcon, 'correct');
3311
- BuildIndicator(incorrectIcon, 'incorrect');
3312
- BuildIndicator(partiallyCorrectIcon, 'partially-correct');
3313
- BuildIndicator(nothingSubmittedIcon, 'nothing-submitted');
3314
- const React$a = _dll_react;
3315
- const {withStyles: withStyles$7} = _dll_material_ui__core_styles;
3316
- const Collapse = _dll_material_ui__core_collapse_index;
3317
- const PropTypes$a = _dll_prop_types;
3318
- const {renderMath: renderMath$3} = _dll_pie_lib__math_rendering;
3319
- const _jsxFileName$8 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx";
3320
- class Collapsible extends React$a.Component {
3321
- constructor(...args) {
3322
- super(...args);
3323
- Collapsible.prototype.__init.call(this);
3324
- Collapsible.prototype.__init2.call(this);
3325
- }
3326
- static __initStatic() {
3327
- this.propTypes = {
3328
- classes: PropTypes$a.object.isRequired,
3329
- className: PropTypes$a.string,
3330
- children: PropTypes$a.object,
3331
- labels: PropTypes$a.shape({
3332
- visible: PropTypes$a.string,
3333
- hidden: PropTypes$a.string
3334
- })
3335
- };
3336
- }
3337
- static __initStatic2() {
3338
- this.defaultProps = {
3339
- labels: {}
3340
- };
3341
- }
3342
- __init() {
3343
- this.state = {
3344
- expanded: false
3345
- };
3346
- }
3347
- __init2() {
3348
- this.toggleExpanded = () => {
3349
- this.setState(state => ({
3350
- expanded: !state.expanded
3351
- }));
3352
- };
3353
- }
3354
- componentDidMount() {
3355
- renderMath$3(this.root);
3356
- }
3357
- componentDidUpdate() {
3358
- renderMath$3(this.root);
3359
- }
3360
- render() {
3361
- const {classes, labels, children, className} = this.props;
3362
- const title = this.state.expanded ? labels.visible || 'Hide' : labels.hidden || 'Show';
3363
- return React$a.createElement('div', {
3364
- className: className,
3365
- ref: r => this.root = r,
3366
- __self: this,
3367
- __source: {
3368
- fileName: _jsxFileName$8,
3369
- lineNumber: 43
3370
- }
3371
- }, React$a.createElement('div', {
3372
- onClick: this.toggleExpanded,
3373
- __self: this,
3374
- __source: {
3375
- fileName: _jsxFileName$8,
3376
- lineNumber: 44
3377
- }
3378
- }, React$a.createElement('span', {
3379
- className: classes.title,
3380
- __self: this,
3381
- __source: {
3382
- fileName: _jsxFileName$8,
3383
- lineNumber: 45
3384
- }
3385
- }, title)), React$a.createElement(Collapse, {
3386
- in: this.state.expanded,
3387
- timeout: "auto",
3388
- unmountOnExit: true,
3389
- className: classes.collapsible,
3390
- __self: this,
3391
- __source: {
3392
- fileName: _jsxFileName$8,
3393
- lineNumber: 47
3394
- }
3395
- }, children));
3396
- }
3397
- }
3398
- Collapsible.__initStatic();
3399
- Collapsible.__initStatic2();
3400
- var Collapsible$1 = withStyles$7(theme => ({
3401
- title: {
3402
- color: theme.palette.primary.light,
3403
- borderBottom: `1px dotted ${theme.palette.primary.light}`
3404
- },
3405
- collapsible: {
3406
- paddingTop: theme.spacing.unit * 2
3407
- }
3408
- }))(Collapsible);
3409
- const React$9 = _dll_react;
3410
- const {withStyles: withStyles$6} = _dll_material_ui__core_styles;
3411
- const {createMuiTheme: createMuiTheme} = _dll_material_ui__core_styles;
3412
- const PropTypes$9 = _dll_prop_types;
3413
- const _jsxFileName$7 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/preview-layout.jsx";
3414
- class PreviewLayout extends React$9.Component {
3415
- static __initStatic() {
3416
- this.propTypes = {
3417
- children: PropTypes$9.oneOfType([PropTypes$9.arrayOf(PropTypes$9.node), PropTypes$9.node]).isRequired,
3418
- classes: PropTypes$9.object
3419
- };
3420
- }
3421
- render() {
3422
- const {children, classes} = this.props;
3423
- return React$9.createElement('div', {
3424
- className: classes.container,
3425
- __self: this,
3426
- __source: {
3427
- fileName: _jsxFileName$7,
3428
- lineNumber: 14
3429
- }
3430
- }, children);
3431
- }
3432
- }
3433
- PreviewLayout.__initStatic();
3434
- const styles$3 = () => ({
3435
- container: {
3436
- display: 'flex',
3437
- flexDirection: 'column',
3438
- position: 'relative'
3439
- }
3440
- });
3441
- createMuiTheme({
3442
- typography: {
3443
- useNextVariants: true
3444
- },
3445
- palette: {
3446
- action: {
3447
- disabled: 'rgba(0, 0, 0, 0.54);'
3448
- }
3449
- },
3450
- overrides: {
3451
- MuiRadio: {
3452
- root: {
3453
- '&$checked': {
3454
- color: '#3f51b5 !important'
3455
- }
3456
- }
3457
- },
3458
- MuiCheckbox: {
3459
- root: {
3460
- '&$checked': {
3461
- color: '#3f51b5 !important'
3462
- }
3463
- }
3464
- },
3465
- MuiTabs: {
3466
- root: {
3467
- borderBottom: '1px solid #eee'
3468
- }
3469
- },
3470
- MuiSwitch: {
3471
- root: {
3472
- '&$checked': {
3473
- color: '#3f51b5 !important',
3474
- '& + $bar': {
3475
- backgroundColor: '#3f51b5 !important',
3476
- opacity: 0.5
3477
- }
3478
- }
3479
- }
3480
- }
3481
- }
3482
- });
3483
- withStyles$6(styles$3)(PreviewLayout);
3484
- const React$8 = _dll_react;
3485
- const PropTypes$8 = _dll_prop_types;
3486
- const {renderMath: renderMath$2} = _dll_pie_lib__math_rendering;
3487
- const _jsxFileName$6 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/html-and-math.js";
3488
- class HtmlAndMath extends React$8.Component {
3489
- static __initStatic() {
3490
- this.propTypes = {
3491
- tag: PropTypes$8.string,
3492
- className: PropTypes$8.string,
3493
- html: PropTypes$8.string
3494
- };
3495
- }
3496
- static __initStatic2() {
3497
- this.defaultProps = {
3498
- tag: 'div',
3499
- html: ''
3500
- };
3501
- }
3502
- componentDidMount() {
3503
- if (this.node) {
3504
- renderMath$2(this.node);
3505
- }
3506
- }
3507
- componentDidUpdate() {
3508
- if (this.node) {
3509
- renderMath$2(this.node);
3510
- }
3511
- }
3512
- render() {
3513
- const {tag, className, html} = this.props;
3514
- const Tag = tag || 'div';
3515
- return React$8.createElement(Tag, {
3516
- ref: r => this.node = r,
3517
- className: className,
3518
- dangerouslySetInnerHTML: {
3519
- __html: html
3520
- },
3521
- __self: this,
3522
- __source: {
3523
- fileName: _jsxFileName$6,
3524
- lineNumber: 33
3525
- }
3526
- });
3527
- }
3528
- }
3529
- HtmlAndMath.__initStatic();
3530
- HtmlAndMath.__initStatic2();
3531
- const {InputLabel: InputLabel} = _dll_material_ui__core;
3532
- const {FormControl: FormControl} = _dll_material_ui__core;
3533
- const PropTypes$7 = _dll_prop_types;
3534
- const React$7 = _dll_react;
3535
- const classNames$1 = _dll_classnames;
3536
- const {withStyles: withStyles$5} = _dll_material_ui__core_styles;
3537
- const _jsxFileName$5 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/input-container.jsx";
3538
- const RawInputContainer = props => {
3539
- const {label, className, children, classes} = props;
3540
- const names = classNames$1(classes.formControl, className);
3541
- return React$7.createElement(FormControl, {
3542
- className: names,
3543
- __self: undefined,
3544
- __source: {
3545
- fileName: _jsxFileName$5,
3546
- lineNumber: 13
3547
- }
3548
- }, React$7.createElement(InputLabel, {
3549
- className: classes.label,
3550
- shrink: true,
3551
- __self: undefined,
3552
- __source: {
3553
- fileName: _jsxFileName$5,
3554
- lineNumber: 14
3555
- }
3556
- }, label), children);
3557
- };
3558
- RawInputContainer.propTypes = {
3559
- label: PropTypes$7.oneOfType([PropTypes$7.string, PropTypes$7.object]).isRequired,
3560
- className: PropTypes$7.string,
3561
- children: PropTypes$7.oneOfType([PropTypes$7.arrayOf(PropTypes$7.node), PropTypes$7.node]).isRequired,
3562
- classes: PropTypes$7.object.isRequired
3563
- };
3564
- withStyles$5(theme => ({
3565
- formControl: {
3566
- marginLeft: 0,
3567
- marginRight: theme.spacing.unit,
3568
- paddingBottom: theme.spacing.unit,
3569
- flex: '1 0 auto',
3570
- minWidth: theme.spacing.unit * 4
3571
- },
3572
- label: {
3573
- fontSize: 'inherit',
3574
- whiteSpace: 'nowrap'
3575
- }
3576
- }))(RawInputContainer);
3577
- const React$6 = _dll_react;
3578
- const {Component: Component} = _dll_react;
3579
- const {withStyles: withStyles$4} = _dll_material_ui__core_styles;
3580
- const PropTypes$6 = _dll_prop_types;
3581
- const _jsxFileName$4 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx";
3582
- const NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
3583
- const NEWLINE_LATEX$1 = '\\newline ';
3584
- class PreviewPrompt extends Component {
3585
- constructor(...args) {
3586
- super(...args);
3587
- PreviewPrompt.prototype.__init.call(this);
3588
- }
3589
- static __initStatic() {
3590
- this.propTypes = {
3591
- classes: PropTypes$6.object,
3592
- prompt: PropTypes$6.string,
3593
- tagName: PropTypes$6.string,
3594
- className: PropTypes$6.string,
3595
- onClick: PropTypes$6.func,
3596
- defaultClassName: PropTypes$6.string
3597
- };
3598
- }
3599
- static __initStatic2() {
3600
- this.defaultProps = {
3601
- onClick: () => {}
3602
- };
3603
- }
3604
- __init() {
3605
- this.parsedText = text => {
3606
- const div = document.createElement('div');
3607
- div.innerHTML = text;
3608
- const audio = div.querySelector('audio');
3609
- if (audio) {
3610
- const source = document.createElement('source');
3611
- source.setAttribute('type', 'audio/mp3');
3612
- source.setAttribute('src', audio.getAttribute('src'));
3613
- audio.removeAttribute('src');
3614
- audio.appendChild(source);
3615
- }
3616
- return div.innerHTML;
3617
- };
3618
- }
3619
- render() {
3620
- const {prompt, classes, tagName, className, onClick, defaultClassName} = this.props;
3621
- const CustomTag = tagName || 'div';
3622
- const customClasses = `${classes.promptTable} ${classes[className] || ''} ${defaultClassName || ''}`;
3623
- return React$6.createElement(CustomTag, {
3624
- onClick: onClick,
3625
- className: customClasses,
3626
- dangerouslySetInnerHTML: {
3627
- __html: this.parsedText(prompt || '').replace(NEWLINE_BLOCK_REGEX, NEWLINE_LATEX$1)
3628
- },
3629
- __self: this,
3630
- __source: {
3631
- fileName: _jsxFileName$4,
3632
- lineNumber: 50
3633
- }
3634
- });
3635
- }
3636
- }
3637
- PreviewPrompt.__initStatic();
3638
- PreviewPrompt.__initStatic2();
3639
- const styles$2 = theme => ({
3640
- prompt: {
3641
- verticalAlign: 'middle',
3642
- color: text()
3643
- },
3644
- rationale: {
3645
- paddingLeft: theme.spacing.unit * 16
3646
- },
3647
- label: {
3648
- color: `${text()} !important`,
3649
- display: 'inline-block',
3650
- verticalAlign: 'middle',
3651
- cursor: 'pointer'
3652
- },
3653
- promptTable: {
3654
- '&:not(.MathJax) > table': {
3655
- borderCollapse: 'collapse'
3656
- },
3657
- '&:not(.MathJax) > table tr': {
3658
- '&:nth-child(2n)': {
3659
- backgroundColor: '#f6f8fa'
3660
- }
3661
- },
3662
- '&:not(.MathJax) > table td, &:not(.MathJax) > table th': {
3663
- padding: '.6em 1em',
3664
- textAlign: 'center'
3665
- }
3666
- }
3667
- });
3668
- var PreviewPrompt$1 = withStyles$4(styles$2)(PreviewPrompt);
3669
- const PropTypes$5 = _dll_prop_types;
3670
- const React$5 = _dll_react;
3671
- const Readable = props => {
3672
- return React$5.createElement(React$5.Fragment, null, React$5.Children.map(props.children, child => React$5.cloneElement(child, {
3673
- 'data-pie-readable': props.false === undefined
3674
- })));
3675
- };
3676
- Readable.propTypes = {
3677
- children: PropTypes$5.node,
3678
- false: PropTypes$5.bool
3679
- };
3680
- const PropTypes$4 = _dll_prop_types;
3681
- ({
3682
- children: PropTypes$4.node,
3683
- purpose: PropTypes$4.string
3684
- });
3685
- const dp = new DOMParser();
3686
- const markupToText = s => {
3687
- const root = dp.parseFromString(s, 'text/html');
3688
- return root.body.textContent;
3689
- };
3690
- const hasText = s => {
3691
- if (!s) {
3692
- return false;
3693
- }
3694
- const tc = markupToText(s);
3695
- return !!(tc && tc.trim());
3696
- };
3697
- const noTouch = {
3698
- '-webkit-touchCcallout': 'none',
3699
- '-webkit-user-select': 'none',
3700
- '-khtml-user-select': 'none',
3701
- '-moz-user-select': 'none',
3702
- '-ms-user-select': 'none',
3703
- 'user-select': 'none'
3704
- };
3705
- var styles$1 = {
3706
- root: {
3707
- width: '100%',
3708
- cursor: 'pointer'
3709
- },
3710
- content: {
3711
- margin: '0 auto',
3712
- textAlign: 'center',
3713
- display: 'flex'
3714
- },
3715
- label: Object.assign({
3716
- width: '140px',
3717
- fontFamily: "'Roboto', sans-serif",
3718
- height: '25px',
3719
- lineHeight: '25px',
3720
- verticalAlign: 'middle',
3721
- color: `var(--correct-answer-toggle-label-color, ${text()})`,
3722
- fontSize: '15px',
3723
- fontWeight: 'normal'
3724
- }, noTouch),
3725
- icon: {
3726
- position: 'absolute',
3727
- width: '25px'
3728
- },
3729
- iconHolder: {
3730
- width: '25px',
3731
- marginRight: '5px'
3732
- },
3733
- enter: {
3734
- opacity: '0'
3735
- },
3736
- enterActive: {
3737
- opacity: '1',
3738
- transition: 'opacity 0.3s ease-in'
3739
- },
3740
- exit: {
3741
- opacity: '1'
3742
- },
3743
- exitActive: {
3744
- opacity: '0',
3745
- transition: 'opacity 0.3s ease-in'
3746
- }
3747
- };
3748
- const React$4 = _dll_react;
3749
- const PropTypes$3 = _dll_prop_types;
3750
- const {withStyles: withStyles$3} = _dll_material_ui__core_styles;
3751
- const _jsxFileName$3 = "/home/circleci/repo/node_modules/@pie-lib/correct-answer-toggle/src/expander.jsx";
3752
- const Expander = props => {
3753
- const {classes, show, children} = props;
3754
- return React$4.createElement(reactTransitionGroup.CSSTransition, {
3755
- in: show,
3756
- appear: true,
3757
- mountOnEnter: false,
3758
- timeout: 300,
3759
- classNames: {
3760
- ...classes
3761
- },
3762
- __self: undefined,
3763
- __source: {
3764
- fileName: _jsxFileName$3,
3765
- lineNumber: 10
3766
- }
3767
- }, React$4.createElement('div', {
3768
- className: classes.expander,
3769
- __self: undefined,
3770
- __source: {
3771
- fileName: _jsxFileName$3,
3772
- lineNumber: 17
3773
- }
3774
- }, children));
3775
- };
3776
- Expander.propTypes = {
3777
- show: PropTypes$3.bool.isRequired,
3778
- className: PropTypes$3.string,
3779
- classes: PropTypes$3.object,
3780
- children: PropTypes$3.oneOfType([PropTypes$3.arrayOf(PropTypes$3.node), PropTypes$3.node]).isRequired
3781
- };
3782
- const transition = 'height ease-in 300ms, opacity ease-in 300ms';
3783
- var Expander$1 = withStyles$3(() => ({
3784
- expander: {
3785
- position: 'relative',
3786
- height: 0,
3787
- overflow: 'hidden',
3788
- display: 'flex',
3789
- visibility: 'hidden',
3790
- width: 0
3791
- },
3792
- enter: {
3793
- transition,
3794
- opacity: 1,
3795
- height: '25px',
3796
- width: 'auto',
3797
- visibility: 'visible'
3798
- },
3799
- enterDone: {
3800
- height: '25px',
3801
- visibility: 'visible',
3802
- width: 'auto'
3803
- },
3804
- exit: {
3805
- transition,
3806
- opacity: 0,
3807
- height: 0,
3808
- visibility: 'visible',
3809
- width: 0
3810
- },
3811
- exitDone: {
3812
- opacity: 0,
3813
- visibility: 'hidden',
3814
- height: 0,
3815
- width: 0
3816
- }
3817
- }))(Expander);
3818
- const {withStyles: withStyles$2} = _dll_material_ui__core_styles;
3819
- const React$3 = _dll_react;
3820
- const classNames = _dll_classnames;
3821
- const PropTypes$2 = _dll_prop_types;
3822
- const _jsxFileName$2 = "/home/circleci/repo/node_modules/@pie-lib/correct-answer-toggle/src/index.jsx";
3823
- class CorrectAnswerToggle extends React$3.Component {
3824
- static __initStatic() {
3825
- this.propTypes = {
3826
- onToggle: PropTypes$2.func,
3827
- toggled: PropTypes$2.bool,
3828
- show: PropTypes$2.bool,
3829
- hideMessage: PropTypes$2.string,
3830
- showMessage: PropTypes$2.string,
3831
- classes: PropTypes$2.object.isRequired,
3832
- className: PropTypes$2.string
3833
- };
3834
- }
3835
- static __initStatic2() {
3836
- this.defaultProps = {
3837
- showMessage: 'Show correct answer',
3838
- hideMessage: 'Hide correct answer',
3839
- show: false,
3840
- toggled: false
3841
- };
3842
- }
3843
- constructor(props) {
3844
- super(props);
3845
- this.state = {
3846
- show: props.show
3847
- };
3848
- }
3849
- onClick() {
3850
- this.props.onToggle(!this.props.toggled);
3851
- }
3852
- componentWillReceiveProps(nextProps) {
3853
- this.setState({
3854
- show: nextProps.show
3855
- });
3856
- }
3857
- render() {
3858
- const {classes, className, toggled, hideMessage, showMessage} = this.props;
3859
- return React$3.createElement('div', {
3860
- className: classNames(classes.root, className),
3861
- __self: this,
3862
- __source: {
3863
- fileName: _jsxFileName$2,
3864
- lineNumber: 52
3865
- }
3866
- }, React$3.createElement(Expander$1, {
3867
- show: this.state.show,
3868
- className: classes.expander,
3869
- __self: this,
3870
- __source: {
3871
- fileName: _jsxFileName$2,
3872
- lineNumber: 53
3873
- }
3874
- }, React$3.createElement('div', {
3875
- className: classes.content,
3876
- onClick: this.onClick.bind(this),
3877
- __self: this,
3878
- __source: {
3879
- fileName: _jsxFileName$2,
3880
- lineNumber: 54
3881
- }
3882
- }, React$3.createElement('div', {
3883
- className: classes.iconHolder,
3884
- __self: this,
3885
- __source: {
3886
- fileName: _jsxFileName$2,
3887
- lineNumber: 55
3888
- }
3889
- }, React$3.createElement(CSSTransition, {
3890
- timeout: 400,
3891
- in: toggled,
3892
- exit: !toggled,
3893
- classNames: classes,
3894
- __self: this,
3895
- __source: {
3896
- fileName: _jsxFileName$2,
3897
- lineNumber: 56
3898
- }
3899
- }, React$3.createElement(CorrectResponse$1, {
3900
- open: toggled,
3901
- key: "correct-open",
3902
- className: classes.icon,
3903
- __self: this,
3904
- __source: {
3905
- fileName: _jsxFileName$2,
3906
- lineNumber: 57
3907
- }
3908
- })), React$3.createElement(CSSTransition, {
3909
- timeout: 5000,
3910
- in: !toggled,
3911
- exit: toggled,
3912
- classNames: classes,
3913
- __self: this,
3914
- __source: {
3915
- fileName: _jsxFileName$2,
3916
- lineNumber: 59
3917
- }
3918
- }, React$3.createElement(CorrectResponse$1, {
3919
- open: toggled,
3920
- key: "correct-closed",
3921
- className: classes.icon,
3922
- __self: this,
3923
- __source: {
3924
- fileName: _jsxFileName$2,
3925
- lineNumber: 60
3926
- }
3927
- }))), React$3.createElement(Readable, {
3928
- false: true,
3929
- __self: this,
3930
- __source: {
3931
- fileName: _jsxFileName$2,
3932
- lineNumber: 63
3933
- }
3934
- }, React$3.createElement('div', {
3935
- className: classes.label,
3936
- 'aria-hidden': !this.state.show,
3937
- __self: this,
3938
- __source: {
3939
- fileName: _jsxFileName$2,
3940
- lineNumber: 64
3941
- }
3942
- }, toggled ? hideMessage : showMessage)))));
3943
- }
3944
- }
3945
- CorrectAnswerToggle.__initStatic();
3946
- CorrectAnswerToggle.__initStatic2();
3947
- var CorrectAnswerToggle$1 = withStyles$2(styles$1)(CorrectAnswerToggle);
3948
- const ResponseTypes = {
3949
- advanced: 'Advanced Multi',
3950
- simple: 'Simple'
3951
- };
3952
- const React$2 = _dll_react;
3953
- const cx$1 = _dll_classnames;
3954
- const {withStyles: withStyles$1} = _dll_material_ui__core_styles;
3955
- const PropTypes$1 = _dll_prop_types;
3956
- const {MathToolbar: MathToolbar} = _dll_pie_lib__math_toolbar;
3957
- const {mq: mq$1} = _dll_pie_lib__math_input;
3958
- const _jsxFileName$1 = "/home/circleci/repo/packages/math-inline/src/simple-question-block.jsx";
3959
- class SimpleQuestionBlockRaw extends React$2.Component {
3960
- constructor(...args) {
3961
- super(...args);
3962
- SimpleQuestionBlockRaw.prototype.__init.call(this);
3963
- SimpleQuestionBlockRaw.prototype.__init2.call(this);
3964
- SimpleQuestionBlockRaw.prototype.__init3.call(this);
3965
- }
3966
- static __initStatic() {
3967
- this.propTypes = {
3968
- classes: PropTypes$1.object,
3969
- onSimpleResponseChange: PropTypes$1.func,
3970
- model: PropTypes$1.object.isRequired,
3971
- emptyResponse: PropTypes$1.bool,
3972
- session: PropTypes$1.object.isRequired,
3973
- showCorrect: PropTypes$1.bool
3974
- };
3975
- }
3976
- __init() {
3977
- this.state = {
3978
- showKeypad: true
3979
- };
3980
- }
3981
- __init2() {
3982
- this.onFocus = () => this.setState({
3983
- showKeypad: true
3984
- });
3985
- }
3986
- __init3() {
3987
- this.onBlur = e => {
3988
- const {relatedTarget, currentTarget} = e || ({});
3989
- if (!relatedTarget || !currentTarget || relatedTarget.offsetParent !== currentTarget.offsetParent) {
3990
- this.setState({
3991
- showKeypad: false
3992
- });
3993
- }
3994
- };
3995
- }
3996
- render() {
3997
- const {classes, model, showCorrect, session, emptyResponse, onSimpleResponseChange} = this.props;
3998
- const {config, disabled, correctness, view} = model || ({});
3999
- if (!config) {
4000
- return;
4001
- }
4002
- const correct = correctness && correctness.correct;
4003
- const {responses, equationEditor} = config;
4004
- return React$2.createElement('div', {
4005
- className: classes.expression,
4006
- __self: this,
4007
- __source: {
4008
- fileName: _jsxFileName$1,
4009
- lineNumber: 54
4010
- }
4011
- }, showCorrect || disabled ? React$2.createElement('div', {
4012
- className: cx$1(classes.static, {
4013
- [classes.incorrect]: !emptyResponse && !correct && !showCorrect,
4014
- [classes.correct]: !emptyResponse && (correct || showCorrect)
4015
- }),
4016
- __self: this,
4017
- __source: {
4018
- fileName: _jsxFileName$1,
4019
- lineNumber: 56
4020
- }
4021
- }, React$2.createElement(mq$1.Static, {
4022
- latex: showCorrect ? responses && responses.length && responses[0].answer : session.response || '',
4023
- __self: this,
4024
- __source: {
4025
- fileName: _jsxFileName$1,
4026
- lineNumber: 62
4027
- }
4028
- })) : React$2.createElement(MathToolbar, {
4029
- classNames: {
4030
- editor: classes.responseEditor
4031
- },
4032
- latex: session.response || '',
4033
- keypadMode: equationEditor,
4034
- onChange: onSimpleResponseChange,
4035
- onDone: () => {},
4036
- onFocus: this.onFocus,
4037
- onBlur: this.onBlur,
4038
- controlledKeypad: true,
4039
- showKeypad: this.state.showKeypad,
4040
- hideDoneButton: true,
4041
- __self: this,
4042
- __source: {
4043
- fileName: _jsxFileName$1,
4044
- lineNumber: 69
4045
- }
4046
- }));
4047
- }
4048
- }
4049
- SimpleQuestionBlockRaw.__initStatic();
4050
- const SimpleQuestionBlock = withStyles$1(theme => ({
4051
- responseEditor: {
4052
- display: 'flex',
4053
- justifyContent: 'center',
4054
- width: 'auto',
4055
- maxWidth: 'fit-content',
4056
- height: 'auto',
4057
- textAlign: 'left',
4058
- padding: theme.spacing.unit,
4059
- '&.mq-math-mode': {
4060
- border: `1px solid ${primaryLight()}`
4061
- }
4062
- },
4063
- expression: {
4064
- marginTop: theme.spacing.unit * 2,
4065
- marginBottom: theme.spacing.unit * 2,
4066
- padding: theme.spacing.unit
4067
- },
4068
- static: {
4069
- color: text(),
4070
- background: background(),
4071
- border: `1px solid ${primaryLight()}`,
4072
- width: 'fit-content',
4073
- fontSize: '1rem',
4074
- padding: theme.spacing.unit / 2,
4075
- '& > .mq-math-mode': {
4076
- '& > .mq-hasCursor': {
4077
- '& > .mq-cursor': {
4078
- display: 'none'
4079
- }
4080
- }
4081
- }
4082
- },
4083
- correct: {
4084
- border: `2px solid ${correct()} !important`,
4085
- padding: theme.spacing.unit,
4086
- letterSpacing: '0.5px'
4087
- },
4088
- incorrect: {
4089
- border: `2px solid ${incorrect()} !important`,
4090
- padding: theme.spacing.unit,
4091
- letterSpacing: '0.5px'
4092
- }
4093
- }))(SimpleQuestionBlockRaw);
4094
- const React$1 = _dll_react;
4095
- const PropTypes = _dll_prop_types;
4096
- const {withStyles: withStyles} = _dll_material_ui__core_styles;
4097
- const {Tooltip: Tooltip} = _dll_material_ui__core;
4098
- const {isEqual: isEqual} = _dll_lodash;
4099
- const {isEmpty: isEmpty} = _dll_lodash;
4100
- const cx = _dll_classnames;
4101
- const {mq: mq} = _dll_pie_lib__math_input;
4102
- const {HorizontalKeypad: HorizontalKeypad} = _dll_pie_lib__math_input;
4103
- const {updateSpans: updateSpans} = _dll_pie_lib__math_input;
4104
- const MathQuill = _dll_pie_framework__mathquill;
4105
- const {renderMath: renderMath$1} = _dll_pie_lib__math_rendering;
4106
- const _jsxFileName = "/home/circleci/repo/packages/math-inline/src/main.jsx";
4107
- function _optionalChain(ops) {
4108
- let lastAccessLHS = undefined;
4109
- let value = ops[0];
4110
- let i = 1;
4111
- while (i < ops.length) {
4112
- const op = ops[i];
4113
- const fn = ops[i + 1];
4114
- i += 2;
4115
- if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
4116
- return undefined;
4117
- }
4118
- if (op === 'access' || op === 'optionalAccess') {
4119
- lastAccessLHS = value;
4120
- value = fn(value);
4121
- } else if (op === 'call' || op === 'optionalCall') {
4122
- value = fn((...args) => value.call(lastAccessLHS, ...args));
4123
- lastAccessLHS = undefined;
4124
- }
4125
- }
4126
- return value;
4127
- }
4128
- let registered = false;
4129
- const NEWLINE_LATEX = /\\newline/g;
4130
- const REGEX = /{{response}}/gm;
4131
- const DEFAULT_KEYPAD_VARIANT = 6;
4132
- const IS_SAFARI = (/^((?!chrome|android).)*safari/i).test(navigator.userAgent);
4133
- function generateAdditionalKeys(keyData = []) {
4134
- return keyData.map(key => ({
4135
- name: key,
4136
- latex: key,
4137
- write: key,
4138
- label: key
4139
- }));
4140
- }
4141
- function getKeyPadWidth(additionalKeys = [], equationEditor) {
4142
- return Math.floor(additionalKeys.length / 5) * 30 + (equationEditor === 'miscellaneous' ? 600 : 500);
4143
- }
4144
- function prepareForStatic(model, state) {
4145
- const {config, disabled} = model || ({});
4146
- const {expression, responses, printMode, alwaysShowCorrect} = config || ({});
4147
- if (config && expression) {
4148
- const modelExpression = expression;
4149
- if (state.showCorrect) {
4150
- return responses && responses.length && responses[0].answer;
4151
- }
4152
- let answerBlocks = 1;
4153
- return (modelExpression || '').replace(REGEX, function () {
4154
- const answer = state.session.answers[`r${answerBlocks}`];
4155
- if (printMode && !alwaysShowCorrect) {
4156
- const blankSpace = ('\\ \\ ').repeat(30) + '\\newline ';
4157
- return `\\MathQuillMathField[r${answerBlocks++}]{${blankSpace.repeat(3)}}`;
4158
- }
4159
- if (disabled) {
4160
- return `\\embed{answerBlock}[r${answerBlocks++}]`;
4161
- }
4162
- return `\\MathQuillMathField[r${answerBlocks++}]{${answer && answer.value || ''}}`;
4163
- }).replace(NEWLINE_LATEX, '\\embed{newLine}[]');
4164
- }
4165
- }
4166
- class Main extends React$1.Component {
4167
- static __initStatic() {
4168
- this.propTypes = {
4169
- classes: PropTypes.object,
4170
- session: PropTypes.object.isRequired,
4171
- onSessionChange: PropTypes.func,
4172
- model: PropTypes.object.isRequired
4173
- };
4174
- }
4175
- constructor(props) {
4176
- super(props);
4177
- Main.prototype.__init.call(this);
4178
- Main.prototype.__init2.call(this);
4179
- Main.prototype.__init3.call(this);
4180
- Main.prototype.__init4.call(this);
4181
- Main.prototype.__init5.call(this);
4182
- Main.prototype.__init6.call(this);
4183
- Main.prototype.__init7.call(this);
4184
- Main.prototype.__init8.call(this);
4185
- Main.prototype.__init9.call(this);
4186
- Main.prototype.__init10.call(this);
4187
- Main.prototype.__init11.call(this);
4188
- Main.prototype.__init12.call(this);
4189
- const answers = {};
4190
- if (props.model.config && props.model.config.expression) {
4191
- let answerBlocks = 1;
4192
- (props.model.config.expression || '').replace(REGEX, () => {
4193
- answers[`r${answerBlocks}`] = {
4194
- value: props.session && props.session.answers && props.session.answers[`r${answerBlocks}`] && props.session.answers[`r${answerBlocks}`].value || ''
4195
- };
4196
- answerBlocks += 1;
4197
- });
4198
- }
4199
- this.state = {
4200
- session: {
4201
- ...props.session,
4202
- answers
4203
- },
4204
- activeAnswerBlock: '',
4205
- showCorrect: this.props.model.config.alwaysShowCorrect || false
4206
- };
4207
- }
4208
- UNSAFE_componentWillMount() {
4209
- const {classes} = this.props;
4210
- if (typeof window !== 'undefined') {
4211
- let MQ = MathQuill.getInterface(2);
4212
- if (!registered) {
4213
- MQ.registerEmbed('answerBlock', data => {
4214
- return {
4215
- htmlString: `<div class="${classes.blockContainer}">
4216
- <div class="${classes.blockResponse}" id="${data}Index">R</div>
4217
- <div class="${classes.blockMath}">
4218
- <span id="${data}"></span>
4219
- </div>
4220
- </div>`,
4221
- text: () => 'text',
4222
- latex: () => `\\embed{answerBlock}[${data}]`
4223
- };
4224
- });
4225
- registered = true;
4226
- }
4227
- }
4228
- }
4229
- __init() {
4230
- this.handleAnswerBlockDomUpdate = () => {
4231
- const {model, classes} = this.props;
4232
- const {session, showCorrect} = this.state;
4233
- const answers = session.answers;
4234
- if (this.root && model.disabled && !showCorrect) {
4235
- Object.keys(answers).forEach(answerId => {
4236
- const el = this.root.querySelector(`#${answerId}`);
4237
- const indexEl = this.root.querySelector(`#${answerId}Index`);
4238
- if (el) {
4239
- let MQ = MathQuill.getInterface(2);
4240
- const answer = answers[answerId];
4241
- el.textContent = answer && answer.value || '';
4242
- if (!model.view) ; else {
4243
- el.parentElement.parentElement.classList.remove(classes.correct);
4244
- el.parentElement.parentElement.classList.remove(classes.incorrect);
4245
- }
4246
- MQ.StaticMath(el);
4247
- indexEl.textContent = 'R';
4248
- }
4249
- });
4250
- }
4251
- renderMath$1(this.root);
4252
- };
4253
- }
4254
- componentDidUpdate() {
4255
- this.handleAnswerBlockDomUpdate();
4256
- }
4257
- UNSAFE_componentWillReceiveProps(nextProps) {
4258
- const {config} = this.props.model;
4259
- const {config: nextConfig = {}} = nextProps.model || ({});
4260
- if (config.env && config.env.mode !== 'evaluate' || nextConfig.env && nextConfig.env.mode !== 'evaluate') {
4261
- this.setState({
4262
- ...this.state.session,
4263
- showCorrect: false
4264
- });
4265
- }
4266
- if (nextConfig.alwaysShowCorrect) {
4267
- this.setState({
4268
- showCorrect: true
4269
- });
4270
- }
4271
- if (config && config.responses && config.responses.length !== nextConfig.responses.length || !config && nextConfig && nextConfig.responses || config && nextConfig && config.expression !== nextConfig.expression) {
4272
- const newAnswers = {};
4273
- const answers = this.state.session.answers;
4274
- let answerBlocks = 1;
4275
- (nextConfig.expression || '').replace(REGEX, () => {
4276
- newAnswers[`r${answerBlocks}`] = {
4277
- value: answers && answers[`r${answerBlocks}`] && answers[`r${answerBlocks}`].value || ''
4278
- };
4279
- answerBlocks++;
4280
- });
4281
- this.setState(state => ({
4282
- session: {
4283
- ...state.session,
4284
- completeAnswer: this.mqStatic && this.mqStatic.mathField.latex(),
4285
- answers: newAnswers
4286
- }
4287
- }), this.handleAnswerBlockDomUpdate);
4288
- }
4289
- }
4290
- shouldComponentUpdate(nextProps, nextState) {
4291
- const sameModel = isEqual(this.props.model, nextProps.model);
4292
- const sameState = isEqual(this.state, nextState);
4293
- return !sameModel || !sameState;
4294
- }
4295
- componentDidMount() {
4296
- this.handleAnswerBlockDomUpdate();
4297
- setTimeout(() => renderMath$1(this.root), 100);
4298
- }
4299
- __init2() {
4300
- this.onDone = () => {};
4301
- }
4302
- __init3() {
4303
- this.onSimpleResponseChange = response => {
4304
- this.setState(state => ({
4305
- session: {
4306
- ...state.session,
4307
- response
4308
- }
4309
- }), this.callOnSessionChange);
4310
- };
4311
- }
4312
- __init4() {
4313
- this.onSubFieldFocus = id => {
4314
- this.setState({
4315
- activeAnswerBlock: id
4316
- });
4317
- };
4318
- }
4319
- __init5() {
4320
- this.toNodeData = data => {
4321
- if (!data) {
4322
- return;
4323
- }
4324
- const {type, value} = data;
4325
- if (type === 'command' || type === 'cursor') {
4326
- return data;
4327
- } else if (type === 'answer') {
4328
- return {
4329
- type: 'answer',
4330
- ...data
4331
- };
4332
- } else if (value === 'clear') {
4333
- return {
4334
- type: 'clear'
4335
- };
4336
- } else {
4337
- return {
4338
- type: 'write',
4339
- value
4340
- };
4341
- }
4342
- };
4343
- }
4344
- __init6() {
4345
- this.setInput = input => {
4346
- this.input = input;
4347
- };
4348
- }
4349
- __init7() {
4350
- this.onClick = data => {
4351
- const c = this.toNodeData(data);
4352
- if (c.type === 'clear') {
4353
- this.input.clear();
4354
- } else if (c.type === 'command') {
4355
- if (Array.isArray(c.value)) {
4356
- c.value.forEach(vv => {
4357
- this.input.cmd(vv);
4358
- });
4359
- } else {
4360
- this.input.cmd(c.value);
4361
- }
4362
- } else if (c.type === 'cursor') {
4363
- this.input.keystroke(c.value);
4364
- } else {
4365
- this.input.write(c.value);
4366
- }
4367
- this.input.focus();
4368
- };
4369
- }
4370
- __init8() {
4371
- this.callOnSessionChange = () => {
4372
- const {onSessionChange} = this.props;
4373
- if (onSessionChange) {
4374
- onSessionChange(this.state.session);
4375
- }
4376
- };
4377
- }
4378
- __init9() {
4379
- this.toggleShowCorrect = show => {
4380
- this.setState({
4381
- showCorrect: show
4382
- }, this.handleAnswerBlockDomUpdate);
4383
- };
4384
- }
4385
- __init10() {
4386
- this.subFieldChanged = (name, subfieldValue) => {
4387
- updateSpans();
4388
- if (name) {
4389
- this.setState(state => ({
4390
- session: {
4391
- ...state.session,
4392
- completeAnswer: this.mqStatic && this.mqStatic.mathField.latex(),
4393
- answers: {
4394
- ...state.session.answers,
4395
- [name]: {
4396
- value: subfieldValue
4397
- }
4398
- }
4399
- }
4400
- }), this.callOnSessionChange);
4401
- }
4402
- };
4403
- }
4404
- __init11() {
4405
- this.getFieldName = (changeField, fields) => {
4406
- const {answers} = this.state.session;
4407
- if (Object.keys(answers || ({})).length) {
4408
- const keys = Object.keys(answers);
4409
- return keys.find(k => {
4410
- const tf = fields[k];
4411
- return tf && tf.id == changeField.id;
4412
- });
4413
- }
4414
- };
4415
- }
4416
- __init12() {
4417
- this.onBlur = e => {
4418
- const {relatedTarget, currentTarget} = e || ({});
4419
- if (!relatedTarget || !currentTarget || !IS_SAFARI && !_optionalChain([relatedTarget, 'optionalAccess', _13 => _13.offsetParent, 'optionalAccess', _14 => _14.children, 'access', _15 => _15[0], 'optionalAccess', _16 => _16.attributes, 'optionalAccess', _17 => _17['data-keypad']]) || IS_SAFARI && !_optionalChain([relatedTarget, 'optionalAccess', _18 => _18.offsetParent, 'optionalAccess', _19 => _19.children, 'access', _20 => _20[0], 'optionalAccess', _21 => _21.children, 'access', _22 => _22[0], 'optionalAccess', _23 => _23.attributes, 'optionalAccess', _24 => _24['data-keypad']])) {
4420
- this.setState({
4421
- activeAnswerBlock: ''
4422
- });
4423
- }
4424
- };
4425
- }
4426
- setTooltipRef(ref) {
4427
- setTimeout(() => {
4428
- if (ref && IS_SAFARI) {
4429
- const div = document.querySelector('[role=\'tooltip\']');
4430
- if (div) {
4431
- const el = div.firstChild;
4432
- el.setAttribute('tabindex', '-1');
4433
- }
4434
- }
4435
- }, 1);
4436
- }
4437
- render() {
4438
- const {model, classes} = this.props;
4439
- const {activeAnswerBlock, showCorrect, session} = this.state;
4440
- const {config, correctness, disabled, view, teacherInstructions, rationale, feedback, animationsDisabled, printMode, alwaysShowCorrect} = model || ({});
4441
- if (!config) {
4442
- return null;
4443
- }
4444
- const {showNote, note, prompt, responses, responseType, equationEditor, customKeys, env: {mode, role} = {}} = config || ({});
4445
- const displayNote = (showCorrect || mode === 'view' && role === 'instructor') && showNote && note;
4446
- const emptyResponse = isEmpty(responses);
4447
- const showCorrectAnswerToggle = !emptyResponse && correctness && correctness.correctness !== 'correct';
4448
- const tooltipModeEnabled = disabled && correctness;
4449
- const additionalKeys = generateAdditionalKeys(customKeys);
4450
- const correct = correctness && correctness.correct;
4451
- const staticLatex = prepareForStatic(model, this.state) || '';
4452
- const viewMode = disabled && !correctness;
4453
- const studentPrintMode = printMode && !alwaysShowCorrect;
4454
- const printView = React$1.createElement('div', {
4455
- className: classes.printContainer,
4456
- __self: this,
4457
- __source: {
4458
- fileName: _jsxFileName,
4459
- lineNumber: 411
4460
- }
4461
- }, React$1.createElement(mq.Static, {
4462
- ref: mqStatic => this.mqStatic = mqStatic || this.mqStatic,
4463
- latex: staticLatex,
4464
- onSubFieldChange: this.subFieldChanged,
4465
- getFieldName: this.getFieldName,
4466
- setInput: this.setInput,
4467
- onSubFieldFocus: this.onSubFieldFocus,
4468
- onBlur: this.onBlur,
4469
- __self: this,
4470
- __source: {
4471
- fileName: _jsxFileName,
4472
- lineNumber: 412
4473
- }
4474
- }));
4475
- const midContent = React$1.createElement('div', {
4476
- className: classes.main,
4477
- __self: this,
4478
- __source: {
4479
- fileName: _jsxFileName,
4480
- lineNumber: 424
4481
- }
4482
- }, prompt && React$1.createElement('div', {
4483
- className: classes.content,
4484
- __self: this,
4485
- __source: {
4486
- fileName: _jsxFileName,
4487
- lineNumber: 426
4488
- }
4489
- }, React$1.createElement(PreviewPrompt$1, {
4490
- prompt: prompt,
4491
- __self: this,
4492
- __source: {
4493
- fileName: _jsxFileName,
4494
- lineNumber: 427
4495
- }
4496
- })), studentPrintMode ? printView : React$1.createElement(Readable, {
4497
- false: true,
4498
- __self: this,
4499
- __source: {
4500
- fileName: _jsxFileName,
4501
- lineNumber: 430
4502
- }
4503
- }, React$1.createElement('div', {
4504
- className: classes.inputAndKeypadContainer,
4505
- __self: this,
4506
- __source: {
4507
- fileName: _jsxFileName,
4508
- lineNumber: 431
4509
- }
4510
- }, responseType === ResponseTypes.simple && React$1.createElement(SimpleQuestionBlock, {
4511
- onSimpleResponseChange: this.onSimpleResponseChange,
4512
- showCorrect: showCorrect,
4513
- emptyResponse: emptyResponse,
4514
- model: model,
4515
- session: session,
4516
- __self: this,
4517
- __source: {
4518
- fileName: _jsxFileName,
4519
- lineNumber: 433
4520
- }
4521
- }), responseType === ResponseTypes.advanced && React$1.createElement('div', {
4522
- className: cx(classes.expression, {
4523
- [classes.incorrect]: !emptyResponse && !correct && !showCorrect,
4524
- [classes.correct]: !emptyResponse && (correct || showCorrect),
4525
- [classes.showCorrectness]: !emptyResponse && disabled && correctness && !view,
4526
- [classes.correctAnswerShown]: showCorrect,
4527
- [classes.printCorrect]: printMode && alwaysShowCorrect
4528
- }),
4529
- __self: this,
4530
- __source: {
4531
- fileName: _jsxFileName,
4532
- lineNumber: 442
4533
- }
4534
- }, React$1.createElement(Tooltip, {
4535
- ref: ref => this.setTooltipRef(ref),
4536
- interactive: true,
4537
- open: !!activeAnswerBlock,
4538
- classes: {
4539
- tooltip: classes.keypadTooltip,
4540
- popper: classes.keypadTooltipPopper
4541
- },
4542
- title: Object.keys(session.answers).map(answerId => answerId === activeAnswerBlock && !(showCorrect || disabled) && React$1.createElement('div', {
4543
- 'data-keypad': true,
4544
- key: answerId,
4545
- className: classes.responseContainer,
4546
- style: {
4547
- width: getKeyPadWidth(additionalKeys, equationEditor)
4548
- },
4549
- __self: this,
4550
- __source: {
4551
- fileName: _jsxFileName,
4552
- lineNumber: 463
4553
- }
4554
- }, React$1.createElement(HorizontalKeypad, {
4555
- additionalKeys: additionalKeys,
4556
- mode: equationEditor || DEFAULT_KEYPAD_VARIANT,
4557
- onClick: this.onClick,
4558
- __self: this,
4559
- __source: {
4560
- fileName: _jsxFileName,
4561
- lineNumber: 472
4562
- }
4563
- })) || null),
4564
- __self: this,
4565
- __source: {
4566
- fileName: _jsxFileName,
4567
- lineNumber: 451
4568
- }
4569
- }, React$1.createElement(mq.Static, {
4570
- ref: mqStatic => this.mqStatic = mqStatic || this.mqStatic,
4571
- latex: staticLatex,
4572
- onSubFieldChange: this.subFieldChanged,
4573
- getFieldName: this.getFieldName,
4574
- setInput: this.setInput,
4575
- onSubFieldFocus: this.onSubFieldFocus,
4576
- onBlur: this.onBlur,
4577
- __self: this,
4578
- __source: {
4579
- fileName: _jsxFileName,
4580
- lineNumber: 482
4581
- }
4582
- }))))), viewMode && teacherInstructions && hasText(teacherInstructions) && React$1.createElement(React$1.Fragment, {
4583
- __self: this,
4584
- __source: {
4585
- fileName: _jsxFileName,
4586
- lineNumber: 498
4587
- }
4588
- }, !animationsDisabled ? React$1.createElement(Collapsible$1, {
4589
- labels: {
4590
- hidden: 'Show Teacher Instructions',
4591
- visible: 'Hide Teacher Instructions'
4592
- },
4593
- __self: this,
4594
- __source: {
4595
- fileName: _jsxFileName,
4596
- lineNumber: 499
4597
- }
4598
- }, React$1.createElement('div', {
4599
- dangerouslySetInnerHTML: {
4600
- __html: teacherInstructions
4601
- },
4602
- __self: this,
4603
- __source: {
4604
- fileName: _jsxFileName,
4605
- lineNumber: 502
4606
- }
4607
- })) : React$1.createElement('div', {
4608
- dangerouslySetInnerHTML: {
4609
- __html: teacherInstructions
4610
- },
4611
- __self: this,
4612
- __source: {
4613
- fileName: _jsxFileName,
4614
- lineNumber: 503
4615
- }
4616
- }), React$1.createElement('br', {
4617
- __self: this,
4618
- __source: {
4619
- fileName: _jsxFileName,
4620
- lineNumber: 504
4621
- }
4622
- })), viewMode && rationale && hasText(rationale) && React$1.createElement(React$1.Fragment, {
4623
- __self: this,
4624
- __source: {
4625
- fileName: _jsxFileName,
4626
- lineNumber: 510
4627
- }
4628
- }, !animationsDisabled ? React$1.createElement(Collapsible$1, {
4629
- labels: {
4630
- hidden: 'Show Rationale',
4631
- visible: 'Hide Rationale'
4632
- },
4633
- __self: this,
4634
- __source: {
4635
- fileName: _jsxFileName,
4636
- lineNumber: 511
4637
- }
4638
- }, React$1.createElement('div', {
4639
- dangerouslySetInnerHTML: {
4640
- __html: rationale
4641
- },
4642
- __self: this,
4643
- __source: {
4644
- fileName: _jsxFileName,
4645
- lineNumber: 514
4646
- }
4647
- })) : React$1.createElement('div', {
4648
- dangerouslySetInnerHTML: {
4649
- __html: rationale
4650
- },
4651
- __self: this,
4652
- __source: {
4653
- fileName: _jsxFileName,
4654
- lineNumber: 515
4655
- }
4656
- })), viewMode && displayNote && React$1.createElement('div', {
4657
- className: classes.note,
4658
- dangerouslySetInnerHTML: {
4659
- __html: `<strong>Note:</strong> ${note}`
4660
- },
4661
- __self: this,
4662
- __source: {
4663
- fileName: _jsxFileName,
4664
- lineNumber: 521
4665
- }
4666
- }));
4667
- if (tooltipModeEnabled && (showCorrectAnswerToggle || teacherInstructions || rationale || feedback)) {
4668
- return React$1.createElement(Tooltip, {
4669
- interactive: true,
4670
- classes: {
4671
- tooltip: classes.tooltip,
4672
- popper: classes.tooltipPopper
4673
- },
4674
- title: React$1.createElement('div', {
4675
- __self: this,
4676
- __source: {
4677
- fileName: _jsxFileName,
4678
- lineNumber: 539
4679
- }
4680
- }, React$1.createElement('div', {
4681
- className: classes.main,
4682
- __self: this,
4683
- __source: {
4684
- fileName: _jsxFileName,
4685
- lineNumber: 540
4686
- }
4687
- }, showCorrectAnswerToggle && React$1.createElement(CorrectAnswerToggle$1, {
4688
- className: classes.toggle,
4689
- show: true,
4690
- toggled: showCorrect,
4691
- onToggle: this.toggleShowCorrect,
4692
- __self: this,
4693
- __source: {
4694
- fileName: _jsxFileName,
4695
- lineNumber: 542
4696
- }
4697
- })), teacherInstructions && hasText(teacherInstructions) && [React$1.createElement(Collapsible$1, {
4698
- key: "collapsible",
4699
- labels: {
4700
- hidden: 'Show Teacher Instructions',
4701
- visible: 'Hide Teacher Instructions'
4702
- },
4703
- className: classes.collapsible,
4704
- __self: this,
4705
- __source: {
4706
- fileName: _jsxFileName,
4707
- lineNumber: 551
4708
- }
4709
- }, React$1.createElement(PreviewPrompt$1, {
4710
- prompt: teacherInstructions,
4711
- __self: this,
4712
- __source: {
4713
- fileName: _jsxFileName,
4714
- lineNumber: 559
4715
- }
4716
- })), React$1.createElement('br', {
4717
- key: "br",
4718
- __self: this,
4719
- __source: {
4720
- fileName: _jsxFileName,
4721
- lineNumber: 561
4722
- }
4723
- })], rationale && hasText(rationale) && [React$1.createElement(Collapsible$1, {
4724
- key: "collapsible",
4725
- labels: {
4726
- hidden: 'Show Rationale',
4727
- visible: 'Hide Rationale'
4728
- },
4729
- __self: this,
4730
- __source: {
4731
- fileName: _jsxFileName,
4732
- lineNumber: 564
4733
- }
4734
- }, React$1.createElement(PreviewPrompt$1, {
4735
- prompt: rationale,
4736
- __self: this,
4737
- __source: {
4738
- fileName: _jsxFileName,
4739
- lineNumber: 571
4740
- }
4741
- })), React$1.createElement('br', {
4742
- key: "br",
4743
- __self: this,
4744
- __source: {
4745
- fileName: _jsxFileName,
4746
- lineNumber: 573
4747
- }
4748
- })], displayNote && hasText(note) && [React$1.createElement(Collapsible$1, {
4749
- key: "collapsible",
4750
- labels: {
4751
- hidden: 'Show Note',
4752
- visible: 'Hide Note'
4753
- },
4754
- __self: this,
4755
- __source: {
4756
- fileName: _jsxFileName,
4757
- lineNumber: 576
4758
- }
4759
- }, React$1.createElement(PreviewPrompt$1, {
4760
- prompt: note,
4761
- __self: this,
4762
- __source: {
4763
- fileName: _jsxFileName,
4764
- lineNumber: 583
4765
- }
4766
- })), React$1.createElement('br', {
4767
- key: "br",
4768
- __self: this,
4769
- __source: {
4770
- fileName: _jsxFileName,
4771
- lineNumber: 585
4772
- }
4773
- })], feedback && React$1.createElement(Feedback$1, {
4774
- correctness: correctness.correctness,
4775
- feedback: feedback,
4776
- __self: this,
4777
- __source: {
4778
- fileName: _jsxFileName,
4779
- lineNumber: 588
4780
- }
4781
- })),
4782
- __self: this,
4783
- __source: {
4784
- fileName: _jsxFileName,
4785
- lineNumber: 532
4786
- }
4787
- }, React$1.createElement('div', {
4788
- className: classes.mainContainer,
4789
- ref: r => this.root = r || this.root,
4790
- __self: this,
4791
- __source: {
4792
- fileName: _jsxFileName,
4793
- lineNumber: 596
4794
- }
4795
- }, midContent));
4796
- }
4797
- return React$1.createElement('div', {
4798
- className: classes.mainContainer,
4799
- ref: r => this.root = r || this.root,
4800
- __self: this,
4801
- __source: {
4802
- fileName: _jsxFileName,
4803
- lineNumber: 606
4804
- }
4805
- }, midContent);
4806
- }
4807
- }
4808
- Main.__initStatic();
4809
- const styles = theme => ({
4810
- mainContainer: {
4811
- display: 'inline-block'
4812
- },
4813
- tooltip: {
4814
- background: `${primaryLight()} !important`,
4815
- color: text(),
4816
- padding: theme.spacing.unit * 2,
4817
- border: `1px solid ${secondary()}`,
4818
- fontSize: '16px',
4819
- '& :not(.MathJax) > table tr': {
4820
- '&:nth-child(2n)': {
4821
- backgroundColor: 'unset !important'
4822
- }
4823
- }
4824
- },
4825
- tooltipPopper: {
4826
- opacity: 1
4827
- },
4828
- keypadTooltip: {
4829
- fontSize: 'initial',
4830
- background: 'transparent',
4831
- width: '600px',
4832
- marginTop: 0,
4833
- paddingTop: 0
4834
- },
4835
- keypadTooltipPopper: {
4836
- background: 'transparent',
4837
- width: '650px',
4838
- opacity: 1
4839
- },
4840
- main: {
4841
- width: '100%',
4842
- position: 'relative',
4843
- padding: theme.spacing.unit / 2,
4844
- backgroundColor: background(),
4845
- color: text()
4846
- },
4847
- title: {
4848
- fontSize: '1.1rem',
4849
- display: 'block',
4850
- marginTop: theme.spacing.unit * 2,
4851
- marginBottom: theme.spacing.unit
4852
- },
4853
- content: {
4854
- marginTop: theme.spacing.unit * 2
4855
- },
4856
- note: {
4857
- paddingTop: '15px'
4858
- },
4859
- collapsible: {
4860
- marginTop: theme.spacing.unit * 2
4861
- },
4862
- responseContainer: {
4863
- zIndex: 10,
4864
- minWidth: '400px',
4865
- marginTop: theme.spacing.unit * 2
4866
- },
4867
- expression: {
4868
- maxWidth: 'fit-content',
4869
- '& > .mq-math-mode': {
4870
- '& > .mq-root-block': {
4871
- '& > .mq-editable-field': {
4872
- minWidth: '10px',
4873
- margin: theme.spacing.unit * 2 / 3,
4874
- padding: theme.spacing.unit / 4
4875
- }
4876
- },
4877
- '& sup': {
4878
- top: 0
4879
- }
4880
- }
4881
- },
4882
- inputAndKeypadContainer: {
4883
- position: 'relative',
4884
- '& .mq-overarrow-inner': {
4885
- border: 'none !important',
4886
- padding: '0 !important'
4887
- },
4888
- '& .mq-overarrow-inner-right': {
4889
- display: 'none !important'
4890
- },
4891
- '& .mq-overarrow-inner-left': {
4892
- display: 'none !important'
4893
- },
4894
- '& .mq-overarrow.mq-arrow-both': {
4895
- minWidth: '1.23em',
4896
- '& *': {
4897
- lineHeight: '1 !important'
4898
- },
4899
- '&:before': {
4900
- top: '-0.4em',
4901
- left: '-1px'
4902
- },
4903
- '&:after': {
4904
- top: '-2.4em',
4905
- right: '-1px'
4906
- },
4907
- '&.mq-empty:after': {
4908
- top: '-0.45em'
4909
- }
4910
- },
4911
- '& .mq-overarrow.mq-arrow-right': {
4912
- '&:before': {
4913
- top: '-0.4em',
4914
- right: '-1px'
4915
- }
4916
- },
4917
- '& .mq-longdiv-inner': {
4918
- borderTop: '1px solid !important',
4919
- paddingTop: '1.5px !important'
4920
- },
4921
- '& .mq-parallelogram': {
4922
- lineHeight: 0.85
4923
- }
4924
- },
4925
- showCorrectness: {
4926
- border: '2px solid'
4927
- },
4928
- correctAnswerShown: {
4929
- padding: theme.spacing.unit,
4930
- letterSpacing: '0.5px'
4931
- },
4932
- printCorrect: {
4933
- border: `2px solid ${correct()} !important`
4934
- },
4935
- correct: {
4936
- borderColor: `${correct()} !important`
4937
- },
4938
- incorrect: {
4939
- borderColor: `${incorrect()} !important`
4940
- },
4941
- blockContainer: {
4942
- margin: `${theme.spacing.unit}px !important`,
4943
- display: 'inline-flex',
4944
- border: '2px solid grey !important'
4945
- },
4946
- blockResponse: {
4947
- flex: 2,
4948
- color: 'grey',
4949
- background: 'lightgrey',
4950
- fontSize: '0.8rem !important',
4951
- padding: `${theme.spacing.unit / 2}px !important`,
4952
- display: 'flex',
4953
- alignItems: 'center',
4954
- justifyContent: 'center',
4955
- borderRight: `2px solid ${disabled()} !important`
4956
- },
4957
- toggle: {
4958
- color: text()
4959
- },
4960
- blockMath: {
4961
- color: text(),
4962
- backgroundColor: background(),
4963
- padding: `${theme.spacing.unit / 2}px !important`,
4964
- display: 'flex',
4965
- alignItems: 'center',
4966
- justifyContent: 'center',
4967
- flex: 8,
4968
- '& > .mq-math-mode': {
4969
- '& > .mq-hasCursor': {
4970
- '& > .mq-cursor': {
4971
- display: 'none'
4972
- }
4973
- }
4974
- }
4975
- },
4976
- printContainer: {
4977
- marginBottom: '10px',
4978
- pointerEvents: 'none'
4979
- }
4980
- });
4981
- var Main$1 = withStyles(styles)(Main);
4982
- const React = _dll_react;
4983
- const ReactDOM = _dll_react_dom;
4984
- const {debounce: debounce} = _dll_lodash;
4985
- const debug = _dll_debug;
4986
- const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
4987
- const log = debug('pie-element:math-inline:print');
4988
- const preparePrintModel = (model, opts) => {
4989
- const instr = opts.role === 'instructor';
4990
- model.prompt = model.promptEnabled !== false ? model.prompt : undefined;
4991
- model.teacherInstructions = instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;
4992
- model.rationale = instr && model.rationaleEnabled !== false ? model.rationale : undefined;
4993
- model.showTeacherInstructions = instr;
4994
- model.alwaysShowCorrect = instr;
4995
- model.printMode = true;
4996
- model.feedback = undefined;
4997
- model.expression = model.expression || '{{response}}';
4998
- model.animationsDisabled = true;
4999
- return {
5000
- ...model,
5001
- disabled: true,
5002
- config: {
5003
- ...model,
5004
- env: {
5005
- mode: instr ? 'evaluate' : model.mode,
5006
- role: opts.role
5007
- }
5008
- }
5009
- };
5010
- };
5011
- class MathInlinePrint extends HTMLElement {
5012
- constructor() {
5013
- super();
5014
- this._options = null;
5015
- this._model = null;
5016
- this._session = [];
5017
- this._rerender = debounce(() => {
5018
- if (this._model && this._session) {
5019
- const printModel = preparePrintModel(this._model, this._options);
5020
- const element = this._options && React.createElement(Main$1, {
5021
- model: printModel,
5022
- session: {}
5023
- });
5024
- ReactDOM.render(element, this, () => {
5025
- log('render complete - render math');
5026
- renderMath(this);
5027
- });
5028
- } else {
5029
- log('skip');
5030
- }
5031
- }, 50, {
5032
- leading: false,
5033
- trailing: true
5034
- });
5035
- }
5036
- set options(o) {
5037
- this._options = o;
5038
- }
5039
- set model(s) {
5040
- this._model = s;
5041
- this._rerender();
5042
- }
5043
- connectedCallback() {}
5044
- }
5045
- export {MathInlinePrint as default};