@pie-element/passage 1.6.4-ps.1 → 1.6.4-ps.5

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 CHANGED
@@ -1,3679 +1,25 @@
1
- import {_dll_prop_types, _dll_react, _dll_material_ui__core_styles, _dll_classnames, _dll_react_dom, _dll_material_ui__core, _dll_debug, _dll_lodash} from "../../../@pie-lib/shared-module@^1.1.0/module/index.js";
2
- import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.3/module/index.js";
3
- const React$k = _dll_react;
4
- const PropTypes$l = _dll_prop_types;
5
- const _jsxFileName$i = "/home/ede/dev/github/pie-framework/pie-elements/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$k.createElement('div', {
18
- style: style,
19
- __self: undefined,
20
- __source: {
21
- fileName: _jsxFileName$i,
22
- lineNumber: 18
23
- }
24
- }, children);
25
- };
26
- Sized.propTypes = {
27
- size: PropTypes$l.number,
28
- children: PropTypes$l.oneOfType([PropTypes$l.arrayOf(PropTypes$l.node), PropTypes$l.node]).isRequired
29
- };
30
- const React$j = _dll_react;
31
- const PropTypes$k = _dll_prop_types;
32
- const _jsxFileName$h = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/icon-root.jsx";
33
- const IconRoot = ({size, children}) => React$j.createElement(Sized, {
34
- size: size,
35
- __self: undefined,
36
- __source: {
37
- fileName: _jsxFileName$h,
38
- lineNumber: 10
39
- }
40
- }, React$j.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$h,
52
- lineNumber: 11
53
- }
54
- }, ' ', children));
55
- IconRoot.propTypes = {
56
- size: PropTypes$k.oneOf([PropTypes$k.string, PropTypes$k.number]),
57
- children: PropTypes$k.oneOfType([PropTypes$k.arrayOf(PropTypes$k.node), PropTypes$k.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$k.string
69
- });
70
- const SquareFeedbackBox = ({className}) => React$j.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$h,
77
- lineNumber: 51
78
- }
79
- });
80
- SquareFeedbackBox.propTypes = {
81
- className: PropTypes$k.string
82
- };
83
- const RoundFeedbackBox = ({className}) => React$j.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$h,
90
- lineNumber: 62
91
- }
92
- });
93
- RoundFeedbackBox.propTypes = {
94
- className: PropTypes$k.string
95
- };
96
- const Circle$1 = ({className}) => React$j.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$h,
105
- lineNumber: 73
106
- }
107
- });
108
- Circle$1.propTypes = {
109
- className: PropTypes$k.string
110
- };
111
- const Square = ({className}) => React$j.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$h,
120
- lineNumber: 81
121
- }
122
- });
123
- Square.propTypes = {
124
- className: PropTypes$k.string
125
- };
126
- const PropTypes$j = _dll_prop_types;
127
- const React$i = _dll_react;
128
- const _jsxFileName$g = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/icon-base.jsx";
129
- var IconBase = (Action, Emoji) => {
130
- class IconBase extends React$i.Component {
131
- static __initStatic() {
132
- this.propTypes = {
133
- classes: PropTypes$j.object.isRequired,
134
- size: PropTypes$j.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$i.createElement(IconRoot, {
144
- size: size,
145
- __self: this,
146
- __source: {
147
- fileName: _jsxFileName$g,
148
- lineNumber: 20
149
- }
150
- }, React$i.createElement(RoundFeedbackBox, {
151
- className: classes.bg,
152
- __self: this,
153
- __source: {
154
- fileName: _jsxFileName$g,
155
- lineNumber: 21
156
- }
157
- }), React$i.createElement(Action, {
158
- className: classes.fg,
159
- __self: this,
160
- __source: {
161
- fileName: _jsxFileName$g,
162
- lineNumber: 22
163
- }
164
- })),
165
- emoji: React$i.createElement(IconRoot, {
166
- size: size,
167
- __self: this,
168
- __source: {
169
- fileName: _jsxFileName$g,
170
- lineNumber: 26
171
- }
172
- }, React$i.createElement(RoundFeedbackBox, {
173
- className: classes.bg,
174
- __self: this,
175
- __source: {
176
- fileName: _jsxFileName$g,
177
- lineNumber: 27
178
- }
179
- }), React$i.createElement(Emoji, {
180
- className: classes.fg,
181
- __self: this,
182
- __source: {
183
- fileName: _jsxFileName$g,
184
- lineNumber: 28
185
- }
186
- })),
187
- open: {
188
- check: React$i.createElement(IconRoot, {
189
- size: size,
190
- __self: this,
191
- __source: {
192
- fileName: _jsxFileName$g,
193
- lineNumber: 33
194
- }
195
- }, React$i.createElement(Action, {
196
- className: classes.bg,
197
- __self: this,
198
- __source: {
199
- fileName: _jsxFileName$g,
200
- lineNumber: 34
201
- }
202
- })),
203
- emoji: React$i.createElement(IconRoot, {
204
- size: size,
205
- __self: this,
206
- __source: {
207
- fileName: _jsxFileName$g,
208
- lineNumber: 38
209
- }
210
- }, React$i.createElement(Emoji, {
211
- className: classes.bg,
212
- __self: this,
213
- __source: {
214
- fileName: _jsxFileName$g,
215
- lineNumber: 39
216
- }
217
- }))
218
- }
219
- },
220
- square: {
221
- check: React$i.createElement(IconRoot, {
222
- size: size,
223
- __self: this,
224
- __source: {
225
- fileName: _jsxFileName$g,
226
- lineNumber: 46
227
- }
228
- }, React$i.createElement(SquareFeedbackBox, {
229
- className: classes.bg,
230
- __self: this,
231
- __source: {
232
- fileName: _jsxFileName$g,
233
- lineNumber: 47
234
- }
235
- }), React$i.createElement(Action, {
236
- className: classes.fg,
237
- __self: this,
238
- __source: {
239
- fileName: _jsxFileName$g,
240
- lineNumber: 48
241
- }
242
- })),
243
- emoji: React$i.createElement(IconRoot, {
244
- size: size,
245
- __self: this,
246
- __source: {
247
- fileName: _jsxFileName$g,
248
- lineNumber: 52
249
- }
250
- }, React$i.createElement(SquareFeedbackBox, {
251
- className: classes.bg,
252
- __self: this,
253
- __source: {
254
- fileName: _jsxFileName$g,
255
- lineNumber: 53
256
- }
257
- }), React$i.createElement(Emoji, {
258
- className: classes.fg,
259
- __self: this,
260
- __source: {
261
- fileName: _jsxFileName$g,
262
- lineNumber: 54
263
- }
264
- })),
265
- open: {
266
- check: React$i.createElement(IconRoot, {
267
- size: size,
268
- __self: this,
269
- __source: {
270
- fileName: _jsxFileName$g,
271
- lineNumber: 59
272
- }
273
- }, React$i.createElement(Action, {
274
- className: classes.bg,
275
- __self: this,
276
- __source: {
277
- fileName: _jsxFileName$g,
278
- lineNumber: 60
279
- }
280
- })),
281
- emoji: React$i.createElement(IconRoot, {
282
- size: size,
283
- __self: this,
284
- __source: {
285
- fileName: _jsxFileName$g,
286
- lineNumber: 64
287
- }
288
- }, React$i.createElement(Emoji, {
289
- className: classes.bg,
290
- __self: this,
291
- __source: {
292
- fileName: _jsxFileName$g,
293
- lineNumber: 65
294
- }
295
- }))
296
- }
297
- }
298
- },
299
- round: {
300
- check: React$i.createElement(IconRoot, {
301
- size: size,
302
- __self: this,
303
- __source: {
304
- fileName: _jsxFileName$g,
305
- lineNumber: 73
306
- }
307
- }, React$i.createElement(Circle$1, {
308
- className: classes.bg,
309
- __self: this,
310
- __source: {
311
- fileName: _jsxFileName$g,
312
- lineNumber: 74
313
- }
314
- }), React$i.createElement(Action, {
315
- className: classes.fg,
316
- __self: this,
317
- __source: {
318
- fileName: _jsxFileName$g,
319
- lineNumber: 75
320
- }
321
- })),
322
- emoji: React$i.createElement(IconRoot, {
323
- size: size,
324
- __self: this,
325
- __source: {
326
- fileName: _jsxFileName$g,
327
- lineNumber: 79
328
- }
329
- }, React$i.createElement(Circle$1, {
330
- className: classes.bg,
331
- __self: this,
332
- __source: {
333
- fileName: _jsxFileName$g,
334
- lineNumber: 80
335
- }
336
- }), React$i.createElement(Emoji, {
337
- className: classes.fg,
338
- __self: this,
339
- __source: {
340
- fileName: _jsxFileName$g,
341
- lineNumber: 81
342
- }
343
- })),
344
- open: {
345
- check: React$i.createElement(IconRoot, {
346
- size: size,
347
- __self: this,
348
- __source: {
349
- fileName: _jsxFileName$g,
350
- lineNumber: 86
351
- }
352
- }, React$i.createElement(Action, {
353
- className: classes.bg,
354
- __self: this,
355
- __source: {
356
- fileName: _jsxFileName$g,
357
- lineNumber: 87
358
- }
359
- })),
360
- emoji: React$i.createElement(IconRoot, {
361
- size: size,
362
- __self: this,
363
- __source: {
364
- fileName: _jsxFileName$g,
365
- lineNumber: 91
366
- }
367
- }, React$i.createElement(Emoji, {
368
- className: classes.bg,
369
- __self: this,
370
- __source: {
371
- fileName: _jsxFileName$g,
372
- lineNumber: 92
373
- }
374
- }))
375
- }
376
- },
377
- square: {
378
- check: React$i.createElement(IconRoot, {
379
- size: size,
380
- __self: this,
381
- __source: {
382
- fileName: _jsxFileName$g,
383
- lineNumber: 99
384
- }
385
- }, React$i.createElement(Square, {
386
- className: classes.bg,
387
- __self: this,
388
- __source: {
389
- fileName: _jsxFileName$g,
390
- lineNumber: 100
391
- }
392
- }), React$i.createElement(Action, {
393
- className: classes.fg,
394
- __self: this,
395
- __source: {
396
- fileName: _jsxFileName$g,
397
- lineNumber: 101
398
- }
399
- })),
400
- emoji: React$i.createElement(IconRoot, {
401
- size: size,
402
- __self: this,
403
- __source: {
404
- fileName: _jsxFileName$g,
405
- lineNumber: 105
406
- }
407
- }, React$i.createElement(Square, {
408
- className: classes.bg,
409
- __self: this,
410
- __source: {
411
- fileName: _jsxFileName$g,
412
- lineNumber: 106
413
- }
414
- }), React$i.createElement(Emoji, {
415
- className: classes.fg,
416
- __self: this,
417
- __source: {
418
- fileName: _jsxFileName$g,
419
- lineNumber: 107
420
- }
421
- })),
422
- open: {
423
- check: React$i.createElement(IconRoot, {
424
- size: size,
425
- __self: this,
426
- __source: {
427
- fileName: _jsxFileName$g,
428
- lineNumber: 112
429
- }
430
- }, React$i.createElement(Action, {
431
- className: classes.bg,
432
- __self: this,
433
- __source: {
434
- fileName: _jsxFileName$g,
435
- lineNumber: 113
436
- }
437
- })),
438
- emoji: React$i.createElement(IconRoot, {
439
- size: size,
440
- __self: this,
441
- __source: {
442
- fileName: _jsxFileName$g,
443
- lineNumber: 117
444
- }
445
- }, React$i.createElement(Emoji, {
446
- className: classes.bg,
447
- __self: this,
448
- __source: {
449
- fileName: _jsxFileName$g,
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$j.oneOf(['emoji', 'check']),
476
- shape: PropTypes$j.oneOf(['round', 'square']),
477
- category: PropTypes$j.oneOf(['feedback', undefined]),
478
- open: PropTypes$j.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$i = _dll_prop_types;
489
- const React$h = _dll_react;
490
- const {withStyles: withStyles$d} = _dll_material_ui__core_styles;
491
- const _jsxFileName$f = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/correct-icon.jsx";
492
- const styles$a = getStyles('correct', '#f8ffe2', '#4aaf46');
493
- const Emoji$3 = ({className}) => React$h.createElement('g', {
494
- transform: 'translate(1, 0)',
495
- __self: undefined,
496
- __source: {
497
- fileName: _jsxFileName$f,
498
- lineNumber: 10
499
- }
500
- }, React$h.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$f,
506
- lineNumber: 11
507
- }
508
- }), React$h.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$f,
517
- lineNumber: 16
518
- }
519
- }), React$h.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$f,
528
- lineNumber: 17
529
- }
530
- }));
531
- Emoji$3.propTypes = {
532
- className: PropTypes$i.string
533
- };
534
- Emoji$3.defaultProps = {
535
- x: 0
536
- };
537
- const Check$1 = ({className, x, y}) => React$h.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$f,
544
- lineNumber: 30
545
- }
546
- });
547
- Check$1.propTypes = {
548
- x: PropTypes$i.number,
549
- y: PropTypes$i.number,
550
- className: PropTypes$i.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$i.oneOf(['emoji', 'check']),
559
- shape: PropTypes$i.oneOf(['round', 'square']),
560
- category: PropTypes$i.oneOf(['feedback', undefined]),
561
- open: PropTypes$i.bool
562
- };
563
- Correct.defaultProps = {
564
- iconSet: 'check',
565
- shape: 'round',
566
- category: undefined,
567
- open: false
568
- };
569
- var correctIcon = withStyles$d(styles$a)(Correct);
570
- const PropTypes$h = _dll_prop_types;
571
- const React$g = _dll_react;
572
- const classNames$3 = _dll_classnames;
573
- const {withStyles: withStyles$c} = _dll_material_ui__core_styles;
574
- const _jsxFileName$e = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/correct-response-icon.jsx";
575
- const OpenIcon = ({bg, fg}) => React$g.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$e,
588
- lineNumber: 7
589
- }
590
- }, React$g.createElement('circle', {
591
- className: bg,
592
- cx: "-266",
593
- cy: "375.9",
594
- r: "14",
595
- __self: undefined,
596
- __source: {
597
- fileName: _jsxFileName$e,
598
- lineNumber: 16
599
- }
600
- }), React$g.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$e,
606
- lineNumber: 17
607
- }
608
- }), React$g.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$e,
614
- lineNumber: 22
615
- }
616
- }));
617
- OpenIcon.propTypes = {
618
- bg: PropTypes$h.string,
619
- fg: PropTypes$h.string
620
- };
621
- const CloseIcon = ({bg, fg, border}) => React$g.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$e,
633
- lineNumber: 35
634
- }
635
- }, React$g.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$e,
646
- lineNumber: 43
647
- }
648
- }), React$g.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$e,
659
- lineNumber: 53
660
- }
661
- }), React$g.createElement('circle', {
662
- className: bg,
663
- cx: "-114.2",
664
- cy: "143.5",
665
- r: "14",
666
- __self: undefined,
667
- __source: {
668
- fileName: _jsxFileName$e,
669
- lineNumber: 62
670
- }
671
- }), React$g.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$e,
677
- lineNumber: 63
678
- }
679
- }), React$g.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$e,
685
- lineNumber: 68
686
- }
687
- }));
688
- CloseIcon.propTypes = {
689
- bg: PropTypes$h.string,
690
- fg: PropTypes$h.string,
691
- border: PropTypes$h.string
692
- };
693
- const styles$9 = {
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$g.createElement('div', {
715
- className: classNames$3(className, classes.root),
716
- __self: undefined,
717
- __source: {
718
- fileName: _jsxFileName$e,
719
- lineNumber: 104
720
- }
721
- }, open ? React$g.createElement(OpenIcon, {
722
- bg: classes.hideIconBg,
723
- fg: classes.hideIconFg,
724
- __self: undefined,
725
- __source: {
726
- fileName: _jsxFileName$e,
727
- lineNumber: 106
728
- }
729
- }) : React$g.createElement(CloseIcon, {
730
- bg: classes.showIconBg,
731
- border: classes.showIconBorder,
732
- fg: classes.showIconFg,
733
- __self: undefined,
734
- __source: {
735
- fileName: _jsxFileName$e,
736
- lineNumber: 108
737
- }
738
- }));
739
- CorrectResponse.propTypes = {
740
- classes: PropTypes$h.object.isRequired,
741
- open: PropTypes$h.bool,
742
- size: PropTypes$h.string,
743
- className: PropTypes$h.string
744
- };
745
- CorrectResponse.defaultProps = {
746
- open: false
747
- };
748
- withStyles$c(styles$9)(CorrectResponse);
749
- const PropTypes$g = _dll_prop_types;
750
- const React$f = _dll_react;
751
- const {withStyles: withStyles$b} = _dll_material_ui__core_styles;
752
- const _jsxFileName$d = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/incorrect-icon.jsx";
753
- const Ex = ({className}) => React$f.createElement('g', {
754
- transform: 'translate(0.5, 0.5)',
755
- __self: undefined,
756
- __source: {
757
- fileName: _jsxFileName$d,
758
- lineNumber: 8
759
- }
760
- }, React$f.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$d,
770
- lineNumber: 9
771
- }
772
- }), React$f.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$d,
782
- lineNumber: 17
783
- }
784
- }));
785
- Ex.propTypes = {
786
- className: PropTypes$g.string
787
- };
788
- const Emoji$2 = ({className}) => React$f.createElement('g', {
789
- transform: 'translate(1,0)',
790
- __self: undefined,
791
- __source: {
792
- fileName: _jsxFileName$d,
793
- lineNumber: 32
794
- }
795
- }, React$f.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$d,
804
- lineNumber: 33
805
- }
806
- }), React$f.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$d,
815
- lineNumber: 34
816
- }
817
- }), React$f.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$d,
826
- lineNumber: 35
827
- }
828
- }));
829
- Emoji$2.propTypes = {
830
- className: PropTypes$g.string
831
- };
832
- const styles$8 = getStyles('incorrect', '#fbf2e3', '#fcb733');
833
- const Incorrect = IconBase(Ex, Emoji$2);
834
- var incorrectIcon = withStyles$b(styles$8)(Incorrect);
835
- Incorrect.propTypes = {
836
- iconSet: PropTypes$g.oneOf(['emoji', 'check']),
837
- shape: PropTypes$g.oneOf(['round', 'square']),
838
- category: PropTypes$g.oneOf(['feedback', undefined]),
839
- open: PropTypes$g.bool
840
- };
841
- Incorrect.defaultProps = {
842
- iconSet: 'check',
843
- shape: 'round',
844
- category: undefined,
845
- open: false
846
- };
847
- const PropTypes$f = _dll_prop_types;
848
- const React$e = _dll_react;
849
- const _jsxFileName$c = "/home/ede/dev/github/pie-framework/pie-elements/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$e.createElement('g', {
858
- __self: undefined,
859
- __source: {
860
- fileName: _jsxFileName$c,
861
- lineNumber: 13
862
- }
863
- }, React$e.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$c,
872
- lineNumber: 14
873
- }
874
- }), React$e.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$c,
883
- lineNumber: 15
884
- }
885
- }), React$e.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$c,
894
- lineNumber: 16
895
- }
896
- }));
897
- };
898
- const Root$1 = ({children, size}) => React$e.createElement(Sized, {
899
- size: size,
900
- __self: undefined,
901
- __source: {
902
- fileName: _jsxFileName$c,
903
- lineNumber: 22
904
- }
905
- }, React$e.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$c,
914
- lineNumber: 23
915
- }
916
- }, children));
917
- Root$1.propTypes = {
918
- children: PropTypes$f.oneOfType([PropTypes$f.arrayOf(PropTypes$f.node), PropTypes$f.node]).isRequired,
919
- size: PropTypes$f.number
920
- };
921
- const GreyInfo = () => {
922
- return React$e.createElement('g', {
923
- __self: undefined,
924
- __source: {
925
- fileName: _jsxFileName$c,
926
- lineNumber: 36
927
- }
928
- }, React$e.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$c,
943
- lineNumber: 37
944
- }
945
- }), React$e.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$c,
957
- lineNumber: 50
958
- }
959
- }), React$e.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$c,
975
- lineNumber: 61
976
- }
977
- }), React$e.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$c,
990
- lineNumber: 76
991
- }
992
- }), React$e.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$c,
1003
- lineNumber: 88
1004
- }
1005
- }), React$e.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$c,
1013
- lineNumber: 89
1014
- }
1015
- }));
1016
- };
1017
- const BlueInfo = () => React$e.createElement('g', {
1018
- __self: undefined,
1019
- __source: {
1020
- fileName: _jsxFileName$c,
1021
- lineNumber: 99
1022
- }
1023
- }, React$e.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$c,
1038
- lineNumber: 100
1039
- }
1040
- }), React$e.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$c,
1052
- lineNumber: 113
1053
- }
1054
- }), React$e.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$c,
1070
- lineNumber: 124
1071
- }
1072
- }), React$e.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$c,
1085
- lineNumber: 138
1086
- }
1087
- }), React$e.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$c,
1098
- lineNumber: 150
1099
- }
1100
- }), React$e.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$c,
1108
- lineNumber: 151
1109
- }
1110
- }));
1111
- class Instructions extends React$e.Component {
1112
- constructor(props) {
1113
- super(props);
1114
- }
1115
- render() {
1116
- if (this.props.open === true) {
1117
- return React$e.createElement(Root$1, {
1118
- __self: this,
1119
- __source: {
1120
- fileName: _jsxFileName$c,
1121
- lineNumber: 167
1122
- }
1123
- }, React$e.createElement(GreyInfo, {
1124
- __self: this,
1125
- __source: {
1126
- fileName: _jsxFileName$c,
1127
- lineNumber: 168
1128
- }
1129
- }), React$e.createElement(Lines, {
1130
- __self: this,
1131
- __source: {
1132
- fileName: _jsxFileName$c,
1133
- lineNumber: 169
1134
- }
1135
- }));
1136
- } else {
1137
- return React$e.createElement(Root$1, {
1138
- __self: this,
1139
- __source: {
1140
- fileName: _jsxFileName$c,
1141
- lineNumber: 174
1142
- }
1143
- }, React$e.createElement(BlueInfo, {
1144
- __self: this,
1145
- __source: {
1146
- fileName: _jsxFileName$c,
1147
- lineNumber: 175
1148
- }
1149
- }), React$e.createElement(Lines, {
1150
- __self: this,
1151
- __source: {
1152
- fileName: _jsxFileName$c,
1153
- lineNumber: 176
1154
- }
1155
- }));
1156
- }
1157
- }
1158
- }
1159
- Instructions.propTypes = {
1160
- open: PropTypes$f.bool
1161
- };
1162
- Instructions.defaultProps = {
1163
- open: false
1164
- };
1165
- const PropTypes$e = _dll_prop_types;
1166
- const React$d = _dll_react;
1167
- const {withStyles: withStyles$a} = _dll_material_ui__core_styles;
1168
- const _jsxFileName$b = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/learn-more-icon.jsx";
1169
- const Glint = ({fill}) => React$d.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$b,
1175
- lineNumber: 7
1176
- }
1177
- });
1178
- Glint.propTypes = {
1179
- fill: PropTypes$e.string
1180
- };
1181
- class LearnMore extends React$d.Component {
1182
- static __initStatic() {
1183
- this.propTypes = {
1184
- classes: PropTypes$e.object.isRequired,
1185
- size: PropTypes$e.number
1186
- };
1187
- }
1188
- render() {
1189
- const {classes, size} = this.props;
1190
- if (this.props.open === true) {
1191
- return React$d.createElement(Sized, {
1192
- size: size,
1193
- __self: this,
1194
- __source: {
1195
- fileName: _jsxFileName$b,
1196
- lineNumber: 28
1197
- }
1198
- }, React$d.createElement('svg', {
1199
- preserveAspectRatio: "xMinYMin meet",
1200
- viewBox: "-135 129 16 32",
1201
- __self: this,
1202
- __source: {
1203
- fileName: _jsxFileName$b,
1204
- lineNumber: 29
1205
- }
1206
- }, React$d.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$b,
1212
- lineNumber: 30
1213
- }
1214
- }), React$d.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$b,
1220
- lineNumber: 34
1221
- }
1222
- }), React$d.createElement(Glint, {
1223
- fill: classes.hideFg.fill,
1224
- __self: this,
1225
- __source: {
1226
- fileName: _jsxFileName$b,
1227
- lineNumber: 38
1228
- }
1229
- })));
1230
- } else {
1231
- return React$d.createElement(Sized, {
1232
- size: size,
1233
- __self: this,
1234
- __source: {
1235
- fileName: _jsxFileName$b,
1236
- lineNumber: 44
1237
- }
1238
- }, React$d.createElement('svg', {
1239
- preserveAspectRatio: "xMinYMin meet",
1240
- viewBox: "-135 129 16 31",
1241
- __self: this,
1242
- __source: {
1243
- fileName: _jsxFileName$b,
1244
- lineNumber: 45
1245
- }
1246
- }, React$d.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$b,
1254
- lineNumber: 46
1255
- }
1256
- }), React$d.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$b,
1264
- lineNumber: 52
1265
- }
1266
- }), React$d.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$b,
1274
- lineNumber: 58
1275
- }
1276
- }), ",", React$d.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$b,
1284
- lineNumber: 65
1285
- }
1286
- }), React$d.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$b,
1292
- lineNumber: 71
1293
- }
1294
- }), React$d.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$b,
1300
- lineNumber: 75
1301
- }
1302
- }), React$d.createElement(Glint, {
1303
- fill: classes.hideFg.fill,
1304
- __self: this,
1305
- __source: {
1306
- fileName: _jsxFileName$b,
1307
- lineNumber: 79
1308
- }
1309
- })));
1310
- }
1311
- }
1312
- }
1313
- LearnMore.__initStatic();
1314
- const styles$7 = {
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$e.bool
1327
- };
1328
- LearnMore.defaultProps = {
1329
- open: false
1330
- };
1331
- withStyles$a(styles$7)(LearnMore);
1332
- const PropTypes$d = _dll_prop_types;
1333
- const React$c = _dll_react;
1334
- const {withStyles: withStyles$9} = _dll_material_ui__core_styles;
1335
- const _jsxFileName$a = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/nothing-submitted-icon.jsx";
1336
- const Exclamation = ({className}) => React$c.createElement('g', {
1337
- __self: undefined,
1338
- __source: {
1339
- fileName: _jsxFileName$a,
1340
- lineNumber: 8
1341
- }
1342
- }, React$c.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$a,
1351
- lineNumber: 9
1352
- }
1353
- }), React$c.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$a,
1362
- lineNumber: 10
1363
- }
1364
- }));
1365
- const Octagon = ({className}) => React$c.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$a,
1371
- lineNumber: 15
1372
- }
1373
- });
1374
- const Emoji$1 = ({className}) => React$c.createElement('g', {
1375
- __self: undefined,
1376
- __source: {
1377
- fileName: _jsxFileName$a,
1378
- lineNumber: 22
1379
- }
1380
- }, React$c.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$a,
1389
- lineNumber: 23
1390
- }
1391
- }), React$c.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$a,
1400
- lineNumber: 24
1401
- }
1402
- }), React$c.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$a,
1408
- lineNumber: 25
1409
- }
1410
- }));
1411
- Emoji$1.propTypes = Octagon.propTypes = Exclamation.propTypes = {
1412
- className: PropTypes$d.string
1413
- };
1414
- const styles$6 = getStyles('nothing-submitted', 'white', '#464146');
1415
- class NothingSubmitted extends React$c.Component {
1416
- static __initStatic() {
1417
- this.propTypes = {
1418
- classes: PropTypes$d.object.isRequired
1419
- };
1420
- }
1421
- constructor(props) {
1422
- super(props);
1423
- const {classes} = this.props;
1424
- this.icons = {
1425
- check: React$c.createElement(IconRoot, {
1426
- __self: this,
1427
- __source: {
1428
- fileName: _jsxFileName$a,
1429
- lineNumber: 48
1430
- }
1431
- }, React$c.createElement(Octagon, {
1432
- className: classes.bg,
1433
- __self: this,
1434
- __source: {
1435
- fileName: _jsxFileName$a,
1436
- lineNumber: 49
1437
- }
1438
- }), React$c.createElement(Exclamation, {
1439
- className: classes.fg,
1440
- __self: this,
1441
- __source: {
1442
- fileName: _jsxFileName$a,
1443
- lineNumber: 50
1444
- }
1445
- })),
1446
- emoji: React$c.createElement(IconRoot, {
1447
- __self: this,
1448
- __source: {
1449
- fileName: _jsxFileName$a,
1450
- lineNumber: 54
1451
- }
1452
- }, React$c.createElement(Octagon, {
1453
- className: classes.bg,
1454
- __self: this,
1455
- __source: {
1456
- fileName: _jsxFileName$a,
1457
- lineNumber: 55
1458
- }
1459
- }), React$c.createElement(Emoji$1, {
1460
- className: classes.fg,
1461
- __self: this,
1462
- __source: {
1463
- fileName: _jsxFileName$a,
1464
- lineNumber: 56
1465
- }
1466
- })),
1467
- feedback: {
1468
- check: React$c.createElement(IconRoot, {
1469
- __self: this,
1470
- __source: {
1471
- fileName: _jsxFileName$a,
1472
- lineNumber: 61
1473
- }
1474
- }, React$c.createElement(Octagon, {
1475
- className: classes.bg,
1476
- __self: this,
1477
- __source: {
1478
- fileName: _jsxFileName$a,
1479
- lineNumber: 62
1480
- }
1481
- }), React$c.createElement(Emoji$1, {
1482
- className: classes.fg,
1483
- __self: this,
1484
- __source: {
1485
- fileName: _jsxFileName$a,
1486
- lineNumber: 63
1487
- }
1488
- })),
1489
- emoji: React$c.createElement(IconRoot, {
1490
- __self: this,
1491
- __source: {
1492
- fileName: _jsxFileName$a,
1493
- lineNumber: 67
1494
- }
1495
- }, React$c.createElement(Octagon, {
1496
- className: classes.bg,
1497
- __self: this,
1498
- __source: {
1499
- fileName: _jsxFileName$a,
1500
- lineNumber: 68
1501
- }
1502
- }), React$c.createElement(Emoji$1, {
1503
- className: classes.fg,
1504
- __self: this,
1505
- __source: {
1506
- fileName: _jsxFileName$a,
1507
- lineNumber: 69
1508
- }
1509
- })),
1510
- square: {
1511
- check: React$c.createElement(IconRoot, {
1512
- __self: this,
1513
- __source: {
1514
- fileName: _jsxFileName$a,
1515
- lineNumber: 74
1516
- }
1517
- }, React$c.createElement(Octagon, {
1518
- className: classes.bg,
1519
- __self: this,
1520
- __source: {
1521
- fileName: _jsxFileName$a,
1522
- lineNumber: 75
1523
- }
1524
- }), React$c.createElement(Exclamation, {
1525
- className: classes.fg,
1526
- __self: this,
1527
- __source: {
1528
- fileName: _jsxFileName$a,
1529
- lineNumber: 76
1530
- }
1531
- })),
1532
- emoji: React$c.createElement(IconRoot, {
1533
- __self: this,
1534
- __source: {
1535
- fileName: _jsxFileName$a,
1536
- lineNumber: 80
1537
- }
1538
- }, React$c.createElement(Octagon, {
1539
- className: classes.bg,
1540
- __self: this,
1541
- __source: {
1542
- fileName: _jsxFileName$a,
1543
- lineNumber: 81
1544
- }
1545
- }), React$c.createElement(Emoji$1, {
1546
- className: classes.fg,
1547
- __self: this,
1548
- __source: {
1549
- fileName: _jsxFileName$a,
1550
- lineNumber: 82
1551
- }
1552
- })),
1553
- open: {
1554
- check: React$c.createElement(IconRoot, {
1555
- __self: this,
1556
- __source: {
1557
- fileName: _jsxFileName$a,
1558
- lineNumber: 87
1559
- }
1560
- }, React$c.createElement(Exclamation, {
1561
- className: classes.bg,
1562
- __self: this,
1563
- __source: {
1564
- fileName: _jsxFileName$a,
1565
- lineNumber: 88
1566
- }
1567
- })),
1568
- emoji: React$c.createElement(IconRoot, {
1569
- __self: this,
1570
- __source: {
1571
- fileName: _jsxFileName$a,
1572
- lineNumber: 92
1573
- }
1574
- }, React$c.createElement(Emoji$1, {
1575
- className: classes.bg,
1576
- __self: this,
1577
- __source: {
1578
- fileName: _jsxFileName$a,
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$d.oneOf(['emoji', 'check', undefined]),
1606
- shape: PropTypes$d.oneOf(['square', undefined]),
1607
- category: PropTypes$d.oneOf(['feedback', undefined]),
1608
- open: PropTypes$d.bool
1609
- };
1610
- NothingSubmitted.defaultProps = {
1611
- iconSet: 'check',
1612
- shape: undefined,
1613
- category: undefined,
1614
- open: false
1615
- };
1616
- var nothingSubmittedIcon = withStyles$9(styles$6)(NothingSubmitted);
1617
- const PropTypes$c = _dll_prop_types;
1618
- const React$b = _dll_react;
1619
- const {withStyles: withStyles$8} = _dll_material_ui__core_styles;
1620
- const _jsxFileName$9 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/partially-correct-icon.jsx";
1621
- const styles$5 = getStyles('partially-correct', '#4aaf46', '#c1e1ac');
1622
- const Check = ({className}) => React$b.createElement('g', {
1623
- transform: 'translate(0, 0)',
1624
- __self: undefined,
1625
- __source: {
1626
- fileName: _jsxFileName$9,
1627
- lineNumber: 10
1628
- }
1629
- }, React$b.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$9,
1635
- lineNumber: 11
1636
- }
1637
- }), React$b.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$9,
1643
- lineNumber: 12
1644
- }
1645
- }));
1646
- const Emoji = ({className}) => React$b.createElement('g', {
1647
- transform: 'translate(2, 0)',
1648
- __self: undefined,
1649
- __source: {
1650
- fileName: _jsxFileName$9,
1651
- lineNumber: 17
1652
- }
1653
- }, React$b.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$9,
1662
- lineNumber: 18
1663
- }
1664
- }), React$b.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$9,
1673
- lineNumber: 19
1674
- }
1675
- }), React$b.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$9,
1685
- lineNumber: 20
1686
- }
1687
- }));
1688
- Emoji.propTypes = Check.propTypes = {
1689
- className: PropTypes$c.string
1690
- };
1691
- const PartiallyCorrect = IconBase(Check, Emoji);
1692
- PartiallyCorrect.propTypes = {
1693
- iconSet: PropTypes$c.oneOf(['emoji', 'check']),
1694
- shape: PropTypes$c.oneOf(['round', 'square']),
1695
- category: PropTypes$c.oneOf(['feedback', undefined]),
1696
- open: PropTypes$c.bool
1697
- };
1698
- PartiallyCorrect.defaultProps = {
1699
- iconSet: 'check',
1700
- shape: 'round',
1701
- category: undefined,
1702
- open: false
1703
- };
1704
- var partiallyCorrectIcon = withStyles$8(styles$5)(PartiallyCorrect);
1705
- const PropTypes$b = _dll_prop_types;
1706
- const React$a = _dll_react;
1707
- const {withStyles: withStyles$7} = _dll_material_ui__core_styles;
1708
- const _jsxFileName$8 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/icons/src/show-rationale-icon.jsx";
1709
- const Info = ({fg}) => React$a.createElement('g', {
1710
- __self: undefined,
1711
- __source: {
1712
- fileName: _jsxFileName$8,
1713
- lineNumber: 7
1714
- }
1715
- }, React$a.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$8,
1724
- lineNumber: 8
1725
- }
1726
- }), React$a.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$8,
1732
- lineNumber: 9
1733
- }
1734
- }));
1735
- Info.propTypes = {
1736
- fg: PropTypes$b.string
1737
- };
1738
- const Border = ({className}) => React$a.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$8,
1744
- lineNumber: 21
1745
- }
1746
- });
1747
- Border.propTypes = {
1748
- className: PropTypes$b.string
1749
- };
1750
- const Circle = () => React$a.createElement('g', {
1751
- __self: undefined,
1752
- __source: {
1753
- fileName: _jsxFileName$8,
1754
- lineNumber: 30
1755
- }
1756
- }, React$a.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$8,
1767
- lineNumber: 31
1768
- }
1769
- }), React$a.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$8,
1780
- lineNumber: 40
1781
- }
1782
- }), React$a.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$8,
1792
- lineNumber: 49
1793
- }
1794
- }));
1795
- const Root = ({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$a.createElement('div', {
1804
- style: style,
1805
- __self: undefined,
1806
- __source: {
1807
- fileName: _jsxFileName$8,
1808
- lineNumber: 63
1809
- }
1810
- }, React$a.createElement('svg', {
1811
- preserveAspectRatio: "xMinYMin meet",
1812
- viewBox: "-129 128 34 34",
1813
- __self: undefined,
1814
- __source: {
1815
- fileName: _jsxFileName$8,
1816
- lineNumber: 64
1817
- }
1818
- }, children));
1819
- };
1820
- Root.propTypes = {
1821
- children: PropTypes$b.oneOfType([PropTypes$b.arrayOf(PropTypes$b.node), PropTypes$b.node]).isRequired,
1822
- size: PropTypes$b.number
1823
- };
1824
- const styles$4 = {
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$a.Component {
1839
- static __initStatic() {
1840
- this.propTypes = {
1841
- classes: PropTypes$b.object.isRequired
1842
- };
1843
- }
1844
- constructor(props) {
1845
- super(props);
1846
- }
1847
- render() {
1848
- const {classes} = this.props;
1849
- const info = React$a.createElement(Info, {
1850
- fg: classes.fg,
1851
- __self: this,
1852
- __source: {
1853
- fileName: _jsxFileName$8,
1854
- lineNumber: 102
1855
- }
1856
- });
1857
- const icons = {
1858
- check: React$a.createElement(Root, {
1859
- __self: this,
1860
- __source: {
1861
- fileName: _jsxFileName$8,
1862
- lineNumber: 105
1863
- }
1864
- }, React$a.createElement(Circle, {
1865
- __self: this,
1866
- __source: {
1867
- fileName: _jsxFileName$8,
1868
- lineNumber: 106
1869
- }
1870
- }), info, React$a.createElement(Border, {
1871
- className: classes.border,
1872
- __self: this,
1873
- __source: {
1874
- fileName: _jsxFileName$8,
1875
- lineNumber: 108
1876
- }
1877
- })),
1878
- emoji: React$a.createElement(Root, {
1879
- __self: this,
1880
- __source: {
1881
- fileName: _jsxFileName$8,
1882
- lineNumber: 112
1883
- }
1884
- }, React$a.createElement(Circle, {
1885
- __self: this,
1886
- __source: {
1887
- fileName: _jsxFileName$8,
1888
- lineNumber: 113
1889
- }
1890
- }), info, React$a.createElement(Border, {
1891
- className: classes.border,
1892
- __self: this,
1893
- __source: {
1894
- fileName: _jsxFileName$8,
1895
- lineNumber: 115
1896
- }
1897
- })),
1898
- open: {
1899
- check: React$a.createElement(Root, {
1900
- __self: this,
1901
- __source: {
1902
- fileName: _jsxFileName$8,
1903
- lineNumber: 120
1904
- }
1905
- }, React$a.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$8,
1915
- lineNumber: 121
1916
- }
1917
- }), React$a.createElement(Info, {
1918
- fg: classes.bg,
1919
- border: classes.whiteBorder,
1920
- __self: this,
1921
- __source: {
1922
- fileName: _jsxFileName$8,
1923
- lineNumber: 122
1924
- }
1925
- })),
1926
- emoji: React$a.createElement(Root, {
1927
- __self: this,
1928
- __source: {
1929
- fileName: _jsxFileName$8,
1930
- lineNumber: 126
1931
- }
1932
- }, React$a.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$8,
1942
- lineNumber: 127
1943
- }
1944
- }), React$a.createElement(Info, {
1945
- fg: classes.bg,
1946
- border: classes.border,
1947
- __self: this,
1948
- __source: {
1949
- fileName: _jsxFileName$8,
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$b.oneOf(['emoji', 'check']),
1965
- open: PropTypes$b.bool
1966
- };
1967
- ShowRationale.defaultProps = {
1968
- iconSet: 'check',
1969
- open: false
1970
- };
1971
- withStyles$7(styles$4)(ShowRationale);
1972
- function unwrapExports(x) {
1973
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1974
- }
1975
- function createCommonjsModule(fn, module) {
1976
- return (module = {
1977
- exports: {}
1978
- }, fn(module, module.exports), module.exports);
1979
- }
1980
- var interopRequireDefault = createCommonjsModule(function (module) {
1981
- function _interopRequireDefault(obj) {
1982
- return obj && obj.__esModule ? obj : {
1983
- "default": obj
1984
- };
1985
- }
1986
- module.exports = _interopRequireDefault;
1987
- });
1988
- unwrapExports(interopRequireDefault);
1989
- var hasClass_1 = createCommonjsModule(function (module, exports) {
1990
- exports.__esModule = true;
1991
- exports.default = hasClass;
1992
- function hasClass(element, className) {
1993
- if (element.classList) return !!className && element.classList.contains(className); else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
1994
- }
1995
- module.exports = exports["default"];
1996
- });
1997
- unwrapExports(hasClass_1);
1998
- var addClass_1 = createCommonjsModule(function (module, exports) {
1999
- exports.__esModule = true;
2000
- exports.default = addClass;
2001
- var _hasClass = interopRequireDefault(hasClass_1);
2002
- function addClass(element, className) {
2003
- 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);
2004
- }
2005
- module.exports = exports["default"];
2006
- });
2007
- unwrapExports(addClass_1);
2008
- function replaceClassName(origClass, classToRemove) {
2009
- return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
2010
- }
2011
- var removeClass = function removeClass(element, className) {
2012
- 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));
2013
- };
2014
- function componentWillMount() {
2015
- var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
2016
- if (state !== null && state !== undefined) {
2017
- this.setState(state);
2018
- }
2019
- }
2020
- function componentWillReceiveProps(nextProps) {
2021
- function updater(prevState) {
2022
- var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
2023
- return state !== null && state !== undefined ? state : null;
2024
- }
2025
- this.setState(updater.bind(this));
2026
- }
2027
- function componentWillUpdate(nextProps, nextState) {
2028
- try {
2029
- var prevProps = this.props;
2030
- var prevState = this.state;
2031
- this.props = nextProps;
2032
- this.state = nextState;
2033
- this.__reactInternalSnapshotFlag = true;
2034
- this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
2035
- } finally {
2036
- this.props = prevProps;
2037
- this.state = prevState;
2038
- }
2039
- }
2040
- componentWillMount.__suppressDeprecationWarning = true;
2041
- componentWillReceiveProps.__suppressDeprecationWarning = true;
2042
- componentWillUpdate.__suppressDeprecationWarning = true;
2043
- function polyfill(Component) {
2044
- var prototype = Component.prototype;
2045
- if (!prototype || !prototype.isReactComponent) {
2046
- throw new Error('Can only polyfill class components');
2047
- }
2048
- if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
2049
- return Component;
2050
- }
2051
- var foundWillMountName = null;
2052
- var foundWillReceivePropsName = null;
2053
- var foundWillUpdateName = null;
2054
- if (typeof prototype.componentWillMount === 'function') {
2055
- foundWillMountName = 'componentWillMount';
2056
- } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
2057
- foundWillMountName = 'UNSAFE_componentWillMount';
2058
- }
2059
- if (typeof prototype.componentWillReceiveProps === 'function') {
2060
- foundWillReceivePropsName = 'componentWillReceiveProps';
2061
- } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
2062
- foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
2063
- }
2064
- if (typeof prototype.componentWillUpdate === 'function') {
2065
- foundWillUpdateName = 'componentWillUpdate';
2066
- } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
2067
- foundWillUpdateName = 'UNSAFE_componentWillUpdate';
2068
- }
2069
- if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
2070
- var componentName = Component.displayName || Component.name;
2071
- var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
2072
- 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');
2073
- }
2074
- if (typeof Component.getDerivedStateFromProps === 'function') {
2075
- prototype.componentWillMount = componentWillMount;
2076
- prototype.componentWillReceiveProps = componentWillReceiveProps;
2077
- }
2078
- if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
2079
- if (typeof prototype.componentDidUpdate !== 'function') {
2080
- throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
2081
- }
2082
- prototype.componentWillUpdate = componentWillUpdate;
2083
- var componentDidUpdate = prototype.componentDidUpdate;
2084
- prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
2085
- var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
2086
- componentDidUpdate.call(this, prevProps, prevState, snapshot);
2087
- };
2088
- }
2089
- return Component;
2090
- }
2091
- var reactLifecyclesCompat_es = Object.freeze({
2092
- __proto__: null,
2093
- polyfill: polyfill
2094
- });
2095
- const require$$0$5 = _dll_prop_types;
2096
- var PropTypes$a = createCommonjsModule(function (module, exports) {
2097
- exports.__esModule = true;
2098
- exports.classNamesShape = exports.timeoutsShape = void 0;
2099
- var _propTypes = _interopRequireDefault(require$$0$5);
2100
- function _interopRequireDefault(obj) {
2101
- return obj && obj.__esModule ? obj : {
2102
- default: obj
2103
- };
2104
- }
2105
- var timeoutsShape = _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
2106
- enter: _propTypes.default.number,
2107
- exit: _propTypes.default.number,
2108
- appear: _propTypes.default.number
2109
- }).isRequired]);
2110
- exports.timeoutsShape = timeoutsShape;
2111
- var classNamesShape = _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
2112
- enter: _propTypes.default.string,
2113
- exit: _propTypes.default.string,
2114
- active: _propTypes.default.string
2115
- }), _propTypes.default.shape({
2116
- enter: _propTypes.default.string,
2117
- enterDone: _propTypes.default.string,
2118
- enterActive: _propTypes.default.string,
2119
- exit: _propTypes.default.string,
2120
- exitDone: _propTypes.default.string,
2121
- exitActive: _propTypes.default.string
2122
- })]);
2123
- exports.classNamesShape = classNamesShape;
2124
- });
2125
- unwrapExports(PropTypes$a);
2126
- PropTypes$a.classNamesShape;
2127
- PropTypes$a.timeoutsShape;
2128
- var _PropTypes = PropTypes$a;
2129
- const require$$0$4 = _dll_prop_types;
2130
- const require$$1$3 = _dll_react;
2131
- const require$$2$1 = _dll_react_dom;
2132
- var Transition_1 = createCommonjsModule(function (module, exports) {
2133
- exports.__esModule = true;
2134
- exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
2135
- var PropTypes = _interopRequireWildcard(require$$0$4);
2136
- var _react = _interopRequireDefault(require$$1$3);
2137
- var _reactDom = _interopRequireDefault(require$$2$1);
2138
- function _interopRequireDefault(obj) {
2139
- return obj && obj.__esModule ? obj : {
2140
- default: obj
2141
- };
2142
- }
2143
- function _interopRequireWildcard(obj) {
2144
- if (obj && obj.__esModule) {
2145
- return obj;
2146
- } else {
2147
- var newObj = {};
2148
- if (obj != null) {
2149
- for (var key in obj) {
2150
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2151
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
2152
- if (desc.get || desc.set) {
2153
- Object.defineProperty(newObj, key, desc);
2154
- } else {
2155
- newObj[key] = obj[key];
2156
- }
2157
- }
2158
- }
2159
- }
2160
- newObj.default = obj;
2161
- return newObj;
2162
- }
2163
- }
2164
- function _objectWithoutPropertiesLoose(source, excluded) {
2165
- if (source == null) return {};
2166
- var target = {};
2167
- var sourceKeys = Object.keys(source);
2168
- var key, i;
2169
- for (i = 0; i < sourceKeys.length; i++) {
2170
- key = sourceKeys[i];
2171
- if (excluded.indexOf(key) >= 0) continue;
2172
- target[key] = source[key];
2173
- }
2174
- return target;
2175
- }
2176
- function _inheritsLoose(subClass, superClass) {
2177
- subClass.prototype = Object.create(superClass.prototype);
2178
- subClass.prototype.constructor = subClass;
2179
- subClass.__proto__ = superClass;
2180
- }
2181
- var UNMOUNTED = 'unmounted';
2182
- exports.UNMOUNTED = UNMOUNTED;
2183
- var EXITED = 'exited';
2184
- exports.EXITED = EXITED;
2185
- var ENTERING = 'entering';
2186
- exports.ENTERING = ENTERING;
2187
- var ENTERED = 'entered';
2188
- exports.ENTERED = ENTERED;
2189
- var EXITING = 'exiting';
2190
- exports.EXITING = EXITING;
2191
- var Transition = (function (_React$Component) {
2192
- _inheritsLoose(Transition, _React$Component);
2193
- function Transition(props, context) {
2194
- var _this;
2195
- _this = _React$Component.call(this, props, context) || this;
2196
- var parentGroup = context.transitionGroup;
2197
- var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
2198
- var initialStatus;
2199
- _this.appearStatus = null;
2200
- if (props.in) {
2201
- if (appear) {
2202
- initialStatus = EXITED;
2203
- _this.appearStatus = ENTERING;
2204
- } else {
2205
- initialStatus = ENTERED;
2206
- }
2207
- } else {
2208
- if (props.unmountOnExit || props.mountOnEnter) {
2209
- initialStatus = UNMOUNTED;
2210
- } else {
2211
- initialStatus = EXITED;
2212
- }
2213
- }
2214
- _this.state = {
2215
- status: initialStatus
2216
- };
2217
- _this.nextCallback = null;
2218
- return _this;
2219
- }
2220
- var _proto = Transition.prototype;
2221
- _proto.getChildContext = function getChildContext() {
2222
- return {
2223
- transitionGroup: null
2224
- };
2225
- };
2226
- Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
2227
- var nextIn = _ref.in;
2228
- if (nextIn && prevState.status === UNMOUNTED) {
2229
- return {
2230
- status: EXITED
2231
- };
2232
- }
2233
- return null;
2234
- };
2235
- _proto.componentDidMount = function componentDidMount() {
2236
- this.updateStatus(true, this.appearStatus);
2237
- };
2238
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
2239
- var nextStatus = null;
2240
- if (prevProps !== this.props) {
2241
- var status = this.state.status;
2242
- if (this.props.in) {
2243
- if (status !== ENTERING && status !== ENTERED) {
2244
- nextStatus = ENTERING;
2245
- }
2246
- } else {
2247
- if (status === ENTERING || status === ENTERED) {
2248
- nextStatus = EXITING;
2249
- }
2250
- }
2251
- }
2252
- this.updateStatus(false, nextStatus);
2253
- };
2254
- _proto.componentWillUnmount = function componentWillUnmount() {
2255
- this.cancelNextCallback();
2256
- };
2257
- _proto.getTimeouts = function getTimeouts() {
2258
- var timeout = this.props.timeout;
2259
- var exit, enter, appear;
2260
- exit = enter = appear = timeout;
2261
- if (timeout != null && typeof timeout !== 'number') {
2262
- exit = timeout.exit;
2263
- enter = timeout.enter;
2264
- appear = timeout.appear !== undefined ? timeout.appear : enter;
2265
- }
2266
- return {
2267
- exit: exit,
2268
- enter: enter,
2269
- appear: appear
2270
- };
2271
- };
2272
- _proto.updateStatus = function updateStatus(mounting, nextStatus) {
2273
- if (mounting === void 0) {
2274
- mounting = false;
2275
- }
2276
- if (nextStatus !== null) {
2277
- this.cancelNextCallback();
2278
- var node = _reactDom.default.findDOMNode(this);
2279
- if (nextStatus === ENTERING) {
2280
- this.performEnter(node, mounting);
2281
- } else {
2282
- this.performExit(node);
2283
- }
2284
- } else if (this.props.unmountOnExit && this.state.status === EXITED) {
2285
- this.setState({
2286
- status: UNMOUNTED
2287
- });
2288
- }
2289
- };
2290
- _proto.performEnter = function performEnter(node, mounting) {
2291
- var _this2 = this;
2292
- var enter = this.props.enter;
2293
- var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
2294
- var timeouts = this.getTimeouts();
2295
- var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
2296
- if (!mounting && !enter) {
2297
- this.safeSetState({
2298
- status: ENTERED
2299
- }, function () {
2300
- _this2.props.onEntered(node);
2301
- });
2302
- return;
2303
- }
2304
- this.props.onEnter(node, appearing);
2305
- this.safeSetState({
2306
- status: ENTERING
2307
- }, function () {
2308
- _this2.props.onEntering(node, appearing);
2309
- _this2.onTransitionEnd(node, enterTimeout, function () {
2310
- _this2.safeSetState({
2311
- status: ENTERED
2312
- }, function () {
2313
- _this2.props.onEntered(node, appearing);
2314
- });
2315
- });
2316
- });
2317
- };
2318
- _proto.performExit = function performExit(node) {
2319
- var _this3 = this;
2320
- var exit = this.props.exit;
2321
- var timeouts = this.getTimeouts();
2322
- if (!exit) {
2323
- this.safeSetState({
2324
- status: EXITED
2325
- }, function () {
2326
- _this3.props.onExited(node);
2327
- });
2328
- return;
2329
- }
2330
- this.props.onExit(node);
2331
- this.safeSetState({
2332
- status: EXITING
2333
- }, function () {
2334
- _this3.props.onExiting(node);
2335
- _this3.onTransitionEnd(node, timeouts.exit, function () {
2336
- _this3.safeSetState({
2337
- status: EXITED
2338
- }, function () {
2339
- _this3.props.onExited(node);
2340
- });
2341
- });
2342
- });
2343
- };
2344
- _proto.cancelNextCallback = function cancelNextCallback() {
2345
- if (this.nextCallback !== null) {
2346
- this.nextCallback.cancel();
2347
- this.nextCallback = null;
2348
- }
2349
- };
2350
- _proto.safeSetState = function safeSetState(nextState, callback) {
2351
- callback = this.setNextCallback(callback);
2352
- this.setState(nextState, callback);
2353
- };
2354
- _proto.setNextCallback = function setNextCallback(callback) {
2355
- var _this4 = this;
2356
- var active = true;
2357
- this.nextCallback = function (event) {
2358
- if (active) {
2359
- active = false;
2360
- _this4.nextCallback = null;
2361
- callback(event);
2362
- }
2363
- };
2364
- this.nextCallback.cancel = function () {
2365
- active = false;
2366
- };
2367
- return this.nextCallback;
2368
- };
2369
- _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
2370
- this.setNextCallback(handler);
2371
- var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
2372
- if (!node || doesNotHaveTimeoutOrListener) {
2373
- setTimeout(this.nextCallback, 0);
2374
- return;
2375
- }
2376
- if (this.props.addEndListener) {
2377
- this.props.addEndListener(node, this.nextCallback);
2378
- }
2379
- if (timeout != null) {
2380
- setTimeout(this.nextCallback, timeout);
2381
- }
2382
- };
2383
- _proto.render = function render() {
2384
- var status = this.state.status;
2385
- if (status === UNMOUNTED) {
2386
- return null;
2387
- }
2388
- var _this$props = this.props, children = _this$props.children, childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]);
2389
- delete childProps.in;
2390
- delete childProps.mountOnEnter;
2391
- delete childProps.unmountOnExit;
2392
- delete childProps.appear;
2393
- delete childProps.enter;
2394
- delete childProps.exit;
2395
- delete childProps.timeout;
2396
- delete childProps.addEndListener;
2397
- delete childProps.onEnter;
2398
- delete childProps.onEntering;
2399
- delete childProps.onEntered;
2400
- delete childProps.onExit;
2401
- delete childProps.onExiting;
2402
- delete childProps.onExited;
2403
- if (typeof children === 'function') {
2404
- return children(status, childProps);
2405
- }
2406
- var child = _react.default.Children.only(children);
2407
- return _react.default.cloneElement(child, childProps);
2408
- };
2409
- return Transition;
2410
- })(_react.default.Component);
2411
- Transition.contextTypes = {
2412
- transitionGroup: PropTypes.object
2413
- };
2414
- Transition.childContextTypes = {
2415
- transitionGroup: function transitionGroup() {}
2416
- };
2417
- Transition.propTypes = {
2418
- children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
2419
- in: PropTypes.bool,
2420
- mountOnEnter: PropTypes.bool,
2421
- unmountOnExit: PropTypes.bool,
2422
- appear: PropTypes.bool,
2423
- enter: PropTypes.bool,
2424
- exit: PropTypes.bool,
2425
- timeout: function timeout(props) {
2426
- var pt = _PropTypes.timeoutsShape;
2427
- if (!props.addEndListener) pt = pt.isRequired;
2428
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2429
- args[_key - 1] = arguments[_key];
2430
- }
2431
- return pt.apply(void 0, [props].concat(args));
2432
- },
2433
- addEndListener: PropTypes.func,
2434
- onEnter: PropTypes.func,
2435
- onEntering: PropTypes.func,
2436
- onEntered: PropTypes.func,
2437
- onExit: PropTypes.func,
2438
- onExiting: PropTypes.func,
2439
- onExited: PropTypes.func
2440
- };
2441
- function noop() {}
2442
- Transition.defaultProps = {
2443
- in: false,
2444
- mountOnEnter: false,
2445
- unmountOnExit: false,
2446
- appear: false,
2447
- enter: true,
2448
- exit: true,
2449
- onEnter: noop,
2450
- onEntering: noop,
2451
- onEntered: noop,
2452
- onExit: noop,
2453
- onExiting: noop,
2454
- onExited: noop
2455
- };
2456
- Transition.UNMOUNTED = 0;
2457
- Transition.EXITED = 1;
2458
- Transition.ENTERING = 2;
2459
- Transition.ENTERED = 3;
2460
- Transition.EXITING = 4;
2461
- var _default = (0, reactLifecyclesCompat_es.polyfill)(Transition);
2462
- exports.default = _default;
2463
- });
2464
- unwrapExports(Transition_1);
2465
- Transition_1.EXITING;
2466
- Transition_1.ENTERED;
2467
- Transition_1.ENTERING;
2468
- Transition_1.EXITED;
2469
- Transition_1.UNMOUNTED;
2470
- var require$$3$1 = Transition_1;
2471
- const require$$0$3 = _dll_prop_types;
2472
- const require$$3 = _dll_react;
2473
- var CSSTransition_1 = createCommonjsModule(function (module, exports) {
2474
- exports.__esModule = true;
2475
- exports.default = void 0;
2476
- var PropTypes = _interopRequireWildcard(require$$0$3);
2477
- var _addClass = _interopRequireDefault(addClass_1);
2478
- var _removeClass = _interopRequireDefault(removeClass);
2479
- var _react = _interopRequireDefault(require$$3);
2480
- var _Transition = _interopRequireDefault(require$$3$1);
2481
- function _interopRequireDefault(obj) {
2482
- return obj && obj.__esModule ? obj : {
2483
- default: obj
2484
- };
2485
- }
2486
- function _interopRequireWildcard(obj) {
2487
- if (obj && obj.__esModule) {
2488
- return obj;
2489
- } else {
2490
- var newObj = {};
2491
- if (obj != null) {
2492
- for (var key in obj) {
2493
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2494
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
2495
- if (desc.get || desc.set) {
2496
- Object.defineProperty(newObj, key, desc);
2497
- } else {
2498
- newObj[key] = obj[key];
2499
- }
2500
- }
2501
- }
2502
- }
2503
- newObj.default = obj;
2504
- return newObj;
2505
- }
2506
- }
2507
- function _extends() {
2508
- _extends = Object.assign || (function (target) {
2509
- for (var i = 1; i < arguments.length; i++) {
2510
- var source = arguments[i];
2511
- for (var key in source) {
2512
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2513
- target[key] = source[key];
2514
- }
2515
- }
2516
- }
2517
- return target;
2518
- });
2519
- return _extends.apply(this, arguments);
2520
- }
2521
- function _inheritsLoose(subClass, superClass) {
2522
- subClass.prototype = Object.create(superClass.prototype);
2523
- subClass.prototype.constructor = subClass;
2524
- subClass.__proto__ = superClass;
2525
- }
2526
- var addClass = function addClass(node, classes) {
2527
- return node && classes && classes.split(' ').forEach(function (c) {
2528
- return (0, _addClass.default)(node, c);
2529
- });
2530
- };
2531
- var removeClass$1 = function removeClass(node, classes) {
2532
- return node && classes && classes.split(' ').forEach(function (c) {
2533
- return (0, _removeClass.default)(node, c);
2534
- });
2535
- };
2536
- var CSSTransition = (function (_React$Component) {
2537
- _inheritsLoose(CSSTransition, _React$Component);
2538
- function CSSTransition() {
2539
- var _this;
2540
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2541
- args[_key] = arguments[_key];
2542
- }
2543
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2544
- _this.onEnter = function (node, appearing) {
2545
- var _this$getClassNames = _this.getClassNames(appearing ? 'appear' : 'enter'), className = _this$getClassNames.className;
2546
- _this.removeClasses(node, 'exit');
2547
- addClass(node, className);
2548
- if (_this.props.onEnter) {
2549
- _this.props.onEnter(node, appearing);
2550
- }
2551
- };
2552
- _this.onEntering = function (node, appearing) {
2553
- var _this$getClassNames2 = _this.getClassNames(appearing ? 'appear' : 'enter'), activeClassName = _this$getClassNames2.activeClassName;
2554
- _this.reflowAndAddClass(node, activeClassName);
2555
- if (_this.props.onEntering) {
2556
- _this.props.onEntering(node, appearing);
2557
- }
2558
- };
2559
- _this.onEntered = function (node, appearing) {
2560
- var appearClassName = _this.getClassNames('appear').doneClassName;
2561
- var enterClassName = _this.getClassNames('enter').doneClassName;
2562
- var doneClassName = appearing ? appearClassName + " " + enterClassName : enterClassName;
2563
- _this.removeClasses(node, appearing ? 'appear' : 'enter');
2564
- addClass(node, doneClassName);
2565
- if (_this.props.onEntered) {
2566
- _this.props.onEntered(node, appearing);
2567
- }
2568
- };
2569
- _this.onExit = function (node) {
2570
- var _this$getClassNames3 = _this.getClassNames('exit'), className = _this$getClassNames3.className;
2571
- _this.removeClasses(node, 'appear');
2572
- _this.removeClasses(node, 'enter');
2573
- addClass(node, className);
2574
- if (_this.props.onExit) {
2575
- _this.props.onExit(node);
2576
- }
2577
- };
2578
- _this.onExiting = function (node) {
2579
- var _this$getClassNames4 = _this.getClassNames('exit'), activeClassName = _this$getClassNames4.activeClassName;
2580
- _this.reflowAndAddClass(node, activeClassName);
2581
- if (_this.props.onExiting) {
2582
- _this.props.onExiting(node);
2583
- }
2584
- };
2585
- _this.onExited = function (node) {
2586
- var _this$getClassNames5 = _this.getClassNames('exit'), doneClassName = _this$getClassNames5.doneClassName;
2587
- _this.removeClasses(node, 'exit');
2588
- addClass(node, doneClassName);
2589
- if (_this.props.onExited) {
2590
- _this.props.onExited(node);
2591
- }
2592
- };
2593
- _this.getClassNames = function (type) {
2594
- var classNames = _this.props.classNames;
2595
- var isStringClassNames = typeof classNames === 'string';
2596
- var prefix = isStringClassNames && classNames ? classNames + '-' : '';
2597
- var className = isStringClassNames ? prefix + type : classNames[type];
2598
- var activeClassName = isStringClassNames ? className + '-active' : classNames[type + 'Active'];
2599
- var doneClassName = isStringClassNames ? className + '-done' : classNames[type + 'Done'];
2600
- return {
2601
- className: className,
2602
- activeClassName: activeClassName,
2603
- doneClassName: doneClassName
2604
- };
2605
- };
2606
- return _this;
2607
- }
2608
- var _proto = CSSTransition.prototype;
2609
- _proto.removeClasses = function removeClasses(node, type) {
2610
- var _this$getClassNames6 = this.getClassNames(type), className = _this$getClassNames6.className, activeClassName = _this$getClassNames6.activeClassName, doneClassName = _this$getClassNames6.doneClassName;
2611
- className && removeClass$1(node, className);
2612
- activeClassName && removeClass$1(node, activeClassName);
2613
- doneClassName && removeClass$1(node, doneClassName);
2614
- };
2615
- _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {
2616
- if (className) {
2617
- node && node.scrollTop;
2618
- addClass(node, className);
2619
- }
2620
- };
2621
- _proto.render = function render() {
2622
- var props = _extends({}, this.props);
2623
- delete props.classNames;
2624
- return _react.default.createElement(_Transition.default, _extends({}, props, {
2625
- onEnter: this.onEnter,
2626
- onEntered: this.onEntered,
2627
- onEntering: this.onEntering,
2628
- onExit: this.onExit,
2629
- onExiting: this.onExiting,
2630
- onExited: this.onExited
2631
- }));
2632
- };
2633
- return CSSTransition;
2634
- })(_react.default.Component);
2635
- CSSTransition.defaultProps = {
2636
- classNames: ''
2637
- };
2638
- CSSTransition.propTypes = _extends({}, _Transition.default.propTypes, {
2639
- classNames: _PropTypes.classNamesShape,
2640
- onEnter: PropTypes.func,
2641
- onEntering: PropTypes.func,
2642
- onEntered: PropTypes.func,
2643
- onExit: PropTypes.func,
2644
- onExiting: PropTypes.func,
2645
- onExited: PropTypes.func
2646
- });
2647
- var _default = CSSTransition;
2648
- exports.default = _default;
2649
- module.exports = exports["default"];
2650
- });
2651
- unwrapExports(CSSTransition_1);
2652
- const _react = _dll_react;
2653
- var ChildMapping = createCommonjsModule(function (module, exports) {
2654
- exports.__esModule = true;
2655
- exports.getChildMapping = getChildMapping;
2656
- exports.mergeChildMappings = mergeChildMappings;
2657
- exports.getInitialChildMapping = getInitialChildMapping;
2658
- exports.getNextChildMapping = getNextChildMapping;
2659
- function getChildMapping(children, mapFn) {
2660
- var mapper = function mapper(child) {
2661
- return mapFn && (0, _react.isValidElement)(child) ? mapFn(child) : child;
2662
- };
2663
- var result = Object.create(null);
2664
- if (children) _react.Children.map(children, function (c) {
2665
- return c;
2666
- }).forEach(function (child) {
2667
- result[child.key] = mapper(child);
2668
- });
2669
- return result;
2670
- }
2671
- function mergeChildMappings(prev, next) {
2672
- prev = prev || ({});
2673
- next = next || ({});
2674
- function getValueForKey(key) {
2675
- return (key in next) ? next[key] : prev[key];
2676
- }
2677
- var nextKeysPending = Object.create(null);
2678
- var pendingKeys = [];
2679
- for (var prevKey in prev) {
2680
- if ((prevKey in next)) {
2681
- if (pendingKeys.length) {
2682
- nextKeysPending[prevKey] = pendingKeys;
2683
- pendingKeys = [];
2684
- }
2685
- } else {
2686
- pendingKeys.push(prevKey);
2687
- }
2688
- }
2689
- var i;
2690
- var childMapping = {};
2691
- for (var nextKey in next) {
2692
- if (nextKeysPending[nextKey]) {
2693
- for (i = 0; i < nextKeysPending[nextKey].length; i++) {
2694
- var pendingNextKey = nextKeysPending[nextKey][i];
2695
- childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
2696
- }
2697
- }
2698
- childMapping[nextKey] = getValueForKey(nextKey);
2699
- }
2700
- for (i = 0; i < pendingKeys.length; i++) {
2701
- childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
2702
- }
2703
- return childMapping;
2704
- }
2705
- function getProp(child, prop, props) {
2706
- return props[prop] != null ? props[prop] : child.props[prop];
2707
- }
2708
- function getInitialChildMapping(props, onExited) {
2709
- return getChildMapping(props.children, function (child) {
2710
- return (0, _react.cloneElement)(child, {
2711
- onExited: onExited.bind(null, child),
2712
- in: true,
2713
- appear: getProp(child, 'appear', props),
2714
- enter: getProp(child, 'enter', props),
2715
- exit: getProp(child, 'exit', props)
2716
- });
2717
- });
2718
- }
2719
- function getNextChildMapping(nextProps, prevChildMapping, onExited) {
2720
- var nextChildMapping = getChildMapping(nextProps.children);
2721
- var children = mergeChildMappings(prevChildMapping, nextChildMapping);
2722
- Object.keys(children).forEach(function (key) {
2723
- var child = children[key];
2724
- if (!(0, _react.isValidElement)(child)) return;
2725
- var hasPrev = (key in prevChildMapping);
2726
- var hasNext = (key in nextChildMapping);
2727
- var prevChild = prevChildMapping[key];
2728
- var isLeaving = (0, _react.isValidElement)(prevChild) && !prevChild.props.in;
2729
- if (hasNext && (!hasPrev || isLeaving)) {
2730
- children[key] = (0, _react.cloneElement)(child, {
2731
- onExited: onExited.bind(null, child),
2732
- in: true,
2733
- exit: getProp(child, 'exit', nextProps),
2734
- enter: getProp(child, 'enter', nextProps)
2735
- });
2736
- } else if (!hasNext && hasPrev && !isLeaving) {
2737
- children[key] = (0, _react.cloneElement)(child, {
2738
- in: false
2739
- });
2740
- } else if (hasNext && hasPrev && (0, _react.isValidElement)(prevChild)) {
2741
- children[key] = (0, _react.cloneElement)(child, {
2742
- onExited: onExited.bind(null, child),
2743
- in: prevChild.props.in,
2744
- exit: getProp(child, 'exit', nextProps),
2745
- enter: getProp(child, 'enter', nextProps)
2746
- });
2747
- }
2748
- });
2749
- return children;
2750
- }
2751
- });
2752
- unwrapExports(ChildMapping);
2753
- ChildMapping.getChildMapping;
2754
- ChildMapping.mergeChildMappings;
2755
- ChildMapping.getInitialChildMapping;
2756
- ChildMapping.getNextChildMapping;
2757
- var _ChildMapping = ChildMapping;
2758
- const require$$0$2 = _dll_prop_types;
2759
- const require$$1$2 = _dll_react;
2760
- var TransitionGroup_1 = createCommonjsModule(function (module, exports) {
2761
- exports.__esModule = true;
2762
- exports.default = void 0;
2763
- var _propTypes = _interopRequireDefault(require$$0$2);
2764
- var _react = _interopRequireDefault(require$$1$2);
2765
- function _interopRequireDefault(obj) {
2766
- return obj && obj.__esModule ? obj : {
2767
- default: obj
2768
- };
2769
- }
2770
- function _objectWithoutPropertiesLoose(source, excluded) {
2771
- if (source == null) return {};
2772
- var target = {};
2773
- var sourceKeys = Object.keys(source);
2774
- var key, i;
2775
- for (i = 0; i < sourceKeys.length; i++) {
2776
- key = sourceKeys[i];
2777
- if (excluded.indexOf(key) >= 0) continue;
2778
- target[key] = source[key];
2779
- }
2780
- return target;
2781
- }
2782
- function _extends() {
2783
- _extends = Object.assign || (function (target) {
2784
- for (var i = 1; i < arguments.length; i++) {
2785
- var source = arguments[i];
2786
- for (var key in source) {
2787
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2788
- target[key] = source[key];
2789
- }
2790
- }
2791
- }
2792
- return target;
2793
- });
2794
- return _extends.apply(this, arguments);
2795
- }
2796
- function _inheritsLoose(subClass, superClass) {
2797
- subClass.prototype = Object.create(superClass.prototype);
2798
- subClass.prototype.constructor = subClass;
2799
- subClass.__proto__ = superClass;
2800
- }
2801
- function _assertThisInitialized(self) {
2802
- if (self === void 0) {
2803
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2804
- }
2805
- return self;
2806
- }
2807
- var values = Object.values || (function (obj) {
2808
- return Object.keys(obj).map(function (k) {
2809
- return obj[k];
2810
- });
2811
- });
2812
- var defaultProps = {
2813
- component: 'div',
2814
- childFactory: function childFactory(child) {
2815
- return child;
2816
- }
2817
- };
2818
- var TransitionGroup = (function (_React$Component) {
2819
- _inheritsLoose(TransitionGroup, _React$Component);
2820
- function TransitionGroup(props, context) {
2821
- var _this;
2822
- _this = _React$Component.call(this, props, context) || this;
2823
- var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
2824
- _this.state = {
2825
- handleExited: handleExited,
2826
- firstRender: true
2827
- };
2828
- return _this;
2829
- }
2830
- var _proto = TransitionGroup.prototype;
2831
- _proto.getChildContext = function getChildContext() {
2832
- return {
2833
- transitionGroup: {
2834
- isMounting: !this.appeared
2835
- }
2836
- };
2837
- };
2838
- _proto.componentDidMount = function componentDidMount() {
2839
- this.appeared = true;
2840
- this.mounted = true;
2841
- };
2842
- _proto.componentWillUnmount = function componentWillUnmount() {
2843
- this.mounted = false;
2844
- };
2845
- TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
2846
- var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
2847
- return {
2848
- children: firstRender ? (0, _ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, _ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
2849
- firstRender: false
2850
- };
2851
- };
2852
- _proto.handleExited = function handleExited(child, node) {
2853
- var currentChildMapping = (0, _ChildMapping.getChildMapping)(this.props.children);
2854
- if ((child.key in currentChildMapping)) return;
2855
- if (child.props.onExited) {
2856
- child.props.onExited(node);
2857
- }
2858
- if (this.mounted) {
2859
- this.setState(function (state) {
2860
- var children = _extends({}, state.children);
2861
- delete children[child.key];
2862
- return {
2863
- children: children
2864
- };
2865
- });
2866
- }
2867
- };
2868
- _proto.render = function render() {
2869
- var _this$props = this.props, Component = _this$props.component, childFactory = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
2870
- var children = values(this.state.children).map(childFactory);
2871
- delete props.appear;
2872
- delete props.enter;
2873
- delete props.exit;
2874
- if (Component === null) {
2875
- return children;
2876
- }
2877
- return _react.default.createElement(Component, props, children);
2878
- };
2879
- return TransitionGroup;
2880
- })(_react.default.Component);
2881
- TransitionGroup.childContextTypes = {
2882
- transitionGroup: _propTypes.default.object.isRequired
2883
- };
2884
- TransitionGroup.propTypes = {
2885
- component: _propTypes.default.any,
2886
- children: _propTypes.default.node,
2887
- appear: _propTypes.default.bool,
2888
- enter: _propTypes.default.bool,
2889
- exit: _propTypes.default.bool,
2890
- childFactory: _propTypes.default.func
2891
- };
2892
- TransitionGroup.defaultProps = defaultProps;
2893
- var _default = (0, reactLifecyclesCompat_es.polyfill)(TransitionGroup);
2894
- exports.default = _default;
2895
- module.exports = exports["default"];
2896
- });
2897
- unwrapExports(TransitionGroup_1);
2898
- var require$$2 = TransitionGroup_1;
2899
- const require$$0$1 = _dll_prop_types;
2900
- const require$$1$1 = _dll_react;
2901
- const _reactDom = _dll_react_dom;
2902
- var ReplaceTransition_1 = createCommonjsModule(function (module, exports) {
2903
- exports.__esModule = true;
2904
- exports.default = void 0;
2905
- var _propTypes = _interopRequireDefault(require$$0$1);
2906
- var _react = _interopRequireDefault(require$$1$1);
2907
- var _TransitionGroup = _interopRequireDefault(require$$2);
2908
- function _interopRequireDefault(obj) {
2909
- return obj && obj.__esModule ? obj : {
2910
- default: obj
2911
- };
2912
- }
2913
- function _objectWithoutPropertiesLoose(source, excluded) {
2914
- if (source == null) return {};
2915
- var target = {};
2916
- var sourceKeys = Object.keys(source);
2917
- var key, i;
2918
- for (i = 0; i < sourceKeys.length; i++) {
2919
- key = sourceKeys[i];
2920
- if (excluded.indexOf(key) >= 0) continue;
2921
- target[key] = source[key];
2922
- }
2923
- return target;
2924
- }
2925
- function _inheritsLoose(subClass, superClass) {
2926
- subClass.prototype = Object.create(superClass.prototype);
2927
- subClass.prototype.constructor = subClass;
2928
- subClass.__proto__ = superClass;
2929
- }
2930
- var ReplaceTransition = (function (_React$Component) {
2931
- _inheritsLoose(ReplaceTransition, _React$Component);
2932
- function ReplaceTransition() {
2933
- var _this;
2934
- for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
2935
- _args[_key] = arguments[_key];
2936
- }
2937
- _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
2938
- _this.handleEnter = function () {
2939
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2940
- args[_key2] = arguments[_key2];
2941
- }
2942
- return _this.handleLifecycle('onEnter', 0, args);
2943
- };
2944
- _this.handleEntering = function () {
2945
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2946
- args[_key3] = arguments[_key3];
2947
- }
2948
- return _this.handleLifecycle('onEntering', 0, args);
2949
- };
2950
- _this.handleEntered = function () {
2951
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2952
- args[_key4] = arguments[_key4];
2953
- }
2954
- return _this.handleLifecycle('onEntered', 0, args);
2955
- };
2956
- _this.handleExit = function () {
2957
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
2958
- args[_key5] = arguments[_key5];
2959
- }
2960
- return _this.handleLifecycle('onExit', 1, args);
2961
- };
2962
- _this.handleExiting = function () {
2963
- for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
2964
- args[_key6] = arguments[_key6];
2965
- }
2966
- return _this.handleLifecycle('onExiting', 1, args);
2967
- };
2968
- _this.handleExited = function () {
2969
- for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
2970
- args[_key7] = arguments[_key7];
2971
- }
2972
- return _this.handleLifecycle('onExited', 1, args);
2973
- };
2974
- return _this;
2975
- }
2976
- var _proto = ReplaceTransition.prototype;
2977
- _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
2978
- var _child$props;
2979
- var children = this.props.children;
2980
- var child = _react.default.Children.toArray(children)[idx];
2981
- if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
2982
- if (this.props[handler]) this.props[handler]((0, _reactDom.findDOMNode)(this));
2983
- };
2984
- _proto.render = function render() {
2985
- var _this$props = this.props, children = _this$props.children, inProp = _this$props.in, props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
2986
- var _React$Children$toArr = _react.default.Children.toArray(children), first = _React$Children$toArr[0], second = _React$Children$toArr[1];
2987
- delete props.onEnter;
2988
- delete props.onEntering;
2989
- delete props.onEntered;
2990
- delete props.onExit;
2991
- delete props.onExiting;
2992
- delete props.onExited;
2993
- return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
2994
- key: 'first',
2995
- onEnter: this.handleEnter,
2996
- onEntering: this.handleEntering,
2997
- onEntered: this.handleEntered
2998
- }) : _react.default.cloneElement(second, {
2999
- key: 'second',
3000
- onEnter: this.handleExit,
3001
- onEntering: this.handleExiting,
3002
- onEntered: this.handleExited
3003
- }));
3004
- };
3005
- return ReplaceTransition;
3006
- })(_react.default.Component);
3007
- ReplaceTransition.propTypes = {
3008
- in: _propTypes.default.bool.isRequired,
3009
- children: function children(props, propName) {
3010
- if (_react.default.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
3011
- return null;
3012
- }
3013
- };
3014
- var _default = ReplaceTransition;
3015
- exports.default = _default;
3016
- module.exports = exports["default"];
3017
- });
3018
- unwrapExports(ReplaceTransition_1);
3019
- var require$$0 = CSSTransition_1;
3020
- var require$$1 = ReplaceTransition_1;
3021
- var reactTransitionGroup = createCommonjsModule(function (module) {
3022
- var _CSSTransition = _interopRequireDefault(require$$0);
3023
- var _ReplaceTransition = _interopRequireDefault(require$$1);
3024
- var _TransitionGroup = _interopRequireDefault(require$$2);
3025
- var _Transition = _interopRequireDefault(require$$3$1);
3026
- function _interopRequireDefault(obj) {
3027
- return obj && obj.__esModule ? obj : {
3028
- default: obj
3029
- };
3030
- }
3031
- module.exports = {
3032
- Transition: _Transition.default,
3033
- TransitionGroup: _TransitionGroup.default,
3034
- ReplaceTransition: _ReplaceTransition.default,
3035
- CSSTransition: _CSSTransition.default
3036
- };
3037
- });
3038
- unwrapExports(reactTransitionGroup);
3039
- reactTransitionGroup.Transition;
3040
- var reactTransitionGroup_2 = reactTransitionGroup.TransitionGroup;
3041
- reactTransitionGroup.ReplaceTransition;
3042
- var reactTransitionGroup_4 = reactTransitionGroup.CSSTransition;
3043
- const {colors: {green: green}} = _dll_material_ui__core;
3044
- const {colors: {orange: orange}} = _dll_material_ui__core;
3045
- const {colors: {pink: pink}} = _dll_material_ui__core;
3046
- const {colors: {indigo: indigo}} = _dll_material_ui__core;
3047
- const defaults = {
3048
- TEXT: 'black',
3049
- DISABLED: 'grey',
3050
- CORRECT: green[500],
3051
- INCORRECT: orange[500],
3052
- PRIMARY: indigo[500],
3053
- PRIMARY_LIGHT: indigo[200],
3054
- PRIMARY_DARK: indigo[800],
3055
- SECONDARY: pink.A400,
3056
- SECONDARY_LIGHT: pink[200],
3057
- SECONDARY_DARK: pink[900],
3058
- BACKGROUND: 'rgba(255,255,255,0)',
3059
- SECONDARY_BACKGROUND: 'rgba(241,241,241,1)'
3060
- };
3061
- Object.freeze(defaults);
3062
- const v = prefix => (...args) => {
3063
- const fallback = args.pop();
3064
- return args.reduceRight((acc, v) => {
3065
- return `var(--${prefix}-${v}, ${acc})`;
3066
- }, fallback);
3067
- };
3068
- const pv = v('pie');
3069
- const text = () => pv('text', defaults.TEXT);
3070
- const disabled = () => pv('disabled', defaults.DISABLED);
3071
- const correct = () => pv('correct', defaults.CORRECT);
3072
- const incorrect = () => pv('incorrect', defaults.INCORRECT);
3073
- const secondary = () => pv('secondary', defaults.SECONDARY);
3074
- const background = () => pv('background', defaults.BACKGROUND);
3075
- const {withStyles: withStyles$6} = _dll_material_ui__core_styles;
3076
- const React$9 = _dll_react;
3077
- const classNames$2 = _dll_classnames;
3078
- const PropTypes$9 = _dll_prop_types;
3079
- const _jsxFileName$7 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/render-ui/src/feedback.jsx";
3080
- const styleSheet = {
3081
- corespringFeedback: {
3082
- transformOrigin: '0% 0px 0px',
3083
- width: '100%',
3084
- display: 'block',
3085
- overflow: 'hidden',
3086
- '&:.incorrect': {
3087
- color: '#946202'
3088
- }
3089
- },
3090
- content: {
3091
- '-webkit-font-smoothing': 'antialiased',
3092
- backgroundColor: `var(--feedback-bg-color, ${disabled()})`,
3093
- borderRadius: '4px',
3094
- fontFamily: '"Roboto", "Noto", sans-serif',
3095
- fontSize: '12px',
3096
- lineHeight: '25px',
3097
- margin: '0px',
3098
- padding: '10px',
3099
- verticalAlign: 'middle',
3100
- color: 'var(--feedback-color, white)'
3101
- },
3102
- correct: {
3103
- backgroundColor: `var(--feedback-correct-bg-color, ${correct()})`
3104
- },
3105
- incorrect: {
3106
- backgroundColor: `var(--feedback-incorrect-bg-color, ${incorrect()})`
3107
- },
3108
- feedbackEnter: {
3109
- height: '1px'
3110
- },
3111
- feedbackEnterActive: {
3112
- height: '45px',
3113
- transition: 'height 500ms'
3114
- },
3115
- feedbackLeave: {
3116
- height: '45px'
3117
- },
3118
- feedbackLeaveActive: {
3119
- height: '1px',
3120
- transition: 'height 200ms'
3121
- }
3122
- };
3123
- class Feedback extends React$9.Component {
3124
- static __initStatic() {
3125
- this.propTypes = {
3126
- correctness: PropTypes$9.string,
3127
- feedback: PropTypes$9.string,
3128
- classes: PropTypes$9.object.isRequired
3129
- };
3130
- }
3131
- render() {
3132
- const {correctness, feedback, classes} = this.props;
3133
- function chooseFeedback(correctness) {
3134
- if (correctness && feedback) {
3135
- return React$9.createElement(reactTransitionGroup_4, {
3136
- classNames: {
3137
- enter: classes.feedbackEnter,
3138
- enterActive: classes.feedbackEnterActive,
3139
- leave: classes.feedbackLeave,
3140
- leaveActive: classes.feedbackLeaveActive
3141
- },
3142
- key: "hasFeedback",
3143
- timeout: {
3144
- enter: 500,
3145
- exit: 300
3146
- },
3147
- __self: this,
3148
- __source: {
3149
- fileName: _jsxFileName$7,
3150
- lineNumber: 69
3151
- }
3152
- }, React$9.createElement('div', {
3153
- className: classes.corespringFeedback,
3154
- __self: this,
3155
- __source: {
3156
- fileName: _jsxFileName$7,
3157
- lineNumber: 79
3158
- }
3159
- }, React$9.createElement('div', {
3160
- className: classNames$2(classes.content, classes[correctness]),
3161
- dangerouslySetInnerHTML: {
3162
- __html: feedback
3163
- },
3164
- __self: this,
3165
- __source: {
3166
- fileName: _jsxFileName$7,
3167
- lineNumber: 80
3168
- }
3169
- })));
3170
- } else {
3171
- return null;
3172
- }
3173
- }
3174
- return React$9.createElement('div', {
3175
- __self: this,
3176
- __source: {
3177
- fileName: _jsxFileName$7,
3178
- lineNumber: 93
3179
- }
3180
- }, React$9.createElement(reactTransitionGroup_2, {
3181
- __self: this,
3182
- __source: {
3183
- fileName: _jsxFileName$7,
3184
- lineNumber: 94
3185
- }
3186
- }, chooseFeedback(correctness)));
3187
- }
3188
- }
3189
- Feedback.__initStatic();
3190
- var Feedback$1 = withStyles$6(styleSheet, {
3191
- name: 'Feedback'
3192
- })(Feedback);
3193
- const React$8 = _dll_react;
3194
- const PropTypes$8 = _dll_prop_types;
3195
- const {Popover: Popover} = _dll_material_ui__core;
3196
- const {withStyles: withStyles$5} = _dll_material_ui__core_styles;
3197
- const debug$1 = _dll_debug;
3198
- const _jsxFileName$6 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/render-ui/src/response-indicators.jsx";
3199
- const log$1 = debug$1('pie-libs:render-ui:response-indicators');
3200
- const styles$3 = () => ({
3201
- responseIndicator: {
3202
- cursor: 'pointer'
3203
- },
3204
- paper: {
3205
- padding: '0',
3206
- borderRadius: '4px'
3207
- },
3208
- popover: {
3209
- cursor: 'pointer'
3210
- },
3211
- popperClose: {
3212
- cursor: 'pointer'
3213
- }
3214
- });
3215
- const BuildIndicator = (Icon, correctness) => {
3216
- class RawIndicator extends React$8.Component {
3217
- constructor(props) {
3218
- super(props);
3219
- RawIndicator.prototype.__init.call(this);
3220
- RawIndicator.prototype.__init2.call(this);
3221
- this.state = {};
3222
- }
3223
- __init() {
3224
- this.handlePopoverOpen = event => {
3225
- log$1('[handlePopoverOpen]', event.target);
3226
- this.setState({
3227
- anchorEl: event.target
3228
- });
3229
- };
3230
- }
3231
- __init2() {
3232
- this.handlePopoverClose = () => {
3233
- this.setState({
3234
- anchorEl: null
3235
- });
3236
- };
3237
- }
3238
- render() {
3239
- const {feedback, classes} = this.props;
3240
- const {anchorEl} = this.state;
3241
- return React$8.createElement('div', {
3242
- className: feedback && classes.responseIndicator,
3243
- __self: this,
3244
- __source: {
3245
- fileName: _jsxFileName$6,
3246
- lineNumber: 47
3247
- }
3248
- }, React$8.createElement('span', {
3249
- ref: r => this.icon = r,
3250
- onClick: this.handlePopoverOpen,
3251
- __self: this,
3252
- __source: {
3253
- fileName: _jsxFileName$6,
3254
- lineNumber: 48
3255
- }
3256
- }, React$8.createElement(Icon, {
3257
- __self: this,
3258
- __source: {
3259
- fileName: _jsxFileName$6,
3260
- lineNumber: 49
3261
- }
3262
- })), feedback && React$8.createElement(Popover, {
3263
- className: classes.popover,
3264
- classes: {
3265
- paper: classes.paper
3266
- },
3267
- open: !!anchorEl,
3268
- anchorEl: anchorEl,
3269
- anchorOrigin: {
3270
- vertical: 'bottom',
3271
- horizontal: 'left'
3272
- },
3273
- transformOrigin: {
3274
- vertical: 'top',
3275
- horizontal: 'left'
3276
- },
3277
- onClose: this.handlePopoverClose,
3278
- __self: this,
3279
- __source: {
3280
- fileName: _jsxFileName$6,
3281
- lineNumber: 53
3282
- }
3283
- }, React$8.createElement(Feedback$1, {
3284
- feedback: feedback,
3285
- correctness: correctness,
3286
- __self: this,
3287
- __source: {
3288
- fileName: _jsxFileName$6,
3289
- lineNumber: 70
3290
- }
3291
- })));
3292
- }
3293
- }
3294
- RawIndicator.propTypes = {
3295
- feedback: PropTypes$8.string,
3296
- classes: PropTypes$8.object.isRequired
3297
- };
3298
- return withStyles$5(styles$3)(RawIndicator);
3299
- };
3300
- BuildIndicator(correctIcon, 'correct');
3301
- BuildIndicator(incorrectIcon, 'incorrect');
3302
- BuildIndicator(partiallyCorrectIcon, 'partially-correct');
3303
- BuildIndicator(nothingSubmittedIcon, 'nothing-submitted');
3304
- const React$7 = _dll_react;
3305
- const {withStyles: withStyles$4} = _dll_material_ui__core_styles;
3306
- const {Collapse: {index: Collapse}} = _dll_material_ui__core;
3307
- const PropTypes$7 = _dll_prop_types;
3308
- const {renderMath: renderMath$1} = _dll_pie_lib__math_rendering;
3309
- const _jsxFileName$5 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx";
3310
- class Collapsible extends React$7.Component {
3311
- constructor(...args) {
3312
- super(...args);
3313
- Collapsible.prototype.__init.call(this);
3314
- Collapsible.prototype.__init2.call(this);
3315
- }
3316
- static __initStatic() {
3317
- this.propTypes = {
3318
- classes: PropTypes$7.object.isRequired,
3319
- className: PropTypes$7.string,
3320
- children: PropTypes$7.object,
3321
- labels: PropTypes$7.shape({
3322
- visible: PropTypes$7.string,
3323
- hidden: PropTypes$7.string
3324
- })
3325
- };
3326
- }
3327
- static __initStatic2() {
3328
- this.defaultProps = {
3329
- labels: {}
3330
- };
3331
- }
3332
- __init() {
3333
- this.state = {
3334
- expanded: false
3335
- };
3336
- }
3337
- __init2() {
3338
- this.toggleExpanded = () => {
3339
- this.setState(state => ({
3340
- expanded: !state.expanded
3341
- }));
3342
- };
3343
- }
3344
- componentDidMount() {
3345
- renderMath$1(this.root);
3346
- }
3347
- componentDidUpdate() {
3348
- renderMath$1(this.root);
3349
- }
3350
- render() {
3351
- const {classes, labels, children, className} = this.props;
3352
- const title = this.state.expanded ? labels.visible || 'Hide' : labels.hidden || 'Show';
3353
- return React$7.createElement('div', {
3354
- className: className,
3355
- ref: r => this.root = r,
3356
- __self: this,
3357
- __source: {
3358
- fileName: _jsxFileName$5,
3359
- lineNumber: 43
3360
- }
3361
- }, React$7.createElement('div', {
3362
- onClick: this.toggleExpanded,
3363
- __self: this,
3364
- __source: {
3365
- fileName: _jsxFileName$5,
3366
- lineNumber: 44
3367
- }
3368
- }, React$7.createElement('span', {
3369
- className: classes.title,
3370
- __self: this,
3371
- __source: {
3372
- fileName: _jsxFileName$5,
3373
- lineNumber: 45
3374
- }
3375
- }, title)), React$7.createElement(Collapse, {
3376
- in: this.state.expanded,
3377
- timeout: "auto",
3378
- unmountOnExit: true,
3379
- className: classes.collapsible,
3380
- __self: this,
3381
- __source: {
3382
- fileName: _jsxFileName$5,
3383
- lineNumber: 47
3384
- }
3385
- }, children));
3386
- }
3387
- }
3388
- Collapsible.__initStatic();
3389
- Collapsible.__initStatic2();
3390
- withStyles$4(theme => ({
3391
- title: {
3392
- color: theme.palette.primary.light,
3393
- borderBottom: `1px dotted ${theme.palette.primary.light}`
3394
- },
3395
- collapsible: {
3396
- paddingTop: theme.spacing.unit * 2
3397
- }
3398
- }))(Collapsible);
3399
- const React$6 = _dll_react;
3400
- const {withStyles: withStyles$3} = _dll_material_ui__core_styles;
3401
- const {createMuiTheme: createMuiTheme} = _dll_material_ui__core_styles;
3402
- const PropTypes$6 = _dll_prop_types;
3403
- const _jsxFileName$4 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/render-ui/src/preview-layout.jsx";
3404
- class PreviewLayout extends React$6.Component {
3405
- static __initStatic() {
3406
- this.propTypes = {
3407
- children: PropTypes$6.oneOfType([PropTypes$6.arrayOf(PropTypes$6.node), PropTypes$6.node]).isRequired,
3408
- classes: PropTypes$6.object
3409
- };
3410
- }
3411
- render() {
3412
- const {children, classes} = this.props;
3413
- return React$6.createElement('div', {
3414
- className: classes.container,
3415
- __self: this,
3416
- __source: {
3417
- fileName: _jsxFileName$4,
3418
- lineNumber: 14
3419
- }
3420
- }, children);
3421
- }
3422
- }
3423
- PreviewLayout.__initStatic();
3424
- const styles$2 = () => ({
3425
- container: {
3426
- display: 'flex',
3427
- flexDirection: 'column',
3428
- position: 'relative'
3429
- }
3430
- });
3431
- createMuiTheme({
3432
- typography: {
3433
- useNextVariants: true
3434
- },
3435
- palette: {
3436
- action: {
3437
- disabled: 'rgba(0, 0, 0, 0.54);'
3438
- }
3439
- },
3440
- overrides: {
3441
- MuiRadio: {
3442
- root: {
3443
- '&$checked': {
3444
- color: '#3f51b5 !important'
3445
- }
3446
- }
3447
- },
3448
- MuiCheckbox: {
3449
- root: {
3450
- '&$checked': {
3451
- color: '#3f51b5 !important'
3452
- }
3453
- }
3454
- },
3455
- MuiTabs: {
3456
- root: {
3457
- borderBottom: '1px solid #eee'
3458
- }
3459
- },
3460
- MuiSwitch: {
3461
- root: {
3462
- '&$checked': {
3463
- color: '#3f51b5 !important',
3464
- '& + $bar': {
3465
- backgroundColor: '#3f51b5 !important',
3466
- opacity: 0.5
3467
- }
3468
- }
3469
- }
3470
- }
3471
- }
3472
- });
3473
- withStyles$3(styles$2)(PreviewLayout);
3474
- const React$5 = _dll_react;
3475
- const PropTypes$5 = _dll_prop_types;
3476
- const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
3477
- const _jsxFileName$3 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/render-ui/src/html-and-math.js";
3478
- class HtmlAndMath extends React$5.Component {
3479
- static __initStatic() {
3480
- this.propTypes = {
3481
- tag: PropTypes$5.string,
3482
- className: PropTypes$5.string,
3483
- html: PropTypes$5.string
3484
- };
3485
- }
3486
- static __initStatic2() {
3487
- this.defaultProps = {
3488
- tag: 'div',
3489
- html: ''
3490
- };
3491
- }
3492
- componentDidMount() {
3493
- if (this.node) {
3494
- renderMath(this.node);
3495
- }
3496
- }
3497
- componentDidUpdate() {
3498
- if (this.node) {
3499
- renderMath(this.node);
3500
- }
3501
- }
3502
- render() {
3503
- const {tag, className, html} = this.props;
3504
- const Tag = tag || 'div';
3505
- return React$5.createElement(Tag, {
3506
- ref: r => this.node = r,
3507
- className: className,
3508
- dangerouslySetInnerHTML: {
3509
- __html: html
3510
- },
3511
- __self: this,
3512
- __source: {
3513
- fileName: _jsxFileName$3,
3514
- lineNumber: 33
3515
- }
3516
- });
3517
- }
3518
- }
3519
- HtmlAndMath.__initStatic();
3520
- HtmlAndMath.__initStatic2();
3521
- const {InputLabel: InputLabel} = _dll_material_ui__core;
3522
- const {FormControl: FormControl} = _dll_material_ui__core;
3523
- const PropTypes$4 = _dll_prop_types;
3524
- const React$4 = _dll_react;
3525
- const classNames$1 = _dll_classnames;
3526
- const {withStyles: withStyles$2} = _dll_material_ui__core_styles;
3527
- const _jsxFileName$2 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/render-ui/src/input-container.jsx";
3528
- const RawInputContainer = props => {
3529
- const {label, className, children, classes} = props;
3530
- const names = classNames$1(classes.formControl, className);
3531
- return React$4.createElement(FormControl, {
3532
- className: names,
3533
- __self: undefined,
3534
- __source: {
3535
- fileName: _jsxFileName$2,
3536
- lineNumber: 13
3537
- }
3538
- }, React$4.createElement(InputLabel, {
3539
- className: classes.label,
3540
- shrink: true,
3541
- __self: undefined,
3542
- __source: {
3543
- fileName: _jsxFileName$2,
3544
- lineNumber: 14
3545
- }
3546
- }, label), children);
3547
- };
3548
- RawInputContainer.propTypes = {
3549
- label: PropTypes$4.oneOfType([PropTypes$4.string, PropTypes$4.object]).isRequired,
3550
- className: PropTypes$4.string,
3551
- children: PropTypes$4.oneOfType([PropTypes$4.arrayOf(PropTypes$4.node), PropTypes$4.node]).isRequired,
3552
- classes: PropTypes$4.object.isRequired
3553
- };
3554
- withStyles$2(theme => ({
3555
- formControl: {
3556
- marginLeft: 0,
3557
- marginRight: theme.spacing.unit,
3558
- paddingBottom: theme.spacing.unit,
3559
- flex: '1 0 auto',
3560
- minWidth: theme.spacing.unit * 4
3561
- },
3562
- label: {
3563
- fontSize: 'inherit',
3564
- whiteSpace: 'nowrap'
3565
- }
3566
- }))(RawInputContainer);
3567
- const React$3 = _dll_react;
3568
- const {Component: Component} = _dll_react;
3569
- const {withStyles: withStyles$1} = _dll_material_ui__core_styles;
3570
- const PropTypes$3 = _dll_prop_types;
3571
- const _jsxFileName$1 = "/home/ede/dev/github/pie-framework/pie-elements/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx";
3572
- const NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
3573
- const NEWLINE_LATEX = '\\newline ';
3574
- class PreviewPrompt extends Component {
3575
- static __initStatic() {
3576
- this.propTypes = {
3577
- classes: PropTypes$3.object,
3578
- prompt: PropTypes$3.string,
3579
- tagName: PropTypes$3.string,
3580
- className: PropTypes$3.string,
3581
- onClick: PropTypes$3.func
3582
- };
3583
- }
3584
- static __initStatic2() {
3585
- this.defaultProps = {
3586
- onClick: () => {}
3587
- };
3588
- }
3589
- render() {
3590
- const {prompt, classes, tagName, className, onClick} = this.props;
3591
- const CustomTag = tagName || 'div';
3592
- const customClasses = `${classes.promptTable} ${classes[className] || ''} `;
3593
- return React$3.createElement(CustomTag, {
3594
- onClick: onClick,
3595
- className: customClasses,
3596
- dangerouslySetInnerHTML: {
3597
- __html: (prompt || '').replace(NEWLINE_BLOCK_REGEX, NEWLINE_LATEX)
3598
- },
3599
- __self: this,
3600
- __source: {
3601
- fileName: _jsxFileName$1,
3602
- lineNumber: 29
3603
- }
3604
- });
3605
- }
3606
- }
3607
- PreviewPrompt.__initStatic();
3608
- PreviewPrompt.__initStatic2();
3609
- const styles$1 = theme => ({
3610
- prompt: {
3611
- verticalAlign: 'middle',
3612
- color: text()
3613
- },
3614
- rationale: {
3615
- paddingLeft: theme.spacing.unit * 16
3616
- },
3617
- label: {
3618
- color: `${text()} !important`,
3619
- display: 'inline-block',
3620
- verticalAlign: 'middle',
3621
- cursor: 'pointer'
3622
- },
3623
- promptTable: {
3624
- '&:not(.MathJax) > table': {
3625
- borderCollapse: 'collapse'
3626
- },
3627
- '&:not(.MathJax) > table tr': {
3628
- borderTop: '1px solid #dfe2e5',
3629
- '&:nth-child(2n)': {
3630
- backgroundColor: '#f6f8fa'
3631
- }
3632
- },
3633
- '&:not(.MathJax) > table td, &:not(.MathJax) > table th': {
3634
- border: '1px solid #dfe2e5',
3635
- padding: '.6em 1em',
3636
- textAlign: 'center'
3637
- }
3638
- }
3639
- });
3640
- withStyles$1(styles$1)(PreviewPrompt);
3641
- const PropTypes$2 = _dll_prop_types;
3642
- ({
3643
- children: PropTypes$2.node,
3644
- false: PropTypes$2.bool
3645
- });
3646
- const PropTypes$1 = _dll_prop_types;
3647
- const React$2 = _dll_react;
3648
- const Purpose = props => {
3649
- return React$2.createElement(React$2.Fragment, null, React$2.Children.map(props.children, child => React$2.cloneElement(child, {
3650
- 'data-pie-purpose': props.purpose
3651
- })));
3652
- };
3653
- Purpose.propTypes = {
3654
- children: PropTypes$1.node,
3655
- purpose: PropTypes$1.string
3656
- };
3657
- new DOMParser();
1
+ import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_pie_lib__render_ui, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/shared-module@^1.2.9/module/index.js";
3658
2
  const React$1 = _dll_react;
