@khanacademy/perseus 49.0.1 → 49.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/es/index.js +34 -27
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +15 -14
- package/dist/es/strings.js.map +1 -1
- package/dist/index.js +35 -27
- package/dist/index.js.map +1 -1
- package/dist/strings.d.ts +18 -18
- package/dist/strings.js +15 -14
- package/dist/strings.js.map +1 -1
- package/package.json +36 -36
package/dist/es/index.js
CHANGED
|
@@ -244,11 +244,11 @@ const mockStrings = {
|
|
|
244
244
|
tan: "tan",
|
|
245
245
|
simulationLoadFail: "Sorry, this simulation cannot load.",
|
|
246
246
|
simulationLocaleWarning: "Sorry, this simulation isn't available in your language.",
|
|
247
|
-
addPoint: "Add Point",
|
|
248
|
-
removePoint: "Remove Point",
|
|
249
|
-
graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
|
|
250
247
|
selectAnAnswer: "Select an answer",
|
|
251
248
|
// The following strings are used for interactive graph SR descriptions.
|
|
249
|
+
graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
|
|
250
|
+
addPoint: "Add Point",
|
|
251
|
+
removePoint: "Remove Point",
|
|
252
252
|
closePolygon: "Close shape",
|
|
253
253
|
openPolygon: "Re-open shape",
|
|
254
254
|
srPointAtCoordinates: ({
|
|
@@ -260,19 +260,19 @@ const mockStrings = {
|
|
|
260
260
|
elements
|
|
261
261
|
}) => `Interactive elements: ${elements}`,
|
|
262
262
|
srNoInteractiveElements: "No interactive elements",
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
srCircleGraph: "A circle on a coordinate plane.",
|
|
264
|
+
srCircleShape: ({
|
|
265
265
|
centerX,
|
|
266
266
|
centerY
|
|
267
267
|
}) => `Circle. The center point is at ${centerX} comma ${centerY}.`,
|
|
268
|
-
|
|
268
|
+
srCircleRadiusPoint: ({
|
|
269
269
|
radiusPointX,
|
|
270
270
|
radiusPointY
|
|
271
271
|
}) => `Radius point at ${radiusPointX} comma ${radiusPointY}.`,
|
|
272
|
-
|
|
272
|
+
srCircleRadius: ({
|
|
273
273
|
radius
|
|
274
274
|
}) => `Circle radius is ${radius}.`,
|
|
275
|
-
|
|
275
|
+
srCircleOuterPoints: ({
|
|
276
276
|
point1X,
|
|
277
277
|
point1Y,
|
|
278
278
|
point2X,
|
|
@@ -34121,6 +34121,12 @@ function getGradableGraph(state, initialGraph) {
|
|
|
34121
34121
|
});
|
|
34122
34122
|
}
|
|
34123
34123
|
if (state.type === "point" && initialGraph.type === "point") {
|
|
34124
|
+
// The unlimited point graph must have at least 1 coordinate or else it is not considered score-able.
|
|
34125
|
+
if (state.numPoints === "unlimited" && state.coords.length === 0) {
|
|
34126
|
+
return _extends({}, initialGraph, {
|
|
34127
|
+
coords: null
|
|
34128
|
+
});
|
|
34129
|
+
}
|
|
34124
34130
|
return _extends({}, initialGraph, {
|
|
34125
34131
|
coords: state.coords
|
|
34126
34132
|
});
|
|
@@ -34194,7 +34200,8 @@ function CircleGraph(props) {
|
|
|
34194
34200
|
radiusPoint
|
|
34195
34201
|
} = graphState;
|
|
34196
34202
|
const {
|
|
34197
|
-
strings
|
|
34203
|
+
strings,
|
|
34204
|
+
locale
|
|
34198
34205
|
} = usePerseusI18n();
|
|
34199
34206
|
const [radiusPointAriaLive, setRadiusPointAriaLive] = React.useState("off");
|
|
34200
34207
|
const radius = getRadius(graphState);
|
|
@@ -34204,27 +34211,27 @@ function CircleGraph(props) {
|
|
|
34204
34211
|
const outerPointsId = id + "-outer-points";
|
|
34205
34212
|
|
|
34206
34213
|
// Aria label strings
|
|
34207
|
-
const circleGraphAriaLabel = strings.
|
|
34208
|
-
const circleShapeAriaLabel = strings.
|
|
34209
|
-
centerX: center[0],
|
|
34210
|
-
centerY: center[1]
|
|
34214
|
+
const circleGraphAriaLabel = strings.srCircleGraph;
|
|
34215
|
+
const circleShapeAriaLabel = strings.srCircleShape({
|
|
34216
|
+
centerX: srFormatNumber(center[0], locale),
|
|
34217
|
+
centerY: srFormatNumber(center[1], locale)
|
|
34211
34218
|
});
|
|
34212
|
-
const circleRadiusPointAriaLabel = strings.
|
|
34213
|
-
radiusPointX: radiusPoint[0],
|
|
34214
|
-
radiusPointY: radiusPoint[1]
|
|
34219
|
+
const circleRadiusPointAriaLabel = strings.srCircleRadiusPoint({
|
|
34220
|
+
radiusPointX: srFormatNumber(radiusPoint[0], locale),
|
|
34221
|
+
radiusPointY: srFormatNumber(radiusPoint[1], locale)
|
|
34215
34222
|
});
|
|
34216
|
-
const circleRadiusDescription = strings.
|
|
34223
|
+
const circleRadiusDescription = strings.srCircleRadius({
|
|
34217
34224
|
radius
|
|
34218
34225
|
});
|
|
34219
|
-
const circleOuterPointsDescription = strings.
|
|
34220
|
-
point1X: center[0] + radius,
|
|
34221
|
-
point1Y: center[1],
|
|
34222
|
-
point2X: center[0],
|
|
34223
|
-
point2Y: center[1] + radius,
|
|
34224
|
-
point3X: center[0] - radius,
|
|
34225
|
-
point3Y: center[1],
|
|
34226
|
-
point4X: center[0],
|
|
34227
|
-
point4Y: center[1] - radius
|
|
34226
|
+
const circleOuterPointsDescription = strings.srCircleOuterPoints({
|
|
34227
|
+
point1X: srFormatNumber(center[0] + radius, locale),
|
|
34228
|
+
point1Y: srFormatNumber(center[1], locale),
|
|
34229
|
+
point2X: srFormatNumber(center[0], locale),
|
|
34230
|
+
point2Y: srFormatNumber(center[1] + radius, locale),
|
|
34231
|
+
point3X: srFormatNumber(center[0] - radius, locale),
|
|
34232
|
+
point3Y: srFormatNumber(center[1], locale),
|
|
34233
|
+
point4X: srFormatNumber(center[0], locale),
|
|
34234
|
+
point4Y: srFormatNumber(center[1] - radius, locale)
|
|
34228
34235
|
});
|
|
34229
34236
|
return /*#__PURE__*/React.createElement("g", {
|
|
34230
34237
|
// Outer circle minimal description
|
|
@@ -45315,7 +45322,7 @@ const init = function init() {
|
|
|
45315
45322
|
|
|
45316
45323
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
45317
45324
|
const libName = "@khanacademy/perseus";
|
|
45318
|
-
const libVersion = "49.0.
|
|
45325
|
+
const libVersion = "49.0.2";
|
|
45319
45326
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
45320
45327
|
|
|
45321
45328
|
const apiVersion = {
|