@khanacademy/perseus 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/es/index.css +3 -67
- package/dist/es/index.js +67 -102
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +3 -67
- package/dist/index.js +67 -102
- package/dist/index.js.map +1 -1
- package/package.json +34 -34
- package/src/components/graph.jsx +0 -2
- package/src/components/math-input.jsx +163 -152
- package/src/components/tex-buttons.jsx +7 -9
- package/src/components/tooltip.jsx +0 -3
- package/src/components/zoomable.jsx +0 -10
- package/src/interactive2/movable-point.jsx +0 -4
- package/src/interactive2/wrapped-ellipse.js +0 -1
- package/src/styles/articles.less +6 -5
- package/src/styles/khan-exercise.css +1 -33
- package/src/styles/perseus-renderer.less +1 -10
- package/src/styles/widgets/expression.less +0 -2
- package/src/styles/widgets/orderer.less +1 -1
- package/src/styles/widgets/plotter.less +0 -4
- package/src/styles/widgets/sortable.less +0 -14
- package/src/widget-container.jsx +4 -0
- package/src/widgets/__stories__/definition.stories.jsx +27 -1
- package/src/widgets/__tests__/__snapshots__/definition_test.js.snap +2 -2
- package/src/widgets/__tests__/__snapshots__/number-line_test.jsx.snap +1 -1
- package/src/widgets/__tests__/__snapshots__/video_test.jsx.snap +2 -2
- package/src/widgets/simulator.jsx +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @khanacademy/perseus
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2c843b38: Update to use wonder-blocks deps after migrating wonder-blocks to TS
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [2c843b38]
|
|
12
|
+
- @khanacademy/math-input@0.6.8
|
|
13
|
+
|
|
14
|
+
## 2.0.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 6272dfbe: Bugfix for definition prompt size in articles
|
|
19
|
+
|
|
3
20
|
## 2.0.0
|
|
4
21
|
|
|
5
22
|
### Major Changes
|
package/dist/es/index.css
CHANGED
|
@@ -16,8 +16,6 @@ div.subhint {
|
|
|
16
16
|
border: 1px solid #aaaaaa;
|
|
17
17
|
background: #f9f9f9;
|
|
18
18
|
display: none;
|
|
19
|
-
-moz-border-radius: 4px;
|
|
20
|
-
-webkit-border-radius: 4px;
|
|
21
19
|
border-radius: 4px;
|
|
22
20
|
margin-left: 20px;
|
|
23
21
|
margin-right: 20px;
|
|
@@ -39,8 +37,6 @@ div.definition {
|
|
|
39
37
|
border: 1px solid #aaaaaa;
|
|
40
38
|
background: #f9f9f9;
|
|
41
39
|
display: none;
|
|
42
|
-
-moz-border-radius: 4px;
|
|
43
|
-
-webkit-border-radius: 4px;
|
|
44
40
|
border-radius: 4px;
|
|
45
41
|
margin-left: 20px;
|
|
46
42
|
margin-right: 20px;
|
|
@@ -152,9 +148,6 @@ body.debug .graphie { outline: 1px dashed #fdd; }
|
|
|
152
148
|
padding-bottom: 40px;
|
|
153
149
|
}
|
|
154
150
|
#scratchpad div {
|
|
155
|
-
-moz-box-sizing: border-box;
|
|
156
|
-
-ms-box-sizing: border-box;
|
|
157
|
-
-webkit-box-sizing: border-box;
|
|
158
151
|
box-sizing: border-box;
|
|
159
152
|
border: 1px solid #ccc;
|
|
160
153
|
height: 100%;
|
|
@@ -232,7 +225,6 @@ body.debug .graphie { outline: 1px dashed #fdd; }
|
|
|
232
225
|
|
|
233
226
|
#answer_area .calculator .history input {
|
|
234
227
|
box-sizing: border-box;
|
|
235
|
-
-moz-box-sizing: border-box;
|
|
236
228
|
display: block;
|
|
237
229
|
font: inherit;
|
|
238
230
|
margin: 5px 3px 3px;
|
|
@@ -362,8 +354,6 @@ body.debug .graphie { outline: 1px dashed #fdd; }
|
|
|
362
354
|
list-style: none;
|
|
363
355
|
border: 1px solid rgba(0, 0, 0, 0.3);
|
|
364
356
|
padding-left: 10px;
|
|
365
|
-
-moz-border-radius: 5px;
|
|
366
|
-
-webkit-border-radius: 5px;
|
|
367
357
|
border-radius: 5px;
|
|
368
358
|
line-height: 22px;
|
|
369
359
|
margin-bottom: 3px;
|
|
@@ -407,8 +397,6 @@ var, div.graphie {
|
|
|
407
397
|
padding: 2px 5px;
|
|
408
398
|
border: 1px solid #999;
|
|
409
399
|
border-radius: 4px;
|
|
410
|
-
-webkit-border-radius: 4px;
|
|
411
|
-
-moz-border-radius: 4px;
|
|
412
400
|
float: left;
|
|
413
401
|
cursor: pointer;
|
|
414
402
|
color: white;
|
|
@@ -606,7 +594,7 @@ html.exercise-browser {
|
|
|
606
594
|
top: 12px;
|
|
607
595
|
padding: 0px;
|
|
608
596
|
border: none;
|
|
609
|
-
|
|
597
|
+
box-shadow: none;
|
|
610
598
|
overflow: visible;
|
|
611
599
|
}
|
|
612
600
|
|
|
@@ -729,9 +717,6 @@ html.exercise-browser {
|
|
|
729
717
|
|
|
730
718
|
#timelinecontainer .simple-button {
|
|
731
719
|
-webkit-user-select: none;
|
|
732
|
-
-khtml-user-select: none;
|
|
733
|
-
-moz-user-select: none;
|
|
734
|
-
-o-user-select: none;
|
|
735
720
|
user-select: none;
|
|
736
721
|
white-space: nowrap;
|
|
737
722
|
}
|
|
@@ -754,8 +739,6 @@ html.exercise-browser {
|
|
|
754
739
|
width: 200px;
|
|
755
740
|
height: 100px;
|
|
756
741
|
border: 1px solid #aaa;
|
|
757
|
-
-webkit-box-shadow: 0 0 3px #ccc;
|
|
758
|
-
-moz-box-shadow: 0 0 3px #ccc;
|
|
759
742
|
box-shadow: 0 0 3px #ccc;
|
|
760
743
|
margin-left: 14px; /* to line up with other titles */
|
|
761
744
|
margin-bottom: 8px;
|
|
@@ -800,8 +783,6 @@ html.exercise-browser {
|
|
|
800
783
|
z-index: 2;
|
|
801
784
|
|
|
802
785
|
box-shadow: 0 1px 2px #ccc;
|
|
803
|
-
-moz-box-shadow: 0 1px 2px #ccc;
|
|
804
|
-
-webkit-box-shadow: 0 1px 2px #ccc;
|
|
805
786
|
}
|
|
806
787
|
|
|
807
788
|
.sortable > ul {
|
|
@@ -813,8 +794,6 @@ html.exercise-browser {
|
|
|
813
794
|
border: 1px solid #b9b9b9;
|
|
814
795
|
border-bottom-color: #939393;
|
|
815
796
|
border-radius: 4px;
|
|
816
|
-
-moz-border-radius: 4px;
|
|
817
|
-
-webkit-border-radius: 4px;
|
|
818
797
|
cursor: pointer;
|
|
819
798
|
margin-right: 4px;
|
|
820
799
|
min-width: 65px;
|
|
@@ -823,9 +802,6 @@ html.exercise-browser {
|
|
|
823
802
|
font-size: 1.2em;
|
|
824
803
|
float: left;
|
|
825
804
|
-webkit-user-select: none;
|
|
826
|
-
-khtml-user-select: none;
|
|
827
|
-
-moz-user-select: none;
|
|
828
|
-
-o-user-select: none;
|
|
829
805
|
user-select: none;
|
|
830
806
|
}
|
|
831
807
|
|
|
@@ -844,10 +820,6 @@ html.exercise-browser {
|
|
|
844
820
|
.sortable > ul > li:hover {
|
|
845
821
|
border-color: #ffa500;
|
|
846
822
|
box-shadow: 0 0 4px #c56f00;
|
|
847
|
-
-moz-box-shadow: 0 0 4px #c56f00;
|
|
848
|
-
-ms-box-shadow: 0 0 4px #c56f00;
|
|
849
|
-
-o-box-shadow: 0 0 4px #c56f00;
|
|
850
|
-
-webkit-box-shadow: 0 0 4px #c56f00;
|
|
851
823
|
}
|
|
852
824
|
|
|
853
825
|
.sortable > ul > li:active, .sortable > ul > li.dragging {
|
|
@@ -861,8 +833,6 @@ html.exercise-browser {
|
|
|
861
833
|
border: 0;
|
|
862
834
|
border-bottom: 0;
|
|
863
835
|
box-shadow: 0 0 0;
|
|
864
|
-
-moz-box-shadow: 0 0 0;
|
|
865
|
-
-webkit-box-shadow: 0 0 0;
|
|
866
836
|
padding-right: 0;
|
|
867
837
|
}
|
|
868
838
|
|
|
@@ -895,8 +865,6 @@ html.exercise-browser {
|
|
|
895
865
|
.qhint {
|
|
896
866
|
border: 1px solid #aaaaaa;
|
|
897
867
|
background: #f9f9f9;
|
|
898
|
-
-moz-border-radius: 4px;
|
|
899
|
-
-webkit-border-radius: 4px;
|
|
900
868
|
border-radius: 4px;
|
|
901
869
|
margin-right: 20px;
|
|
902
870
|
margin-bottom: 20px;
|
|
@@ -1360,7 +1328,7 @@ body.mobile ul.inequalities-one-line-radios > li {
|
|
|
1360
1328
|
margin: 0;
|
|
1361
1329
|
max-width: none;
|
|
1362
1330
|
}
|
|
1363
|
-
.bibliotron-article.framework-perseus.perseus-article:not(.perseus-mobile) .perseus-widget-container {
|
|
1331
|
+
.bibliotron-article.framework-perseus.perseus-article:not(.perseus-mobile) .perseus-widget-container:not(.perseus-widget__definition) {
|
|
1364
1332
|
font-size: 14px;
|
|
1365
1333
|
line-height: 19.6px;
|
|
1366
1334
|
}
|
|
@@ -2183,8 +2151,6 @@ img.zoom-img {
|
|
|
2183
2151
|
cursor: -moz-zoom-out;
|
|
2184
2152
|
}
|
|
2185
2153
|
.zoom-transition {
|
|
2186
|
-
-webkit-transition: transform 300ms ease;
|
|
2187
|
-
-ms-transition: transform 300ms ease;
|
|
2188
2154
|
transition: transform 300ms ease;
|
|
2189
2155
|
}
|
|
2190
2156
|
.zoom-overlay {
|
|
@@ -2214,8 +2180,6 @@ img.zoom-img {
|
|
|
2214
2180
|
bottom: 0;
|
|
2215
2181
|
background: white;
|
|
2216
2182
|
opacity: 0;
|
|
2217
|
-
-webkit-transition: opacity 300ms;
|
|
2218
|
-
-ms-transition: opacity 300ms;
|
|
2219
2183
|
transition: opacity 300ms;
|
|
2220
2184
|
}
|
|
2221
2185
|
.zoom-overlay-open > .zoom-backdrop {
|
|
@@ -2228,10 +2192,7 @@ img.zoom-img {
|
|
|
2228
2192
|
margin-top: 48px;
|
|
2229
2193
|
}
|
|
2230
2194
|
.no-select {
|
|
2231
|
-
-moz-user-select: -moz-none;
|
|
2232
|
-
-khtml-user-select: none;
|
|
2233
2195
|
-webkit-user-select: none;
|
|
2234
|
-
-o-user-select: none;
|
|
2235
2196
|
user-select: none;
|
|
2236
2197
|
}
|
|
2237
2198
|
.blank-background {
|
|
@@ -2252,10 +2213,7 @@ img.zoom-img {
|
|
|
2252
2213
|
background: #ffffff;
|
|
2253
2214
|
}
|
|
2254
2215
|
.graphie {
|
|
2255
|
-
-moz-user-select: -moz-none;
|
|
2256
|
-
-khtml-user-select: none;
|
|
2257
2216
|
-webkit-user-select: none;
|
|
2258
|
-
-o-user-select: none;
|
|
2259
2217
|
user-select: none;
|
|
2260
2218
|
}
|
|
2261
2219
|
.perseus-interactive,
|
|
@@ -2645,8 +2603,6 @@ body.mobile .categorizer-container td.category input[type="radio"] + span:active
|
|
|
2645
2603
|
overflow-y: hidden;
|
|
2646
2604
|
}
|
|
2647
2605
|
.perseus-widget-expression-old > .output > .placeholder > .error {
|
|
2648
|
-
-webkit-border-radius: 10px;
|
|
2649
|
-
-moz-border-radius: 10px;
|
|
2650
2606
|
border-radius: 10px;
|
|
2651
2607
|
background: #f7f7f7;
|
|
2652
2608
|
border: 1px solid #ddd;
|
|
@@ -2941,6 +2897,7 @@ body.mobile .perseus-matrix .math-output {
|
|
|
2941
2897
|
padding: 0 10px;
|
|
2942
2898
|
cursor: pointer;
|
|
2943
2899
|
position: relative;
|
|
2900
|
+
-webkit-user-select: none;
|
|
2944
2901
|
user-select: none;
|
|
2945
2902
|
width: auto;
|
|
2946
2903
|
display: flex;
|
|
@@ -2988,7 +2945,6 @@ body.mobile .perseus-matrix .math-output {
|
|
|
2988
2945
|
.orderer.layout-vertical .bank,
|
|
2989
2946
|
.orderer.layout-vertical .draggable-box {
|
|
2990
2947
|
box-sizing: border-box;
|
|
2991
|
-
-moz-box-sizing: border-box;
|
|
2992
2948
|
float: left;
|
|
2993
2949
|
max-width: 50%;
|
|
2994
2950
|
}
|
|
@@ -3095,11 +3051,7 @@ body.sat-section .perseus-widget-passage {
|
|
|
3095
3051
|
position: absolute;
|
|
3096
3052
|
}
|
|
3097
3053
|
.perseus-widget-plotter span.rotate {
|
|
3098
|
-
-moz-transform: rotate(-90deg);
|
|
3099
|
-
-o-transform: rotate(-90deg);
|
|
3100
|
-
-webkit-transform: rotate(-90deg);
|
|
3101
3054
|
transform: rotate(-90deg);
|
|
3102
|
-
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
|
|
3103
3055
|
}
|
|
3104
3056
|
.set-from-scale-box {
|
|
3105
3057
|
border: 2px solid #EEEEEE;
|
|
@@ -3192,8 +3144,6 @@ body.sat-section .perseus-widget-passage {
|
|
|
3192
3144
|
border: 1px solid #ccc;
|
|
3193
3145
|
border-bottom: 1px solid #aaa;
|
|
3194
3146
|
box-shadow: 0 1px 2px #ccc;
|
|
3195
|
-
-moz-box-shadow: 0 1px 2px #ccc;
|
|
3196
|
-
-webkit-box-shadow: 0 1px 2px #ccc;
|
|
3197
3147
|
}
|
|
3198
3148
|
.draggy-boxy-thing .cards-area {
|
|
3199
3149
|
position: relative;
|
|
@@ -3206,12 +3156,6 @@ body.sat-section .perseus-widget-passage {
|
|
|
3206
3156
|
border: 1px solid #b9b9b9;
|
|
3207
3157
|
border-bottom-color: #939393;
|
|
3208
3158
|
border-radius: 4px;
|
|
3209
|
-
-moz-border-radius: 4px;
|
|
3210
|
-
-webkit-border-radius: 4px;
|
|
3211
|
-
-webkit-user-select: none;
|
|
3212
|
-
-khtml-user-select: none;
|
|
3213
|
-
-moz-user-select: none;
|
|
3214
|
-
-o-user-select: none;
|
|
3215
3159
|
cursor: pointer;
|
|
3216
3160
|
touch-action: none;
|
|
3217
3161
|
}
|
|
@@ -3242,8 +3186,6 @@ body.sat-section .perseus-widget-passage {
|
|
|
3242
3186
|
border: 1px solid #b9b9b9;
|
|
3243
3187
|
border-bottom-color: #939393;
|
|
3244
3188
|
border-radius: 4px;
|
|
3245
|
-
-moz-border-radius: 4px;
|
|
3246
|
-
-webkit-border-radius: 4px;
|
|
3247
3189
|
height: 100%;
|
|
3248
3190
|
width: 100%;
|
|
3249
3191
|
z-index: -1;
|
|
@@ -3254,10 +3196,6 @@ body.sat-section .perseus-widget-passage {
|
|
|
3254
3196
|
.draggy-boxy-thing .card:hover {
|
|
3255
3197
|
border-color: #ffa500;
|
|
3256
3198
|
box-shadow: 0 0 4px #c78100;
|
|
3257
|
-
-moz-box-shadow: 0 0 4px #c78100;
|
|
3258
|
-
-ms-box-shadow: 0 0 4px #c78100;
|
|
3259
|
-
-o-box-shadow: 0 0 4px #c78100;
|
|
3260
|
-
-webkit-box-shadow: 0 0 4px #c78100;
|
|
3261
3199
|
}
|
|
3262
3200
|
.perseus-sortable div.paragraph {
|
|
3263
3201
|
margin: 0;
|
|
@@ -3359,8 +3297,6 @@ body.mobile .framework-perseus table.perseus-widget-table-of-values.non-markdown
|
|
|
3359
3297
|
transition: all 0.15s;
|
|
3360
3298
|
}
|
|
3361
3299
|
.perseus-widget-container.widget-highlight {
|
|
3362
|
-
-webkit-box-shadow: 0px 0px 0px 2px #ffa500;
|
|
3363
|
-
-moz-box-shadow: 0px 0px 0px 2px #ffa500;
|
|
3364
3300
|
box-shadow: 0px 0px 0px 2px #ffa500;
|
|
3365
3301
|
transition: all 0.15s;
|
|
3366
3302
|
}
|
package/dist/es/index.js
CHANGED
|
@@ -10529,7 +10529,6 @@ var WrappedEllipse = function WrappedEllipse(graphie, center, radii, options) {
|
|
|
10529
10529
|
if (options.shadow) {
|
|
10530
10530
|
var filter = "drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5))";
|
|
10531
10531
|
var wrapper = this.wrapper;
|
|
10532
|
-
wrapper.style.webkitFilter = filter;
|
|
10533
10532
|
wrapper.style.filter = filter;
|
|
10534
10533
|
|
|
10535
10534
|
this.moveTo = function (point) {
|
|
@@ -14988,7 +14987,6 @@ _.extend(MovablePoint$5.prototype, {
|
|
|
14988
14987
|
|
|
14989
14988
|
if (state.shadow) {
|
|
14990
14989
|
var filter = "none";
|
|
14991
|
-
svgElem.style.webkitFilter = filter;
|
|
14992
14990
|
svgElem.style.filter = filter;
|
|
14993
14991
|
}
|
|
14994
14992
|
|
|
@@ -15008,7 +15006,6 @@ _.extend(MovablePoint$5.prototype, {
|
|
|
15008
15006
|
if (state.shadow) {
|
|
15009
15007
|
var content = svgElem.getElementsByClassName("tooltip-content")[0];
|
|
15010
15008
|
var _filter = "drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5))";
|
|
15011
|
-
content.style.webkitFilter = _filter;
|
|
15012
15009
|
content.style.filter = _filter;
|
|
15013
15010
|
}
|
|
15014
15011
|
}
|
|
@@ -15052,7 +15049,6 @@ _.extend(MovablePoint$5.prototype, {
|
|
|
15052
15049
|
|
|
15053
15050
|
if (state.shadow) {
|
|
15054
15051
|
var filter = "drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5))";
|
|
15055
|
-
svgElem.style.webkitFilter = filter;
|
|
15056
15052
|
svgElem.style.filter = filter;
|
|
15057
15053
|
}
|
|
15058
15054
|
|
|
@@ -15067,7 +15063,6 @@ _.extend(MovablePoint$5.prototype, {
|
|
|
15067
15063
|
// tooltips.
|
|
15068
15064
|
showTrashTooltip();
|
|
15069
15065
|
var content = svgElem.getElementsByClassName("tooltip-content")[0];
|
|
15070
|
-
content.style.webkitFilter = "none";
|
|
15071
15066
|
content.style.filter = "none";
|
|
15072
15067
|
|
|
15073
15068
|
this._tooltip.firstChild.addEventListener("touchstart", e => {
|
|
@@ -17599,14 +17594,8 @@ class Zoomable extends React.Component {
|
|
|
17599
17594
|
|
|
17600
17595
|
var transitionStyle = visible ? {
|
|
17601
17596
|
transitionProperty: property,
|
|
17602
|
-
WebkitTransitionProperty: property,
|
|
17603
|
-
msTransitionProperty: property,
|
|
17604
17597
|
transitionDuration: "0.3s",
|
|
17605
|
-
|
|
17606
|
-
msTransitionDuration: "0.3s",
|
|
17607
|
-
transitionTimingFunction: "ease-out",
|
|
17608
|
-
WebkitTransitionTimingfunction: "ease-out",
|
|
17609
|
-
msTransitionTmingFunction: "ease-out"
|
|
17598
|
+
transitionTimingFunction: "ease-out"
|
|
17610
17599
|
} : {}; // Do a fancy little slide as we fade the contents in the first time.
|
|
17611
17600
|
|
|
17612
17601
|
var translateOffset = visible ? "" : " translate(0, 8px)";
|
|
@@ -17618,11 +17607,7 @@ class Zoomable extends React.Component {
|
|
|
17618
17607
|
width: "100%",
|
|
17619
17608
|
height: zoomed ? expandedHeight : compactHeight,
|
|
17620
17609
|
transform: transform,
|
|
17621
|
-
WebkitTransform: transform,
|
|
17622
|
-
msTransform: transform,
|
|
17623
17610
|
transformOrigin: "0 0",
|
|
17624
|
-
WebkitTransformOrigin: "0 0",
|
|
17625
|
-
msTransformOrigin: "0 0",
|
|
17626
17611
|
opacity: visible ? 1 : 0,
|
|
17627
17612
|
WebkitTapHighlightColor: "transparent"
|
|
17628
17613
|
}, transitionStyle);
|
|
@@ -19221,7 +19206,11 @@ class WidgetContainer extends React.Component {
|
|
|
19221
19206
|
var className = classNames({
|
|
19222
19207
|
"perseus-widget-container": true,
|
|
19223
19208
|
"widget-highlight": this.props.shouldHighlight,
|
|
19224
|
-
"widget-nohighlight": !this.props.shouldHighlight
|
|
19209
|
+
"widget-nohighlight": !this.props.shouldHighlight,
|
|
19210
|
+
// HACK(matthewc): perseus-widget-container is setting a font-size
|
|
19211
|
+
// but we want the definition prompt to match the surrounding font
|
|
19212
|
+
// I'm sorry, but there's a time crunch
|
|
19213
|
+
"perseus-widget__definition": this.props.type === "definition"
|
|
19225
19214
|
});
|
|
19226
19215
|
var type = this.props.type;
|
|
19227
19216
|
var WidgetType = getWidget(type);
|
|
@@ -20979,7 +20968,7 @@ var buttonSets = {
|
|
|
20979
20968
|
}, i18n.doNotTranslate("\\geq")), "\\geq"];
|
|
20980
20969
|
}]
|
|
20981
20970
|
};
|
|
20982
|
-
var
|
|
20971
|
+
var buttonSetsPropType = PropTypes.arrayOf(PropTypes.oneOf(_(buttonSets).keys()));
|
|
20983
20972
|
|
|
20984
20973
|
class TexButtons extends React.Component {
|
|
20985
20974
|
render() {
|
|
@@ -21015,18 +21004,11 @@ class TexButtons extends React.Component {
|
|
|
21015
21004
|
|
|
21016
21005
|
}
|
|
21017
21006
|
|
|
21018
|
-
_defineProperty(TexButtons, "propTypes", {
|
|
21019
|
-
sets: buttonSetsType.isRequired,
|
|
21020
|
-
onInsert: PropTypes.func.isRequired,
|
|
21021
|
-
className: PropTypes.string
|
|
21022
|
-
});
|
|
21023
|
-
|
|
21024
21007
|
_defineProperty(TexButtons, "buttonSets", buttonSets);
|
|
21025
21008
|
|
|
21026
|
-
_defineProperty(TexButtons, "buttonSetsType",
|
|
21027
|
-
|
|
21028
|
-
var PT = PropTypes; // A WYSIWYG math input that calls `onChange(LaTeX-string)`
|
|
21009
|
+
_defineProperty(TexButtons, "buttonSetsType", buttonSetsPropType);
|
|
21029
21010
|
|
|
21011
|
+
// A WYSIWYG math input that calls `onChange(LaTeX-string)`
|
|
21030
21012
|
class MathInput extends React.Component {
|
|
21031
21013
|
constructor() {
|
|
21032
21014
|
super(...arguments);
|
|
@@ -21138,63 +21120,6 @@ class MathInput extends React.Component {
|
|
|
21138
21120
|
});
|
|
21139
21121
|
}
|
|
21140
21122
|
|
|
21141
|
-
render() {
|
|
21142
|
-
var className = classNames({
|
|
21143
|
-
"perseus-math-input": true,
|
|
21144
|
-
// mathquill usually adds these itself but react removes them when
|
|
21145
|
-
// updating the component.
|
|
21146
|
-
"mq-editable-field": true,
|
|
21147
|
-
"mq-math-mode": true
|
|
21148
|
-
});
|
|
21149
|
-
|
|
21150
|
-
if (this.props.className) {
|
|
21151
|
-
className = className + " " + this.props.className;
|
|
21152
|
-
}
|
|
21153
|
-
|
|
21154
|
-
var buttons = null;
|
|
21155
|
-
|
|
21156
|
-
if (this._shouldShowButtons()) {
|
|
21157
|
-
buttons = /*#__PURE__*/React.createElement(TexButtons, {
|
|
21158
|
-
sets: this.props.buttonSets,
|
|
21159
|
-
className: "math-input-buttons absolute",
|
|
21160
|
-
convertDotToTimes: this.props.convertDotToTimes,
|
|
21161
|
-
onInsert: this.insert
|
|
21162
|
-
});
|
|
21163
|
-
}
|
|
21164
|
-
|
|
21165
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21166
|
-
style: {
|
|
21167
|
-
display: "inline-block"
|
|
21168
|
-
}
|
|
21169
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
21170
|
-
style: {
|
|
21171
|
-
display: "inline-block"
|
|
21172
|
-
}
|
|
21173
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
21174
|
-
className: className // eslint-disable-next-line react/no-string-refs
|
|
21175
|
-
,
|
|
21176
|
-
ref: "mathinput",
|
|
21177
|
-
"aria-label": this.props.labelText,
|
|
21178
|
-
onFocus: this.handleFocus,
|
|
21179
|
-
onBlur: this.handleBlur
|
|
21180
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
21181
|
-
style: {
|
|
21182
|
-
position: "relative"
|
|
21183
|
-
},
|
|
21184
|
-
onBlur: this.handleBlur
|
|
21185
|
-
}, buttons));
|
|
21186
|
-
} // handlers:
|
|
21187
|
-
// keep track of two related bits of state:
|
|
21188
|
-
// * this.state.focused - whether the buttons are currently shown
|
|
21189
|
-
// * this.mouseDown - whether a mouse click is active that started in the
|
|
21190
|
-
// buttons div
|
|
21191
|
-
|
|
21192
|
-
|
|
21193
|
-
componentWillUnmount() {
|
|
21194
|
-
window.removeEventListener("mousedown", this.handleMouseDown);
|
|
21195
|
-
window.removeEventListener("mouseup", this.handleMouseUp);
|
|
21196
|
-
}
|
|
21197
|
-
|
|
21198
21123
|
componentDidMount() {
|
|
21199
21124
|
window.addEventListener("mousedown", this.handleMouseDown);
|
|
21200
21125
|
window.addEventListener("mouseup", this.handleMouseUp);
|
|
@@ -21283,18 +21208,64 @@ class MathInput extends React.Component {
|
|
|
21283
21208
|
initialized = true;
|
|
21284
21209
|
}
|
|
21285
21210
|
|
|
21286
|
-
|
|
21211
|
+
componentWillUnmount() {
|
|
21212
|
+
window.removeEventListener("mousedown", this.handleMouseDown);
|
|
21213
|
+
window.removeEventListener("mouseup", this.handleMouseUp);
|
|
21214
|
+
} // handlers:
|
|
21215
|
+
// keep track of two related bits of state:
|
|
21216
|
+
// * this.state.focused - whether the buttons are currently shown
|
|
21217
|
+
// * this.mouseDown - whether a mouse click is active that started in the
|
|
21218
|
+
// buttons div
|
|
21287
21219
|
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
|
|
21292
|
-
|
|
21293
|
-
|
|
21294
|
-
|
|
21295
|
-
|
|
21296
|
-
|
|
21297
|
-
|
|
21220
|
+
|
|
21221
|
+
render() {
|
|
21222
|
+
var className = classNames({
|
|
21223
|
+
"perseus-math-input": true,
|
|
21224
|
+
// mathquill usually adds these itself but react removes them when
|
|
21225
|
+
// updating the component.
|
|
21226
|
+
"mq-editable-field": true,
|
|
21227
|
+
"mq-math-mode": true
|
|
21228
|
+
});
|
|
21229
|
+
|
|
21230
|
+
if (this.props.className) {
|
|
21231
|
+
className = className + " " + this.props.className;
|
|
21232
|
+
}
|
|
21233
|
+
|
|
21234
|
+
var buttons = null;
|
|
21235
|
+
|
|
21236
|
+
if (this._shouldShowButtons()) {
|
|
21237
|
+
buttons = /*#__PURE__*/React.createElement(TexButtons, {
|
|
21238
|
+
sets: this.props.buttonSets,
|
|
21239
|
+
className: "math-input-buttons absolute",
|
|
21240
|
+
convertDotToTimes: this.props.convertDotToTimes,
|
|
21241
|
+
onInsert: this.insert
|
|
21242
|
+
});
|
|
21243
|
+
}
|
|
21244
|
+
|
|
21245
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21246
|
+
style: {
|
|
21247
|
+
display: "inline-block"
|
|
21248
|
+
}
|
|
21249
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
21250
|
+
style: {
|
|
21251
|
+
display: "inline-block"
|
|
21252
|
+
}
|
|
21253
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
21254
|
+
className: className // eslint-disable-next-line react/no-string-refs
|
|
21255
|
+
,
|
|
21256
|
+
ref: "mathinput",
|
|
21257
|
+
"aria-label": this.props.labelText,
|
|
21258
|
+
onFocus: this.handleFocus,
|
|
21259
|
+
onBlur: this.handleBlur
|
|
21260
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
21261
|
+
style: {
|
|
21262
|
+
position: "relative"
|
|
21263
|
+
},
|
|
21264
|
+
onBlur: this.handleBlur
|
|
21265
|
+
}, buttons));
|
|
21266
|
+
}
|
|
21267
|
+
|
|
21268
|
+
}
|
|
21298
21269
|
|
|
21299
21270
|
_defineProperty(MathInput, "defaultProps", {
|
|
21300
21271
|
value: "",
|
|
@@ -21988,8 +21959,6 @@ var Tooltip = createReactClass({
|
|
|
21988
21959
|
top: settings["top"],
|
|
21989
21960
|
left: settings.tooltipLeft,
|
|
21990
21961
|
border: "1px solid " + this.props.borderColor,
|
|
21991
|
-
WebkitBoxShadow: "0 1px 3px " + this.props.borderColor,
|
|
21992
|
-
MozBoxShadow: "0 1px 3px " + this.props.borderColor,
|
|
21993
21962
|
boxShadow: "0 1px 3px " + this.props.borderColor,
|
|
21994
21963
|
zIndex: zIndex - 1
|
|
21995
21964
|
}
|
|
@@ -32087,9 +32056,7 @@ var defaultInstructionsStyle = {
|
|
|
32087
32056
|
backgroundColor: "white",
|
|
32088
32057
|
position: "absolute",
|
|
32089
32058
|
zIndex: 1,
|
|
32090
|
-
transition: "opacity .25s ease-in-out"
|
|
32091
|
-
"-moz-transition": "opacity .25s ease-in-out",
|
|
32092
|
-
"-webkit-transition": "opacity .25s ease-in-out"
|
|
32059
|
+
transition: "opacity .25s ease-in-out"
|
|
32093
32060
|
};
|
|
32094
32061
|
var instructionsTextStyle = {
|
|
32095
32062
|
position: "relative",
|
|
@@ -43236,8 +43203,6 @@ class Simulator extends React.Component {
|
|
|
43236
43203
|
var highlight = "0px 0px 0px 2px rgba(255, 165, 0, 1)";
|
|
43237
43204
|
|
|
43238
43205
|
var highlightStyle = _.extend({}, inputStyle, {
|
|
43239
|
-
WebkitBoxShadow: highlight,
|
|
43240
|
-
MozBoxShadow: highlight,
|
|
43241
43206
|
boxShadow: highlight,
|
|
43242
43207
|
transition: "all 0.15s"
|
|
43243
43208
|
});
|