@khanacademy/perseus-editor 0.0.1 → 0.1.2

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.
Files changed (127) hide show
  1. package/.babelrc.js +1 -1
  2. package/CHANGELOG.md +26 -0
  3. package/dist/es/index.css +1020 -0
  4. package/dist/es/index.js +9 -1
  5. package/dist/es/index.js.map +1 -1
  6. package/dist/index.css +1020 -0
  7. package/dist/index.js +9 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/strings.js +6 -1
  10. package/package.json +16 -4
  11. package/src/README.md +7 -0
  12. package/src/__stories__/editor.stories.js +33 -0
  13. package/src/__stories__/section-control-button.stories.jsx +27 -0
  14. package/src/__testdata__/input-number_testdata.js +28 -0
  15. package/src/__tests__/editor_test.jsx +123 -0
  16. package/src/__tests__/i18n_test.jsx +585 -0
  17. package/src/__tests__/traversal_test.jsx +378 -0
  18. package/src/all-editors.js +85 -0
  19. package/src/all-editors_test.js +17 -0
  20. package/src/all-widgets.js +10 -0
  21. package/src/article-editor.jsx +437 -0
  22. package/src/components/__stories__/blur-input.stories.jsx +24 -0
  23. package/src/components/blur-input.jsx +62 -0
  24. package/src/components/checkbox.jsx +194 -0
  25. package/src/components/device-framer.jsx +91 -0
  26. package/src/components/drag-target.jsx +88 -0
  27. package/src/components/dropdown-option.jsx +318 -0
  28. package/src/components/form-wrapped-text-field.jsx +248 -0
  29. package/src/components/graph-settings.jsx +631 -0
  30. package/src/components/hover-behavior.jsx +178 -0
  31. package/src/components/json-editor.jsx +121 -0
  32. package/src/components/link.jsx +173 -0
  33. package/src/components/simple-button.jsx +86 -0
  34. package/src/components/sortable.jsx +186 -0
  35. package/src/components/util.js +39 -0
  36. package/src/components/viewport-resizer.jsx +73 -0
  37. package/src/diffs/__stories__/perseus-diff-wrapper.jsx +8 -0
  38. package/src/diffs/__stories__/structured-item-diff.stories.jsx +855 -0
  39. package/src/diffs/__stories__/tags-diff.stories.jsx +38 -0
  40. package/src/diffs/__stories__/text-diff.stories.jsx +37 -0
  41. package/src/diffs/__tests__/split-diff_test.js +34 -0
  42. package/src/diffs/__tests__/string-array-diff_test.js +74 -0
  43. package/src/diffs/__tests__/structured-item-diff_test.js +432 -0
  44. package/src/diffs/__tests__/widget-diff-performer_test.js +44 -0
  45. package/src/diffs/article-diff.jsx +70 -0
  46. package/src/diffs/item-diff.jsx +77 -0
  47. package/src/diffs/renderer-diff.jsx +143 -0
  48. package/src/diffs/split-diff.jsx +30 -0
  49. package/src/diffs/string-array-diff.jsx +75 -0
  50. package/src/diffs/structured-item-diff.jsx +269 -0
  51. package/src/diffs/tags-diff.jsx +50 -0
  52. package/src/diffs/text-diff.jsx +194 -0
  53. package/src/diffs/widget-diff-performer.jsx +74 -0
  54. package/src/diffs/widget-diff.jsx +291 -0
  55. package/src/editor-page.jsx +351 -0
  56. package/src/editor.jsx +1364 -0
  57. package/src/hint-editor.jsx +447 -0
  58. package/src/i18n.jsx +139 -0
  59. package/src/iframe-content-renderer.jsx +201 -0
  60. package/src/index.js +27 -8
  61. package/src/item-editor.jsx +159 -0
  62. package/src/item-extras-editor.jsx +150 -0
  63. package/src/katex-error-view.jsx +87 -0
  64. package/src/multirenderer-editor.jsx +1074 -0
  65. package/src/section-control-button.jsx +53 -0
  66. package/src/stateful-article-editor.jsx +176 -0
  67. package/src/stateful-editor-page.jsx +90 -0
  68. package/src/styles/perseus-editor.less +1339 -0
  69. package/src/testing-widgets.js +12 -0
  70. package/src/util/register-all-widgets-and-editors-for-testing.js +15 -0
  71. package/src/util/register-all-widgets-and-editors-for-testing_test.js +18 -0
  72. package/src/widgets/__stories__/label-image-editor.stories.jsx +97 -0
  73. package/src/widgets/categorizer-editor.jsx +103 -0
  74. package/src/widgets/cs-program-editor.jsx +258 -0
  75. package/src/widgets/definition-editor.jsx +75 -0
  76. package/src/widgets/dropdown-editor.jsx +201 -0
  77. package/src/widgets/example-graphie-widget-editor.jsx +70 -0
  78. package/src/widgets/example-graphie-widget.jsx +175 -0
  79. package/src/widgets/example-widget-editor.jsx +60 -0
  80. package/src/widgets/example-widget.jsx +153 -0
  81. package/src/widgets/explanation-editor.jsx +89 -0
  82. package/src/widgets/expression-editor.jsx +560 -0
  83. package/src/widgets/graded-group-editor.jsx +162 -0
  84. package/src/widgets/graded-group-set-editor.jsx +101 -0
  85. package/src/widgets/grapher-editor.jsx +154 -0
  86. package/src/widgets/group-editor.jsx +83 -0
  87. package/src/widgets/iframe-editor.jsx +200 -0
  88. package/src/widgets/image-editor.jsx +326 -0
  89. package/src/widgets/input-number-editor.jsx +269 -0
  90. package/src/widgets/interaction/constraint-editor.jsx +147 -0
  91. package/src/widgets/interaction-editor.jsx +1389 -0
  92. package/src/widgets/interactive-graph-editor.jsx +322 -0
  93. package/src/widgets/label-image/__stories__/answer-choices.stories.jsx +81 -0
  94. package/src/widgets/label-image/__stories__/behavior.stories.jsx +32 -0
  95. package/src/widgets/label-image/__stories__/marker.stories.jsx +76 -0
  96. package/src/widgets/label-image/__stories__/question-markers.stories.jsx +106 -0
  97. package/src/widgets/label-image/__stories__/select-image.stories.jsx +60 -0
  98. package/src/widgets/label-image/answer-choices.jsx +231 -0
  99. package/src/widgets/label-image/behavior.jsx +92 -0
  100. package/src/widgets/label-image/marker.jsx +292 -0
  101. package/src/widgets/label-image/question-markers.jsx +181 -0
  102. package/src/widgets/label-image/select-image.jsx +86 -0
  103. package/src/widgets/label-image-editor.jsx +257 -0
  104. package/src/widgets/lights-puzzle-editor.jsx +267 -0
  105. package/src/widgets/matcher-editor.jsx +147 -0
  106. package/src/widgets/matrix-editor.jsx +155 -0
  107. package/src/widgets/measurer-editor.jsx +245 -0
  108. package/src/widgets/molecule-editor.jsx +63 -0
  109. package/src/widgets/number-line-editor.jsx +498 -0
  110. package/src/widgets/numeric-input-editor.jsx +554 -0
  111. package/src/widgets/orderer-editor.jsx +166 -0
  112. package/src/widgets/passage-editor.jsx +115 -0
  113. package/src/widgets/passage-ref-editor.jsx +77 -0
  114. package/src/widgets/passage-ref-target-editor.jsx +47 -0
  115. package/src/widgets/plotter-editor.jsx +537 -0
  116. package/src/widgets/radio/editor.jsx +398 -0
  117. package/src/widgets/reaction-diagram-editor.jsx +127 -0
  118. package/src/widgets/sequence-editor.jsx +205 -0
  119. package/src/widgets/simple-markdown-tester-editor.jsx +84 -0
  120. package/src/widgets/simple-markdown-tester.jsx +91 -0
  121. package/src/widgets/simulator-editor.jsx +144 -0
  122. package/src/widgets/sorter-editor.jsx +100 -0
  123. package/src/widgets/table-editor.jsx +164 -0
  124. package/src/widgets/transformer-editor.jsx +1006 -0
  125. package/src/widgets/unit-editor.jsx +293 -0
  126. package/src/widgets/video-editor.jsx +74 -0
  127. package/src/__tests__/index.test.js +0 -15