3659
3
  const PropTypes = _dll_prop_types;
3660
4
  const {Tabs: Tabs} = _dll_material_ui__core;
3661
5
  const {Tab: Tab} = _dll_material_ui__core;
3662
6
  const {Typography: Typography} = _dll_material_ui__core;
3663
7
  const {withStyles: withStyles} = _dll_material_ui__core_styles;
8
+ const {color: color} = _dll_pie_lib__render_ui;
9
+ const {Purpose: Purpose} = _dll_pie_lib__render_ui;
3664
10
  const classNames = _dll_classnames;
3665
11
  const _jsxFileName = "/home/ede/dev/github/pie-framework/pie-elements/packages/passage/src/stimulus-tabs.jsx";
3666
12
  const styles = () => ({
3667
13
  root: {
3668
14
  flexGrow: 1,
3669
- backgroundColor: background(),
3670
- color: text()
15
+ backgroundColor: color.background(),
16
+ color: color.text()
3671
17
  },
3672
18
  tab: {
3673
19
  fontSize: '0.8125em'
3674
20
  },
3675
21
  stickyTabs: {
3676
- background: background(),
22
+ background: color.background(),
3677
23
  paddingBottom: '20px',
3678
24
  position: 'sticky',
3679
25
  top: 0
@@ -3681,7 +27,7 @@ const styles = () => ({
3681
27
  title: {
3682
28
  textTransform: 'uppercase',
3683
29
  padding: '6px 24px',
3684
- borderBottom: `2px solid ${secondary()}`,
30
+ borderBottom: `2px solid ${color.secondary()}`,
3685
31
  width: 'fit-content',
3686
32
  marginBottom: '6px'
3687
33
  }
@@ -3693,8 +39,8 @@ function TabContainer(props) {
3693
39
  style: {
3694
40
  padding,
3695
41
  fontSize: '0.875em',
3696
- backgroundColor: background(),
3697
- color: text()
42
+ backgroundColor: color.background(),
43
+ color: color.text()
3698
44
  },
3699
45
  __self: this,
3700
46
  __source: {