@khanacademy/perseus 22.0.0 → 22.0.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.
package/dist/index.js
CHANGED
|
@@ -649,6 +649,9 @@ class InnerMathInput extends React__namespace.Component {
|
|
|
649
649
|
class MathInput extends React__namespace.Component {
|
|
650
650
|
static contextType = mathInput.MathInputI18nContext;
|
|
651
651
|
inputRef = /*#__PURE__*/React__namespace.createRef();
|
|
652
|
+
blur() {
|
|
653
|
+
this.inputRef.current?.blur();
|
|
654
|
+
}
|
|
652
655
|
focus() {
|
|
653
656
|
this.inputRef.current?.focus();
|
|
654
657
|
}
|
|
@@ -2594,7 +2597,11 @@ class Expression extends React__namespace.Component {
|
|
|
2594
2597
|
blurInputPath = inputPath => {
|
|
2595
2598
|
// eslint-disable-next-line react/no-string-refs
|
|
2596
2599
|
// @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
|
|
2597
|
-
this.refs.input
|
|
2600
|
+
if (typeof this.refs.input?.blur === "function") {
|
|
2601
|
+
// eslint-disable-next-line react/no-string-refs
|
|
2602
|
+
// @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
|
|
2603
|
+
this.refs.input?.blur();
|
|
2604
|
+
}
|
|
2598
2605
|
};
|
|
2599
2606
|
|
|
2600
2607
|
// HACK(joel)
|
|
@@ -21944,10 +21951,14 @@ class SimpleKeypadInput extends React__namespace.Component {
|
|
|
21944
21951
|
}
|
|
21945
21952
|
|
|
21946
21953
|
blur() {
|
|
21954
|
+
// eslint-disable-next-line react/no-string-refs
|
|
21947
21955
|
// @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
|
|
21948
|
-
this.refs.input
|
|
21956
|
+
if (typeof this.refs.input?.blur === "function") {
|
|
21957
|
+
// eslint-disable-next-line react/no-string-refs
|
|
21958
|
+
// @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
|
|
21959
|
+
this.refs.input?.blur();
|
|
21960
|
+
}
|
|
21949
21961
|
}
|
|
21950
|
-
|
|
21951
21962
|
getValue() {
|
|
21952
21963
|
return this.props.value;
|
|
21953
21964
|
}
|
|
@@ -22152,7 +22163,11 @@ class InputNumber extends React__namespace.Component {
|
|
|
22152
22163
|
blurInputPath = inputPath => {
|
|
22153
22164
|
// eslint-disable-next-line react/no-string-refs
|
|
22154
22165
|
// @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
|
|
22155
|
-
this.refs.input
|
|
22166
|
+
if (typeof this.refs.input?.blur === "function") {
|
|
22167
|
+
// eslint-disable-next-line react/no-string-refs
|
|
22168
|
+
// @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
|
|
22169
|
+
this.refs.input?.blur();
|
|
22170
|
+
}
|
|
22156
22171
|
};
|
|
22157
22172
|
getInputPaths = () => {
|
|
22158
22173
|
// The widget itself is an input, so we return a single empty list to
|
|
@@ -29170,7 +29185,7 @@ function Arrowhead(props) {
|
|
|
29170
29185
|
d: arrowPath,
|
|
29171
29186
|
fill: "none",
|
|
29172
29187
|
style: {
|
|
29173
|
-
stroke: "inherit"
|
|
29188
|
+
stroke: props.color ?? "inherit"
|
|
29174
29189
|
},
|
|
29175
29190
|
strokeLinejoin: "round",
|
|
29176
29191
|
strokeLinecap: "round"
|
|
@@ -29776,22 +29791,27 @@ function AxisArrows() {
|
|
|
29776
29791
|
const {
|
|
29777
29792
|
range: [[xMin, xMax], [yMin, yMax]]
|
|
29778
29793
|
} = useGraphConfig();
|
|
29794
|
+
const axisColor = "var(--mafs-fg)";
|
|
29779
29795
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Arrowhead, {
|
|
29796
|
+
color: axisColor,
|
|
29797
|
+
x: xMin,
|
|
29798
|
+
y: 0,
|
|
29799
|
+
angle: 180
|
|
29800
|
+
}), /*#__PURE__*/React__default["default"].createElement(Arrowhead, {
|
|
29801
|
+
color: axisColor,
|
|
29780
29802
|
x: xMax,
|
|
29781
29803
|
y: 0,
|
|
29782
29804
|
angle: 0
|
|
29783
29805
|
}), /*#__PURE__*/React__default["default"].createElement(Arrowhead, {
|
|
29806
|
+
color: axisColor,
|
|
29784
29807
|
x: 0,
|
|
29785
29808
|
y: yMin,
|
|
29786
|
-
angle:
|
|
29787
|
-
}), /*#__PURE__*/React__default["default"].createElement(Arrowhead, {
|
|
29788
|
-
x: xMin,
|
|
29789
|
-
y: 0,
|
|
29790
|
-
angle: 180
|
|
29809
|
+
angle: 270
|
|
29791
29810
|
}), /*#__PURE__*/React__default["default"].createElement(Arrowhead, {
|
|
29811
|
+
color: axisColor,
|
|
29792
29812
|
x: 0,
|
|
29793
29813
|
y: yMax,
|
|
29794
|
-
angle:
|
|
29814
|
+
angle: 90
|
|
29795
29815
|
}));
|
|
29796
29816
|
}
|
|
29797
29817
|
|
|
@@ -29919,7 +29939,7 @@ const Grid = props => {
|
|
|
29919
29939
|
return props.markings === "none" ? null : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(mafs.Coordinates.Cartesian, {
|
|
29920
29940
|
xAxis: axisOptions(props, 0),
|
|
29921
29941
|
yAxis: axisOptions(props, 1)
|
|
29922
|
-
}),
|
|
29942
|
+
}),
|
|
29923
29943
|
// Only render the axis ticks and arrows if the markings are set to a full "graph"
|
|
29924
29944
|
props.markings === "graph" && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(AxisTicks, {
|
|
29925
29945
|
range: props.range,
|
|
@@ -43331,7 +43351,7 @@ const init = function (options) {
|
|
|
43331
43351
|
|
|
43332
43352
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
43333
43353
|
const libName = "@khanacademy/perseus";
|
|
43334
|
-
const libVersion = "22.0.
|
|
43354
|
+
const libVersion = "22.0.2";
|
|
43335
43355
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
43336
43356
|
|
|
43337
43357
|
const apiVersion = {
|