@khanacademy/perseus 56.2.0 → 57.0.1
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/es/index.css +22 -1519
- package/dist/es/index.js +142 -101
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +4 -4
- package/dist/es/strings.js.map +1 -1
- package/dist/index.css +22 -1519
- package/dist/index.js +143 -102
- package/dist/index.js.map +1 -1
- package/dist/strings.js +4 -4
- package/dist/strings.js.map +1 -1
- package/dist/widgets/interactive-graphs/backgrounds/axis-labels.d.ts +5 -0
- package/dist/widgets/interactive-graphs/graphs/components/sr-description-within-svg.d.ts +19 -0
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +3 -1
- package/dist/widgets/interactive-graphs/mafs-graph.d.ts +1 -0
- package/dist/widgets/interactive-graphs/reducer/use-graph-config.d.ts +2 -1
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +1 -0
- package/package.json +7 -7
package/dist/es/index.js
CHANGED
|
@@ -234,8 +234,8 @@ const mockStrings = {
|
|
|
234
234
|
simulationLocaleWarning: "Sorry, this simulation isn't available in your language.",
|
|
235
235
|
selectAnAnswer: "Select an answer",
|
|
236
236
|
// The following strings are used for interactive graph SR descriptions.
|
|
237
|
-
srGraphInstructions: "Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use
|
|
238
|
-
srUnlimitedGraphInstructions: "Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use
|
|
237
|
+
srGraphInstructions: "Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.",
|
|
238
|
+
srUnlimitedGraphInstructions: "Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.",
|
|
239
239
|
xAxis: "X-axis",
|
|
240
240
|
yAxis: "Y-axis",
|
|
241
241
|
graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
|
|
@@ -16542,7 +16542,7 @@ Zoomable.defaultProps = {
|
|
|
16542
16542
|
* measurements.
|
|
16543
16543
|
*/
|
|
16544
16544
|
const computeMathBounds = (parentNode, parentBounds) => {
|
|
16545
|
-
const textElement = parentNode.querySelector(".
|
|
16545
|
+
const textElement = parentNode.querySelector(".MathJax");
|
|
16546
16546
|
const textBounds = {
|
|
16547
16547
|
// @ts-expect-error - TS2531 - Object is possibly 'null'. | TS2339 - Property 'offsetWidth' does not exist on type 'Element'.
|
|
16548
16548
|
width: textElement.offsetWidth,
|
|
@@ -18625,14 +18625,7 @@ class Renderer extends React.Component {
|
|
|
18625
18625
|
}, content)))));
|
|
18626
18626
|
}
|
|
18627
18627
|
if (node.type === "math") {
|
|
18628
|
-
|
|
18629
|
-
// support (yet) with \begin{aligned}...\end{aligned} which renders
|
|
18630
|
-
// the same is supported by KaTeX. It does the same for align*.
|
|
18631
|
-
// TODO(kevinb) update content to use aligned instead of align.
|
|
18632
|
-
// TODO(LEMS-1608) Remove this replacement as MathJax supports the
|
|
18633
|
-
// "align" macro correctly (and, in fact, it is not synonymous with
|
|
18634
|
-
// "aligned").
|
|
18635
|
-
const tex = node.content.replace(/\{align[*]?\}/g, "{aligned}");
|
|
18628
|
+
const tex = node.content;
|
|
18636
18629
|
|
|
18637
18630
|
// We render math here instead of in perseus-markdown.jsx
|
|
18638
18631
|
// because we need to pass it our onRender callback.
|
|
@@ -24014,7 +24007,8 @@ const _choiceTransform = (widgetOptions, strings, problemNum) => {
|
|
|
24014
24007
|
// Add meta-information to choices
|
|
24015
24008
|
const choices = widgetOptions.choices.map((choice, i) => {
|
|
24016
24009
|
return _extends({}, choice, {
|
|
24017
|
-
originalIndex: i
|
|
24010
|
+
originalIndex: i,
|
|
24011
|
+
correct: Boolean(choice.correct)
|
|
24018
24012
|
});
|
|
24019
24013
|
});
|
|
24020
24014
|
|
|
@@ -25004,7 +24998,7 @@ class GradedGroupAnswerBar extends React.Component {
|
|
|
25004
24998
|
}
|
|
25005
24999
|
}
|
|
25006
25000
|
GradedGroupAnswerBar.contextType = PerseusI18nContext;
|
|
25007
|
-
const fontSize = 17;
|
|
25001
|
+
const fontSize$1 = 17;
|
|
25008
25002
|
const styles$j = {
|
|
25009
25003
|
answerBar: {
|
|
25010
25004
|
display: "flex",
|
|
@@ -25029,7 +25023,7 @@ const styles$j = {
|
|
|
25029
25023
|
flexDirection: "row",
|
|
25030
25024
|
alignItems: "center",
|
|
25031
25025
|
fontWeight: "bold",
|
|
25032
|
-
fontSize: fontSize
|
|
25026
|
+
fontSize: fontSize$1
|
|
25033
25027
|
}
|
|
25034
25028
|
};
|
|
25035
25029
|
|
|
@@ -27685,6 +27679,7 @@ const defaultGraphConfig = {
|
|
|
27685
27679
|
width: 0,
|
|
27686
27680
|
height: 0,
|
|
27687
27681
|
labels: [],
|
|
27682
|
+
labelLocation: "onAxis",
|
|
27688
27683
|
disableKeyboardInteraction: false,
|
|
27689
27684
|
interactiveColor: "var(--mafs-blue)"
|
|
27690
27685
|
};
|
|
@@ -27900,6 +27895,8 @@ function escapeIfUnescaped(character) {
|
|
|
27900
27895
|
}
|
|
27901
27896
|
}
|
|
27902
27897
|
|
|
27898
|
+
// Exported for testing purposes
|
|
27899
|
+
const fontSize = 14;
|
|
27903
27900
|
function AxisLabels({
|
|
27904
27901
|
i18n
|
|
27905
27902
|
}) {
|
|
@@ -27907,24 +27904,26 @@ function AxisLabels({
|
|
|
27907
27904
|
range,
|
|
27908
27905
|
labels,
|
|
27909
27906
|
width,
|
|
27910
|
-
height
|
|
27907
|
+
height,
|
|
27908
|
+
labelLocation
|
|
27911
27909
|
} = useGraphConfig();
|
|
27912
27910
|
const {
|
|
27913
27911
|
strings
|
|
27914
27912
|
} = i18n;
|
|
27915
|
-
const yAxisLabelLocation = [0, range[Y][MAX]];
|
|
27916
|
-
const xAxisLabelLocation = [range[X][MAX], 0];
|
|
27917
|
-
const [xAxisLabelText, yAxisLabelText] = labels;
|
|
27918
27913
|
const graphInfo = {
|
|
27919
27914
|
range,
|
|
27920
27915
|
width,
|
|
27921
27916
|
height
|
|
27922
27917
|
};
|
|
27923
|
-
|
|
27924
|
-
//
|
|
27925
|
-
|
|
27926
|
-
|
|
27927
|
-
|
|
27918
|
+
|
|
27919
|
+
// Get the position of the main axis labels
|
|
27920
|
+
const [xAxisLabelLocation, yAxisLabelLocation] = getLabelPosition(graphInfo, labelLocation);
|
|
27921
|
+
const [xAxisLabelText, yAxisLabelText] = labels;
|
|
27922
|
+
|
|
27923
|
+
// If the labels are rotated, we need to center the
|
|
27924
|
+
// x-axis label along the bottom of the graph.
|
|
27925
|
+
const xLabelTransform = labelLocation === "onAxis" ? "translate(7px, -50%)" : "translate(-50%, -50%)";
|
|
27926
|
+
const yLabelTransform = labelLocation === "onAxis" ? "translate(-50%, 0px)" : "translate(-50%, 0px) rotate(-90deg)";
|
|
27928
27927
|
const {
|
|
27929
27928
|
TeX
|
|
27930
27929
|
} = getDependencies();
|
|
@@ -27932,22 +27931,53 @@ function AxisLabels({
|
|
|
27932
27931
|
"aria-label": strings.xAxis,
|
|
27933
27932
|
style: {
|
|
27934
27933
|
position: "absolute",
|
|
27935
|
-
left:
|
|
27936
|
-
top:
|
|
27937
|
-
fontSize: "
|
|
27938
|
-
transform:
|
|
27934
|
+
left: xAxisLabelLocation[X],
|
|
27935
|
+
top: xAxisLabelLocation[Y],
|
|
27936
|
+
fontSize: fontSize + "px",
|
|
27937
|
+
transform: xLabelTransform
|
|
27939
27938
|
}
|
|
27940
27939
|
}, /*#__PURE__*/React__default.createElement(TeX, null, replaceOutsideTeX(xAxisLabelText))), /*#__PURE__*/React__default.createElement("span", {
|
|
27941
27940
|
"aria-label": strings.yAxis,
|
|
27942
27941
|
style: {
|
|
27943
27942
|
position: "absolute",
|
|
27944
|
-
left:
|
|
27945
|
-
top:
|
|
27946
|
-
fontSize: "
|
|
27947
|
-
transform:
|
|
27943
|
+
left: yAxisLabelLocation[X],
|
|
27944
|
+
top: yAxisLabelLocation[Y],
|
|
27945
|
+
fontSize: fontSize + "px",
|
|
27946
|
+
transform: yLabelTransform
|
|
27948
27947
|
}
|
|
27949
27948
|
}, /*#__PURE__*/React__default.createElement(TeX, null, replaceOutsideTeX(yAxisLabelText))));
|
|
27950
27949
|
}
|
|
27950
|
+
const getLabelPosition = (graphInfo, labelLocation) => {
|
|
27951
|
+
// If the labels are placed along the edge of the graph, we need to place them at the
|
|
27952
|
+
// center of the graph, which is the average of the min and max values of the axes.
|
|
27953
|
+
if (labelLocation === "alongEdge") {
|
|
27954
|
+
// Offset the labels by a certain amount based on the range of the graph, to ensure that
|
|
27955
|
+
// the labels do not overlap with the axis tick if they are out of the graph bounds.
|
|
27956
|
+
const xAxisLabelOffset = graphInfo.range[Y][MIN] >= 0 ? [0, fontSize * 3] // Move the label down by 3 font sizes if the y-axis min is positive
|
|
27957
|
+
: [0, fontSize]; // Move the label down by 1 font size if the y-axis min is negative
|
|
27958
|
+
const yAxisLabelOffset = graphInfo.range[X][MIN] >= 0 ? [-fontSize * 3, -fontSize] // Move the label left by 3 font sizes if the x-axis min is positive
|
|
27959
|
+
: [-fontSize, -fontSize]; // Move the label left by 1 font size if the x-axis min is negative
|
|
27960
|
+
|
|
27961
|
+
// Calculate the location of the labels to be halfway between the min and max values of the axes
|
|
27962
|
+
const xAxisLabelLocation = [(graphInfo.range[X][MIN] + graphInfo.range[X][MAX]) / 2, graphInfo.range[Y][MIN]];
|
|
27963
|
+
const yAxisLabelLocation = [graphInfo.range[X][MIN], (graphInfo.range[Y][MIN] + graphInfo.range[Y][MAX]) / 2];
|
|
27964
|
+
|
|
27965
|
+
// Convert the Vector2 coordinates to pixel coordinates and add the offsets
|
|
27966
|
+
const _xLabel = vec.add(pointToPixel(xAxisLabelLocation, graphInfo), xAxisLabelOffset);
|
|
27967
|
+
const _yLabel = vec.add(pointToPixel(yAxisLabelLocation, graphInfo), yAxisLabelOffset);
|
|
27968
|
+
return [_xLabel, _yLabel];
|
|
27969
|
+
}
|
|
27970
|
+
|
|
27971
|
+
// Otherwise, the labels are placed on the axes (default), and we need to
|
|
27972
|
+
// place them at the end of the axis, which is the maximum value of the axis.
|
|
27973
|
+
const xLabelInitial = [graphInfo.range[X][MAX], 0];
|
|
27974
|
+
const yLabelInitial = [0, graphInfo.range[Y][MAX]];
|
|
27975
|
+
const yLabelOffset = [0, -fontSize * 2]; // Move the y-axis label up by 2 font sizes
|
|
27976
|
+
|
|
27977
|
+
const xLabel = pointToPixel(xLabelInitial, graphInfo);
|
|
27978
|
+
const yLabel = vec.add(pointToPixel(yLabelInitial, graphInfo), yLabelOffset);
|
|
27979
|
+
return [xLabel, yLabel];
|
|
27980
|
+
};
|
|
27951
27981
|
|
|
27952
27982
|
// The size of the ticks and labels in pixels
|
|
27953
27983
|
const tickSize = 10;
|
|
@@ -30167,6 +30197,7 @@ function useDraggable(args) {
|
|
|
30167
30197
|
const {
|
|
30168
30198
|
direction: yDownDirection,
|
|
30169
30199
|
altKey,
|
|
30200
|
+
ctrlKey,
|
|
30170
30201
|
metaKey,
|
|
30171
30202
|
shiftKey
|
|
30172
30203
|
} = state;
|
|
@@ -30176,7 +30207,7 @@ function useDraggable(args) {
|
|
|
30176
30207
|
if (altKey || metaKey) {
|
|
30177
30208
|
divisions = 200;
|
|
30178
30209
|
}
|
|
30179
|
-
if (shiftKey) {
|
|
30210
|
+
if (shiftKey && !ctrlKey) {
|
|
30180
30211
|
divisions = 10;
|
|
30181
30212
|
}
|
|
30182
30213
|
const min = span / (divisions * 2);
|
|
@@ -30705,6 +30736,35 @@ const MovablePoint$1 = /*#__PURE__*/React.forwardRef((props, pointRef) => {
|
|
|
30705
30736
|
return /*#__PURE__*/React.createElement(React.Fragment, null, focusableHandle, visiblePoint);
|
|
30706
30737
|
});
|
|
30707
30738
|
|
|
30739
|
+
/**
|
|
30740
|
+
* If an element has an `aria-describedby` attribute, it needs to point to
|
|
30741
|
+
* a separate description element that contains the description for that
|
|
30742
|
+
* element.
|
|
30743
|
+
*
|
|
30744
|
+
* If the element is within an SVG, the description element must be a
|
|
30745
|
+
* `<span>` within a `<foreignObject>` in order for some browser/SR
|
|
30746
|
+
* combos to be able to access it.
|
|
30747
|
+
*
|
|
30748
|
+
* Use this SRDescInSVG component to create the <foreignObject>
|
|
30749
|
+
* and styling for this description element.
|
|
30750
|
+
*/
|
|
30751
|
+
function SRDescInSVG(props) {
|
|
30752
|
+
const {
|
|
30753
|
+
id,
|
|
30754
|
+
children
|
|
30755
|
+
} = props;
|
|
30756
|
+
return /*#__PURE__*/React.createElement("foreignObject", null, /*#__PURE__*/React.createElement("span", {
|
|
30757
|
+
id: id
|
|
30758
|
+
// Hidden visually
|
|
30759
|
+
,
|
|
30760
|
+
style: a11y.srOnly
|
|
30761
|
+
// Hidden from screen readers so they don't read this
|
|
30762
|
+
// again outside of the element that it describes.
|
|
30763
|
+
,
|
|
30764
|
+
"aria-hidden": true
|
|
30765
|
+
}, children));
|
|
30766
|
+
}
|
|
30767
|
+
|
|
30708
30768
|
const {
|
|
30709
30769
|
calculateAngleInDegrees: calculateAngleInDegrees$1,
|
|
30710
30770
|
getClockwiseAngle: getClockwiseAngle$2,
|
|
@@ -30811,9 +30871,8 @@ function AngleGraph(props) {
|
|
|
30811
30871
|
constrain: getAngleSideConstraint(coords[2], coords[1], snapDegrees || 1),
|
|
30812
30872
|
onMove: destination => dispatch(actions.angle.movePoint(2, destination)),
|
|
30813
30873
|
ariaLabel: srAngleStartingSide
|
|
30814
|
-
}), /*#__PURE__*/React.createElement(
|
|
30815
|
-
id: descriptionId
|
|
30816
|
-
style: a11y.srOnly
|
|
30874
|
+
}), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
30875
|
+
id: descriptionId
|
|
30817
30876
|
}, srAngleGraphAriaDescription));
|
|
30818
30877
|
}
|
|
30819
30878
|
function getAngleGraphDescription(state, i18n) {
|
|
@@ -31089,12 +31148,10 @@ function CircleGraph(props) {
|
|
|
31089
31148
|
dispatch(actions.circle.moveRadiusPoint(newRadiusPoint));
|
|
31090
31149
|
},
|
|
31091
31150
|
constrain: getCircleKeyboardConstraint(center, radiusPoint, snapStep)
|
|
31092
|
-
}), /*#__PURE__*/React.createElement(
|
|
31093
|
-
id: radiusId
|
|
31094
|
-
|
|
31095
|
-
|
|
31096
|
-
id: outerPointsId,
|
|
31097
|
-
style: a11y.srOnly
|
|
31151
|
+
}), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31152
|
+
id: radiusId
|
|
31153
|
+
}, srCircleRadius), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31154
|
+
id: outerPointsId
|
|
31098
31155
|
}, srCircleOuterPoints));
|
|
31099
31156
|
}
|
|
31100
31157
|
function MovableCircle(props) {
|
|
@@ -31341,15 +31398,12 @@ const LinearGraph = (props, key) => {
|
|
|
31341
31398
|
end: true
|
|
31342
31399
|
},
|
|
31343
31400
|
onMovePoint: (endpointIndex, destination) => dispatch(actions.linear.movePoint(endpointIndex, destination))
|
|
31344
|
-
}), /*#__PURE__*/React.createElement(
|
|
31345
|
-
id: pointsDescriptionId
|
|
31346
|
-
|
|
31347
|
-
|
|
31348
|
-
|
|
31349
|
-
|
|
31350
|
-
}, interceptString), /*#__PURE__*/React.createElement("g", {
|
|
31351
|
-
id: slopeDescriptionId,
|
|
31352
|
-
style: a11y.srOnly
|
|
31401
|
+
}), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31402
|
+
id: pointsDescriptionId
|
|
31403
|
+
}, srLinearGraphPoints), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31404
|
+
id: interceptDescriptionId
|
|
31405
|
+
}, interceptString), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31406
|
+
id: slopeDescriptionId
|
|
31353
31407
|
}, slopeString));
|
|
31354
31408
|
};
|
|
31355
31409
|
function getLinearGraphDescription(state, i18n) {
|
|
@@ -31487,21 +31541,16 @@ const LinearSystemGraph = props => {
|
|
|
31487
31541
|
pointsDescription,
|
|
31488
31542
|
interceptDescription,
|
|
31489
31543
|
slopeDescription
|
|
31490
|
-
}) => /*#__PURE__*/React.createElement(
|
|
31491
|
-
key:
|
|
31492
|
-
|
|
31493
|
-
|
|
31494
|
-
}, pointsDescription), /*#__PURE__*/React.createElement(
|
|
31495
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
},
|
|
31499
|
-
|
|
31500
|
-
id: slopeDescriptionId,
|
|
31501
|
-
style: a11y.srOnly
|
|
31502
|
-
}, slopeDescription))), /*#__PURE__*/React.createElement("g", {
|
|
31503
|
-
id: intersectionId,
|
|
31504
|
-
style: a11y.srOnly
|
|
31544
|
+
}, i) => /*#__PURE__*/React.createElement("span", {
|
|
31545
|
+
key: `line-descriptions-${i}`
|
|
31546
|
+
}, /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31547
|
+
id: pointsDescriptionId
|
|
31548
|
+
}, pointsDescription), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31549
|
+
id: interceptDescriptionId
|
|
31550
|
+
}, interceptDescription), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31551
|
+
id: slopeDescriptionId
|
|
31552
|
+
}, slopeDescription))), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
31553
|
+
id: intersectionId
|
|
31505
31554
|
}, intersectionDescription));
|
|
31506
31555
|
};
|
|
31507
31556
|
|
|
@@ -33056,23 +33105,21 @@ const LimitedPolygonGraph = statefulProps => {
|
|
|
33056
33105
|
// point is "polite".
|
|
33057
33106
|
setAriaLives(["off", ...newPointAriaLives]);
|
|
33058
33107
|
}
|
|
33059
|
-
}), angleDegree && /*#__PURE__*/React.createElement(
|
|
33108
|
+
}), angleDegree && /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33060
33109
|
id: angleId
|
|
33061
33110
|
}, Number.isInteger(angleDegree) ? strings.srPolygonPointAngle({
|
|
33062
33111
|
angle: angleDegree
|
|
33063
33112
|
}) : strings.srPolygonPointAngleApprox({
|
|
33064
33113
|
angle: srFormatNumber(angleDegree, locale, 1)
|
|
33065
|
-
})), /*#__PURE__*/React.createElement(
|
|
33114
|
+
})), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33066
33115
|
id: side1Id
|
|
33067
|
-
}, getPolygonSideString(side1Length, point1Index, strings, locale)), /*#__PURE__*/React.createElement(
|
|
33116
|
+
}, getPolygonSideString(side1Length, point1Index, strings, locale)), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33068
33117
|
id: side2Id
|
|
33069
33118
|
}, getPolygonSideString(side2Length, point2Index, strings, locale)));
|
|
33070
|
-
}), /*#__PURE__*/React.createElement(
|
|
33071
|
-
id: polygonPointsNumId
|
|
33072
|
-
|
|
33073
|
-
|
|
33074
|
-
id: polygonPointsId,
|
|
33075
|
-
style: a11y.srOnly
|
|
33119
|
+
}), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33120
|
+
id: polygonPointsNumId
|
|
33121
|
+
}, srPolygonGraphPointsNum), srPolygonGraphPoints && /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33122
|
+
id: polygonPointsId
|
|
33076
33123
|
}, srPolygonGraphPoints));
|
|
33077
33124
|
};
|
|
33078
33125
|
const UnlimitedPolygonGraph = statefulProps => {
|
|
@@ -33207,7 +33254,7 @@ const UnlimitedPolygonGraph = statefulProps => {
|
|
|
33207
33254
|
}
|
|
33208
33255
|
dispatch(actions.polygon.clickPoint(i));
|
|
33209
33256
|
}
|
|
33210
|
-
}), angleDegree && /*#__PURE__*/React.createElement(
|
|
33257
|
+
}), angleDegree && /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33211
33258
|
id: angleId
|
|
33212
33259
|
}, Number.isInteger(angleDegree) ? strings.srPolygonPointAngle({
|
|
33213
33260
|
angle: angleDegree
|
|
@@ -33216,16 +33263,14 @@ const UnlimitedPolygonGraph = statefulProps => {
|
|
|
33216
33263
|
})), sidesArray.map(({
|
|
33217
33264
|
pointIndex,
|
|
33218
33265
|
sideLength
|
|
33219
|
-
}, j) => /*#__PURE__*/React.createElement(
|
|
33266
|
+
}, j) => /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33220
33267
|
key: `${id}-point-${i}-side-${j}`,
|
|
33221
33268
|
id: `${id}-point-${i}-side-${j}`
|
|
33222
33269
|
}, getPolygonSideString(sideLength, pointIndex, strings, locale))));
|
|
33223
|
-
}), coords.length > 0 && /*#__PURE__*/React.createElement(
|
|
33224
|
-
id: polygonPointsNumId
|
|
33225
|
-
|
|
33226
|
-
|
|
33227
|
-
id: polygonPointsId,
|
|
33228
|
-
style: a11y.srOnly
|
|
33270
|
+
}), coords.length > 0 && /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33271
|
+
id: polygonPointsNumId
|
|
33272
|
+
}, srPolygonGraphPointsNum), srPolygonGraphPoints && /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33273
|
+
id: polygonPointsId
|
|
33229
33274
|
}, srPolygonGraphPoints));
|
|
33230
33275
|
};
|
|
33231
33276
|
function getLines(points) {
|
|
@@ -33482,15 +33527,12 @@ function QuadraticGraph(props) {
|
|
|
33482
33527
|
constrain: getQuadraticKeyboardConstraint(coords, snapStep, i),
|
|
33483
33528
|
onMove: destination => dispatch(actions.quadratic.movePoint(i, destination))
|
|
33484
33529
|
});
|
|
33485
|
-
}), srQuadraticDirection && /*#__PURE__*/React.createElement(
|
|
33486
|
-
id: quadraticDirectionId
|
|
33487
|
-
|
|
33488
|
-
|
|
33489
|
-
|
|
33490
|
-
|
|
33491
|
-
}, srQuadraticVertex), /*#__PURE__*/React.createElement("g", {
|
|
33492
|
-
id: quadraticInterceptsId,
|
|
33493
|
-
style: a11y.srOnly
|
|
33530
|
+
}), srQuadraticDirection && /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33531
|
+
id: quadraticDirectionId
|
|
33532
|
+
}, srQuadraticDirection), srQuadraticVertex && /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33533
|
+
id: quadraticVertexId
|
|
33534
|
+
}, srQuadraticVertex), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33535
|
+
id: quadraticInterceptsId
|
|
33494
33536
|
}, srQuadraticXIntercepts ? `${srQuadraticXIntercepts} ${srQuadraticYIntercept}` : `${srQuadraticYIntercept}`));
|
|
33495
33537
|
}
|
|
33496
33538
|
|
|
@@ -33678,9 +33720,8 @@ const RayGraph = props => {
|
|
|
33678
33720
|
start: false,
|
|
33679
33721
|
end: true
|
|
33680
33722
|
}
|
|
33681
|
-
}), /*#__PURE__*/React.createElement(
|
|
33682
|
-
id: pointsDescriptionId
|
|
33683
|
-
style: a11y.srOnly
|
|
33723
|
+
}), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33724
|
+
id: pointsDescriptionId
|
|
33684
33725
|
}, srRayPoints));
|
|
33685
33726
|
};
|
|
33686
33727
|
function getRayGraphDescription(state, i18n) {
|
|
@@ -33818,13 +33859,11 @@ const SegmentGraph = ({
|
|
|
33818
33859
|
point2Y: srFormatNumber(segment[1][Y], locale)
|
|
33819
33860
|
})
|
|
33820
33861
|
}
|
|
33821
|
-
}), /*#__PURE__*/React.createElement(
|
|
33822
|
-
id: lengthDescriptionId
|
|
33823
|
-
style: a11y.srOnly
|
|
33862
|
+
}), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33863
|
+
id: lengthDescriptionId
|
|
33824
33864
|
}, strings.srSegmentLength({
|
|
33825
33865
|
length: srFormatNumber(getLengthOfSegment(segment), locale)
|
|
33826
|
-
})))), /*#__PURE__*/React.createElement(
|
|
33827
|
-
style: a11y.srOnly,
|
|
33866
|
+
})))), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33828
33867
|
id: wholeGraphDescriptionId
|
|
33829
33868
|
}, getWholeSegmentGraphAriaDescription()));
|
|
33830
33869
|
};
|
|
@@ -33923,7 +33962,7 @@ function SinusoidGraph(props) {
|
|
|
33923
33962
|
sequenceNumber: i + 1,
|
|
33924
33963
|
constrain: getSinusoidKeyboardConstraint(coords, snapStep, i),
|
|
33925
33964
|
onMove: destination => dispatch(actions.sinusoid.movePoint(i, destination))
|
|
33926
|
-
})), /*#__PURE__*/React.createElement(
|
|
33965
|
+
})), /*#__PURE__*/React.createElement(SRDescInSVG, {
|
|
33927
33966
|
id: descriptionId
|
|
33928
33967
|
}, srSinusoidDescription));
|
|
33929
33968
|
}
|
|
@@ -34197,6 +34236,7 @@ const MafsGraph = props => {
|
|
|
34197
34236
|
state,
|
|
34198
34237
|
dispatch,
|
|
34199
34238
|
labels,
|
|
34239
|
+
labelLocation,
|
|
34200
34240
|
readOnly,
|
|
34201
34241
|
fullGraphAriaLabel,
|
|
34202
34242
|
fullGraphAriaDescription
|
|
@@ -34277,6 +34317,7 @@ const MafsGraph = props => {
|
|
|
34277
34317
|
width,
|
|
34278
34318
|
height,
|
|
34279
34319
|
labels,
|
|
34320
|
+
labelLocation,
|
|
34280
34321
|
disableKeyboardInteraction: disableInteraction,
|
|
34281
34322
|
// If the graph is read-only or static, we want to make it
|
|
34282
34323
|
// visually clear that the graph is no longer interactive.
|
|
@@ -41388,7 +41429,7 @@ const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
|
|
|
41388
41429
|
|
|
41389
41430
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
41390
41431
|
const libName = "@khanacademy/perseus";
|
|
41391
|
-
const libVersion = "
|
|
41432
|
+
const libVersion = "57.0.1";
|
|
41392
41433
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
41393
41434
|
|
|
41394
41435
|
const apiVersion = {
|