@khanacademy/perseus-editor 4.1.4 → 4.1.6

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