@pie-element/multiple-choice 6.1.7 → 6.1.8

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,4826 +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.2.14/module/index.js";
2
- import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.17/module/index.js";
3
- const React$q = _dll_react;
4
- const PropTypes$s = _dll_prop_types;
5
- const _jsxFileName$o = "/home/circleci/repo/node_modules/@pie-lib/icons/src/sized.jsx";
6
- const normalizeSize = size => {
7
- return typeof size === 'string' ? size : typeof size === 'number' ? `${size}px` : '30px';
8
- };
9
- const Sized = ({size, children}) => {
10
- size = normalizeSize(size);
11
- const style = {
12
- height: size,
13
- width: size,
14
- display: 'inline-block',
15
- position: 'relative'
16
- };
17
- return React$q.createElement('div', {
18
- style: style,
19
- __self: undefined,
20
- __source: {
21
- fileName: _jsxFileName$o,
22
- lineNumber: 18
23
- }
24
- }, children);
25
- };
26
- Sized.propTypes = {
27
- size: PropTypes$s.number,
28
- children: PropTypes$s.oneOfType([PropTypes$s.arrayOf(PropTypes$s.node), PropTypes$s.node]).isRequired
29
- };
30
- const React$p = _dll_react;
31
- const PropTypes$r = _dll_prop_types;
32
- const _jsxFileName$n = "/home/circleci/repo/node_modules/@pie-lib/icons/src/icon-root.jsx";
33
- const IconRoot = ({size, children}) => React$p.createElement(Sized, {
34
- size: size,
35
- __self: undefined,
36
- __source: {
37
- fileName: _jsxFileName$n,
38
- lineNumber: 10
39
- }
40
- }, React$p.createElement('svg', {
41
- preserveAspectRatio: "xMinYMin meet",
42
- version: "1.1",
43
- x: "0px",
44
- y: "0px",
45
- viewBox: "0 0 44 40",
46
- style: {
47
- enableBackground: 'new 0 0 44 40'
48
- },
49
- __self: undefined,
50
- __source: {
51
- fileName: _jsxFileName$n,
52
- lineNumber: 11
53
- }
54
- }, ' ', children));
55
- IconRoot.propTypes = {
56
- size: PropTypes$r.oneOf([PropTypes$r.string, PropTypes$r.number]),
57
- children: PropTypes$r.oneOfType([PropTypes$r.arrayOf(PropTypes$r.node), PropTypes$r.node]).isRequired
58
- };
59
- const getStyles = (name, fg, bg) => ({
60
- bg: {
61
- fill: `var(--icons-${name}-bg, ${bg})`
62
- },
63
- fg: {
64
- fill: `var(--icons-${name}-fg, ${fg})`
65
- }
66
- });
67
- ({
68
- className: PropTypes$r.string
69
- });
70
- const SquareFeedbackBox = ({className}) => React$p.createElement('polygon', {
71
- transform: "translate(2, 0)",
72
- className: className,
73
- points: "34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",
74
- __self: undefined,
75
- __source: {
76
- fileName: _jsxFileName$n,
77
- lineNumber: 51
78
- }
79
- });
80
- SquareFeedbackBox.propTypes = {
81
- className: PropTypes$r.string
82
- };
83
- const RoundFeedbackBox = ({className}) => React$p.createElement('path', {
84
- transform: "translate(1, 0)",
85
- className: className,
86
- 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",
87
- __self: undefined,
88
- __source: {
89
- fileName: _jsxFileName$n,
90
- lineNumber: 62
91
- }
92
- });
93
- RoundFeedbackBox.propTypes = {
94
- className: PropTypes$r.string
95
- };
96
- const Circle$1 = ({className}) => React$p.createElement('circle', {
97
- transform: "translate(-3, 0)",
98
- className: className,
99
- cx: "23",
100
- cy: "20.4",
101
- r: "16",
102
- __self: undefined,
103
- __source: {
104
- fileName: _jsxFileName$n,
105
- lineNumber: 73
106
- }
107
- });
108
- Circle$1.propTypes = {
109
- className: PropTypes$r.string
110
- };
111
- const Square = ({className}) => React$p.createElement('rect', {
112
- x: "3.6",
113
- y: "4.1",
114
- className: className,
115
- width: "32",
116
- height: "32",
117
- __self: undefined,
118
- __source: {
119
- fileName: _jsxFileName$n,
120
- lineNumber: 81
121
- }
122
- });
123
- Square.propTypes = {
124
- className: PropTypes$r.string
125
- };
126
- const PropTypes$q = _dll_prop_types;
127
- const React$o = _dll_react;
128
- const _jsxFileName$m = "/home/circleci/repo/node_modules/@pie-lib/icons/src/icon-base.jsx";
129
- var IconBase = (Action, Emoji) => {
130
- class IconBase extends React$o.Component {
131
- static __initStatic() {
132
- this.propTypes = {
133
- classes: PropTypes$q.object.isRequired,
134
- size: PropTypes$q.number
135
- };
136
- }
137
- constructor(props) {
138
- super(props);
139
- const {classes, size} = this.props;
140
- this.icons = {
141
- feedback: {
142
- round: {
143
- check: React$o.createElement(IconRoot, {
144
- size: size,
145
- __self: this,
146
- __source: {
147
- fileName: _jsxFileName$m,
148
- lineNumber: 20
149
- }
150
- }, React$o.createElement(RoundFeedbackBox, {
151
- className: classes.bg,
152
- __self: this,
153
- __source: {
154
- fileName: _jsxFileName$m,
155
- lineNumber: 21
156
- }
157
- }), React$o.createElement(Action, {
158
- className: classes.fg,
159
- __self: this,
160
- __source: {
161
- fileName: _jsxFileName$m,
162
- lineNumber: 22
163
- }
164
- })),
165
- emoji: React$o.createElement(IconRoot, {
166
- size: size,
167
- __self: this,
168
- __source: {
169
- fileName: _jsxFileName$m,
170
- lineNumber: 26
171
- }
172
- }, React$o.createElement(RoundFeedbackBox, {
173
- className: classes.bg,
174
- __self: this,
175
- __source: {
176
- fileName: _jsxFileName$m,
177
- lineNumber: 27
178
- }
179
- }), React$o.createElement(Emoji, {
180
- className: classes.fg,
181
- __self: this,
182
- __source: {
183
- fileName: _jsxFileName$m,
184
- lineNumber: 28
185
- }
186
- })),
187
- open: {
188
- check: React$o.createElement(IconRoot, {
189
- size: size,
190
- __self: this,
191
- __source: {
192
- fileName: _jsxFileName$m,
193
- lineNumber: 33
194
- }
195
- }, React$o.createElement(Action, {
196
- className: classes.bg,
197
- __self: this,
198
- __source: {
199
- fileName: _jsxFileName$m,
200
- lineNumber: 34
201
- }
202
- })),
203
- emoji: React$o.createElement(IconRoot, {
204
- size: size,
205
- __self: this,
206
- __source: {
207
- fileName: _jsxFileName$m,
208
- lineNumber: 38
209
- }
210
- }, React$o.createElement(Emoji, {
211
- className: classes.bg,
212
- __self: this,
213
- __source: {
214
- fileName: _jsxFileName$m,
215
- lineNumber: 39
216
- }
217
- }))
218
- }
219
- },
220
- square: {
221
- check: React$o.createElement(IconRoot, {
222
- size: size,
223
- __self: this,
224
- __source: {
225
- fileName: _jsxFileName$m,
226
- lineNumber: 46
227
- }
228
- }, React$o.createElement(SquareFeedbackBox, {
229
- className: classes.bg,
230
- __self: this,
231
- __source: {
232
- fileName: _jsxFileName$m,
233
- lineNumber: 47
234
- }
235
- }), React$o.createElement(Action, {
236
- className: classes.fg,
237
- __self: this,
238
- __source: {
239
- fileName: _jsxFileName$m,
240
- lineNumber: 48
241
- }
242
- })),
243
- emoji: React$o.createElement(IconRoot, {
244
- size: size,
245
- __self: this,
246
- __source: {
247
- fileName: _jsxFileName$m,
248
- lineNumber: 52
249
- }
250
- }, React$o.createElement(SquareFeedbackBox, {
251
- className: classes.bg,
252
- __self: this,
253
- __source: {
254
- fileName: _jsxFileName$m,
255
- lineNumber: 53
256
- }
257
- }), React$o.createElement(Emoji, {
258
- className: classes.fg,
259
- __self: this,
260
- __source: {
261
- fileName: _jsxFileName$m,
262
- lineNumber: 54
263
- }
264
- })),
265
- open: {
266
- check: React$o.createElement(IconRoot, {
267
- size: size,
268
- __self: this,
269
- __source: {
270
- fileName: _jsxFileName$m,
271
- lineNumber: 59
272
- }
273
- }, React$o.createElement(Action, {
274
- className: classes.bg,
275
- __self: this,
276
- __source: {
277
- fileName: _jsxFileName$m,
278
- lineNumber: 60
279
- }
280
- })),
281
- emoji: React$o.createElement(IconRoot, {
282
- size: size,
283
- __self: this,
284
- __source: {
285
- fileName: _jsxFileName$m,
286
- lineNumber: 64
287
- }
288
- }, React$o.createElement(Emoji, {
289
- className: classes.bg,
290
- __self: this,
291
- __source: {
292
- fileName: _jsxFileName$m,
293
- lineNumber: 65
294
- }
295
- }))
296
- }
297
- }
298
- },
299
- round: {
300
- check: React$o.createElement(IconRoot, {
301
- size: size,
302
- __self: this,
303
- __source: {
304
- fileName: _jsxFileName$m,
305
- lineNumber: 73
306
- }
307
- }, React$o.createElement(Circle$1, {
308
- className: classes.bg,
309
- __self: this,
310
- __source: {
311
- fileName: _jsxFileName$m,
312
- lineNumber: 74
313
- }
314
- }), React$o.createElement(Action, {
315
- className: classes.fg,
316
- __self: this,
317
- __source: {
318
- fileName: _jsxFileName$m,
319
- lineNumber: 75
320
- }
321
- })),
322
- emoji: React$o.createElement(IconRoot, {
323
- size: size,
324
- __self: this,
325
- __source: {
326
- fileName: _jsxFileName$m,
327
- lineNumber: 79
328
- }
329
- }, React$o.createElement(Circle$1, {
330
- className: classes.bg,
331
- __self: this,
332
- __source: {
333
- fileName: _jsxFileName$m,
334
- lineNumber: 80
335
- }
336
- }), React$o.createElement(Emoji, {
337
- className: classes.fg,
338
- __self: this,
339
- __source: {
340
- fileName: _jsxFileName$m,
341
- lineNumber: 81
342
- }
343
- })),
344
- open: {
345
- check: React$o.createElement(IconRoot, {
346
- size: size,
347
- __self: this,
348
- __source: {
349
- fileName: _jsxFileName$m,
350
- lineNumber: 86
351
- }
352
- }, React$o.createElement(Action, {
353
- className: classes.bg,
354
- __self: this,
355
- __source: {
356
- fileName: _jsxFileName$m,
357
- lineNumber: 87
358
- }
359
- })),
360
- emoji: React$o.createElement(IconRoot, {
361
- size: size,
362
- __self: this,
363
- __source: {
364
- fileName: _jsxFileName$m,
365
- lineNumber: 91
366
- }
367
- }, React$o.createElement(Emoji, {
368
- className: classes.bg,
369
- __self: this,
370
- __source: {
371
- fileName: _jsxFileName$m,
372
- lineNumber: 92
373
- }
374
- }))
375
- }
376
- },
377
- square: {
378
- check: React$o.createElement(IconRoot, {
379
- size: size,
380
- __self: this,
381
- __source: {
382
- fileName: _jsxFileName$m,
383
- lineNumber: 99
384
- }
385
- }, React$o.createElement(Square, {
386
- className: classes.bg,
387
- __self: this,
388
- __source: {
389
- fileName: _jsxFileName$m,
390
- lineNumber: 100
391
- }
392
- }), React$o.createElement(Action, {
393
- className: classes.fg,
394
- __self: this,
395
- __source: {
396
- fileName: _jsxFileName$m,
397
- lineNumber: 101
398
- }
399
- })),
400
- emoji: React$o.createElement(IconRoot, {
401
- size: size,
402
- __self: this,
403
- __source: {
404
- fileName: _jsxFileName$m,
405
- lineNumber: 105
406
- }
407
- }, React$o.createElement(Square, {
408
- className: classes.bg,
409
- __self: this,
410
- __source: {
411
- fileName: _jsxFileName$m,
412
- lineNumber: 106
413
- }
414
- }), React$o.createElement(Emoji, {
415
- className: classes.fg,
416
- __self: this,
417
- __source: {
418
- fileName: _jsxFileName$m,
419
- lineNumber: 107
420
- }
421
- })),
422
- open: {
423
- check: React$o.createElement(IconRoot, {
424
- size: size,
425
- __self: this,
426
- __source: {
427
- fileName: _jsxFileName$m,
428
- lineNumber: 112
429
- }
430
- }, React$o.createElement(Action, {
431
- className: classes.bg,
432
- __self: this,
433
- __source: {
434
- fileName: _jsxFileName$m,
435
- lineNumber: 113
436
- }
437
- })),
438
- emoji: React$o.createElement(IconRoot, {
439
- size: size,
440
- __self: this,
441
- __source: {
442
- fileName: _jsxFileName$m,
443
- lineNumber: 117
444
- }
445
- }, React$o.createElement(Emoji, {
446
- className: classes.bg,
447
- __self: this,
448
- __source: {
449
- fileName: _jsxFileName$m,
450
- lineNumber: 118
451
- }
452
- }))
453
- }
454
- }
455
- };
456
- }
457
- render() {
458
- if (this.props.category === undefined) {
459
- if (this.props.open === true) {
460
- return this.icons[this.props.shape].open[this.props.iconSet];
461
- } else {
462
- return this.icons[this.props.shape][this.props.iconSet];
463
- }
464
- } else {
465
- if (this.props.open === true) {
466
- return this.icons.feedback[this.props.shape].open[this.props.iconSet];
467
- } else {
468
- return this.icons.feedback[this.props.shape][this.props.iconSet];
469
- }
470
- }
471
- }
472
- }
473
- IconBase.__initStatic();
474
- IconBase.propTypes = {
475
- iconSet: PropTypes$q.oneOf(['emoji', 'check']),
476
- shape: PropTypes$q.oneOf(['round', 'square']),
477
- category: PropTypes$q.oneOf(['feedback', undefined]),
478
- open: PropTypes$q.bool
479
- };
480
- IconBase.defaultProps = {
481
- iconSet: 'check',
482
- shape: 'round',
483
- category: undefined,
484
- open: false
485
- };
486
- return IconBase;
487
- };
488
- const PropTypes$p = _dll_prop_types;
489
- const React$n = _dll_react;
490
- const {withStyles: withStyles$j} = _dll_material_ui__core_styles;
491
- const _jsxFileName$l = "/home/circleci/repo/node_modules/@pie-lib/icons/src/correct-icon.jsx";
492
- const styles$b = getStyles('correct', '#f8ffe2', '#4aaf46');
493
- const Emoji$3 = ({className}) => React$n.createElement('g', {
494
- transform: 'translate(1, 0)',
495
- __self: undefined,
496
- __source: {
497
- fileName: _jsxFileName$l,
498
- lineNumber: 10
499
- }
500
- }, React$n.createElement('path', {
501
- className: className,
502
- 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",
503
- __self: undefined,
504
- __source: {
505
- fileName: _jsxFileName$l,
506
- lineNumber: 11
507
- }
508
- }), React$n.createElement('rect', {
509
- x: "21.1",
510
- y: "13.1",
511
- className: className,
512
- width: "3.7",
513
- height: "4.7",
514
- __self: undefined,
515
- __source: {
516
- fileName: _jsxFileName$l,
517
- lineNumber: 16
518
- }
519
- }), React$n.createElement('rect', {
520
- x: "12.7",
521
- y: "13.1",
522
- className: className,
523
- width: "3.7",
524
- height: "4.7",
525
- __self: undefined,
526
- __source: {
527
- fileName: _jsxFileName$l,
528
- lineNumber: 17
529
- }
530
- }));
531
- Emoji$3.propTypes = {
532
- className: PropTypes$p.string
533
- };
534
- Emoji$3.defaultProps = {
535
- x: 0
536
- };
537
- const Check$1 = ({className, x, y}) => React$n.createElement('polygon', {
538
- transform: `translate(${x}, ${y})`,
539
- className: className,
540
- 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",
541
- __self: undefined,
542
- __source: {
543
- fileName: _jsxFileName$l,
544
- lineNumber: 30
545
- }
546
- });
547
- Check$1.propTypes = {
548
- x: PropTypes$p.number,
549
- y: PropTypes$p.number,
550
- className: PropTypes$p.string
551
- };
552
- Check$1.defaultProps = {
553
- x: 0,
554
- y: 0
555
- };
556
- const Correct = IconBase(Check$1, Emoji$3);
557
- Correct.propTypes = {
558
- iconSet: PropTypes$p.oneOf(['emoji', 'check']),
559
- shape: PropTypes$p.oneOf(['round', 'square']),
560
- category: PropTypes$p.oneOf(['feedback', undefined]),
561
- open: PropTypes$p.bool
562
- };
563
- Correct.defaultProps = {
564
- iconSet: 'check',
565
- shape: 'round',
566
- category: undefined,
567
- open: false
568
- };
569
- var correctIcon = withStyles$j(styles$b)(Correct);
570
- const PropTypes$o = _dll_prop_types;
571
- const React$m = _dll_react;
572
- const classNames$7 = _dll_classnames;
573
- const {withStyles: withStyles$i} = _dll_material_ui__core_styles;
574
- const _jsxFileName$k = "/home/circleci/repo/node_modules/@pie-lib/icons/src/correct-response-icon.jsx";
575
- const OpenIcon = ({bg, fg}) => React$m.createElement('svg', {
576
- preserveAspectRatio: "xMinYMin meet",
577
- version: "1.1",
578
- id: "Layer_1",
579
- x: "0px",
580
- y: "0px",
581
- viewBox: "-283 359 34 35",
582
- style: {
583
- enableBackground: 'new -283 359 34 35'
584
- },
585
- __self: undefined,
586
- __source: {
587
- fileName: _jsxFileName$k,
588
- lineNumber: 7
589
- }
590
- }, React$m.createElement('circle', {
591
- className: bg,
592
- cx: "-266",
593
- cy: "375.9",
594
- r: "14",
595
- __self: undefined,
596
- __source: {
597
- fileName: _jsxFileName$k,
598
- lineNumber: 16
599
- }
600
- }), React$m.createElement('path', {
601
- className: bg,
602
- 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",
603
- __self: undefined,
604
- __source: {
605
- fileName: _jsxFileName$k,
606
- lineNumber: 17
607
- }
608
- }), React$m.createElement('polygon', {
609
- className: fg,
610
- 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 ",
611
- __self: undefined,
612
- __source: {
613
- fileName: _jsxFileName$k,
614
- lineNumber: 22
615
- }
616
- }));
617
- OpenIcon.propTypes = {
618
- bg: PropTypes$o.string,
619
- fg: PropTypes$o.string
620
- };
621
- const CloseIcon = ({bg, fg, border}) => React$m.createElement('svg', {
622
- preserveAspectRatio: "xMinYMin meet",
623
- version: "1.1",
624
- x: "0px",
625
- y: "0px",
626
- viewBox: "-129.5 127 34 35",
627
- style: {
628
- enableBackground: 'new -129.5 127 34 35'
629
- },
630
- __self: undefined,
631
- __source: {
632
- fileName: _jsxFileName$k,
633
- lineNumber: 35
634
- }
635
- }, React$m.createElement('path', {
636
- style: {
637
- fill: '#D0CAC5',
638
- stroke: '#E6E3E0',
639
- strokeWidth: 0.75,
640
- strokeMiterlimit: 10
641
- },
642
- 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",
643
- __self: undefined,
644
- __source: {
645
- fileName: _jsxFileName$k,
646
- lineNumber: 43
647
- }
648
- }), React$m.createElement('path', {
649
- style: {
650
- fill: '#B3ABA4',
651
- stroke: '#CDC7C2',
652
- strokeWidth: 0.5,
653
- strokeMiterlimit: 10
654
- },
655
- 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",
656
- __self: undefined,
657
- __source: {
658
- fileName: _jsxFileName$k,
659
- lineNumber: 53
660
- }
661
- }), React$m.createElement('circle', {
662
- className: bg,
663
- cx: "-114.2",
664
- cy: "143.5",
665
- r: "14",
666
- __self: undefined,
667
- __source: {
668
- fileName: _jsxFileName$k,
669
- lineNumber: 62
670
- }
671
- }), React$m.createElement('path', {
672
- className: border,
673
- 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",
674
- __self: undefined,
675
- __source: {
676
- fileName: _jsxFileName$k,
677
- lineNumber: 63
678
- }
679
- }), React$m.createElement('polygon', {
680
- className: fg,
681
- points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
682
- __self: undefined,
683
- __source: {
684
- fileName: _jsxFileName$k,
685
- lineNumber: 68
686
- }
687
- }));
688
- CloseIcon.propTypes = {
689
- bg: PropTypes$o.string,
690
- fg: PropTypes$o.string,
691
- border: PropTypes$o.string
692
- };
693
- const styles$a = {
694
- root: {
695
- width: props => props.size || '25px',
696
- height: props => props.size || '25px'
697
- },
698
- hideIconBg: {
699
- fill: '#bce2ff'
700
- },
701
- hideIconFg: {
702
- fill: '#1a9cff'
703
- },
704
- showIconBg: {
705
- fill: 'white'
706
- },
707
- showIconFg: {
708
- fill: '#1a9cff'
709
- },
710
- showIconBorder: {
711
- fill: '#bce2ff'
712
- }
713
- };
714
- const CorrectResponse = ({open, classes, className}) => React$m.createElement('div', {
715
- className: classNames$7(className, classes.root),
716
- __self: undefined,
717
- __source: {
718
- fileName: _jsxFileName$k,
719
- lineNumber: 104
720
- }
721
- }, open ? React$m.createElement(OpenIcon, {
722
- bg: classes.hideIconBg,
723
- fg: classes.hideIconFg,
724
- __self: undefined,
725
- __source: {
726
- fileName: _jsxFileName$k,
727
- lineNumber: 106
728
- }
729
- }) : React$m.createElement(CloseIcon, {
730
- bg: classes.showIconBg,
731
- border: classes.showIconBorder,
732
- fg: classes.showIconFg,
733
- __self: undefined,
734
- __source: {
735
- fileName: _jsxFileName$k,
736
- lineNumber: 108
737
- }
738
- }));
739
- CorrectResponse.propTypes = {
740
- classes: PropTypes$o.object.isRequired,
741
- open: PropTypes$o.bool,
742
- size: PropTypes$o.string,
743
- className: PropTypes$o.string
744
- };
745
- CorrectResponse.defaultProps = {
746
- open: false
747
- };
748
- var CorrectResponse$1 = withStyles$i(styles$a)(CorrectResponse);
749
- const PropTypes$n = _dll_prop_types;
750
- const React$l = _dll_react;
751
- const {withStyles: withStyles$h} = _dll_material_ui__core_styles;
752
- const _jsxFileName$j = "/home/circleci/repo/node_modules/@pie-lib/icons/src/incorrect-icon.jsx";
753
- const Ex = ({className}) => React$l.createElement('g', {
754
- transform: 'translate(0.5, 0.5)',
755
- __self: undefined,
756
- __source: {
757
- fileName: _jsxFileName$j,
758
- lineNumber: 8
759
- }
760
- }, React$l.createElement('rect', {
761
- x: "11",
762
- y: "17.3",
763
- transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",
764
- className: className,
765
- width: "16.6",
766
- height: "3.7",
767
- __self: undefined,
768
- __source: {
769
- fileName: _jsxFileName$j,
770
- lineNumber: 9
771
- }
772
- }), React$l.createElement('rect', {
773
- x: "17.4",
774
- y: "10.7",
775
- transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",
776
- className: className,
777
- width: "3.7",
778
- height: "16.6",
779
- __self: undefined,
780
- __source: {
781
- fileName: _jsxFileName$j,
782
- lineNumber: 17
783
- }
784
- }));
785
- Ex.propTypes = {
786
- className: PropTypes$n.string
787
- };
788
- const Emoji$2 = ({className}) => React$l.createElement('g', {
789
- transform: 'translate(1,0)',
790
- __self: undefined,
791
- __source: {
792
- fileName: _jsxFileName$j,
793
- lineNumber: 32
794
- }
795
- }, React$l.createElement('rect', {
796
- x: "21",
797
- y: "12.9",
798
- className: className,
799
- width: "3.7",
800
- height: "4.7",
801
- __self: undefined,
802
- __source: {
803
- fileName: _jsxFileName$j,
804
- lineNumber: 33
805
- }
806
- }), React$l.createElement('rect', {
807
- x: "12.7",
808
- y: "12.9",
809
- className: className,
810
- width: "3.7",
811
- height: "4.7",
812
- __self: undefined,
813
- __source: {
814
- fileName: _jsxFileName$j,
815
- lineNumber: 34
816
- }
817
- }), React$l.createElement('rect', {
818
- x: "12.2",
819
- y: "22.5",
820
- className: className,
821
- width: "13",
822
- height: "3.3",
823
- __self: undefined,
824
- __source: {
825
- fileName: _jsxFileName$j,
826
- lineNumber: 35
827
- }
828
- }));
829
- Emoji$2.propTypes = {
830
- className: PropTypes$n.string
831
- };
832
- const styles$9 = getStyles('incorrect', '#fbf2e3', '#fcb733');
833
- const Incorrect = IconBase(Ex, Emoji$2);
834
- var incorrectIcon = withStyles$h(styles$9)(Incorrect);
835
- Incorrect.propTypes = {
836
- iconSet: PropTypes$n.oneOf(['emoji', 'check']),
837
- shape: PropTypes$n.oneOf(['round', 'square']),
838
- category: PropTypes$n.oneOf(['feedback', undefined]),
839
- open: PropTypes$n.bool
840
- };
841
- Incorrect.defaultProps = {
842
- iconSet: 'check',
843
- shape: 'round',
844
- category: undefined,
845
- open: false
846
- };
847
- const PropTypes$m = _dll_prop_types;
848
- const React$k = _dll_react;
849
- const _jsxFileName$i = "/home/circleci/repo/node_modules/@pie-lib/icons/src/instructions-icon.jsx";
850
- const Lines = () => {
851
- const style = {
852
- fill: 'none',
853
- stroke: '#BCE2FF',
854
- strokeWidth: 2,
855
- strokeMiterlimit: 10
856
- };
857
- return React$k.createElement('g', {
858
- __self: undefined,
859
- __source: {
860
- fileName: _jsxFileName$i,
861
- lineNumber: 13
862
- }
863
- }, React$k.createElement('line', {
864
- style: style,
865
- x1: "-98",
866
- y1: "142",
867
- x2: "-114.6",
868
- y2: "142",
869
- __self: undefined,
870
- __source: {
871
- fileName: _jsxFileName$i,
872
- lineNumber: 14
873
- }
874
- }), React$k.createElement('line', {
875
- style: style,
876
- x1: "-98",
877
- y1: "146.3",
878
- x2: "-114.6",
879
- y2: "146.3",
880
- __self: undefined,
881
- __source: {
882
- fileName: _jsxFileName$i,
883
- lineNumber: 15
884
- }
885
- }), React$k.createElement('line', {
886
- style: style,
887
- x1: "-104",
888
- y1: "150.7",
889
- x2: "-114.6",
890
- y2: "150.7",
891
- __self: undefined,
892
- __source: {
893
- fileName: _jsxFileName$i,
894
- lineNumber: 16
895
- }
896
- }));
897
- };
898
- const Root$2 = ({children, size}) => React$k.createElement(Sized, {
899
- size: size,
900
- __self: undefined,
901
- __source: {
902
- fileName: _jsxFileName$i,
903
- lineNumber: 22
904
- }
905
- }, React$k.createElement('svg', {
906
- version: "1.1",
907
- viewBox: "-128 129 31 31",
908
- style: {
909
- enableBackground: 'new -128 129 31 31'
910
- },
911
- __self: undefined,
912
- __source: {
913
- fileName: _jsxFileName$i,
914
- lineNumber: 23
915
- }
916
- }, children));
917
- Root$2.propTypes = {
918
- children: PropTypes$m.oneOfType([PropTypes$m.arrayOf(PropTypes$m.node), PropTypes$m.node]).isRequired,
919
- size: PropTypes$m.number
920
- };
921
- const GreyInfo = () => {
922
- return React$k.createElement('g', {
923
- __self: undefined,
924
- __source: {
925
- fileName: _jsxFileName$i,
926
- lineNumber: 36
927
- }
928
- }, React$k.createElement('rect', {
929
- x: "-123.9",
930
- y: "135.3",
931
- style: {
932
- fill: '#D0CAC5',
933
- stroke: '#E6E3E0',
934
- strokeWidth: 0.75,
935
- strokeLinejoin: 'round',
936
- strokeMiterlimit: 10
937
- },
938
- width: "4.1",
939
- height: "4.1",
940
- __self: undefined,
941
- __source: {
942
- fileName: _jsxFileName$i,
943
- lineNumber: 37
944
- }
945
- }), React$k.createElement('polygon', {
946
- style: {
947
- fill: '#D0CAC5',
948
- stroke: '#E6E3E0',
949
- strokeWidth: 0.75,
950
- strokeLinejoin: 'round',
951
- strokeMiterlimit: 10
952
- },
953
- 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 ",
954
- __self: undefined,
955
- __source: {
956
- fileName: _jsxFileName$i,
957
- lineNumber: 50
958
- }
959
- }), React$k.createElement('rect', {
960
- x: "-124.7",
961
- y: "134.7",
962
- style: {
963
- fill: '#B3ABA4',
964
- stroke: '#CDC7C2',
965
- strokeWidth: 0.5,
966
- strokeLinecap: 'round',
967
- strokeLinejoin: 'round',
968
- strokeMiterlimit: 10
969
- },
970
- width: "4.1",
971
- height: "4.1",
972
- __self: undefined,
973
- __source: {
974
- fileName: _jsxFileName$i,
975
- lineNumber: 61
976
- }
977
- }), React$k.createElement('polygon', {
978
- style: {
979
- fill: '#B3ABA4',
980
- stroke: '#CDC7C2',
981
- strokeWidth: 0.5,
982
- strokeLinecap: 'round',
983
- strokeLinejoin: 'round',
984
- strokeMiterlimit: 10
985
- },
986
- 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 ",
987
- __self: undefined,
988
- __source: {
989
- fileName: _jsxFileName$i,
990
- lineNumber: 76
991
- }
992
- }), React$k.createElement('rect', {
993
- x: "-125.5",
994
- y: "134",
995
- style: {
996
- fill: '#7FABC6'
997
- },
998
- width: "4.1",
999
- height: "4.1",
1000
- __self: undefined,
1001
- __source: {
1002
- fileName: _jsxFileName$i,
1003
- lineNumber: 88
1004
- }
1005
- }), React$k.createElement('polygon', {
1006
- style: {
1007
- fill: '#7FABC6'
1008
- },
1009
- 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 ",
1010
- __self: undefined,
1011
- __source: {
1012
- fileName: _jsxFileName$i,
1013
- lineNumber: 89
1014
- }
1015
- }));
1016
- };
1017
- const BlueInfo = () => React$k.createElement('g', {
1018
- __self: undefined,
1019
- __source: {
1020
- fileName: _jsxFileName$i,
1021
- lineNumber: 99
1022
- }
1023
- }, React$k.createElement('rect', {
1024
- x: "-123.9",
1025
- y: "135.3",
1026
- style: {
1027
- fill: '#D0CAC5',
1028
- stroke: '#E6E3E0',
1029
- strokeWidth: 0.75,
1030
- strokeLinejoin: 'round',
1031
- strokeMiterlimit: 10
1032
- },
1033
- width: "4.1",
1034
- height: "4.1",
1035
- __self: undefined,
1036
- __source: {
1037
- fileName: _jsxFileName$i,
1038
- lineNumber: 100
1039
- }
1040
- }), React$k.createElement('polygon', {
1041
- style: {
1042
- fill: '#D0CAC5',
1043
- stroke: '#E6E3E0',
1044
- strokeWidth: 0.75,
1045
- strokeLinejoin: 'round',
1046
- strokeMiterlimit: 10
1047
- },
1048
- 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 ",
1049
- __self: undefined,
1050
- __source: {
1051
- fileName: _jsxFileName$i,
1052
- lineNumber: 113
1053
- }
1054
- }), React$k.createElement('rect', {
1055
- x: "-124.7",
1056
- y: "134.7",
1057
- style: {
1058
- fill: '#B3ABA4',
1059
- stroke: '#CDC7C2',
1060
- strokeWidth: 0.5,
1061
- strokeLinecap: 'round',
1062
- strokeLinejoin: 'round',
1063
- strokeMiterlimit: 10
1064
- },
1065
- width: "4.1",
1066
- height: "4.1",
1067
- __self: undefined,
1068
- __source: {
1069
- fileName: _jsxFileName$i,
1070
- lineNumber: 124
1071
- }
1072
- }), React$k.createElement('polygon', {
1073
- style: {
1074
- fill: '#B3ABA4',
1075
- stroke: '#CDC7C2',
1076
- strokeWidth: 0.5,
1077
- strokeLinecap: 'round',
1078
- strokeLinejoin: 'round',
1079
- strokeMiterlimit: 10
1080
- },
1081
- 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 ",
1082
- __self: undefined,
1083
- __source: {
1084
- fileName: _jsxFileName$i,
1085
- lineNumber: 138
1086
- }
1087
- }), React$k.createElement('rect', {
1088
- x: "-125.5",
1089
- y: "134",
1090
- style: {
1091
- fill: '#1A9CFF'
1092
- },
1093
- width: "4.1",
1094
- height: "4.1",
1095
- __self: undefined,
1096
- __source: {
1097
- fileName: _jsxFileName$i,
1098
- lineNumber: 150
1099
- }
1100
- }), React$k.createElement('polygon', {
1101
- style: {
1102
- fill: '#1A9CFF'
1103
- },
1104
- 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 ",
1105
- __self: undefined,
1106
- __source: {
1107
- fileName: _jsxFileName$i,
1108
- lineNumber: 151
1109
- }
1110
- }));
1111
- class Instructions extends React$k.Component {
1112
- constructor(props) {
1113
- super(props);
1114
- }
1115
- render() {
1116
- if (this.props.open === true) {
1117
- return React$k.createElement(Root$2, {
1118
- __self: this,
1119
- __source: {
1120
- fileName: _jsxFileName$i,
1121
- lineNumber: 167
1122
- }
1123
- }, React$k.createElement(GreyInfo, {
1124
- __self: this,
1125
- __source: {
1126
- fileName: _jsxFileName$i,
1127
- lineNumber: 168
1128
- }
1129
- }), React$k.createElement(Lines, {
1130
- __self: this,
1131
- __source: {
1132
- fileName: _jsxFileName$i,
1133
- lineNumber: 169
1134
- }
1135
- }));
1136
- } else {
1137
- return React$k.createElement(Root$2, {
1138
- __self: this,
1139
- __source: {
1140
- fileName: _jsxFileName$i,
1141
- lineNumber: 174
1142
- }
1143
- }, React$k.createElement(BlueInfo, {
1144
- __self: this,
1145
- __source: {
1146
- fileName: _jsxFileName$i,
1147
- lineNumber: 175
1148
- }
1149
- }), React$k.createElement(Lines, {
1150
- __self: this,
1151
- __source: {
1152
- fileName: _jsxFileName$i,
1153
- lineNumber: 176
1154
- }
1155
- }));
1156
- }
1157
- }
1158
- }
1159
- Instructions.propTypes = {
1160
- open: PropTypes$m.bool
1161
- };
1162
- Instructions.defaultProps = {
1163
- open: false
1164
- };
1165
- const PropTypes$l = _dll_prop_types;
1166
- const React$j = _dll_react;
1167
- const {withStyles: withStyles$g} = _dll_material_ui__core_styles;
1168
- const _jsxFileName$h = "/home/circleci/repo/node_modules/@pie-lib/icons/src/learn-more-icon.jsx";
1169
- const Glint = ({fill}) => React$j.createElement('path', {
1170
- fill: fill,
1171
- 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",
1172
- __self: undefined,
1173
- __source: {
1174
- fileName: _jsxFileName$h,
1175
- lineNumber: 7
1176
- }
1177
- });
1178
- Glint.propTypes = {
1179
- fill: PropTypes$l.string
1180
- };
1181
- class LearnMore extends React$j.Component {
1182
- static __initStatic() {
1183
- this.propTypes = {
1184
- classes: PropTypes$l.object.isRequired,
1185
- size: PropTypes$l.number
1186
- };
1187
- }
1188
- render() {
1189
- const {classes, size} = this.props;
1190
- if (this.props.open === true) {
1191
- return React$j.createElement(Sized, {
1192
- size: size,
1193
- __self: this,
1194
- __source: {
1195
- fileName: _jsxFileName$h,
1196
- lineNumber: 28
1197
- }
1198
- }, React$j.createElement('svg', {
1199
- preserveAspectRatio: "xMinYMin meet",
1200
- viewBox: "-135 129 16 32",
1201
- __self: this,
1202
- __source: {
1203
- fileName: _jsxFileName$h,
1204
- lineNumber: 29
1205
- }
1206
- }, React$j.createElement('path', {
1207
- className: classes.hideBg,
1208
- 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",
1209
- __self: this,
1210
- __source: {
1211
- fileName: _jsxFileName$h,
1212
- lineNumber: 30
1213
- }
1214
- }), React$j.createElement('path', {
1215
- className: classes.hideBg,
1216
- 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",
1217
- __self: this,
1218
- __source: {
1219
- fileName: _jsxFileName$h,
1220
- lineNumber: 34
1221
- }
1222
- }), React$j.createElement(Glint, {
1223
- fill: classes.hideFg.fill,
1224
- __self: this,
1225
- __source: {
1226
- fileName: _jsxFileName$h,
1227
- lineNumber: 38
1228
- }
1229
- })));
1230
- } else {
1231
- return React$j.createElement(Sized, {
1232
- size: size,
1233
- __self: this,
1234
- __source: {
1235
- fileName: _jsxFileName$h,
1236
- lineNumber: 44
1237
- }
1238
- }, React$j.createElement('svg', {
1239
- preserveAspectRatio: "xMinYMin meet",
1240
- viewBox: "-135 129 16 31",
1241
- __self: this,
1242
- __source: {
1243
- fileName: _jsxFileName$h,
1244
- lineNumber: 45
1245
- }
1246
- }, React$j.createElement('path', {
1247
- fill: "#D0CAC5",
1248
- stroke: "#E6E3E0",
1249
- className: "st0",
1250
- 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",
1251
- __self: this,
1252
- __source: {
1253
- fileName: _jsxFileName$h,
1254
- lineNumber: 46
1255
- }
1256
- }), React$j.createElement('path', {
1257
- fill: "#D0CAC5",
1258
- stroke: "#E6E3E0",
1259
- className: "st0",
1260
- 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",
1261
- __self: this,
1262
- __source: {
1263
- fileName: _jsxFileName$h,
1264
- lineNumber: 52
1265
- }
1266
- }), React$j.createElement('path', {
1267
- fill: "#B3ABA4",
1268
- stroke: "#CDC7C2",
1269
- className: "st1",
1270
- 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",
1271
- __self: this,
1272
- __source: {
1273
- fileName: _jsxFileName$h,
1274
- lineNumber: 58
1275
- }
1276
- }), ",", React$j.createElement('path', {
1277
- fill: "#B3ABA4",
1278
- stroke: "#CDC7C2",
1279
- className: "st1",
1280
- 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",
1281
- __self: this,
1282
- __source: {
1283
- fileName: _jsxFileName$h,
1284
- lineNumber: 65
1285
- }
1286
- }), React$j.createElement('path', {
1287
- className: classes.showBg,
1288
- 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",
1289
- __self: this,
1290
- __source: {
1291
- fileName: _jsxFileName$h,
1292
- lineNumber: 71
1293
- }
1294
- }), React$j.createElement('path', {
1295
- className: classes.showBg,
1296
- 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",
1297
- __self: this,
1298
- __source: {
1299
- fileName: _jsxFileName$h,
1300
- lineNumber: 75
1301
- }
1302
- }), React$j.createElement(Glint, {
1303
- fill: classes.hideFg.fill,
1304
- __self: this,
1305
- __source: {
1306
- fileName: _jsxFileName$h,
1307
- lineNumber: 79
1308
- }
1309
- })));
1310
- }
1311
- }
1312
- }
1313
- LearnMore.__initStatic();
1314
- const styles$8 = {
1315
- showBg: {
1316
- fill: '#1a9cff'
1317
- },
1318
- hideFg: {
1319
- fill: '#1a9cff'
1320
- },
1321
- hideBg: {
1322
- fill: '#bce2ff'
1323
- }
1324
- };
1325
- LearnMore.propTypes = {
1326
- open: PropTypes$l.bool
1327
- };
1328
- LearnMore.defaultProps = {
1329
- open: false
1330
- };
1331
- withStyles$g(styles$8)(LearnMore);
1332
- const PropTypes$k = _dll_prop_types;
1333
- const React$i = _dll_react;
1334
- const {withStyles: withStyles$f} = _dll_material_ui__core_styles;
1335
- const _jsxFileName$g = "/home/circleci/repo/node_modules/@pie-lib/icons/src/nothing-submitted-icon.jsx";
1336
- const Exclamation = ({className}) => React$i.createElement('g', {
1337
- __self: undefined,
1338
- __source: {
1339
- fileName: _jsxFileName$g,
1340
- lineNumber: 8
1341
- }
1342
- }, React$i.createElement('rect', {
1343
- x: "19.3",
1344
- y: "10.3",
1345
- className: className,
1346
- width: "4.5",
1347
- height: "12.7",
1348
- __self: undefined,
1349
- __source: {
1350
- fileName: _jsxFileName$g,
1351
- lineNumber: 9
1352
- }
1353
- }), React$i.createElement('rect', {
1354
- x: "19.3",
1355
- y: "26.2",
1356
- className: className,
1357
- width: "4.5",
1358
- height: "4.5",
1359
- __self: undefined,
1360
- __source: {
1361
- fileName: _jsxFileName$g,
1362
- lineNumber: 10
1363
- }
1364
- }));
1365
- const Octagon = ({className}) => React$i.createElement('polygon', {
1366
- className: className,
1367
- 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",
1368
- __self: undefined,
1369
- __source: {
1370
- fileName: _jsxFileName$g,
1371
- lineNumber: 15
1372
- }
1373
- });
1374
- const Emoji$1 = ({className}) => React$i.createElement('g', {
1375
- __self: undefined,
1376
- __source: {
1377
- fileName: _jsxFileName$g,
1378
- lineNumber: 22
1379
- }
1380
- }, React$i.createElement('rect', {
1381
- x: "23.8",
1382
- y: "15",
1383
- className: className,
1384
- width: "3.5",
1385
- height: "4.4",
1386
- __self: undefined,
1387
- __source: {
1388
- fileName: _jsxFileName$g,
1389
- lineNumber: 23
1390
- }
1391
- }), React$i.createElement('rect', {
1392
- x: "16",
1393
- y: "15",
1394
- className: className,
1395
- width: "3.5",
1396
- height: "4.4",
1397
- __self: undefined,
1398
- __source: {
1399
- fileName: _jsxFileName$g,
1400
- lineNumber: 24
1401
- }
1402
- }), React$i.createElement('path', {
1403
- className: className,
1404
- 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",
1405
- __self: undefined,
1406
- __source: {
1407
- fileName: _jsxFileName$g,
1408
- lineNumber: 25
1409
- }
1410
- }));
1411
- Emoji$1.propTypes = Octagon.propTypes = Exclamation.propTypes = {
1412
- className: PropTypes$k.string
1413
- };
1414
- const styles$7 = getStyles('nothing-submitted', 'white', '#464146');
1415
- class NothingSubmitted extends React$i.Component {
1416
- static __initStatic() {
1417
- this.propTypes = {
1418
- classes: PropTypes$k.object.isRequired
1419
- };
1420
- }
1421
- constructor(props) {
1422
- super(props);
1423
- const {classes} = this.props;
1424
- this.icons = {
1425
- check: React$i.createElement(IconRoot, {
1426
- __self: this,
1427
- __source: {
1428
- fileName: _jsxFileName$g,
1429
- lineNumber: 48
1430
- }
1431
- }, React$i.createElement(Octagon, {
1432
- className: classes.bg,
1433
- __self: this,
1434
- __source: {
1435
- fileName: _jsxFileName$g,
1436
- lineNumber: 49
1437
- }
1438
- }), React$i.createElement(Exclamation, {
1439
- className: classes.fg,
1440
- __self: this,
1441
- __source: {
1442
- fileName: _jsxFileName$g,
1443
- lineNumber: 50
1444
- }
1445
- })),
1446
- emoji: React$i.createElement(IconRoot, {
1447
- __self: this,
1448
- __source: {
1449
- fileName: _jsxFileName$g,
1450
- lineNumber: 54
1451
- }
1452
- }, React$i.createElement(Octagon, {
1453
- className: classes.bg,
1454
- __self: this,
1455
- __source: {
1456
- fileName: _jsxFileName$g,
1457
- lineNumber: 55
1458
- }
1459
- }), React$i.createElement(Emoji$1, {
1460
- className: classes.fg,
1461
- __self: this,
1462
- __source: {
1463
- fileName: _jsxFileName$g,
1464
- lineNumber: 56
1465
- }
1466
- })),
1467
- feedback: {
1468
- check: React$i.createElement(IconRoot, {
1469
- __self: this,
1470
- __source: {
1471
- fileName: _jsxFileName$g,
1472
- lineNumber: 61
1473
- }
1474
- }, React$i.createElement(Octagon, {
1475
- className: classes.bg,
1476
- __self: this,
1477
- __source: {
1478
- fileName: _jsxFileName$g,
1479
- lineNumber: 62
1480
- }
1481
- }), React$i.createElement(Emoji$1, {
1482
- className: classes.fg,
1483
- __self: this,
1484
- __source: {
1485
- fileName: _jsxFileName$g,
1486
- lineNumber: 63
1487
- }
1488
- })),
1489
- emoji: React$i.createElement(IconRoot, {
1490
- __self: this,
1491
- __source: {
1492
- fileName: _jsxFileName$g,
1493
- lineNumber: 67
1494
- }
1495
- }, React$i.createElement(Octagon, {
1496
- className: classes.bg,
1497
- __self: this,
1498
- __source: {
1499
- fileName: _jsxFileName$g,
1500
- lineNumber: 68
1501
- }
1502
- }), React$i.createElement(Emoji$1, {
1503
- className: classes.fg,
1504
- __self: this,
1505
- __source: {
1506
- fileName: _jsxFileName$g,
1507
- lineNumber: 69
1508
- }
1509
- })),
1510
- square: {
1511
- check: React$i.createElement(IconRoot, {
1512
- __self: this,
1513
- __source: {
1514
- fileName: _jsxFileName$g,
1515
- lineNumber: 74
1516
- }
1517
- }, React$i.createElement(Octagon, {
1518
- className: classes.bg,
1519
- __self: this,
1520
- __source: {
1521
- fileName: _jsxFileName$g,
1522
- lineNumber: 75
1523
- }
1524
- }), React$i.createElement(Exclamation, {
1525
- className: classes.fg,
1526
- __self: this,
1527
- __source: {
1528
- fileName: _jsxFileName$g,
1529
- lineNumber: 76
1530
- }
1531
- })),
1532
- emoji: React$i.createElement(IconRoot, {
1533
- __self: this,
1534
- __source: {
1535
- fileName: _jsxFileName$g,
1536
- lineNumber: 80
1537
- }
1538
- }, React$i.createElement(Octagon, {
1539
- className: classes.bg,
1540
- __self: this,
1541
- __source: {
1542
- fileName: _jsxFileName$g,
1543
- lineNumber: 81
1544
- }
1545
- }), React$i.createElement(Emoji$1, {
1546
- className: classes.fg,
1547
- __self: this,
1548
- __source: {
1549
- fileName: _jsxFileName$g,
1550
- lineNumber: 82
1551
- }
1552
- })),
1553
- open: {
1554
- check: React$i.createElement(IconRoot, {
1555
- __self: this,
1556
- __source: {
1557
- fileName: _jsxFileName$g,
1558
- lineNumber: 87
1559
- }
1560
- }, React$i.createElement(Exclamation, {
1561
- className: classes.bg,
1562
- __self: this,
1563
- __source: {
1564
- fileName: _jsxFileName$g,
1565
- lineNumber: 88
1566
- }
1567
- })),
1568
- emoji: React$i.createElement(IconRoot, {
1569
- __self: this,
1570
- __source: {
1571
- fileName: _jsxFileName$g,
1572
- lineNumber: 92
1573
- }
1574
- }, React$i.createElement(Emoji$1, {
1575
- className: classes.bg,
1576
- __self: this,
1577
- __source: {
1578
- fileName: _jsxFileName$g,
1579
- lineNumber: 93
1580
- }
1581
- }))
1582
- }
1583
- }
1584
- }
1585
- };
1586
- }
1587
- render() {
1588
- if (this.props.category === undefined) {
1589
- return this.icons[this.props.iconSet];
1590
- } else {
1591
- if (this.props.shape === undefined) {
1592
- return this.icons.feedback[this.props.iconSet];
1593
- } else {
1594
- if (this.props.open === true) {
1595
- return this.icons.feedback.square.open[this.props.iconSet];
1596
- } else {
1597
- return this.icons.feedback.square[this.props.iconSet];
1598
- }
1599
- }
1600
- }
1601
- }
1602
- }
1603
- NothingSubmitted.__initStatic();
1604
- NothingSubmitted.propTypes = {
1605
- iconSet: PropTypes$k.oneOf(['emoji', 'check', undefined]),
1606
- shape: PropTypes$k.oneOf(['square', undefined]),
1607
- category: PropTypes$k.oneOf(['feedback', undefined]),
1608
- open: PropTypes$k.bool
1609
- };
1610
- NothingSubmitted.defaultProps = {
1611
- iconSet: 'check',
1612
- shape: undefined,
1613
- category: undefined,
1614
- open: false
1615
- };
1616
- var nothingSubmittedIcon = withStyles$f(styles$7)(NothingSubmitted);
1617
- const PropTypes$j = _dll_prop_types;
1618
- const React$h = _dll_react;
1619
- const {withStyles: withStyles$e} = _dll_material_ui__core_styles;
1620
- const _jsxFileName$f = "/home/circleci/repo/node_modules/@pie-lib/icons/src/partially-correct-icon.jsx";
1621
- const styles$6 = getStyles('partially-correct', '#4aaf46', '#c1e1ac');
1622
- const Check = ({className}) => React$h.createElement('g', {
1623
- transform: 'translate(0, 0)',
1624
- __self: undefined,
1625
- __source: {
1626
- fileName: _jsxFileName$f,
1627
- lineNumber: 10
1628
- }
1629
- }, React$h.createElement('polygon', {
1630
- className: className,
1631
- points: "27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",
1632
- __self: undefined,
1633
- __source: {
1634
- fileName: _jsxFileName$f,
1635
- lineNumber: 11
1636
- }
1637
- }), React$h.createElement('polygon', {
1638
- className: className,
1639
- points: "16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",
1640
- __self: undefined,
1641
- __source: {
1642
- fileName: _jsxFileName$f,
1643
- lineNumber: 12
1644
- }
1645
- }));
1646
- const Emoji = ({className}) => React$h.createElement('g', {
1647
- transform: 'translate(2, 0)',
1648
- __self: undefined,
1649
- __source: {
1650
- fileName: _jsxFileName$f,
1651
- lineNumber: 17
1652
- }
1653
- }, React$h.createElement('rect', {
1654
- x: "20.6",
1655
- y: "11.8",
1656
- className: className,
1657
- width: "4",
1658
- height: "5",
1659
- __self: undefined,
1660
- __source: {
1661
- fileName: _jsxFileName$f,
1662
- lineNumber: 18
1663
- }
1664
- }), React$h.createElement('rect', {
1665
- x: "11.5",
1666
- y: "11.8",
1667
- className: className,
1668
- width: "4",
1669
- height: "5",
1670
- __self: undefined,
1671
- __source: {
1672
- fileName: _jsxFileName$f,
1673
- lineNumber: 19
1674
- }
1675
- }), React$h.createElement('rect', {
1676
- x: "10.9",
1677
- y: "22.9",
1678
- transform: "matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",
1679
- className: className,
1680
- width: "14.3",
1681
- height: "3.7",
1682
- __self: undefined,
1683
- __source: {
1684
- fileName: _jsxFileName$f,
1685
- lineNumber: 20
1686
- }
1687
- }));
1688
- Emoji.propTypes = Check.propTypes = {
1689
- className: PropTypes$j.string
1690
- };
1691
- const PartiallyCorrect = IconBase(Check, Emoji);
1692
- PartiallyCorrect.propTypes = {
1693
- iconSet: PropTypes$j.oneOf(['emoji', 'check']),
1694
- shape: PropTypes$j.oneOf(['round', 'square']),
1695
- category: PropTypes$j.oneOf(['feedback', undefined]),
1696
- open: PropTypes$j.bool
1697
- };
1698
- PartiallyCorrect.defaultProps = {
1699
- iconSet: 'check',
1700
- shape: 'round',
1701
- category: undefined,
1702
- open: false
1703
- };
1704
- var partiallyCorrectIcon = withStyles$e(styles$6)(PartiallyCorrect);
1705
- const PropTypes$i = _dll_prop_types;
1706
- const React$g = _dll_react;
1707
- const {withStyles: withStyles$d} = _dll_material_ui__core_styles;
1708
- const _jsxFileName$e = "/home/circleci/repo/node_modules/@pie-lib/icons/src/show-rationale-icon.jsx";
1709
- const Info = ({fg}) => React$g.createElement('g', {
1710
- __self: undefined,
1711
- __source: {
1712
- fileName: _jsxFileName$e,
1713
- lineNumber: 7
1714
- }
1715
- }, React$g.createElement('rect', {
1716
- x: "-115",
1717
- y: "136.7",
1718
- className: fg,
1719
- width: "3",
1720
- height: "3",
1721
- __self: undefined,
1722
- __source: {
1723
- fileName: _jsxFileName$e,
1724
- lineNumber: 8
1725
- }
1726
- }), React$g.createElement('polygon', {
1727
- className: fg,
1728
- 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",
1729
- __self: undefined,
1730
- __source: {
1731
- fileName: _jsxFileName$e,
1732
- lineNumber: 9
1733
- }
1734
- }));
1735
- Info.propTypes = {
1736
- fg: PropTypes$i.string
1737
- };
1738
- const Border = ({className}) => React$g.createElement('path', {
1739
- className: className,
1740
- 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",
1741
- __self: undefined,
1742
- __source: {
1743
- fileName: _jsxFileName$e,
1744
- lineNumber: 21
1745
- }
1746
- });
1747
- Border.propTypes = {
1748
- className: PropTypes$i.string
1749
- };
1750
- const Circle = () => React$g.createElement('g', {
1751
- __self: undefined,
1752
- __source: {
1753
- fileName: _jsxFileName$e,
1754
- lineNumber: 30
1755
- }
1756
- }, React$g.createElement('path', {
1757
- style: {
1758
- fill: '#D0CAC5',
1759
- stroke: '#E6E3E0',
1760
- strokeWidth: 0.75,
1761
- strokeMiterlimit: 10
1762
- },
1763
- 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",
1764
- __self: undefined,
1765
- __source: {
1766
- fileName: _jsxFileName$e,
1767
- lineNumber: 31
1768
- }
1769
- }), React$g.createElement('path', {
1770
- style: {
1771
- fill: '#B3ABA4',
1772
- stroke: '#CDC7C2',
1773
- strokeWidth: 0.5,
1774
- strokeMiterlimit: 10
1775
- },
1776
- 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",
1777
- __self: undefined,
1778
- __source: {
1779
- fileName: _jsxFileName$e,
1780
- lineNumber: 40
1781
- }
1782
- }), React$g.createElement('circle', {
1783
- style: {
1784
- fill: '#FFFFFF'
1785
- },
1786
- cx: "-113",
1787
- cy: "144",
1788
- r: "14",
1789
- __self: undefined,
1790
- __source: {
1791
- fileName: _jsxFileName$e,
1792
- lineNumber: 49
1793
- }
1794
- }));
1795
- const Root$1 = ({children, size}) => {
1796
- size = normalizeSize(size);
1797
- const style = {
1798
- height: size,
1799
- width: size,
1800
- display: 'inline-block',
1801
- position: 'relative'
1802
- };
1803
- return React$g.createElement('div', {
1804
- style: style,
1805
- __self: undefined,
1806
- __source: {
1807
- fileName: _jsxFileName$e,
1808
- lineNumber: 63
1809
- }
1810
- }, React$g.createElement('svg', {
1811
- preserveAspectRatio: "xMinYMin meet",
1812
- viewBox: "-129 128 34 34",
1813
- __self: undefined,
1814
- __source: {
1815
- fileName: _jsxFileName$e,
1816
- lineNumber: 64
1817
- }
1818
- }, children));
1819
- };
1820
- Root$1.propTypes = {
1821
- children: PropTypes$i.oneOfType([PropTypes$i.arrayOf(PropTypes$i.node), PropTypes$i.node]).isRequired,
1822
- size: PropTypes$i.number
1823
- };
1824
- const styles$5 = {
1825
- fg: {
1826
- fill: '#1a9cff'
1827
- },
1828
- bg: {
1829
- fill: '#bce2ff'
1830
- },
1831
- border: {
1832
- fill: '#bbe3fd'
1833
- },
1834
- whiteBorder: {
1835
- fill: 'white'
1836
- }
1837
- };
1838
- class ShowRationale extends React$g.Component {
1839
- static __initStatic() {
1840
- this.propTypes = {
1841
- classes: PropTypes$i.object.isRequired
1842
- };
1843
- }
1844
- constructor(props) {
1845
- super(props);
1846
- }
1847
- render() {
1848
- const {classes} = this.props;
1849
- const info = React$g.createElement(Info, {
1850
- fg: classes.fg,
1851
- __self: this,
1852
- __source: {
1853
- fileName: _jsxFileName$e,
1854
- lineNumber: 102
1855
- }
1856
- });
1857
- const icons = {
1858
- check: React$g.createElement(Root$1, {
1859
- __self: this,
1860
- __source: {
1861
- fileName: _jsxFileName$e,
1862
- lineNumber: 105
1863
- }
1864
- }, React$g.createElement(Circle, {
1865
- __self: this,
1866
- __source: {
1867
- fileName: _jsxFileName$e,
1868
- lineNumber: 106
1869
- }
1870
- }), info, React$g.createElement(Border, {
1871
- className: classes.border,
1872
- __self: this,
1873
- __source: {
1874
- fileName: _jsxFileName$e,
1875
- lineNumber: 108
1876
- }
1877
- })),
1878
- emoji: React$g.createElement(Root$1, {
1879
- __self: this,
1880
- __source: {
1881
- fileName: _jsxFileName$e,
1882
- lineNumber: 112
1883
- }
1884
- }, React$g.createElement(Circle, {
1885
- __self: this,
1886
- __source: {
1887
- fileName: _jsxFileName$e,
1888
- lineNumber: 113
1889
- }
1890
- }), info, React$g.createElement(Border, {
1891
- className: classes.border,
1892
- __self: this,
1893
- __source: {
1894
- fileName: _jsxFileName$e,
1895
- lineNumber: 115
1896
- }
1897
- })),
1898
- open: {
1899
- check: React$g.createElement(Root$1, {
1900
- __self: this,
1901
- __source: {
1902
- fileName: _jsxFileName$e,
1903
- lineNumber: 120
1904
- }
1905
- }, React$g.createElement('circle', {
1906
- style: {
1907
- fill: '#FFFFFF'
1908
- },
1909
- cx: "-113",
1910
- cy: "144",
1911
- r: "14",
1912
- __self: this,
1913
- __source: {
1914
- fileName: _jsxFileName$e,
1915
- lineNumber: 121
1916
- }
1917
- }), React$g.createElement(Info, {
1918
- fg: classes.bg,
1919
- border: classes.whiteBorder,
1920
- __self: this,
1921
- __source: {
1922
- fileName: _jsxFileName$e,
1923
- lineNumber: 122
1924
- }
1925
- })),
1926
- emoji: React$g.createElement(Root$1, {
1927
- __self: this,
1928
- __source: {
1929
- fileName: _jsxFileName$e,
1930
- lineNumber: 126
1931
- }
1932
- }, React$g.createElement('circle', {
1933
- style: {
1934
- fill: '#FFFFFF'
1935
- },
1936
- cx: "-113",
1937
- cy: "144",
1938
- r: "14",
1939
- __self: this,
1940
- __source: {
1941
- fileName: _jsxFileName$e,
1942
- lineNumber: 127
1943
- }
1944
- }), React$g.createElement(Info, {
1945
- fg: classes.bg,
1946
- border: classes.border,
1947
- __self: this,
1948
- __source: {
1949
- fileName: _jsxFileName$e,
1950
- lineNumber: 128
1951
- }
1952
- }))
1953
- }
1954
- };
1955
- if (this.props.open === true) {
1956
- return icons.open[this.props.iconSet];
1957
- } else {
1958
- return icons[this.props.iconSet];
1959
- }
1960
- }
1961
- }
1962
- ShowRationale.__initStatic();
1963
- ShowRationale.propTypes = {
1964
- iconSet: PropTypes$i.oneOf(['emoji', 'check']),
1965
- open: PropTypes$i.bool
1966
- };
1967
- ShowRationale.defaultProps = {
1968
- iconSet: 'check',
1969
- open: false
1970
- };
1971
- withStyles$d(styles$5)(ShowRationale);
1972
- function getDefaultExportFromCjs(x) {
1973
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1974
- }
1975
- function getAugmentedNamespace(n) {
1976
- if (n.__esModule) return n;
1977
- var a = Object.defineProperty({}, '__esModule', {
1978
- value: true
1979
- });
1980
- Object.keys(n).forEach(function (k) {
1981
- var d = Object.getOwnPropertyDescriptor(n, k);
1982
- Object.defineProperty(a, k, d.get ? d : {
1983
- enumerable: true,
1984
- get: function () {
1985
- return n[k];
1986
- }
1987
- });
1988
- });
1989
- return a;
1990
- }
1991
- var CSSTransition$1 = {
1992
- exports: {}
1993
- };
1994
- var addClass = {
1995
- exports: {}
1996
- };
1997
- var interopRequireDefault = {
1998
- exports: {}
1999
- };
2000
- (function (module) {
2001
- function _interopRequireDefault(obj) {
2002
- return obj && obj.__esModule ? obj : {
2003
- "default": obj
2004
- };
2005
- }
2006
- module.exports = _interopRequireDefault;
2007
- (module.exports["default"] = module.exports, module.exports.__esModule = true);
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$h = {};
2123
- const require$$0$5 = _dll_prop_types;
2124
- PropTypes$h.__esModule = true;
2125
- PropTypes$h.classNamesShape = PropTypes$h.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$h.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$h.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$g = _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$h;
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$g.object
2436
- };
2437
- Transition.childContextTypes = {
2438
- transitionGroup: function transitionGroup() {}
2439
- };
2440
- Transition.propTypes = {
2441
- children: PropTypes$g.oneOfType([PropTypes$g.func.isRequired, PropTypes$g.element.isRequired]).isRequired,
2442
- in: PropTypes$g.bool,
2443
- mountOnEnter: PropTypes$g.bool,
2444
- unmountOnExit: PropTypes$g.bool,
2445
- appear: PropTypes$g.bool,
2446
- enter: PropTypes$g.bool,
2447
- exit: PropTypes$g.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$g.func,
2457
- onEnter: PropTypes$g.func,
2458
- onEntering: PropTypes$g.func,
2459
- onEntered: PropTypes$g.func,
2460
- onExit: PropTypes$g.func,
2461
- onExiting: PropTypes$g.func,
2462
- onExited: PropTypes$g.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$h;
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 primary = () => pv('primary', defaults.PRIMARY);
3083
- const primaryLight = () => pv('primary-light', defaults.PRIMARY_LIGHT);
3084
- const background = () => pv('background', defaults.BACKGROUND);
3085
- const {withStyles: withStyles$c} = _dll_material_ui__core_styles;
3086
- const React$f = _dll_react;
3087
- const classNames$6 = _dll_classnames;
3088
- const PropTypes$f = _dll_prop_types;
3089
- const _jsxFileName$d = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/feedback.jsx";
3090
- const styleSheet$1 = {
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$f.Component {
3134
- static __initStatic() {
3135
- this.propTypes = {
3136
- correctness: PropTypes$f.string,
3137
- feedback: PropTypes$f.string,
3138
- classes: PropTypes$f.object.isRequired
3139
- };
3140
- }
3141
- render() {
3142
- const {correctness, feedback, classes} = this.props;
3143
- function chooseFeedback(correctness) {
3144
- if (correctness && feedback) {
3145
- return React$f.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$d,
3160
- lineNumber: 69
3161
- }
3162
- }, React$f.createElement('div', {
3163
- className: classes.corespringFeedback,
3164
- __self: this,
3165
- __source: {
3166
- fileName: _jsxFileName$d,
3167
- lineNumber: 79
3168
- }
3169
- }, React$f.createElement('div', {
3170
- className: classNames$6(classes.content, classes[correctness]),
3171
- dangerouslySetInnerHTML: {
3172
- __html: feedback
3173
- },
3174
- __self: this,
3175
- __source: {
3176
- fileName: _jsxFileName$d,
3177
- lineNumber: 80
3178
- }
3179
- })));
3180
- } else {
3181
- return null;
3182
- }
3183
- }
3184
- return React$f.createElement('div', {
3185
- __self: this,
3186
- __source: {
3187
- fileName: _jsxFileName$d,
3188
- lineNumber: 93
3189
- }
3190
- }, React$f.createElement(reactTransitionGroup.TransitionGroup, {
3191
- __self: this,
3192
- __source: {
3193
- fileName: _jsxFileName$d,
3194
- lineNumber: 94
3195
- }
3196
- }, chooseFeedback(correctness)));
3197
- }
3198
- }
3199
- Feedback.__initStatic();
3200
- var Feedback$1 = withStyles$c(styleSheet$1, {
3201
- name: 'Feedback'
3202
- })(Feedback);
3203
- const React$e = _dll_react;
3204
- const PropTypes$e = _dll_prop_types;
3205
- const {Popover: Popover} = _dll_material_ui__core;
3206
- const {withStyles: withStyles$b} = _dll_material_ui__core_styles;
3207
- const debug$1 = _dll_debug;
3208
- const _jsxFileName$c = "/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$e.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$e.createElement('div', {
3252
- className: feedback && classes.responseIndicator,
3253
- __self: this,
3254
- __source: {
3255
- fileName: _jsxFileName$c,
3256
- lineNumber: 47
3257
- }
3258
- }, React$e.createElement('span', {
3259
- ref: r => this.icon = r,
3260
- onClick: this.handlePopoverOpen,
3261
- __self: this,
3262
- __source: {
3263
- fileName: _jsxFileName$c,
3264
- lineNumber: 48
3265
- }
3266
- }, React$e.createElement(Icon, {
3267
- __self: this,
3268
- __source: {
3269
- fileName: _jsxFileName$c,
3270
- lineNumber: 49
3271
- }
3272
- })), feedback && React$e.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$c,
3291
- lineNumber: 53
3292
- }
3293
- }, React$e.createElement(Feedback$1, {
3294
- feedback: feedback,
3295
- correctness: correctness,
3296
- __self: this,
3297
- __source: {
3298
- fileName: _jsxFileName$c,
3299
- lineNumber: 70
3300
- }
3301
- })));
3302
- }
3303
- }
3304
- RawIndicator.propTypes = {
3305
- feedback: PropTypes$e.string,
3306
- classes: PropTypes$e.object.isRequired
3307
- };
3308
- return withStyles$b(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$d = _dll_react;
3315
- const {withStyles: withStyles$a} = _dll_material_ui__core_styles;
3316
- const Collapse = _dll_material_ui__core_collapse_index;
3317
- const PropTypes$d = _dll_prop_types;
3318
- const {renderMath: renderMath$2} = _dll_pie_lib__math_rendering;
3319
- const _jsxFileName$b = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx";
3320
- class Collapsible extends React$d.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$d.object.isRequired,
3329
- className: PropTypes$d.string,
3330
- children: PropTypes$d.object,
3331
- labels: PropTypes$d.shape({
3332
- visible: PropTypes$d.string,
3333
- hidden: PropTypes$d.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$2(this.root);
3356
- }
3357
- componentDidUpdate() {
3358
- renderMath$2(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$d.createElement('div', {
3364
- className: className,
3365
- ref: r => this.root = r,
3366
- __self: this,
3367
- __source: {
3368
- fileName: _jsxFileName$b,
3369
- lineNumber: 43
3370
- }
3371
- }, React$d.createElement('div', {
3372
- onClick: this.toggleExpanded,
3373
- __self: this,
3374
- __source: {
3375
- fileName: _jsxFileName$b,
3376
- lineNumber: 44
3377
- }
3378
- }, React$d.createElement('span', {
3379
- className: classes.title,
3380
- __self: this,
3381
- __source: {
3382
- fileName: _jsxFileName$b,
3383
- lineNumber: 45
3384
- }
3385
- }, title)), React$d.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$b,
3393
- lineNumber: 47
3394
- }
3395
- }, children));
3396
- }
3397
- }
3398
- Collapsible.__initStatic();
3399
- Collapsible.__initStatic2();
3400
- var Collapsible$1 = withStyles$a(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$c = _dll_react;
3410
- const {withStyles: withStyles$9} = _dll_material_ui__core_styles;
3411
- const {createMuiTheme: createMuiTheme$1} = _dll_material_ui__core_styles;
3412
- const {MuiThemeProvider: MuiThemeProvider$1} = _dll_material_ui__core_styles;
3413
- const PropTypes$c = _dll_prop_types;
3414
- const _jsxFileName$a = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/preview-layout.jsx";
3415
- class PreviewLayout extends React$c.Component {
3416
- static __initStatic() {
3417
- this.propTypes = {
3418
- children: PropTypes$c.oneOfType([PropTypes$c.arrayOf(PropTypes$c.node), PropTypes$c.node]).isRequired,
3419
- classes: PropTypes$c.object
3420
- };
3421
- }
3422
- render() {
3423
- const {children, classes} = this.props;
3424
- return React$c.createElement('div', {
3425
- className: classes.container,
3426
- __self: this,
3427
- __source: {
3428
- fileName: _jsxFileName$a,
3429
- lineNumber: 14
3430
- }
3431
- }, children);
3432
- }
3433
- }
3434
- PreviewLayout.__initStatic();
3435
- const styles$3 = () => ({
3436
- container: {
3437
- display: 'flex',
3438
- flexDirection: 'column',
3439
- position: 'relative'
3440
- }
3441
- });
3442
- const theme$1 = createMuiTheme$1({
3443
- typography: {
3444
- useNextVariants: true
3445
- },
3446
- palette: {
3447
- action: {
3448
- disabled: 'rgba(0, 0, 0, 0.54);'
3449
- }
3450
- },
3451
- overrides: {
3452
- MuiRadio: {
3453
- root: {
3454
- '&$checked': {
3455
- color: '#3f51b5 !important'
3456
- }
3457
- }
3458
- },
3459
- MuiCheckbox: {
3460
- root: {
3461
- '&$checked': {
3462
- color: '#3f51b5 !important'
3463
- }
3464
- }
3465
- },
3466
- MuiTabs: {
3467
- root: {
3468
- borderBottom: '1px solid #eee'
3469
- }
3470
- },
3471
- MuiSwitch: {
3472
- root: {
3473
- '&$checked': {
3474
- color: '#3f51b5 !important',
3475
- '& + $bar': {
3476
- backgroundColor: '#3f51b5 !important',
3477
- opacity: 0.5
3478
- }
3479
- }
3480
- }
3481
- }
3482
- }
3483
- });
3484
- const Styled$1 = withStyles$9(styles$3)(PreviewLayout);
3485
- const RootElem = props => React$c.createElement(MuiThemeProvider$1, {
3486
- theme: theme$1,
3487
- __self: undefined,
3488
- __source: {
3489
- fileName: _jsxFileName$a,
3490
- lineNumber: 72
3491
- }
3492
- }, React$c.createElement(Styled$1, {
3493
- ...props,
3494
- __self: undefined,
3495
- __source: {
3496
- fileName: _jsxFileName$a,
3497
- lineNumber: 73
3498
- }
3499
- }));
3500
- const React$b = _dll_react;
3501
- const PropTypes$b = _dll_prop_types;
3502
- const {renderMath: renderMath$1} = _dll_pie_lib__math_rendering;
3503
- const _jsxFileName$9 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/html-and-math.js";
3504
- class HtmlAndMath extends React$b.Component {
3505
- static __initStatic() {
3506
- this.propTypes = {
3507
- tag: PropTypes$b.string,
3508
- className: PropTypes$b.string,
3509
- html: PropTypes$b.string
3510
- };
3511
- }
3512
- static __initStatic2() {
3513
- this.defaultProps = {
3514
- tag: 'div',
3515
- html: ''
3516
- };
3517
- }
3518
- componentDidMount() {
3519
- if (this.node) {
3520
- renderMath$1(this.node);
3521
- }
3522
- }
3523
- componentDidUpdate() {
3524
- if (this.node) {
3525
- renderMath$1(this.node);
3526
- }
3527
- }
3528
- render() {
3529
- const {tag, className, html} = this.props;
3530
- const Tag = tag || 'div';
3531
- return React$b.createElement(Tag, {
3532
- ref: r => this.node = r,
3533
- className: className,
3534
- dangerouslySetInnerHTML: {
3535
- __html: html
3536
- },
3537
- __self: this,
3538
- __source: {
3539
- fileName: _jsxFileName$9,
3540
- lineNumber: 33
3541
- }
3542
- });
3543
- }
3544
- }
3545
- HtmlAndMath.__initStatic();
3546
- HtmlAndMath.__initStatic2();
3547
- const {InputLabel: InputLabel} = _dll_material_ui__core;
3548
- const {FormControl: FormControl} = _dll_material_ui__core;
3549
- const PropTypes$a = _dll_prop_types;
3550
- const React$a = _dll_react;
3551
- const classNames$5 = _dll_classnames;
3552
- const {withStyles: withStyles$8} = _dll_material_ui__core_styles;
3553
- const _jsxFileName$8 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/input-container.jsx";
3554
- const RawInputContainer = props => {
3555
- const {label, className, children, classes} = props;
3556
- const names = classNames$5(classes.formControl, className);
3557
- return React$a.createElement(FormControl, {
3558
- className: names,
3559
- __self: undefined,
3560
- __source: {
3561
- fileName: _jsxFileName$8,
3562
- lineNumber: 13
3563
- }
3564
- }, React$a.createElement(InputLabel, {
3565
- className: classes.label,
3566
- shrink: true,
3567
- __self: undefined,
3568
- __source: {
3569
- fileName: _jsxFileName$8,
3570
- lineNumber: 14
3571
- }
3572
- }, label), children);
3573
- };
3574
- RawInputContainer.propTypes = {
3575
- label: PropTypes$a.oneOfType([PropTypes$a.string, PropTypes$a.object]).isRequired,
3576
- className: PropTypes$a.string,
3577
- children: PropTypes$a.oneOfType([PropTypes$a.arrayOf(PropTypes$a.node), PropTypes$a.node]).isRequired,
3578
- classes: PropTypes$a.object.isRequired
3579
- };
3580
- withStyles$8(theme => ({
3581
- formControl: {
3582
- marginLeft: 0,
3583
- marginRight: theme.spacing.unit,
3584
- paddingBottom: theme.spacing.unit,
3585
- flex: '1 0 auto',
3586
- minWidth: theme.spacing.unit * 4
3587
- },
3588
- label: {
3589
- fontSize: 'inherit',
3590
- whiteSpace: 'nowrap'
3591
- }
3592
- }))(RawInputContainer);
3593
- const React$9 = _dll_react;
3594
- const {Component: Component} = _dll_react;
3595
- const {withStyles: withStyles$7} = _dll_material_ui__core_styles;
3596
- const PropTypes$9 = _dll_prop_types;
3597
- const _jsxFileName$7 = "/home/circleci/repo/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx";
3598
- const NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
3599
- const NEWLINE_LATEX = '\\newline ';
3600
- class PreviewPrompt extends Component {
3601
- constructor(...args) {
3602
- super(...args);
3603
- PreviewPrompt.prototype.__init.call(this);
3604
- }
3605
- static __initStatic() {
3606
- this.propTypes = {
3607
- classes: PropTypes$9.object,
3608
- prompt: PropTypes$9.string,
3609
- tagName: PropTypes$9.string,
3610
- className: PropTypes$9.string,
3611
- onClick: PropTypes$9.func,
3612
- defaultClassName: PropTypes$9.string
3613
- };
3614
- }
3615
- static __initStatic2() {
3616
- this.defaultProps = {
3617
- onClick: () => {}
3618
- };
3619
- }
3620
- __init() {
3621
- this.parsedText = text => {
3622
- const div = document.createElement('div');
3623
- div.innerHTML = text;
3624
- const audio = div.querySelector('audio');
3625
- if (audio) {
3626
- const source = document.createElement('source');
3627
- source.setAttribute('type', 'audio/mp3');
3628
- source.setAttribute('src', audio.getAttribute('src'));
3629
- audio.removeAttribute('src');
3630
- audio.appendChild(source);
3631
- }
3632
- return div.innerHTML;
3633
- };
3634
- }
3635
- render() {
3636
- const {prompt, classes, tagName, className, onClick, defaultClassName} = this.props;
3637
- const CustomTag = tagName || 'div';
3638
- const customClasses = `${classes.promptTable} ${classes[className] || ''} ${defaultClassName || ''}`;
3639
- return React$9.createElement(CustomTag, {
3640
- onClick: onClick,
3641
- className: customClasses,
3642
- dangerouslySetInnerHTML: {
3643
- __html: this.parsedText(prompt || '').replace(NEWLINE_BLOCK_REGEX, NEWLINE_LATEX)
3644
- },
3645
- __self: this,
3646
- __source: {
3647
- fileName: _jsxFileName$7,
3648
- lineNumber: 50
3649
- }
3650
- });
3651
- }
3652
- }
3653
- PreviewPrompt.__initStatic();
3654
- PreviewPrompt.__initStatic2();
3655
- const styles$2 = theme => ({
3656
- prompt: {
3657
- verticalAlign: 'middle',
3658
- color: text()
3659
- },
3660
- rationale: {
3661
- paddingLeft: theme.spacing.unit * 16
3662
- },
3663
- label: {
3664
- color: `${text()} !important`,
3665
- display: 'inline-block',
3666
- verticalAlign: 'middle',
3667
- cursor: 'pointer'
3668
- },
3669
- promptTable: {
3670
- '&:not(.MathJax) > table': {
3671
- borderCollapse: 'collapse'
3672
- },
3673
- '&:not(.MathJax) > table tr': {
3674
- '&:nth-child(2n)': {
3675
- backgroundColor: '#f6f8fa'
3676
- }
3677
- },
3678
- '&:not(.MathJax) > table td, &:not(.MathJax) > table th': {
3679
- padding: '.6em 1em',
3680
- textAlign: 'center'
3681
- }
3682
- }
3683
- });
3684
- var PreviewPrompt$1 = withStyles$7(styles$2)(PreviewPrompt);
3685
- const PropTypes$8 = _dll_prop_types;
3686
- const React$8 = _dll_react;
3687
- const Readable = props => {
3688
- return React$8.createElement(React$8.Fragment, null, React$8.Children.map(props.children, child => React$8.cloneElement(child, {
3689
- 'data-pie-readable': props.false === undefined
3690
- })));
3691
- };
3692
- Readable.propTypes = {
3693
- children: PropTypes$8.node,
3694
- false: PropTypes$8.bool
3695
- };
3696
- const PropTypes$7 = _dll_prop_types;
3697
- ({
3698
- children: PropTypes$7.node,
3699
- purpose: PropTypes$7.string
3700
- });
3701
- new DOMParser();
3702
- const noTouch = {
3703
- '-webkit-touchCcallout': 'none',
3704
- '-webkit-user-select': 'none',
3705
- '-khtml-user-select': 'none',
3706
- '-moz-user-select': 'none',
3707
- '-ms-user-select': 'none',
3708
- 'user-select': 'none'
3709
- };
3710
- var styles$1 = {
3711
- root: {
3712
- width: '100%',
3713
- cursor: 'pointer'
3714
- },
3715
- content: {
3716
- margin: '0 auto',
3717
- textAlign: 'center',
3718
- display: 'flex'
3719
- },
3720
- label: Object.assign({
3721
- width: '140px',
3722
- fontFamily: "'Roboto', sans-serif",
3723
- height: '25px',
3724
- lineHeight: '25px',
3725
- verticalAlign: 'middle',
3726
- color: `var(--correct-answer-toggle-label-color, ${text()})`,
3727
- fontSize: '15px',
3728
- fontWeight: 'normal'
3729
- }, noTouch),
3730
- icon: {
3731
- position: 'absolute',
3732
- width: '25px'
3733
- },
3734
- iconHolder: {
3735
- width: '25px',
3736
- marginRight: '5px'
3737
- },
3738
- enter: {
3739
- opacity: '0'
3740
- },
3741
- enterActive: {
3742
- opacity: '1',
3743
- transition: 'opacity 0.3s ease-in'
3744
- },
3745
- exit: {
3746
- opacity: '1'
3747
- },
3748
- exitActive: {
3749
- opacity: '0',
3750
- transition: 'opacity 0.3s ease-in'
3751
- }
3752
- };
3753
- const React$7 = _dll_react;
3754
- const PropTypes$6 = _dll_prop_types;
3755
- const {withStyles: withStyles$6} = _dll_material_ui__core_styles;
3756
- const _jsxFileName$6 = "/home/circleci/repo/node_modules/@pie-lib/correct-answer-toggle/src/expander.jsx";
3757
- const Expander = props => {
3758
- const {classes, show, children} = props;
3759
- return React$7.createElement(reactTransitionGroup.CSSTransition, {
3760
- in: show,
3761
- appear: true,
3762
- mountOnEnter: false,
3763
- timeout: 300,
3764
- classNames: {
3765
- ...classes
3766
- },
3767
- __self: undefined,
3768
- __source: {
3769
- fileName: _jsxFileName$6,
3770
- lineNumber: 10
3771
- }
3772
- }, React$7.createElement('div', {
3773
- className: classes.expander,
3774
- __self: undefined,
3775
- __source: {
3776
- fileName: _jsxFileName$6,
3777
- lineNumber: 17
3778
- }
3779
- }, children));
3780
- };
3781
- Expander.propTypes = {
3782
- show: PropTypes$6.bool.isRequired,
3783
- className: PropTypes$6.string,
3784
- classes: PropTypes$6.object,
3785
- children: PropTypes$6.oneOfType([PropTypes$6.arrayOf(PropTypes$6.node), PropTypes$6.node]).isRequired
3786
- };
3787
- const transition = 'height ease-in 300ms, opacity ease-in 300ms';
3788
- var Expander$1 = withStyles$6(() => ({
3789
- expander: {
3790
- position: 'relative',
3791
- height: 0,
3792
- overflow: 'hidden',
3793
- display: 'flex',
3794
- visibility: 'hidden',
3795
- width: 0
3796
- },
3797
- enter: {
3798
- transition,
3799
- opacity: 1,
3800
- height: '25px',
3801
- width: 'auto',
3802
- visibility: 'visible'
3803
- },
3804
- enterDone: {
3805
- height: '25px',
3806
- visibility: 'visible',
3807
- width: 'auto'
3808
- },
3809
- exit: {
3810
- transition,
3811
- opacity: 0,
3812
- height: 0,
3813
- visibility: 'visible',
3814
- width: 0
3815
- },
3816
- exitDone: {
3817
- opacity: 0,
3818
- visibility: 'hidden',
3819
- height: 0,
3820
- width: 0
3821
- }
3822
- }))(Expander);
3823
- const {withStyles: withStyles$5} = _dll_material_ui__core_styles;
3824
- const React$6 = _dll_react;
3825
- const classNames$4 = _dll_classnames;
3826
- const PropTypes$5 = _dll_prop_types;
3827
- const _jsxFileName$5 = "/home/circleci/repo/node_modules/@pie-lib/correct-answer-toggle/src/index.jsx";
3828
- class CorrectAnswerToggle extends React$6.Component {
3829
- static __initStatic() {
3830
- this.propTypes = {
3831
- onToggle: PropTypes$5.func,
3832
- toggled: PropTypes$5.bool,
3833
- show: PropTypes$5.bool,
3834
- hideMessage: PropTypes$5.string,
3835
- showMessage: PropTypes$5.string,
3836
- classes: PropTypes$5.object.isRequired,
3837
- className: PropTypes$5.string
3838
- };
3839
- }
3840
- static __initStatic2() {
3841
- this.defaultProps = {
3842
- showMessage: 'Show correct answer',
3843
- hideMessage: 'Hide correct answer',
3844
- show: false,
3845
- toggled: false
3846
- };
3847
- }
3848
- constructor(props) {
3849
- super(props);
3850
- this.state = {
3851
- show: props.show
3852
- };
3853
- }
3854
- onClick() {
3855
- this.props.onToggle(!this.props.toggled);
3856
- }
3857
- componentWillReceiveProps(nextProps) {
3858
- this.setState({
3859
- show: nextProps.show
3860
- });
3861
- }
3862
- render() {
3863
- const {classes, className, toggled, hideMessage, showMessage} = this.props;
3864
- return React$6.createElement('div', {
3865
- className: classNames$4(classes.root, className),
3866
- __self: this,
3867
- __source: {
3868
- fileName: _jsxFileName$5,
3869
- lineNumber: 52
3870
- }
3871
- }, React$6.createElement(Expander$1, {
3872
- show: this.state.show,
3873
- className: classes.expander,
3874
- __self: this,
3875
- __source: {
3876
- fileName: _jsxFileName$5,
3877
- lineNumber: 53
3878
- }
3879
- }, React$6.createElement('div', {
3880
- className: classes.content,
3881
- onClick: this.onClick.bind(this),
3882
- __self: this,
3883
- __source: {
3884
- fileName: _jsxFileName$5,
3885
- lineNumber: 54
3886
- }
3887
- }, React$6.createElement('div', {
3888
- className: classes.iconHolder,
3889
- __self: this,
3890
- __source: {
3891
- fileName: _jsxFileName$5,
3892
- lineNumber: 55
3893
- }
3894
- }, React$6.createElement(CSSTransition, {
3895
- timeout: 400,
3896
- in: toggled,
3897
- exit: !toggled,
3898
- classNames: classes,
3899
- __self: this,
3900
- __source: {
3901
- fileName: _jsxFileName$5,
3902
- lineNumber: 56
3903
- }
3904
- }, React$6.createElement(CorrectResponse$1, {
3905
- open: toggled,
3906
- key: "correct-open",
3907
- className: classes.icon,
3908
- __self: this,
3909
- __source: {
3910
- fileName: _jsxFileName$5,
3911
- lineNumber: 57
3912
- }
3913
- })), React$6.createElement(CSSTransition, {
3914
- timeout: 5000,
3915
- in: !toggled,
3916
- exit: toggled,
3917
- classNames: classes,
3918
- __self: this,
3919
- __source: {
3920
- fileName: _jsxFileName$5,
3921
- lineNumber: 59
3922
- }
3923
- }, React$6.createElement(CorrectResponse$1, {
3924
- open: toggled,
3925
- key: "correct-closed",
3926
- className: classes.icon,
3927
- __self: this,
3928
- __source: {
3929
- fileName: _jsxFileName$5,
3930
- lineNumber: 60
3931
- }
3932
- }))), React$6.createElement(Readable, {
3933
- false: true,
3934
- __self: this,
3935
- __source: {
3936
- fileName: _jsxFileName$5,
3937
- lineNumber: 63
3938
- }
3939
- }, React$6.createElement('div', {
3940
- className: classes.label,
3941
- __self: this,
3942
- __source: {
3943
- fileName: _jsxFileName$5,
3944
- lineNumber: 64
3945
- }
3946
- }, toggled ? hideMessage : showMessage)))));
3947
- }
3948
- }
3949
- CorrectAnswerToggle.__initStatic();
3950
- CorrectAnswerToggle.__initStatic2();
3951
- var CorrectAnswerToggle$1 = withStyles$5(styles$1)(CorrectAnswerToggle);
3952
- const React$5 = _dll_react;
3953
- const {withStyles: withStyles$4} = _dll_material_ui__core_styles;
3954
- const PropTypes$4 = _dll_prop_types;
3955
- const _jsxFileName$4 = "/home/circleci/repo/packages/multiple-choice/src/feedback-tick.jsx";
3956
- const stylesheet = {
3957
- incorrect: {
3958
- fill: `var(--feedback-incorrect-bg-color, ${incorrect()})`
3959
- },
3960
- correct: {
3961
- fill: `var(--feedback-correct-bg-color, ${correct()})`
3962
- },
3963
- feedbackTick: {
3964
- width: '33px',
3965
- height: '33px',
3966
- '& svg': {
3967
- position: 'absolute',
3968
- display: 'inline-block',
3969
- width: '33px',
3970
- height: '33px',
3971
- verticalAlign: 'middle',
3972
- '& hide': {
3973
- display: 'none'
3974
- }
3975
- }
3976
- },
3977
- feedbackTickEnter: {
3978
- opacity: '0',
3979
- left: '-50px'
3980
- },
3981
- feedbackTickEnterActive: {
3982
- opacity: '1',
3983
- left: '0px',
3984
- transition: 'left 500ms ease-in 200ms, opacity 500ms linear 200ms'
3985
- },
3986
- feedbackTickLeave: {
3987
- opacity: '1',
3988
- left: '0px'
3989
- },
3990
- feedbackTickLeaveActive: {
3991
- opacity: '0',
3992
- left: '-50px',
3993
- transition: 'left 300ms ease-in, opacity 300ms'
3994
- }
3995
- };
3996
- class FeedbackTick extends React$5.Component {
3997
- static __initStatic() {
3998
- this.propTypes = {
3999
- classes: PropTypes$4.object.isRequired,
4000
- correctness: PropTypes$4.string
4001
- };
4002
- }
4003
- constructor(props) {
4004
- super(props);
4005
- this.incorrectIcon = React$5.createElement('svg', {
4006
- key: "1",
4007
- preserveAspectRatio: "xMinYMin meet",
4008
- x: "0px",
4009
- y: "0px",
4010
- viewBox: "0 0 44 40",
4011
- style: {
4012
- enableBackground: 'new 0 0 44 40'
4013
- },
4014
- __self: this,
4015
- __source: {
4016
- fileName: _jsxFileName$4,
4017
- lineNumber: 56
4018
- }
4019
- }, React$5.createElement('g', {
4020
- __self: this,
4021
- __source: {
4022
- fileName: _jsxFileName$4,
4023
- lineNumber: 64
4024
- }
4025
- }, React$5.createElement('rect', {
4026
- x: "11",
4027
- y: "17.3",
4028
- transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",
4029
- className: this.props.classes.incorrect,
4030
- width: "16.6",
4031
- height: "3.7",
4032
- __self: this,
4033
- __source: {
4034
- fileName: _jsxFileName$4,
4035
- lineNumber: 65
4036
- }
4037
- }), React$5.createElement('rect', {
4038
- x: "17.4",
4039
- y: "10.7",
4040
- transform: "matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",
4041
- className: this.props.classes.incorrect,
4042
- width: "3.7",
4043
- height: "16.6",
4044
- __self: this,
4045
- __source: {
4046
- fileName: _jsxFileName$4,
4047
- lineNumber: 73
4048
- }
4049
- })));
4050
- this.correctIcon = React$5.createElement('svg', {
4051
- key: "2",
4052
- preserveAspectRatio: "xMinYMin meet",
4053
- version: "1.1",
4054
- x: "0px",
4055
- y: "0px",
4056
- viewBox: "0 0 44 40",
4057
- style: {
4058
- enableBackground: 'new 0 0 44 40'
4059
- },
4060
- __self: this,
4061
- __source: {
4062
- fileName: _jsxFileName$4,
4063
- lineNumber: 86
4064
- }
4065
- }, React$5.createElement('polygon', {
4066
- className: this.props.classes.correct,
4067
- 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",
4068
- __self: this,
4069
- __source: {
4070
- fileName: _jsxFileName$4,
4071
- lineNumber: 95
4072
- }
4073
- }));
4074
- }
4075
- render() {
4076
- const {correctness, classes} = this.props;
4077
- const icon = (() => {
4078
- if (correctness === 'incorrect') {
4079
- return this.incorrectIcon;
4080
- } else if (correctness === 'correct') {
4081
- return this.correctIcon;
4082
- }
4083
- })();
4084
- return React$5.createElement('div', {
4085
- className: classes.feedbackTick,
4086
- __self: this,
4087
- __source: {
4088
- fileName: _jsxFileName$4,
4089
- lineNumber: 115
4090
- }
4091
- }, React$5.createElement(reactTransitionGroup.TransitionGroup, {
4092
- __self: this,
4093
- __source: {
4094
- fileName: _jsxFileName$4,
4095
- lineNumber: 116
4096
- }
4097
- }, correctness && React$5.createElement(reactTransitionGroup.CSSTransition, {
4098
- classNames: {
4099
- enter: classes.feedbackTickEnter,
4100
- enterActive: classes.feedbackTickEnterActive,
4101
- exit: classes.feedbackTickLeave,
4102
- exitActive: classes.feedbackTickLeaveActive
4103
- },
4104
- timeout: {
4105
- enter: 700,
4106
- exit: 300
4107
- },
4108
- __self: this,
4109
- __source: {
4110
- fileName: _jsxFileName$4,
4111
- lineNumber: 118
4112
- }
4113
- }, icon)));
4114
- }
4115
- }
4116
- FeedbackTick.__initStatic();
4117
- var FeedbackTick$1 = withStyles$4(stylesheet, {
4118
- name: 'FeedbackTick'
4119
- })(FeedbackTick);
4120
- const {FormControlLabel: FormControlLabel} = _dll_material_ui__core;
4121
- const {Checkbox: Checkbox} = _dll_material_ui__core;
4122
- const {Radio: Radio} = _dll_material_ui__core;
4123
- const React$4 = _dll_react;
4124
- const PropTypes$3 = _dll_prop_types;
4125
- const {withStyles: withStyles$3} = _dll_material_ui__core_styles;
4126
- const classNames$3 = _dll_classnames;
4127
- const _jsxFileName$3 = "/home/circleci/repo/packages/multiple-choice/src/choice-input.jsx";
4128
- const styleSheet = () => ({
4129
- row: {
4130
- display: 'flex',
4131
- alignItems: 'center',
4132
- backgroundColor: background()
4133
- },
4134
- checkboxHolder: {
4135
- display: 'flex',
4136
- alignItems: 'center',
4137
- backgroundColor: background(),
4138
- flex: 1,
4139
- '& label': {
4140
- color: text()
4141
- }
4142
- }
4143
- });
4144
- const formStyleSheet = {
4145
- label: {
4146
- color: `${text()} !important`,
4147
- backgroundColor: background()
4148
- }
4149
- };
4150
- const StyledFormControlLabel = withStyles$3(formStyleSheet, {
4151
- name: 'FormControlLabel'
4152
- })(props => React$4.createElement(FormControlLabel, {
4153
- ...props,
4154
- classes: {
4155
- label: props.classes.label
4156
- },
4157
- __self: undefined,
4158
- __source: {
4159
- fileName: _jsxFileName$3,
4160
- lineNumber: 39
4161
- }
4162
- }));
4163
- const CLASS_NAME = 'multiple-choice-component';
4164
- const colorStyle = (varName, fallback) => ({
4165
- [`&.${CLASS_NAME}`]: {
4166
- color: `var(--choice-input-${varName}, ${fallback}) !important`
4167
- }
4168
- });
4169
- const inputStyles = {
4170
- 'correct-root': colorStyle('correct-color', text()),
4171
- 'correct-checked': colorStyle('correct-selected-color', correct()),
4172
- 'correct-disabled': colorStyle('correct-disabled-color', disabled()),
4173
- 'incorrect-root': colorStyle('incorrect-color', incorrect()),
4174
- 'incorrect-checked': colorStyle('incorrect-checked', incorrect()),
4175
- 'incorrect-disabled': colorStyle('incorrect-disabled-color', disabled()),
4176
- root: {
4177
- ...colorStyle('color', text()),
4178
- '&:hover': {
4179
- color: `${primaryLight()} !important`
4180
- }
4181
- },
4182
- checked: colorStyle('selected-color', primary()),
4183
- disabled: {
4184
- ...colorStyle('disabled-color', text()),
4185
- opacity: 0.6,
4186
- cursor: 'not-allowed !important',
4187
- pointerEvents: 'initial !important'
4188
- }
4189
- };
4190
- const StyledCheckbox = withStyles$3(inputStyles)(props => {
4191
- const {correctness, classes, checked, onChange, disabled, accessibility} = props;
4192
- const key = k => correctness ? `${correctness}-${k}` : k;
4193
- const resolved = {
4194
- root: classes[key('root')],
4195
- checked: classes[key('checked')],
4196
- disabled: classes[key('disabled')]
4197
- };
4198
- const miniProps = {
4199
- checked,
4200
- onChange,
4201
- disabled
4202
- };
4203
- return React$4.createElement(Checkbox, {
4204
- 'aria-label': accessibility,
4205
- ...miniProps,
4206
- className: CLASS_NAME,
4207
- classes: {
4208
- root: resolved.root,
4209
- checked: resolved.checked,
4210
- disabled: `${correctness ? '' : resolved.disabled}`
4211
- },
4212
- __self: undefined,
4213
- __source: {
4214
- fileName: _jsxFileName$3,
4215
- lineNumber: 92
4216
- }
4217
- });
4218
- });
4219
- const StyledRadio = withStyles$3(inputStyles)(props => {
4220
- const {correctness, classes, checked, onChange, disabled, accessibility} = props;
4221
- const key = k => correctness ? `${correctness}-${k}` : k;
4222
- const resolved = {
4223
- root: classes[key('root')],
4224
- checked: classes[key('checked')],
4225
- disabled: classes[key('disabled')]
4226
- };
4227
- const miniProps = {
4228
- checked,
4229
- onChange,
4230
- disabled
4231
- };
4232
- return React$4.createElement(Radio, {
4233
- 'aria-label': accessibility,
4234
- ...miniProps,
4235
- className: CLASS_NAME,
4236
- classes: {
4237
- root: resolved.root,
4238
- checked: resolved.checked,
4239
- disabled: `${correctness ? '' : resolved.disabled}`
4240
- },
4241
- __self: undefined,
4242
- __source: {
4243
- fileName: _jsxFileName$3,
4244
- lineNumber: 125
4245
- }
4246
- });
4247
- });
4248
- class ChoiceInput extends React$4.Component {
4249
- static __initStatic() {
4250
- this.propTypes = {
4251
- choiceMode: PropTypes$3.oneOf(['radio', 'checkbox']),
4252
- displayKey: PropTypes$3.string.isRequired,
4253
- checked: PropTypes$3.bool.isRequired,
4254
- correctness: PropTypes$3.string,
4255
- disabled: PropTypes$3.bool.isRequired,
4256
- feedback: PropTypes$3.string,
4257
- label: PropTypes$3.string.isRequired,
4258
- rationale: PropTypes$3.string,
4259
- accessibility: PropTypes$3.string,
4260
- onChange: PropTypes$3.func.isRequired,
4261
- value: PropTypes$3.string.isRequired,
4262
- classes: PropTypes$3.object,
4263
- className: PropTypes$3.string,
4264
- hideTick: PropTypes$3.bool,
4265
- isEvaluateMode: PropTypes$3.bool
4266
- };
4267
- }
4268
- static __initStatic2() {
4269
- this.defaultProps = {
4270
- rationale: null,
4271
- accessibility: null,
4272
- checked: false,
4273
- isEvaluateMode: false
4274
- };
4275
- }
4276
- constructor(props) {
4277
- super(props);
4278
- this.onToggleChoice = this.onToggleChoice.bind(this);
4279
- }
4280
- onToggleChoice() {
4281
- this.props.onChange({
4282
- value: this.props.value,
4283
- selected: !this.props.checked
4284
- });
4285
- }
4286
- render() {
4287
- const {choiceMode, disabled, displayKey, feedback, label, checked, correctness, classes, className, rationale, accessibility, hideTick, isEvaluateMode} = this.props;
4288
- const Tag = choiceMode === 'checkbox' ? StyledCheckbox : StyledRadio;
4289
- const classSuffix = choiceMode === 'checkbox' ? 'checkbox' : 'radio-button';
4290
- return React$4.createElement('div', {
4291
- className: classNames$3(className, 'corespring-' + classSuffix, 'choice-input'),
4292
- __self: this,
4293
- __source: {
4294
- fileName: _jsxFileName$3,
4295
- lineNumber: 197
4296
- }
4297
- }, React$4.createElement('div', {
4298
- className: classes.row,
4299
- __self: this,
4300
- __source: {
4301
- fileName: _jsxFileName$3,
4302
- lineNumber: 198
4303
- }
4304
- }, !hideTick && isEvaluateMode && React$4.createElement(FeedbackTick$1, {
4305
- correctness: correctness,
4306
- __self: this,
4307
- __source: {
4308
- fileName: _jsxFileName$3,
4309
- lineNumber: 199
4310
- }
4311
- }), React$4.createElement('div', {
4312
- className: classNames$3(classes.checkboxHolder, 'checkbox-holder'),
4313
- __self: this,
4314
- __source: {
4315
- fileName: _jsxFileName$3,
4316
- lineNumber: 200
4317
- }
4318
- }, React$4.createElement(StyledFormControlLabel, {
4319
- disabled: disabled,
4320
- label: displayKey ? displayKey + '. ' : '',
4321
- control: React$4.createElement(Tag, {
4322
- accessibility: accessibility,
4323
- checked: checked,
4324
- correctness: correctness,
4325
- onChange: this.onToggleChoice,
4326
- __self: this,
4327
- __source: {
4328
- fileName: _jsxFileName$3,
4329
- lineNumber: 205
4330
- }
4331
- }),
4332
- __self: this,
4333
- __source: {
4334
- fileName: _jsxFileName$3,
4335
- lineNumber: 201
4336
- }
4337
- }), React$4.createElement(PreviewPrompt$1, {
4338
- className: "label",
4339
- onClick: this.onToggleChoice,
4340
- prompt: label,
4341
- tagName: "span",
4342
- __self: this,
4343
- __source: {
4344
- fileName: _jsxFileName$3,
4345
- lineNumber: 213
4346
- }
4347
- }))), rationale && React$4.createElement(PreviewPrompt$1, {
4348
- className: "rationale",
4349
- defaultClassName: "rationale",
4350
- prompt: rationale,
4351
- __self: this,
4352
- __source: {
4353
- fileName: _jsxFileName$3,
4354
- lineNumber: 222
4355
- }
4356
- }), React$4.createElement(Feedback$1, {
4357
- feedback: feedback,
4358
- correctness: correctness,
4359
- __self: this,
4360
- __source: {
4361
- fileName: _jsxFileName$3,
4362
- lineNumber: 224
4363
- }
4364
- }));
4365
- }
4366
- }
4367
- ChoiceInput.__initStatic();
4368
- ChoiceInput.__initStatic2();
4369
- var ChoiceInput$1 = withStyles$3(styleSheet)(ChoiceInput);
4370
- const React$3 = _dll_react;
4371
- const PropTypes$2 = _dll_prop_types;
4372
- const {withStyles: withStyles$2} = _dll_material_ui__core_styles;
4373
- const classNames$2 = _dll_classnames;
4374
- const _jsxFileName$2 = "/home/circleci/repo/packages/multiple-choice/src/choice.jsx";
4375
- class Choice extends React$3.Component {
4376
- constructor(...args) {
4377
- super(...args);
4378
- Choice.prototype.__init.call(this);
4379
- }
4380
- __init() {
4381
- this.onChange = choice => {
4382
- const {disabled, onChoiceChanged} = this.props;
4383
- if (!disabled) {
4384
- onChoiceChanged(choice);
4385
- }
4386
- };
4387
- }
4388
- render() {
4389
- const {choice, index, choicesLength, showCorrect, isEvaluateMode, choiceMode, disabled, checked, correctness, displayKey, classes, choicesLayout, gridColumns} = this.props;
4390
- const choiceClass = 'choice' + (index === choicesLength - 1 ? ' last' : '');
4391
- const feedback = !isEvaluateMode || showCorrect ? '' : choice.feedback;
4392
- const choiceProps = {
4393
- ...choice,
4394
- checked,
4395
- choiceMode,
4396
- disabled,
4397
- feedback,
4398
- correctness,
4399
- displayKey,
4400
- choicesLayout,
4401
- gridColumns,
4402
- onChange: this.onChange,
4403
- isEvaluateMode
4404
- };
4405
- const names = classNames$2(classes.choice, {
4406
- [classes.noBorder]: index === choicesLength - 1 || choicesLayout !== 'vertical'
4407
- });
4408
- return React$3.createElement('div', {
4409
- className: choiceClass,
4410
- key: index,
4411
- __self: this,
4412
- __source: {
4413
- fileName: _jsxFileName$2,
4414
- lineNumber: 56
4415
- }
4416
- }, React$3.createElement(ChoiceInput$1, {
4417
- ...choiceProps,
4418
- className: names,
4419
- __self: this,
4420
- __source: {
4421
- fileName: _jsxFileName$2,
4422
- lineNumber: 57
4423
- }
4424
- }));
4425
- }
4426
- }
4427
- Choice.propTypes = {
4428
- choiceMode: PropTypes$2.oneOf(['radio', 'checkbox']),
4429
- choice: PropTypes$2.object,
4430
- disabled: PropTypes$2.bool.isRequired,
4431
- onChoiceChanged: PropTypes$2.func,
4432
- classes: PropTypes$2.object.isRequired,
4433
- index: PropTypes$2.number,
4434
- choicesLength: PropTypes$2.number,
4435
- showCorrect: PropTypes$2.bool,
4436
- isEvaluateMode: PropTypes$2.bool,
4437
- checked: PropTypes$2.bool,
4438
- correctness: PropTypes$2.string,
4439
- displayKey: PropTypes$2.string,
4440
- choicesLayout: PropTypes$2.oneOf(['vertical', 'grid', 'horizontal']),
4441
- gridColumns: PropTypes$2.string
4442
- };
4443
- var StyledChoice = withStyles$2({
4444
- choice: {
4445
- paddingTop: '20px',
4446
- paddingBottom: '10px',
4447
- borderBottom: '1px solid #E0DEE0'
4448
- },
4449
- noBorder: {
4450
- borderBottom: 'none'
4451
- }
4452
- })(Choice);
4453
- const React$2 = _dll_react;
4454
- const PropTypes$1 = _dll_prop_types;
4455
- const classNames$1 = _dll_classnames;
4456
- const {withStyles: withStyles$1} = _dll_material_ui__core_styles;
4457
- const _jsxFileName$1 = "/home/circleci/repo/packages/multiple-choice/src/multiple-choice.jsx";
4458
- const styles = {
4459
- corespringChoice: {
4460
- backgroundColor: background(),
4461
- padding: '5px',
4462
- '& *': {
4463
- '-webkit-font-smoothing': 'antialiased'
4464
- }
4465
- },
4466
- horizontalLayout: {
4467
- display: 'flex',
4468
- flexDirection: 'row',
4469
- flexWrap: 'wrap'
4470
- },
4471
- gridLayout: {
4472
- display: 'grid'
4473
- },
4474
- getColumns: function (columns) {
4475
- return columns > 1 ? {
4476
- gridTemplateColumns: `repeat(${columns}, 1fr)`
4477
- } : undefined;
4478
- }
4479
- };
4480
- class MultipleChoice extends React$2.Component {
4481
- static __initStatic() {
4482
- this.propTypes = {
4483
- mode: PropTypes$1.oneOf(['gather', 'view', 'evaluate']),
4484
- choiceMode: PropTypes$1.oneOf(['radio', 'checkbox']),
4485
- keyMode: PropTypes$1.oneOf(['numbers', 'letters', 'none']),
4486
- choices: PropTypes$1.array,
4487
- prompt: PropTypes$1.string,
4488
- teacherInstructions: PropTypes$1.string,
4489
- session: PropTypes$1.object,
4490
- disabled: PropTypes$1.bool,
4491
- onChoiceChanged: PropTypes$1.func,
4492
- responseCorrect: PropTypes$1.bool,
4493
- classes: PropTypes$1.object.isRequired,
4494
- correctResponse: PropTypes$1.array,
4495
- choicesLayout: PropTypes$1.oneOf(['vertical', 'grid', 'horizontal']),
4496
- gridColumns: PropTypes$1.string,
4497
- alwaysShowCorrect: PropTypes$1.bool,
4498
- animationsDisabled: PropTypes$1.bool
4499
- };
4500
- }
4501
- constructor(props) {
4502
- super(props);
4503
- MultipleChoice.prototype.__init.call(this);
4504
- this.state = {
4505
- showCorrect: this.props.alwaysShowCorrect || false
4506
- };
4507
- this.onToggle = this.onToggle.bind(this);
4508
- }
4509
- onToggle() {
4510
- if (this.props.mode === 'evaluate') {
4511
- this.setState({
4512
- showCorrect: !this.state.showCorrect
4513
- });
4514
- }
4515
- }
4516
- UNSAFE_componentWillReceiveProps(nextProps) {
4517
- if (!nextProps.correctResponse) {
4518
- this.setState({
4519
- showCorrect: false
4520
- });
4521
- }
4522
- if (nextProps.alwaysShowCorrect) {
4523
- this.setState({
4524
- showCorrect: true
4525
- });
4526
- }
4527
- }
4528
- isSelected(value) {
4529
- const sessionValue = this.props.session && this.props.session.value;
4530
- return sessionValue && sessionValue.indexOf && sessionValue.indexOf(value) >= 0;
4531
- }
4532
- indexToSymbol(index) {
4533
- if (this.props.keyMode === 'numbers') {
4534
- return `${index + 1}`;
4535
- }
4536
- if (this.props.keyMode === 'letters') {
4537
- return String.fromCharCode(97 + index).toUpperCase();
4538
- }
4539
- return '';
4540
- }
4541
- __init() {
4542
- this.getCorrectness = (choice = {}) => {
4543
- const isCorrect = choice.correct;
4544
- const isChecked = this.isSelected(choice.value);
4545
- if (this.state.showCorrect) {
4546
- return isCorrect ? 'correct' : undefined;
4547
- }
4548
- if (isCorrect) {
4549
- if (isChecked) {
4550
- return 'correct';
4551
- } else {
4552
- return 'incorrect';
4553
- }
4554
- } else {
4555
- if (isChecked) {
4556
- return 'incorrect';
4557
- } else {
4558
- return undefined;
4559
- }
4560
- }
4561
- };
4562
- }
4563
- render() {
4564
- const {mode, disabled, choices = [], choiceMode, prompt, onChoiceChanged, responseCorrect, teacherInstructions, classes, alwaysShowCorrect, animationsDisabled} = this.props;
4565
- const {showCorrect} = this.state;
4566
- const isEvaluateMode = mode === 'evaluate';
4567
- const showCorrectAnswerToggle = isEvaluateMode && !responseCorrect;
4568
- return React$2.createElement('div', {
4569
- className: classNames$1(classes.corespringChoice, 'multiple-choice'),
4570
- __self: this,
4571
- __source: {
4572
- fileName: _jsxFileName$1,
4573
- lineNumber: 146
4574
- }
4575
- }, teacherInstructions && React$2.createElement(React$2.Fragment, {
4576
- __self: this,
4577
- __source: {
4578
- fileName: _jsxFileName$1,
4579
- lineNumber: 148
4580
- }
4581
- }, !animationsDisabled ? React$2.createElement(Collapsible$1, {
4582
- labels: {
4583
- hidden: 'Show Teacher Instructions',
4584
- visible: 'Hide Teacher Instructions'
4585
- },
4586
- __self: this,
4587
- __source: {
4588
- fileName: _jsxFileName$1,
4589
- lineNumber: 150
4590
- }
4591
- }, React$2.createElement(PreviewPrompt$1, {
4592
- tagName: "div",
4593
- className: "prompt",
4594
- prompt: teacherInstructions,
4595
- __self: this,
4596
- __source: {
4597
- fileName: _jsxFileName$1,
4598
- lineNumber: 156
4599
- }
4600
- })) : React$2.createElement(PreviewPrompt$1, {
4601
- tagName: "div",
4602
- className: "prompt",
4603
- defaultClassName: "teacher-instructions",
4604
- prompt: teacherInstructions,
4605
- __self: this,
4606
- __source: {
4607
- fileName: _jsxFileName$1,
4608
- lineNumber: 162
4609
- }
4610
- }), React$2.createElement('br', {
4611
- __self: this,
4612
- __source: {
4613
- fileName: _jsxFileName$1,
4614
- lineNumber: 168
4615
- }
4616
- })), !alwaysShowCorrect && React$2.createElement(CorrectAnswerToggle$1, {
4617
- show: showCorrectAnswerToggle,
4618
- toggled: showCorrect,
4619
- onToggle: this.onToggle.bind(this),
4620
- __self: this,
4621
- __source: {
4622
- fileName: _jsxFileName$1,
4623
- lineNumber: 172
4624
- }
4625
- }), showCorrectAnswerToggle && React$2.createElement('br', {
4626
- __self: this,
4627
- __source: {
4628
- fileName: _jsxFileName$1,
4629
- lineNumber: 178
4630
- }
4631
- }), React$2.createElement(PreviewPrompt$1, {
4632
- className: "prompt",
4633
- defaultClassName: "prompt",
4634
- prompt: prompt,
4635
- __self: this,
4636
- __source: {
4637
- fileName: _jsxFileName$1,
4638
- lineNumber: 179
4639
- }
4640
- }), React$2.createElement('div', {
4641
- className: classNames$1({
4642
- [classes.gridLayout]: this.props.choicesLayout === 'grid'
4643
- }, {
4644
- [classes.horizontalLayout]: this.props.choicesLayout === 'horizontal'
4645
- }),
4646
- style: styles.getColumns(this.props.gridColumns),
4647
- __self: this,
4648
- __source: {
4649
- fileName: _jsxFileName$1,
4650
- lineNumber: 180
4651
- }
4652
- }, choices.map((choice, index) => React$2.createElement(StyledChoice, {
4653
- choicesLayout: this.props.choicesLayout,
4654
- gridColumns: this.props.gridColumns,
4655
- key: `choice-${index}`,
4656
- choice: choice,
4657
- index: index,
4658
- choicesLength: choices.length,
4659
- showCorrect: showCorrect,
4660
- isEvaluateMode: isEvaluateMode,
4661
- choiceMode: choiceMode,
4662
- disabled: disabled,
4663
- onChoiceChanged: onChoiceChanged,
4664
- hideTick: choice.hideTick,
4665
- checked: showCorrect ? choice.correct || false : this.isSelected(choice.value),
4666
- correctness: isEvaluateMode ? this.getCorrectness(choice) : undefined,
4667
- displayKey: this.indexToSymbol(index),
4668
- __self: this,
4669
- __source: {
4670
- fileName: _jsxFileName$1,
4671
- lineNumber: 191
4672
- }
4673
- }))));
4674
- }
4675
- }
4676
- MultipleChoice.__initStatic();
4677
- MultipleChoice.defaultProps = {
4678
- session: {
4679
- value: []
4680
- }
4681
- };
4682
- var MultipleChoice$1 = withStyles$1(styles)(MultipleChoice);
4683
- const React$1 = _dll_react;
4684
- const PropTypes = _dll_prop_types;
4685
- const {withStyles: withStyles} = _dll_material_ui__core_styles;
4686
- const {createMuiTheme: createMuiTheme} = _dll_material_ui__core_styles;
4687
- const {MuiThemeProvider: MuiThemeProvider} = _dll_material_ui__core_styles;
4688
- const classNames = _dll_classnames;
4689
- const _jsxFileName = "/home/circleci/repo/packages/multiple-choice/src/main.jsx";
4690
- class Main extends React$1.Component {
4691
- static __initStatic() {
4692
- this.propTypes = {
4693
- model: PropTypes.object,
4694
- session: PropTypes.object,
4695
- onChoiceChanged: PropTypes.func,
4696
- classes: PropTypes.object.isRequired
4697
- };
4698
- }
4699
- static __initStatic2() {
4700
- this.defaultProps = {
4701
- model: {},
4702
- session: {}
4703
- };
4704
- }
4705
- constructor(props) {
4706
- super(props);
4707
- }
4708
- render() {
4709
- const {model, onChoiceChanged, session, classes} = this.props;
4710
- return React$1.createElement(RootElem, {
4711
- __self: this,
4712
- __source: {
4713
- fileName: _jsxFileName,
4714
- lineNumber: 30
4715
- }
4716
- }, model.partLabel && React$1.createElement('p', {
4717
- __self: this,
4718
- __source: {
4719
- fileName: _jsxFileName,
4720
- lineNumber: 31
4721
- }
4722
- }, model.partLabel), React$1.createElement('div', {
4723
- className: classNames(classes.root, classes[model.className]),
4724
- __self: this,
4725
- __source: {
4726
- fileName: _jsxFileName,
4727
- lineNumber: 32
4728
- }
4729
- }, React$1.createElement(MultipleChoice$1, {
4730
- ...model,
4731
- session: session,
4732
- onChoiceChanged: onChoiceChanged,
4733
- __self: this,
4734
- __source: {
4735
- fileName: _jsxFileName,
4736
- lineNumber: 33
4737
- }
4738
- })));
4739
- }
4740
- }
4741
- Main.__initStatic();
4742
- Main.__initStatic2();
4743
- const Styled = withStyles({}, {
4744
- name: 'Main'
4745
- })(Main);
4746
- const theme = createMuiTheme({
4747
- typography: {
4748
- useNextVariants: true
4749
- }
4750
- });
4751
- const Root = props => React$1.createElement(MuiThemeProvider, {
4752
- theme: theme,
4753
- __self: undefined,
4754
- __source: {
4755
- fileName: _jsxFileName,
4756
- lineNumber: 53
4757
- }
4758
- }, React$1.createElement(Styled, {
4759
- ...props,
4760
- __self: undefined,
4761
- __source: {
4762
- fileName: _jsxFileName,
4763
- lineNumber: 54
4764
- }
4765
- }));
4766
- const React = _dll_react;
4767
- const ReactDOM = _dll_react_dom;
4768
- const {debounce: debounce} = _dll_lodash;
4769
- const {cloneDeep: cloneDeep} = _dll_lodash;
4770
- const debug = _dll_debug;
4771
- const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
4772
- const log = debug('pie-element:multiple-choice:print');
4773
- const preparePrintModel = (model, opts) => {
4774
- const instr = opts.role === 'instructor';
4775
- model.prompt = model.promptEnabled !== false ? model.prompt : undefined;
4776
- model.teacherInstructions = instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;
4777
- model.showTeacherInstructions = instr;
4778
- model.alwaysShowCorrect = instr;
4779
- model.mode = instr ? 'evaluate' : model.mode;
4780
- model.disabled = true;
4781
- model.animationsDisabled = true;
4782
- const choices = cloneDeep(model.choices);
4783
- model.choices = choices.map(c => {
4784
- c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;
4785
- c.hideTick = instr;
4786
- c.feedback = undefined;
4787
- return c;
4788
- });
4789
- model.keyMode = model.choicePrefix || 'letters';
4790
- return model;
4791
- };
4792
- class MultipleChoicePrint extends HTMLElement {
4793
- constructor() {
4794
- super();
4795
- this._options = null;
4796
- this._model = null;
4797
- this._session = [];
4798
- this._rerender = debounce(() => {
4799
- if (this._model && this._session) {
4800
- const printModel = preparePrintModel(this._model, this._options);
4801
- const element = this._options && React.createElement(Root, {
4802
- model: printModel,
4803
- session: {}
4804
- });
4805
- ReactDOM.render(element, this, () => {
4806
- log('render complete - render math');
4807
- renderMath(this);
4808
- });
4809
- } else {
4810
- log('skip');
4811
- }
4812
- }, 50, {
4813
- leading: false,
4814
- trailing: true
4815
- });
4816
- }
4817
- set options(o) {
4818
- this._options = o;
4819
- }
4820
- set model(s) {
4821
- this._model = s;
4822
- this._rerender();
4823
- }
4824
- connectedCallback() {}
4825
- }
4826
- export {MultipleChoicePrint as default};