@@ -0,0 +1,1339 @@
1
+ // Use this file only for editor styles
2
+ // (changes to the renderer will not work in production)
3
+ //
4
+
5
+ // Variables
6
+ // Should be consistent with webapp's variables.less
7
+
8
+ // Colors
9
+ @grayDarker: #333;
10
+ @gray: #999;
11
+ @grayExtraLight: #eee;
12
+ @grayLighter: #ddd;
13
+ @white: #fff;
14
+
15
+ // Editor Style
16
+ @editorBorderWidth: 1px;
17
+ @editorBorder: @editorBorderWidth solid @grayLighter;
18
+ @editorBorderRadius: 3px;
19
+ @editorPadding: 10px;
20
+
21
+ @widgetBorderWidth: 1px;
22
+ @widgetBorderColor: #ccc;
23
+ @widgetBorder: @widgetBorderWidth solid @widgetBorderColor;
24
+ @widgetBorderRadius: 3px;
25
+
26
+ // Dimensions
27
+ @leftCellWidth: 360px;
28
+ @cellPadding: 30px;
29
+
30
+ // Colors
31
+ @wrongRed: #ffcccc;
32
+ @correctGreen: #aaffaa;
33
+ @ungradedBlue: #d9edf7;
34
+
35
+ .border-box-sizing() {
36
+ -webkit-box-sizing: border-box;
37
+ -moz-box-sizing: border-box;
38
+ box-sizing: border-box;
39
+
40
+ }
41
+
42
+ .size(@width: auto, @height: auto) {
43
+ height: @height;
44
+ width: @width;
45
+ }
46
+
47
+ .position(@position: static, @top: auto, @right: auto, @bottom: auto, @left: auto) {
48
+ position: @position;
49
+ top: @top;
50
+ right: @right;
51
+ bottom: @bottom;
52
+ left: @left;
53
+ }
54
+
55
+ .user-select (@select) {
56
+ -webkit-user-select: @select;
57
+ -khtml-user-drag: @select;
58
+ -khtml-user-select: @select;
59
+ -moz-user-select: @select;
60
+ -ms-user-select: @select;
61
+ user-select: @select;
62
+ }
63
+
64
+ .pod-title {
65
+ background-color: @grayExtraLight;
66
+ border: 1px solid @grayLighter;
67
+ border-bottom: 0;
68
+ font-size: 1.25em;
69
+ padding: 4px 10px;
70
+ border-radius: @editorBorderRadius @editorBorderRadius 0 0;
71
+ &.closed {
72
+ border-radius: @editorBorderRadius;
73
+ }
74
+ }
75
+
76
+ .smiley {
77
+ position: absolute;
78
+ left: 0px;
79
+ top: 4px;
80
+ }
81
+
82
+ //
83
+ // General editor styles
84
+ //
85
+
86
+ .perseus-single-editor {
87
+ box-sizing: border-box;
88
+ width: 100%;
89
+ }
90
+
91
+ .perseus-json-editor {
92
+ width: 100%;
93
+ font-family: monospace;
94
+ height: 500px;
95
+ }
96
+
97
+ .perseus-json-editor.invalid {
98
+ background-color: #ffe6e6;
99
+ }
100
+
101
+ .perseus-textarea-pair {
102
+ border: 1px solid @grayLighter;
103
+ font-size: 12px;
104
+ line-height: 1.6;
105
+ position: relative;
106
+ }
107
+
108
+ .perseus-textarea-pair > .perseus-textarea-underlay {
109
+ color: transparent;
110
+ margin-bottom: 12px;
111
+ padding: @editorPadding;
112
+ white-space: pre-wrap;
113
+ word-wrap: break-word;
114
+ }
115
+
116
+ .perseus-textarea-pair > .perseus-textarea-underlay b {
117
+ font-weight: normal;
118
+ background-color: #dfd;
119
+ }
120
+
121
+ .perseus-textarea-pair > .perseus-textarea-underlay b.selected {
122
+ background-color: #ddf;
123
+ }
124
+
125
+ .perseus-textarea-pair > .perseus-textarea-underlay b.error {
126
+ background-color: #fcc;
127
+ }
128
+
129
+ .perseus-textarea-pair > textarea {
130
+ background: transparent;
131
+ border: 0;
132
+ -moz-box-sizing: border-box;
133
+ -ms-box-sizing: border-box;
134
+ box-sizing: border-box;
135
+ font: inherit;
136
+ height: 100%;
137
+ left: 0;
138
+ overflow: hidden;
139
+ padding: @editorPadding;
140
+ position: absolute;
141
+ resize: none;
142
+ top: 0;
143
+ width: 100%;
144
+ }
145
+
146
+ .perseus-widget-row {
147
+ margin: 7px 0;
148
+ width: 100%;
149
+
150
+ .perseus-widget-left-col,
151
+ .perseus-widget-right-col {
152
+ display: inline-block;
153
+ width: 50%;
154
+
155
+ .range-input {
156
+ float: right;
157
+ margin-right: 5px;
158
+ }
159
+ }
160
+ > .range-input {
161
+ margin-left: 10px;
162
+ }
163
+ }
164
+
165
+ .perseus-answer-options {
166
+ border: @editorBorder;
167
+ padding: @editorPadding;
168
+ }
169
+
170
+ .perseus-answer-widget {
171
+ border: @editorBorder;
172
+ border-radius: 0 0 @editorBorderRadius @editorBorderRadius;
173
+ padding: @editorPadding;
174
+ }
175
+
176
+ .perseus-answer-none {
177
+ & > div {
178
+ display: none;
179
+ }
180
+
181
+ border-bottom: @editorBorder;
182
+ }
183
+
184
+ .perseus-widget-editor {
185
+ border: @editorBorder;
186
+ border-radius: @editorBorderRadius;
187
+ margin-top: 10px;
188
+
189
+ .perseus-widget-editor-title {
190
+ .pod-title;
191
+ border: 0;
192
+ display: flex;
193
+ align-items: center;
194
+ position: relative;
195
+
196
+ :first-child {
197
+ flex-grow: 1;
198
+ }
199
+
200
+ > a {
201
+ color: inherit;
202
+ text-decoration: none;
203
+ }
204
+
205
+ .alignment {
206
+ margin-right: 5px;
207
+ }
208
+
209
+ .simple-button {
210
+ font-size: 13px;
211
+ padding: 0 10px;
212
+ }
213
+ }
214
+
215
+ .perseus-widget-editor-content {
216
+ border-radius: 0 0 @editorBorderRadius @editorBorderRadius;
217
+ border-top: @editorBorder;
218
+ padding: @editorPadding;
219
+ transition: all 0s;
220
+
221
+ &.enter {}
222
+ &.leave {
223
+ display: none;
224
+ }
225
+ }
226
+
227
+ // Are any widgets capable of overflowing in the editor interface?
228
+ .categorizer-container {
229
+ overflow-x: scroll;
230
+ }
231
+
232
+ }
233
+
234
+ .perseus-widget-editor-title-id > svg {
235
+ float: left;
236
+ font-size: 14px;
237
+ margin-right: 10px;
238
+ }
239
+
240
+ .perseus-editor-widgets-selectors {
241
+ background-color: @grayExtraLight;
242
+ border: 1px solid @grayLighter;
243
+ border-top: 0;
244
+ border-radius: 0 0 @editorBorderRadius @editorBorderRadius;
245
+ display: flex;
246
+ flex-wrap: wrap;
247
+ padding: @editorPadding/2;
248
+
249
+ select {
250
+ margin: 2px;
251
+ }
252
+ }
253
+
254
+ .perseus-editor-widgets > div.selected > strong {
255
+ background-color: #ddf;
256
+ }
257
+
258
+ .perseus-editor-widgets .warning {
259
+ background-color: @wrongRed;
260
+ padding: 4px;
261
+ margin: 4px;
262
+ }
263
+
264
+ .perseus-editor-word-count {
265
+ cursor: help;
266
+ flex: 1;
267
+ float: right;
268
+ margin-right: 3px;
269
+ margin-top: 2px;
270
+ text-align: right;
271
+ }
272
+
273
+ //
274
+ // Misc styles
275
+ //
276
+
277
+ .MathJax .math {
278
+ // override athena silliness
279
+ color: inherit;
280
+ }
281
+
282
+ //
283
+ // DOM-based styles that overwrite rules set in khan-exercise.css
284
+ //
285
+
286
+ #perseus {
287
+ margin: 20px;
288
+
289
+ // Question area styles
290
+ #problemarea {
291
+ /* Override the min-height property used for displaying the problem.
292
+ While editing, the size of the editor itself is a better constraint on
293
+ the size of the problemarea, and having a smaller problemarea is nicer
294
+ if it means it aligns better with the editor. */
295
+ min-height: 0;
296
+
297
+ // Force the hint width to take up the width of its containing viewport.
298
+ width: 100%;
299
+
300
+ #workarea {
301
+ margin: 0; // override ke
302
+ }
303
+ }
304
+
305
+ // Space out the question, answer, and hint areas
306
+ .perseus-question-container > div, .perseus-answer-container > div {
307
+ padding-bottom: 25px;
308
+ }
309
+
310
+ // Add radio choice/hint button styles
311
+ .add-choice-container,
312
+ .add-hint-container {
313
+ margin-bottom: 20px;
314
+ text-align: left;
315
+ }
316
+ }
317
+
318
+ //
319
+ // Table styles for Editor/Renderer pairs
320
+ //
321
+
322
+ .perseus-editor-table {
323
+ clear: both;
324
+ display: table;
325
+ table-layout: fixed;
326
+ }
327
+
328
+ .perseus-editor-row {
329
+ display: table-row;
330
+ }
331
+
332
+ .perseus-editor-left-cell {
333
+ display: table-cell;
334
+ padding-right: 30px;
335
+ vertical-align: top;
336
+ width: @leftCellWidth;
337
+ max-width: @leftCellWidth;
338
+ min-width: @leftCellWidth;
339
+ }
340
+
341
+ .perseus-editor-right-cell {
342
+ .border-box-sizing();
343
+ display: table-cell;
344
+ padding: @cellPadding;
345
+ padding-top: 5px;
346
+ vertical-align: top;
347
+ }
348
+
349
+ //
350
+ // Hint Editor
351
+ //
352
+
353
+
354
+ .perseus-hint-editor {
355
+ padding-bottom: 20px;
356
+
357
+ .perseus-single-editor {
358
+ margin-bottom: 5px;
359
+ }
360
+
361
+ .reorder-hints button {
362
+ font-size: 16px;
363
+
364
+ &:hover, &:active {
365
+ color: #000;
366
+ text-decoration: none;
367
+ }
368
+
369
+ &.hidden {
370
+ visibility: hidden;
371
+ }
372
+ }
373
+
374
+ .remove-hint {
375
+ float: right;
376
+ font-size: 13px;
377
+ padding: 0 10px;
378
+ }
379
+ }
380
+
381
+ .perseus-hints-editor {
382
+ .add-hint {
383
+ font-size: 13px;
384
+ }
385
+
386
+ // Prevent double-thick border between question area and hint area
387
+ .perseus-editor-row:first-child .perseus-editor-right-cell {
388
+ border-top: 0;
389
+ }
390
+ }
391
+
392
+ // Only apply borders to hints if they immediately follow a hint-editor
393
+ .perseus-hint-editor + div .perseus-hint-renderer {
394
+ div.paragraph {
395
+ margin: 0px 0px 22px 0px;
396
+ }
397
+
398
+ // Force the hint width to take up the width of its containing viewport.
399
+ width: 100%;
400
+ }
401
+
402
+ // Article Editor
403
+ .perseus-article-editor {
404
+ margin-bottom: 20px;
405
+ margin-top: 20px;
406
+
407
+ .perseus-editor-table {
408
+ margin-left: auto;
409
+ margin-right: auto;
410
+ }
411
+
412
+ .perseus-single-editor {
413
+ margin-bottom: 10px;
414
+ }
415
+
416
+ .section-control-button, .step-control-button {
417
+ font-size: 13px;
418
+ padding: 2px 10px;
419
+ margin: 0 2px;
420
+ }
421
+
422
+ .perseus-editor-left-cell {
423
+ min-width: 360px;
424
+ }
425
+
426
+ .mobile-preview, .desktop-preview,
427
+ .editor-preview, .standalone-preview {
428
+ box-sizing: border-box;
429
+ }
430
+
431
+ .mobile-preview {
432
+ border: 1px solid rgba(0, 0, 0, 0.29);
433
+ // Account for border
434
+ max-width: 322px;
435
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29);
436
+ padding: 32px 16px;
437
+ }
438
+
439
+ .desktop-preview {
440
+ border: 1px solid transparent;
441
+ padding: 32px 20px;
442
+ }
443
+
444
+ .editor-preview {
445
+ display: table-cell;
446
+
447
+ &.full-width {
448
+ width: 100%;
449
+ }
450
+
451
+ .desktop-preview {
452
+ border: 1px solid rgba(0, 0, 0, 0.29);
453
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.29);
454
+ width: 100%;
455
+ }
456
+ }
457
+
458
+ .standalone-preview {
459
+ .mobile-preview, .desktop-preview {
460
+ margin-left: auto;
461
+ margin-right: auto;
462
+ }
463
+ }
464
+
465
+ .json-editor {
466
+ margin: auto;
467
+ max-width: 688px;
468
+ }
469
+
470
+ .perseus-json-editor {
471
+ display: block;
472
+ margin-left: auto;
473
+ margin-right: auto;
474
+ }
475
+
476
+ .json-editor-warning {
477
+ margin-bottom: 10px;
478
+ text-align: center;
479
+ }
480
+
481
+ .bibliotron-article.framework-perseus.perseus-article {
482
+ // Match Bibliotron's .box-sizing-border-box-reset, so that the Perseus
483
+ // editor and webapp behave even more similarly.
484
+ box-sizing: border-box;
485
+ * {
486
+ box-sizing: inherit;
487
+ }
488
+ }
489
+
490
+ .perseus-editor-left-cell > .pod-title {
491
+ // Make section header padding visually match widget editor header padding
492
+ padding: 4px 9px;
493
+ }
494
+ }
495
+
496
+
497
+ //
498
+ // Expression editor
499
+ //
500
+ .perseus-widget-expression-editor {
501
+ .answer-options-list li {
502
+ margin: 5px 0;
503
+ }
504
+
505
+ .answer-status {
506
+ color: inherit;
507
+ cursor: pointer;
508
+ display: inline-block;
509
+ text-align: center;
510
+ text-decoration: none;
511
+ width: 75%; // TODO(joel) 60%?
512
+ .user-select(none);
513
+
514
+ &.wrong {
515
+ background-color: @wrongRed;
516
+ }
517
+
518
+ &.correct {
519
+ background-color: @correctGreen;
520
+ }
521
+
522
+ &.ungraded {
523
+ background-color: @ungradedBlue;
524
+ }
525
+ }
526
+
527
+ .expression-editor-h3 {
528
+ margin: 10px 0 4px;
529
+ }
530
+ }
531
+
532
+
533
+ //
534
+ // Dropdown editor
535
+ //
536
+ .perseus-widget-dropdown {
537
+ input[type=text] {
538
+ border: 1px solid #ccc;
539
+ border-radius: 5px;
540
+ padding: 5px;
541
+
542
+ &.correct {
543
+ background: @correctGreen;
544
+ }
545
+
546
+ &.incorrect {
547
+ background: @wrongRed;
548
+ }
549
+ }
550
+
551
+ .dropdown-choices {
552
+ margin: 20px 0;
553
+
554
+ input[type="text"] {
555
+ margin: 0 5px;
556
+ width: 70%;
557
+ }
558
+ }
559
+
560
+ .dropdown-info {
561
+ float: left;
562
+ }
563
+
564
+ .dropdown-placeholder {
565
+ float: right;
566
+ }
567
+
568
+ .remove-choice {
569
+ margin-bottom: 10px;
570
+ }
571
+ }
572
+
573
+ //
574
+ // Input Number / Text Input
575
+ //
576
+ .perseus-input-number-editor {
577
+ font-size: 14px;
578
+
579
+ .ui-title, .msg-title {
580
+ display: inline-block;
581
+ text-align: center;
582
+ }
583
+
584
+ .ui-title {
585
+ width: 100px;
586
+ }
587
+
588
+ .msg-title {
589
+ margin-left: 5px;
590
+ width: 230px;
591
+ }
592
+
593
+ .options-container {
594
+ padding-left: 30px;
595
+ }
596
+
597
+ .input-answer-editor-value,
598
+ .input-answer-editor-message {
599
+ display: inline-block;
600
+ }
601
+
602
+ .input-answer-editor-value-container {
603
+ border: @widgetBorder;
604
+ border-radius: @widgetBorderRadius;
605
+ float: left;
606
+ .size(100px, 53px);
607
+ overflow: hidden;
608
+ position: relative;
609
+
610
+ .numeric-input-value {
611
+ border: 0;
612
+ font-size: 13px;
613
+ outline-offset: -3px;
614
+ width: 100%;
615
+ }
616
+
617
+ &.with-max-error {
618
+ .numeric-input-value {
619
+ width: 60%;
620
+ }
621
+ }
622
+
623
+ .max-error-container {
624
+ display: inline-block;
625
+ width: 40%;
626
+ .max-error-plusmn {
627
+ cursor: default;
628
+ display: inline-block;
629
+ width: 20%;
630
+ }
631
+ .number-input {
632
+ border: 0;
633
+ font-size: 13px;
634
+ width: 80%;
635
+ }
636
+ }
637
+ }
638
+
639
+ .options-toggle,
640
+ .answer-trash,
641
+ .answer-status {
642
+ height: 26px;
643
+ line-height: 26px;
644
+ outline-offset: -3px;
645
+ vertical-align: middle;
646
+ }
647
+
648
+ .value-divider {
649
+ border-top: @widgetBorder;
650
+ }
651
+
652
+ .options-toggle,
653
+ .answer-trash {
654
+ border-left: @widgetBorder;
655
+ .border-box-sizing();
656
+ cursor: pointer;
657
+ display: inline-block;
658
+ text-align: center;
659
+ text-decoration: none;
660
+ width: 20%;
661
+ }
662
+
663
+ .options-toggle {
664
+ background-color: #eee;
665
+ color: #444;
666
+ &:hover {
667
+ background-color: #ccc;
668
+ }
669
+ }
670
+
671
+ .answer-trash {
672
+ background-color: #C04F03;
673
+ background-image: linear-gradient(to bottom, #E35D04, #C04F03);
674
+ color: #FFF;
675
+ &:hover {
676
+ color: #FFF;
677
+ background-image: linear-gradient(to bottom, #F46E15, #D16014);
678
+ }
679
+ }
680
+
681
+ .is-strict-indicator {
682
+ background-color: @ungradedBlue;
683
+ border-bottom: @widgetBorder;
684
+ border-right: @widgetBorder;
685
+ cursor: default;
686
+ font-size: 16px;
687
+ line-height: 12px;
688
+ .size(12px, 12px);
689
+ text-align: center;
690
+ .position(absolute, 0, auto, auto, 0);
691
+ .user-select(none);
692
+ }
693
+
694
+ .simplify-indicator {
695
+ border-top: @widgetBorder;
696
+ border-right: @widgetBorder;
697
+ cursor: default;
698
+ font-size: 10px;
699
+ line-height: 13px;
700
+ .size(12px, 13px);
701
+ text-align: center;
702
+ .position(absolute, 12px, auto, auto, 0);
703
+ .user-select(none);
704
+
705
+ &.optional {
706
+ background-color: @correctGreen;
707
+ }
708
+ &.enforced {
709
+ background-color: @wrongRed;
710
+ }
711
+ }
712
+
713
+ .answer-status {
714
+ color: inherit;
715
+ display: inline-block;
716
+ text-align: center;
717
+ text-decoration: none;
718
+ width: 60%;
719
+ .user-select(none);
720
+
721
+ &.wrong {
722
+ background-color: @wrongRed;
723
+ }
724
+
725
+ &.correct {
726
+ background-color: @correctGreen;
727
+ }
728
+
729
+ &.ungraded {
730
+ background-color: @ungradedBlue;
731
+ }
732
+ }
733
+
734
+ .input-answer-editor-message {
735
+ margin-left: 5px;
736
+
737
+ .perseus-single-editor{
738
+ font-family: 'Lucida Grande';
739
+ width: 230px;
740
+
741
+ .perseus-textarea-pair > textarea,
742
+ .perseus-textarea-underlay {
743
+ padding: 5px;
744
+ }
745
+
746
+ .perseus-textarea-pair {
747
+ border-color: @widgetBorderColor;
748
+ border-radius: @editorBorderRadius;
749
+ min-height: 53px;
750
+ }
751
+
752
+ .perseus-textarea-underlay {
753
+ margin-bottom: 0; //override
754
+ }
755
+ }
756
+ }
757
+ }
758
+
759
+ //
760
+ // Radio editor / renderer
761
+ //
762
+
763
+ .perseus-widget-radio {
764
+ margin-bottom: 10px;
765
+
766
+ .choice-editor {
767
+ .perseus-single-editor {
768
+ margin-bottom: 0;
769
+ }
770
+ &.correct textarea {
771
+ background: @correctGreen;
772
+ }
773
+ &.incorrect textarea {
774
+ background: @wrongRed;
775
+ }
776
+ }
777
+
778
+ textarea {
779
+ // http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css
780
+ &::-webkit-input-placeholder {
781
+ color: #777;
782
+ }
783
+ &:-moz-placeholder {
784
+ color: #777;
785
+ opacity: 1;
786
+ }
787
+ &::-moz-placeholder {
788
+ color: #777;
789
+ opacity: 1;
790
+ }
791
+ &:-ms-input-placeholder {
792
+ color: #777;
793
+ }
794
+ }
795
+
796
+ .clue-editor {
797
+ .perseus-textarea-pair {
798
+ border-top: 0;
799
+ }
800
+ }
801
+
802
+ .choice-clue-editors,
803
+ .choice-editor,
804
+ .clue-editor {
805
+ display: inline-block;
806
+ }
807
+
808
+ .delete-choice {
809
+ margin-left: 5px;
810
+ padding: 5px;
811
+ }
812
+
813
+ .perseus-single-editor {
814
+ border: 0;
815
+ display: inline-block;
816
+ margin: 0 0 5px;
817
+ vertical-align: top;
818
+ width: 280px;
819
+
820
+ p {margin: 0;}
821
+ }
822
+
823
+ .perseus-textarea-pair,
824
+ .perseus-textarea-underlay {
825
+ display: block;
826
+ }
827
+ }
828
+
829
+ .perseus-widget-radio .perseus-textarea-pair {
830
+ & > textarea, > .perseus-textarea-underlay {
831
+ padding: 5px;
832
+ }
833
+ }
834
+
835
+ .perseus-widget-editor-content {
836
+ .add-choice-container {
837
+ .simple-button {
838
+ margin-right: 10px;
839
+ }
840
+ }
841
+
842
+ .perseus-widget-radio {
843
+ position: static;
844
+
845
+ .checkbox, .delete-choice {
846
+ position: relative;
847
+ top: -10px;
848
+ }
849
+ }
850
+
851
+ .perseus-radio-option.none-of-above {
852
+
853
+ &:before {
854
+ content: 'None of the above';
855
+ display: block;
856
+ font-style: italic;
857
+ font-weight: bold;
858
+ }
859
+
860
+ .choice-editor.incorrect {
861
+ opacity: 0.5;
862
+ }
863
+ }
864
+ }
865
+
866
+ #solutionarea .perseus-widget-radio li {
867
+ padding: 7px 0;
868
+ }
869
+
870
+ //
871
+ // Table of values editor
872
+ //
873
+
874
+ .framework-perseus table.perseus-widget-table-of-values {
875
+ th {
876
+ .perseus-single-editor {
877
+ width: 80px;
878
+ margin-bottom: 6px;
879
+ }
880
+ .perseus-textarea-pair,
881
+ .perseus-single-editor {
882
+ height: 50px;
883
+ }
884
+ }
885
+ }
886
+
887
+ //
888
+ // Categorization Editor
889
+ //
890
+
891
+ .categorization-container.categorization-container-editor {
892
+ @categoryWidth: 160px;
893
+ width: 350px;
894
+ margin-bottom: 160px;
895
+
896
+ .card input {
897
+ margin: 7px 3px 7px 13px;
898
+ font-size: 12px;
899
+ display: block;
900
+ width: 81%;
901
+ }
902
+
903
+
904
+ .category {
905
+ float: left;
906
+ padding: 5px;
907
+ width: @categoryWidth;
908
+ }
909
+ .categories {
910
+ width: (@categoryWidth + 16px);
911
+ }
912
+
913
+ .perseus-textarea-underlay {
914
+ margin-bottom: 0;
915
+ }
916
+
917
+ .drag-bar {
918
+ float: left;
919
+ font-size: 10px;
920
+ padding: 2px 0;
921
+ height: 70%;
922
+ margin-top: 3px;
923
+ }
924
+ .header {
925
+ margin-bottom: 8px;
926
+ input {
927
+ display: block;
928
+ margin-right: 24px;
929
+ width: 76%;
930
+ }
931
+ .remove {
932
+ position: relative;
933
+ top: -14px;
934
+ left: 12px;
935
+ float: right;
936
+ width: 20px;
937
+ height: 20px;
938
+ padding: 2px;
939
+ color: #666;
940
+ &:hover {
941
+ color: @grayDarker;
942
+ }
943
+ cursor: pointer;
944
+ }
945
+ }
946
+ .delete-item-area {
947
+ position: absolute;
948
+ width: 150px;
949
+ height: 60px;
950
+ padding-top: 40px;
951
+ bottom: -150px;
952
+ left: 10px;
953
+ border: dashed 2px #888;
954
+ color: #888;
955
+ &.target {
956
+ border-color: black;
957
+ color: @grayDarker;
958
+ }
959
+ text-align: center;
960
+ font-size: 20px;
961
+ }
962
+ .card {
963
+ width: (@categoryWidth - 30px);
964
+ padding: 0;
965
+ &.dragging .drag-bar {
966
+ margin-left: 2px;
967
+ }
968
+ }
969
+ }
970
+
971
+ .categorization-editor-area {
972
+ height: 30px;
973
+
974
+ .add-item {
975
+ float: left;
976
+ margin-left: 17px;
977
+ }
978
+
979
+ .add-category {
980
+ margin-left: 173px;
981
+ }
982
+ }
983
+
984
+ //
985
+ // Graph Editor
986
+ //
987
+
988
+ .perseus-widget-interactive-graph {
989
+ display: block;
990
+ }
991
+
992
+ //
993
+ // Plot Editor
994
+ //
995
+
996
+ .perseus-widget-plotter-editor {
997
+ .plotter-categories, .pic-url {
998
+ width: 70%;
999
+ }
1000
+ }
1001
+
1002
+ //
1003
+ // Text List Editors (Orderer, Matcher, Sorter)
1004
+ //
1005
+ .perseus-text-list-editor {
1006
+ input[type=text] {
1007
+ padding: 3px;
1008
+ margin-right: 5px;
1009
+ min-width: 20px;
1010
+ max-width: 340px;
1011
+ }
1012
+
1013
+ &.layout-horizontal input[type=text] {
1014
+ float: left;
1015
+ }
1016
+ }
1017
+
1018
+ .perseus-matcher-editor {
1019
+ .perseus-text-list-editor {
1020
+ float: left;
1021
+ max-width: 50%;
1022
+
1023
+ input[type=text] {
1024
+ max-width: 90%;
1025
+ }
1026
+ }
1027
+
1028
+ input[type=text] {
1029
+ width: 46%;
1030
+ }
1031
+
1032
+ input[type=text] + input[type=text] {
1033
+ margin-left: 2%;
1034
+ }
1035
+ }
1036
+
1037
+ // Info-tip lives in react-components but these styles are perseus-specific.
1038
+ .info-tip {
1039
+ display: inline-block;
1040
+ }
1041
+
1042
+ .info-tip-content-container p {
1043
+ font-size: 12px;
1044
+ line-height: 1.4;
1045
+ margin: 0;
1046
+ }
1047
+
1048
+ .info-tip-content-container p + p {
1049
+ margin-top: 22px;
1050
+ }
1051
+
1052
+ .expression-answer-option {
1053
+ border: 1px solid #ddd;
1054
+ border-radius: 3px;
1055
+
1056
+ .answer-handle {
1057
+ // textured draggy handle
1058
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==) no-repeat 50% 50%;
1059
+ border-right: 1px solid #ddd;
1060
+ cursor: move;
1061
+ display: table-cell;
1062
+ width: 20px;
1063
+ }
1064
+
1065
+ .answer-body {
1066
+ display: table-cell;
1067
+ }
1068
+
1069
+ .answer-considered {
1070
+ display: table;
1071
+ }
1072
+
1073
+ .answer-expression {
1074
+ display: table-cell;
1075
+ }
1076
+
1077
+ .answer-status {
1078
+ display: table-cell;
1079
+ width: 100px;
1080
+ }
1081
+
1082
+ .answer-option {
1083
+ padding-left: 5px;
1084
+ }
1085
+
1086
+ .remove-container {
1087
+ padding: 5px;
1088
+
1089
+ button {
1090
+ width: 100%;
1091
+ }
1092
+ }
1093
+
1094
+ .perseus-math-input{
1095
+ width: 236px;
1096
+
1097
+ .mq-root-block {
1098
+ border-top: none;
1099
+ border-right: none;
1100
+ border-bottom: 1px solid #ddd !important;
1101
+ border-left: 1px solid #ddd !important;
1102
+ }
1103
+ }
1104
+ }
1105
+
1106
+ //
1107
+ // Interaction Editor
1108
+ //
1109
+
1110
+ .perseus-widget-interaction-editor {
1111
+ .perseus-widget-interaction-editor-select-element {
1112
+ background-color: #eee;
1113
+ border: 1px solid #ddd;
1114
+ border-top: 0;
1115
+ border-radius: 0 0 3px 3px;
1116
+ padding: 5px 10px;
1117
+ margin: 20px -11px -11px -11px;
1118
+ }
1119
+
1120
+ .colorpicker-circle {
1121
+ border-radius: 50%;
1122
+ width: 14px;
1123
+ height: 14px;
1124
+ position: absolute;
1125
+ left: 5px;
1126
+ top: 5px;
1127
+ }
1128
+ }
1129
+
1130
+ .perseus-interaction-element {
1131
+ border: @editorBorder;
1132
+ border-radius: @editorBorderRadius;
1133
+
1134
+ .perseus-interaction-element-title {
1135
+ .pod-title;
1136
+ border: 0;
1137
+ color: inherit;
1138
+ display: block;
1139
+ text-decoration: none;
1140
+ white-space: nowrap;
1141
+ font-size: 1em;
1142
+
1143
+ overflow: hidden;
1144
+
1145
+ > svg {
1146
+ float: left;
1147
+ font-size: 14px;
1148
+ margin-right: 10px;
1149
+ }
1150
+ }
1151
+
1152
+ .perseus-interaction-element-content {
1153
+ border-radius: 0 0 @editorBorderRadius @editorBorderRadius;
1154
+ border-top: @editorBorder;
1155
+ padding: @editorPadding;
1156
+
1157
+ .edit-controls {
1158
+ text-align: right;
1159
+ margin-top: -30px;
1160
+ > button {
1161
+ background: #fff;
1162
+ border: 0;
1163
+ cursor: pointer;
1164
+ padding: 0;
1165
+ margin-left: 7px;
1166
+ font-size: 18px;
1167
+ color: #555;
1168
+ }
1169
+ }
1170
+
1171
+ &.enter {}
1172
+ &.leave {
1173
+ display: none;
1174
+ }
1175
+ }
1176
+ }
1177
+
1178
+ .button-set-label {
1179
+ display: block;
1180
+ }
1181
+
1182
+ // Float the first one left because it has a suboption.
1183
+ // This is a minor hack.
1184
+ .button-set-label-float {
1185
+ display: block;
1186
+ float: left;
1187
+ margin-right: 10px;
1188
+ }
1189
+
1190
+ .button-set-separator {
1191
+ margin: 10px 0;
1192
+ }
1193
+
1194
+ // Don't allow selection on this label because I found it very easy to select
1195
+ // (don't know why...) which caused the selection to not actually be made.
1196
+ // I know this is autoprefixed in prod, but I want it to work in the perseus
1197
+ // repo.
1198
+ .show-div-button {
1199
+ -webkit-user-select: none;
1200
+ -moz-user-select: none;
1201
+ -ms-user-select: none;
1202
+ user-select: none;
1203
+ }
1204
+
1205
+ // double selector for specificity
1206
+ .perseus-widget-editor .unit-radio {
1207
+ color: black;
1208
+ text-decoration: none;
1209
+ }
1210
+
1211
+ .unit-example-not-okay {
1212
+ color: red;
1213
+ }
1214
+
1215
+ .unit-example-okay {
1216
+ color: green;
1217
+ }
1218
+
1219
+ .pair-editor input {
1220
+ width: 120px;
1221
+ }
1222
+
1223
+ .marvel-device.iphone6.silver:after {
1224
+ z-index: 1;
1225
+ }
1226
+
1227
+ .perseus-diff {
1228
+ @borderColor: #E4E4E4;
1229
+ margin: 0 10px;
1230
+
1231
+ .diff-header {
1232
+ font-size: 18px;
1233
+ padding: 10px 0;
1234
+ width: 50%;
1235
+ display: inline-block;
1236
+ &.collapsed {
1237
+ font-size: 14px;
1238
+ padding: 0px;
1239
+ }
1240
+ }
1241
+
1242
+ .diff-body {
1243
+ border-top: 1px solid @borderColor;
1244
+ border-bottom: 1px solid @borderColor;
1245
+ }
1246
+
1247
+ .diff-row {
1248
+ width: 50%;
1249
+ white-space: pre-wrap;
1250
+ box-sizing: border-box;
1251
+ -moz-box-sizing: border-box;
1252
+ font-size: 14px;
1253
+ padding-right: 20px;
1254
+ padding-left: 10px;
1255
+ overflow: hidden;
1256
+ &.collapsed {
1257
+ color: #888;
1258
+ cursor: pointer;
1259
+ &:hover {
1260
+ color: #666;
1261
+ }
1262
+
1263
+ &:active {
1264
+ color: #444;
1265
+ }
1266
+ }
1267
+
1268
+ .diff-line {
1269
+ margin-bottom: 20px;
1270
+ }
1271
+ }
1272
+
1273
+ .before {
1274
+ float: left;
1275
+ border-left: 1px solid @borderColor;
1276
+ }
1277
+
1278
+ .after {
1279
+ float: right;
1280
+ border-right: 1px solid @borderColor;
1281
+ border-left: 1px solid @borderColor;
1282
+ }
1283
+
1284
+ .inner-value {
1285
+ height: 100%;
1286
+ padding: 3px;
1287
+ }
1288
+
1289
+ .not-present {
1290
+ display: none;
1291
+ }
1292
+
1293
+ .blank-space {
1294
+ visibility: hidden;
1295
+ }
1296
+
1297
+
1298
+ .added {
1299
+ background-color: #EEFFEE;
1300
+ &.dark {
1301
+ background-color: #AAFFAA;
1302
+ }
1303
+ }
1304
+
1305
+ .removed {
1306
+ background-color: #FFEEEE;
1307
+ &.dark {
1308
+ background-color: #FFAAAA;
1309
+ }
1310
+ }
1311
+
1312
+ .image {
1313
+ display: inline-block;
1314
+ margin-left: 20px;
1315
+ margin-bottom: 10px;
1316
+
1317
+ &, > div, > img {
1318
+ max-height: 300px;
1319
+ max-width: 100%;
1320
+ }
1321
+ }
1322
+
1323
+ .image-unchanged {
1324
+ border: 1px solid #AAAAAA;
1325
+ }
1326
+
1327
+ .image-added {
1328
+ border: 2px solid #AAFFAA;
1329
+ }
1330
+
1331
+ .image-removed {
1332
+ border: 2px solid #FFAAAA;
1333
+ }
1334
+
1335
+ .diff-separator {
1336
+ border-bottom: 1px dashed #444;
1337
+ margin: 30px 0 10px 0;
1338
+ }
1339
+ }