@khanacademy/perseus 58.0.0 → 59.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/strings.js CHANGED
@@ -1,3 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * The translated strings that are used to render Perseus.
7
+ */
8
+
9
+ /**
10
+ * Untranslated strings used in Perseus. To be used by an external
11
+ * translator to produce translated strings, passed in as `PerseusStrings`.
12
+ * !! Note: Ensure that all escape sequences are double-escaped. (e.g. `\\text` -> `\\\\text`)
13
+ */
1
14
  const strings = {
2
15
  closeKeypad: "close math keypad",
3
16
  openKeypad: "open math keypad",
@@ -134,6 +147,7 @@ const strings = {
134
147
  simulationLoadFail: "Sorry, this simulation cannot load.",
135
148
  simulationLocaleWarning: "Sorry, this simulation isn't available in your language.",
136
149
  selectAnAnswer: "Select an answer",
150
+ // The following strings are used for interactive graph SR descriptions.
137
151
  addPoint: "Add Point",
138
152
  removePoint: "Remove Point",
139
153
  graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
@@ -141,6 +155,10 @@ const strings = {
141
155
  openPolygon: "Re-open shape",
142
156
  srInteractiveElements: "Interactive elements: %(elements)s",
143
157
  srNoInteractiveElements: "No interactive elements",
158
+ // TODO(LEMS-2660): The following strings are ones that will need
159
+ // translation tickets after all interactive graph SR strings have
160
+ // been finalized. Remove this comment after the tickets have been
161
+ // created.
144
162
  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.",
145
163
  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.",
146
164
  srPointAtCoordinates: "Point %(num)s at %(x)s comma %(y)s.",
@@ -218,19 +236,30 @@ const strings = {
218
236
  srSinusoidFlatPoint: "Line through point at %(x)s comma %(y)s.",
219
237
  srSinusoidDescription: "The graph shows a wave with a minimum value of %(minValue)s and a maximum value of %(maxValue)s. The wave completes a full cycle from %(cycleStart)s to %(cycleEnd)s.",
220
238
  srSinusoidInteractiveElements: "Sinusoid graph with midline intersection point at %(point1X)s comma %(point1Y)s and extremum point at %(point2X)s comma %(point2Y)s."
239
+ // The above strings are used for interactive graph SR descriptions.
221
240
  };
241
+
242
+ /**
243
+ * Mock strings for the Perseus package, to be used for tests and Storybook.
244
+ */
222
245
  const mockStrings = {
223
246
  closeKeypad: "close math keypad",
224
247
  openKeypad: "open math keypad",
225
248
  mathInputBox: "Math input box",
226
249
  removeHighlight: "Remove highlight",
227
250
  addHighlight: "Add highlight",
228
- hintPos: ({
229
- pos
230
- }) => `Hint #${pos}`,
231
- errorRendering: ({
232
- error
233
- }) => `Error rendering: ${error}`,
251
+ hintPos: _ref => {
252
+ let {
253
+ pos
254
+ } = _ref;
255
+ return `Hint #${pos}`;
256
+ },
257
+ errorRendering: _ref2 => {
258
+ let {
259
+ error
260
+ } = _ref2;
261
+ return `Error rendering: ${error}`;
262
+ },
234
263
  APPROXIMATED_PI_ERROR: "Your answer is close, but you may " + "have approximated pi. Enter your " + "answer as a multiple of pi, like " + "<code>12\\ \\text{pi}</code> or " + "<code>2/3\\ \\text{pi}</code>",
235
264
  EXTRA_SYMBOLS_ERROR: "We could not understand your " + "answer. Please check your answer for extra " + "text or symbols.",
236
265
  NEEDS_TO_BE_SIMPLFIED_ERROR: "Your answer is almost correct, " + "but it needs to be simplified.",
@@ -249,9 +278,12 @@ const mockStrings = {
249
278
  check: "Check",
250
279
  correctExcited: "Correct!",
251
280
  nextQuestion: "Next question",
252
- skipToTitle: ({
253
- title
254
- }) => `Skip to ${title}`,
281
+ skipToTitle: _ref3 => {
282
+ let {
283
+ title
284
+ } = _ref3;
285
+ return `Skip to ${title}`;
286
+ },
255
287
  current: "Current",
256
288
  correct: "Correct",
257
289
  correctSelected: "Correct (selected)",
@@ -281,52 +313,85 @@ const mockStrings = {
281
313
  clickMultiple: "Click each dot on the image to select all answers that apply.",
282
314
  clickSingle: "Click each dot on the image to select an answer.",
283
315
  choices: "Choices:",
284
- answers: ({
285
- num
286
- }) => num === 1 ? `${num} answer` : `${num} answers`,
316
+ answers: _ref4 => {
317
+ let {
318
+ num
319
+ } = _ref4;
320
+ return num === 1 ? `${num} answer` : `${num} answers`;
321
+ },
287
322
  hideAnswersToggleLabel: "Hide answer choices",
288
- moves: ({
289
- num
290
- }) => num === 1 ? `Moves: ${num}` : `Moves: ${num}`,
323
+ moves: _ref5 => {
324
+ let {
325
+ num
326
+ } = _ref5;
327
+ return num === 1 ? `Moves: ${num}` : `Moves: ${num}`;
328
+ },
291
329
  clickTiles: "Click on the tiles to change the lights.",
292
330
  turnOffLights: "You must turn on all of the lights to continue.",
293
331
  fillAllCells: "Make sure you fill in all cells in the matrix.",
294
- molecularDrawing: ({
295
- content
296
- }) => `A molecular structure drawing. SMILES notation: ${content}`,
332
+ molecularDrawing: _ref6 => {
333
+ let {
334
+ content
335
+ } = _ref6;
336
+ return `A molecular structure drawing. SMILES notation: ${content}`;
337
+ },
297
338
  switchDirection: "Switch direction",
298
339
  circleOpen: "Make circle open",
299
340
  circleFilled: "Make circle filled",
300
341
  numDivisions: "Number of divisions:",
301
- divisions: ({
302
- divRangeString
303
- }) => `Please make sure the number of divisions is in the range ${divRangeString}.`,
304
- lineRange: ({
305
- lineRange
306
- }) => `lines ${lineRange}`,
307
- lineNumber: ({
308
- lineNumber
309
- }) => `line ${lineNumber}`,
310
- symbolPassage: ({
311
- questionSymbol,
312
- questionNumber
313
- }) => `The symbol ${questionSymbol} indicates that question ${questionNumber} references this portion of the passage.`,
314
- symbolQuestion: ({
315
- sentenceSymbol
316
- }) => ` The symbol ${sentenceSymbol} indicates that the following sentence is referenced in a question.`,
342
+ divisions: _ref7 => {
343
+ let {
344
+ divRangeString
345
+ } = _ref7;
346
+ return `Please make sure the number of divisions is in the range ${divRangeString}.`;
347
+ },
348
+ lineRange: _ref8 => {
349
+ let {
350
+ lineRange
351
+ } = _ref8;
352
+ return `lines ${lineRange}`;
353
+ },
354
+ lineNumber: _ref9 => {
355
+ let {
356
+ lineNumber
357
+ } = _ref9;
358
+ return `line ${lineNumber}`;
359
+ },
360
+ symbolPassage: _ref10 => {
361
+ let {
362
+ questionSymbol,
363
+ questionNumber
364
+ } = _ref10;
365
+ return `The symbol ${questionSymbol} indicates that question ${questionNumber} references this portion of the passage.`;
366
+ },
367
+ symbolQuestion: _ref11 => {
368
+ let {
369
+ sentenceSymbol
370
+ } = _ref11;
371
+ return ` The symbol ${sentenceSymbol} indicates that the following sentence is referenced in a question.`;
372
+ },
317
373
  lineLabel: "Line",
318
374
  beginningPassage: "Beginning of reading passage.",
319
375
  beginningFootnotes: "Beginning of reading passage footnotes.",
320
376
  endPassage: "End of reading passage.",
321
- questionMarker: ({
322
- number
323
- }) => `[Marker for question ${number}]`,
324
- circleMarker: ({
325
- number
326
- }) => `[Circle marker ${number}]`,
327
- sentenceMarker: ({
328
- number
329
- }) => `[Sentence ${number}]`,
377
+ questionMarker: _ref12 => {
378
+ let {
379
+ number
380
+ } = _ref12;
381
+ return `[Marker for question ${number}]`;
382
+ },
383
+ circleMarker: _ref13 => {
384
+ let {
385
+ number
386
+ } = _ref13;
387
+ return `[Circle marker ${number}]`;
388
+ },
389
+ sentenceMarker: _ref14 => {
390
+ let {
391
+ number
392
+ } = _ref14;
393
+ return `[Sentence ${number}]`;
394
+ },
330
395
  dragHandles: "Drag handles to make graph",
331
396
  tapAddPoints: "Tap to add points",
332
397
  false: "False",
@@ -336,47 +401,83 @@ const mockStrings = {
336
401
  chooseCorrectNum: "Please choose the correct number of answers.",
337
402
  notNoneOfTheAbove: "'None of the above' may not be selected when other answers are selected.",
338
403
  noneOfTheAbove: "None of the above",
339
- chooseNumAnswers: ({
340
- numCorrect
341
- }) => `Choose ${numCorrect} answers:`,
404
+ chooseNumAnswers: _ref15 => {
405
+ let {
406
+ numCorrect
407
+ } = _ref15;
408
+ return `Choose ${numCorrect} answers:`;
409
+ },
342
410
  chooseAllAnswers: "Choose all answers that apply:",
343
411
  chooseOneAnswer: "Choose 1 answer:",
344
- choiceCheckedCorrect: ({
345
- letter
346
- }) => `(Choice ${letter}, Checked, Correct)`,
347
- choiceCrossedOutCorrect: ({
348
- letter
349
- }) => `(Choice ${letter}, Crossed out, Correct)`,
350
- choiceCorrect: ({
351
- letter
352
- }) => `(Choice ${letter}, Correct)`,
353
- choiceCheckedIncorrect: ({
354
- letter
355
- }) => `(Choice ${letter}, Checked, Incorrect)`,
356
- choiceCrossedOutIncorrect: ({
357
- letter
358
- }) => `(Choice ${letter}, Crossed out, Incorrect)`,
359
- choiceIncorrect: ({
360
- letter
361
- }) => `(Choice ${letter}, Incorrect)`,
362
- choiceChecked: ({
363
- letter
364
- }) => `(Choice ${letter}, Checked)`,
365
- choiceCrossedOut: ({
366
- letter
367
- }) => `(Choice ${letter}, Crossed out)`,
368
- choice: ({
369
- letter
370
- }) => `(Choice ${letter})`,
412
+ choiceCheckedCorrect: _ref16 => {
413
+ let {
414
+ letter
415
+ } = _ref16;
416
+ return `(Choice ${letter}, Checked, Correct)`;
417
+ },
418
+ choiceCrossedOutCorrect: _ref17 => {
419
+ let {
420
+ letter
421
+ } = _ref17;
422
+ return `(Choice ${letter}, Crossed out, Correct)`;
423
+ },
424
+ choiceCorrect: _ref18 => {
425
+ let {
426
+ letter
427
+ } = _ref18;
428
+ return `(Choice ${letter}, Correct)`;
429
+ },
430
+ choiceCheckedIncorrect: _ref19 => {
431
+ let {
432
+ letter
433
+ } = _ref19;
434
+ return `(Choice ${letter}, Checked, Incorrect)`;
435
+ },
436
+ choiceCrossedOutIncorrect: _ref20 => {
437
+ let {
438
+ letter
439
+ } = _ref20;
440
+ return `(Choice ${letter}, Crossed out, Incorrect)`;
441
+ },
442
+ choiceIncorrect: _ref21 => {
443
+ let {
444
+ letter
445
+ } = _ref21;
446
+ return `(Choice ${letter}, Incorrect)`;
447
+ },
448
+ choiceChecked: _ref22 => {
449
+ let {
450
+ letter
451
+ } = _ref22;
452
+ return `(Choice ${letter}, Checked)`;
453
+ },
454
+ choiceCrossedOut: _ref23 => {
455
+ let {
456
+ letter
457
+ } = _ref23;
458
+ return `(Choice ${letter}, Crossed out)`;
459
+ },
460
+ choice: _ref24 => {
461
+ let {
462
+ letter
463
+ } = _ref24;
464
+ return `(Choice ${letter})`;
465
+ },
371
466
  crossOut: "Cross out",
372
467
  crossOutOption: "Cross out option",
373
- crossOutChoice: ({
374
- letter
375
- }) => `Cross out Choice ${letter}`,
468
+ crossOutChoice: _ref25 => {
469
+ let {
470
+ letter
471
+ } = _ref25;
472
+ return `Cross out Choice ${letter}`;
473
+ },
376
474
  bringBack: "Bring back",
377
- openMenuForChoice: ({
378
- letter
379
- }) => `Open menu for Choice ${letter}`,
475
+ openMenuForChoice: _ref26 => {
476
+ let {
477
+ letter
478
+ } = _ref26;
479
+ return `Open menu for Choice ${letter}`;
480
+ },
380
481
  letters: "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z",
381
482
  rightArrow: "Reaction arrow pointing to the right.",
382
483
  dontUnderstandUnits: "I couldn't understand those units.",
@@ -396,6 +497,7 @@ const mockStrings = {
396
497
  simulationLoadFail: "Sorry, this simulation cannot load.",
397
498
  simulationLocaleWarning: "Sorry, this simulation isn't available in your language.",
398
499
  selectAnAnswer: "Select an answer",
500
+ // The following strings are used for interactive graph SR descriptions.
399
501
  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.",
400
502
  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.",
401
503
  graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
@@ -403,280 +505,444 @@ const mockStrings = {
403
505
  removePoint: "Remove Point",
404
506
  closePolygon: "Close shape",
405
507
  openPolygon: "Re-open shape",
406
- srPointAtCoordinates: ({
407
- num,
408
- x,
409
- y
410
- }) => `Point ${num} at ${x} comma ${y}.`,
411
- srInteractiveElements: ({
412
- elements
413
- }) => `Interactive elements: ${elements}`,
508
+ srPointAtCoordinates: _ref27 => {
509
+ let {
510
+ num,
511
+ x,
512
+ y
513
+ } = _ref27;
514
+ return `Point ${num} at ${x} comma ${y}.`;
515
+ },
516
+ srInteractiveElements: _ref28 => {
517
+ let {
518
+ elements
519
+ } = _ref28;
520
+ return `Interactive elements: ${elements}`;
521
+ },
414
522
  srNoInteractiveElements: "No interactive elements",
415
523
  srCircleGraph: "A circle on a coordinate plane.",
416
- srCircleShape: ({
417
- centerX,
418
- centerY
419
- }) => `Circle. The center point is at ${centerX} comma ${centerY}.`,
420
- srCircleRadiusPointRight: ({
421
- radiusPointX,
422
- radiusPointY
423
- }) => `Right radius endpoint at ${radiusPointX} comma ${radiusPointY}.`,
424
- srCircleRadiusPointLeft: ({
425
- radiusPointX,
426
- radiusPointY
427
- }) => `Left radius endpoint at ${radiusPointX} comma ${radiusPointY}.`,
428
- srCircleRadius: ({
429
- radius
430
- }) => `Circle radius is ${radius}.`,
431
- srCircleOuterPoints: ({
432
- point1X,
433
- point1Y,
434
- point2X,
435
- point2Y,
436
- point3X,
437
- point3Y,
438
- point4X,
439
- point4Y
440
- }) => `Points on the circle at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, ${point3X} comma ${point3Y}, ${point4X} comma ${point4Y}.`,
524
+ srCircleShape: _ref29 => {
525
+ let {
526
+ centerX,
527
+ centerY
528
+ } = _ref29;
529
+ return `Circle. The center point is at ${centerX} comma ${centerY}.`;
530
+ },
531
+ srCircleRadiusPointRight: _ref30 => {
532
+ let {
533
+ radiusPointX,
534
+ radiusPointY
535
+ } = _ref30;
536
+ return `Right radius endpoint at ${radiusPointX} comma ${radiusPointY}.`;
537
+ },
538
+ srCircleRadiusPointLeft: _ref31 => {
539
+ let {
540
+ radiusPointX,
541
+ radiusPointY
542
+ } = _ref31;
543
+ return `Left radius endpoint at ${radiusPointX} comma ${radiusPointY}.`;
544
+ },
545
+ srCircleRadius: _ref32 => {
546
+ let {
547
+ radius
548
+ } = _ref32;
549
+ return `Circle radius is ${radius}.`;
550
+ },
551
+ srCircleOuterPoints: _ref33 => {
552
+ let {
553
+ point1X,
554
+ point1Y,
555
+ point2X,
556
+ point2Y,
557
+ point3X,
558
+ point3Y,
559
+ point4X,
560
+ point4Y
561
+ } = _ref33;
562
+ return `Points on the circle at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, ${point3X} comma ${point3Y}, ${point4X} comma ${point4Y}.`;
563
+ },
441
564
  srLinearGraph: "A line on a coordinate plane.",
442
- srLinearGraphPoints: ({
443
- point1X,
444
- point1Y,
445
- point2X,
446
- point2Y
447
- }) => `The line has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`,
565
+ srLinearGraphPoints: _ref34 => {
566
+ let {
567
+ point1X,
568
+ point1Y,
569
+ point2X,
570
+ point2Y
571
+ } = _ref34;
572
+ return `The line has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`;
573
+ },
448
574
  srLinearGraphSlopeIncreasing: "Its slope increases from left to right.",
449
575
  srLinearGraphSlopeDecreasing: "Its slope decreases from left to right.",
450
576
  srLinearGraphSlopeHorizontal: "Its slope is zero.",
451
577
  srLinearGraphSlopeVertical: "Its slope is undefined.",
452
- srLinearGraphXOnlyIntercept: ({
453
- xIntercept
454
- }) => `The line crosses the X-axis at ${xIntercept} comma 0.`,
455
- srLinearGraphYOnlyIntercept: ({
456
- yIntercept
457
- }) => `The line crosses the Y-axis at 0 comma ${yIntercept}.`,
458
- srLinearGraphBothIntercepts: ({
459
- xIntercept,
460
- yIntercept
461
- }) => `The line crosses the X-axis at ${xIntercept} comma 0 and the Y-axis at 0 comma ${yIntercept}.`,
578
+ srLinearGraphXOnlyIntercept: _ref35 => {
579
+ let {
580
+ xIntercept
581
+ } = _ref35;
582
+ return `The line crosses the X-axis at ${xIntercept} comma 0.`;
583
+ },
584
+ srLinearGraphYOnlyIntercept: _ref36 => {
585
+ let {
586
+ yIntercept
587
+ } = _ref36;
588
+ return `The line crosses the Y-axis at 0 comma ${yIntercept}.`;
589
+ },
590
+ srLinearGraphBothIntercepts: _ref37 => {
591
+ let {
592
+ xIntercept,
593
+ yIntercept
594
+ } = _ref37;
595
+ return `The line crosses the X-axis at ${xIntercept} comma 0 and the Y-axis at 0 comma ${yIntercept}.`;
596
+ },
462
597
  srLinearGraphOriginIntercept: "The line crosses the X and Y axes at the graph's origin.",
463
- srLinearGrabHandle: ({
464
- point1X,
465
- point1Y,
466
- point2X,
467
- point2Y
468
- }) => `Line going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`,
469
- srAngleStartingSide: ({
470
- x,
471
- y
472
- }) => `Point 3, starting side at ${x} comma ${y}.`,
473
- srAngleEndingSide: ({
474
- x,
475
- y
476
- }) => `Point 2, ending side at ${x} comma ${y}.`,
477
- srAngleVertexWithAngleMeasure: ({
478
- x,
479
- y,
480
- angleMeasure
481
- }) => `Point 1, vertex at ${x} comma ${y}. Angle ${angleMeasure} degrees.`,
598
+ srLinearGrabHandle: _ref38 => {
599
+ let {
600
+ point1X,
601
+ point1Y,
602
+ point2X,
603
+ point2Y
604
+ } = _ref38;
605
+ return `Line going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`;
606
+ },
607
+ srAngleStartingSide: _ref39 => {
608
+ let {
609
+ x,
610
+ y
611
+ } = _ref39;
612
+ return `Point 3, starting side at ${x} comma ${y}.`;
613
+ },
614
+ srAngleEndingSide: _ref40 => {
615
+ let {
616
+ x,
617
+ y
618
+ } = _ref40;
619
+ return `Point 2, ending side at ${x} comma ${y}.`;
620
+ },
621
+ srAngleVertexWithAngleMeasure: _ref41 => {
622
+ let {
623
+ x,
624
+ y,
625
+ angleMeasure
626
+ } = _ref41;
627
+ return `Point 1, vertex at ${x} comma ${y}. Angle ${angleMeasure} degrees.`;
628
+ },
482
629
  srAngleGraphAriaLabel: "An angle on a coordinate plane.",
483
- srAngleGraphAriaDescription: ({
484
- angleMeasure,
485
- vertexX,
486
- vertexY,
487
- startingSideX,
488
- startingSideY,
489
- endingSideX,
490
- endingSideY
491
- }) => `The angle measure is ${angleMeasure} degrees with a vertex at ${vertexX} comma ${vertexY}, a point on the starting side at ${startingSideX} comma ${startingSideY} and a point on the ending side at ${endingSideX} comma ${endingSideY}.`,
492
- srAngleInteractiveElements: ({
493
- vertexX,
494
- vertexY,
495
- startingSideX,
496
- startingSideY,
497
- endingSideX,
498
- endingSideY
499
- }) => `An angle formed by 3 points. The vertex is at ${vertexX} comma ${vertexY}. The starting side point is at ${startingSideX} comma ${startingSideY}. The ending side point is at ${endingSideX} comma ${endingSideY}.`,
630
+ srAngleGraphAriaDescription: _ref42 => {
631
+ let {
632
+ angleMeasure,
633
+ vertexX,
634
+ vertexY,
635
+ startingSideX,
636
+ startingSideY,
637
+ endingSideX,
638
+ endingSideY
639
+ } = _ref42;
640
+ return `The angle measure is ${angleMeasure} degrees with a vertex at ${vertexX} comma ${vertexY}, a point on the starting side at ${startingSideX} comma ${startingSideY} and a point on the ending side at ${endingSideX} comma ${endingSideY}.`;
641
+ },
642
+ srAngleInteractiveElements: _ref43 => {
643
+ let {
644
+ vertexX,
645
+ vertexY,
646
+ startingSideX,
647
+ startingSideY,
648
+ endingSideX,
649
+ endingSideY
650
+ } = _ref43;
651
+ return `An angle formed by 3 points. The vertex is at ${vertexX} comma ${vertexY}. The starting side point is at ${startingSideX} comma ${startingSideY}. The ending side point is at ${endingSideX} comma ${endingSideY}.`;
652
+ },
500
653
  srSingleSegmentGraphAriaLabel: "A line segment on a coordinate plane.",
501
- srMultipleSegmentGraphAriaLabel: ({
502
- countOfSegments
503
- }) => `${countOfSegments} segments on a coordinate plane.`,
504
- srMultipleSegmentIndividualLabel: ({
505
- point1X,
506
- point1Y,
507
- point2X,
508
- point2Y,
509
- indexOfSegment
510
- }) => `Segment ${indexOfSegment}: Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`,
511
- srSingleSegmentLabel: ({
512
- point1X,
513
- point1Y,
514
- point2X,
515
- point2Y
516
- }) => `Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`,
517
- srSegmentLength: ({
518
- length
519
- }) => `Segment length ${length} units.`,
520
- srSingleSegmentGraphEndpointAriaLabel: ({
521
- endpointNumber,
522
- x,
523
- y
524
- }) => `Endpoint ${endpointNumber} at ${x} comma ${y}.`,
525
- srMultipleSegmentGraphEndpointAriaLabel: ({
526
- endpointNumber,
527
- x,
528
- y,
529
- indexOfSegment
530
- }) => `Endpoint ${endpointNumber} on segment ${indexOfSegment} at ${x} comma ${y}.`,
531
- srSegmentGrabHandle: ({
532
- point1X,
533
- point1Y,
534
- point2X,
535
- point2Y
536
- }) => `Segment from ${point1X} comma ${point1Y} to ${point2X} comma ${point2Y}.`,
654
+ srMultipleSegmentGraphAriaLabel: _ref44 => {
655
+ let {
656
+ countOfSegments
657
+ } = _ref44;
658
+ return `${countOfSegments} segments on a coordinate plane.`;
659
+ },
660
+ srMultipleSegmentIndividualLabel: _ref45 => {
661
+ let {
662
+ point1X,
663
+ point1Y,
664
+ point2X,
665
+ point2Y,
666
+ indexOfSegment
667
+ } = _ref45;
668
+ return `Segment ${indexOfSegment}: Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`;
669
+ },
670
+ srSingleSegmentLabel: _ref46 => {
671
+ let {
672
+ point1X,
673
+ point1Y,
674
+ point2X,
675
+ point2Y
676
+ } = _ref46;
677
+ return `Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`;
678
+ },
679
+ srSegmentLength: _ref47 => {
680
+ let {
681
+ length
682
+ } = _ref47;
683
+ return `Segment length ${length} units.`;
684
+ },
685
+ srSingleSegmentGraphEndpointAriaLabel: _ref48 => {
686
+ let {
687
+ endpointNumber,
688
+ x,
689
+ y
690
+ } = _ref48;
691
+ return `Endpoint ${endpointNumber} at ${x} comma ${y}.`;
692
+ },
693
+ srMultipleSegmentGraphEndpointAriaLabel: _ref49 => {
694
+ let {
695
+ endpointNumber,
696
+ x,
697
+ y,
698
+ indexOfSegment
699
+ } = _ref49;
700
+ return `Endpoint ${endpointNumber} on segment ${indexOfSegment} at ${x} comma ${y}.`;
701
+ },
702
+ srSegmentGrabHandle: _ref50 => {
703
+ let {
704
+ point1X,
705
+ point1Y,
706
+ point2X,
707
+ point2Y
708
+ } = _ref50;
709
+ return `Segment from ${point1X} comma ${point1Y} to ${point2X} comma ${point2Y}.`;
710
+ },
537
711
  srLinearSystemGraph: "Two lines on a coordinate plane.",
538
- srLinearSystemPoints: ({
539
- lineNumber,
540
- point1X,
541
- point1Y,
542
- point2X,
543
- point2Y
544
- }) => `Line ${lineNumber} has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`,
545
- srLinearSystemPoint: ({
546
- lineNumber,
547
- pointSequence,
548
- x,
549
- y
550
- }) => `Point ${pointSequence} on line ${lineNumber} at ${x} comma ${y}.`,
551
- srLinearSystemGrabHandle: ({
552
- lineNumber,
553
- point1X,
554
- point1Y,
555
- point2X,
556
- point2Y
557
- }) => `Line ${lineNumber} going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`,
558
- srLinearSystemIntersection: ({
559
- x,
560
- y
561
- }) => `Line 1 and line 2 intersect at point ${x} comma ${y}.`,
712
+ srLinearSystemPoints: _ref51 => {
713
+ let {
714
+ lineNumber,
715
+ point1X,
716
+ point1Y,
717
+ point2X,
718
+ point2Y
719
+ } = _ref51;
720
+ return `Line ${lineNumber} has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`;
721
+ },
722
+ srLinearSystemPoint: _ref52 => {
723
+ let {
724
+ lineNumber,
725
+ pointSequence,
726
+ x,
727
+ y
728
+ } = _ref52;
729
+ return `Point ${pointSequence} on line ${lineNumber} at ${x} comma ${y}.`;
730
+ },
731
+ srLinearSystemGrabHandle: _ref53 => {
732
+ let {
733
+ lineNumber,
734
+ point1X,
735
+ point1Y,
736
+ point2X,
737
+ point2Y
738
+ } = _ref53;
739
+ return `Line ${lineNumber} going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`;
740
+ },
741
+ srLinearSystemIntersection: _ref54 => {
742
+ let {
743
+ x,
744
+ y
745
+ } = _ref54;
746
+ return `Line 1 and line 2 intersect at point ${x} comma ${y}.`;
747
+ },
562
748
  srLinearSystemParallel: "Line 1 and line 2 are parallel.",
563
749
  srRayGraph: "A ray on a coordinate plane.",
564
- srRayPoints: ({
565
- point1X,
566
- point1Y,
567
- point2X,
568
- point2Y
569
- }) => `The endpoint is at ${point1X} comma ${point1Y} and the ray goes through point ${point2X} comma ${point2Y}.`,
570
- srRayGrabHandle: ({
571
- point1X,
572
- point1Y,
573
- point2X,
574
- point2Y
575
- }) => `Ray with endpoint ${point1X} comma ${point1Y} going through point ${point2X} comma ${point2Y}.`,
576
- srRayEndpoint: ({
577
- x,
578
- y
579
- }) => `Endpoint at ${x} comma ${y}.`,
580
- srRayTerminalPoint: ({
581
- x,
582
- y
583
- }) => `Through point at ${x} comma ${y}.`,
750
+ srRayPoints: _ref55 => {
751
+ let {
752
+ point1X,
753
+ point1Y,
754
+ point2X,
755
+ point2Y
756
+ } = _ref55;
757
+ return `The endpoint is at ${point1X} comma ${point1Y} and the ray goes through point ${point2X} comma ${point2Y}.`;
758
+ },
759
+ srRayGrabHandle: _ref56 => {
760
+ let {
761
+ point1X,
762
+ point1Y,
763
+ point2X,
764
+ point2Y
765
+ } = _ref56;
766
+ return `Ray with endpoint ${point1X} comma ${point1Y} going through point ${point2X} comma ${point2Y}.`;
767
+ },
768
+ srRayEndpoint: _ref57 => {
769
+ let {
770
+ x,
771
+ y
772
+ } = _ref57;
773
+ return `Endpoint at ${x} comma ${y}.`;
774
+ },
775
+ srRayTerminalPoint: _ref58 => {
776
+ let {
777
+ x,
778
+ y
779
+ } = _ref58;
780
+ return `Through point at ${x} comma ${y}.`;
781
+ },
584
782
  srQuadraticGraph: "A parabola on a 4-quadrant coordinate plane.",
585
783
  srQuadraticFaceUp: "The parabola opens upward.",
586
784
  srQuadraticFaceDown: "The parabola opens downward.",
587
785
  srQuadraticGraphVertexOrigin: "Vertex is at the origin.",
588
786
  srQuadraticGraphVertexXAxis: "Vertex is on the X-axis.",
589
787
  srQuadraticGraphVertexYAxis: "Vertex is on the Y-axis.",
590
- srQuadraticGraphVertexQuadrant: ({
591
- quadrant
592
- }) => `Vertex is in quadrant ${quadrant}.`,
593
- srQuadraticTwoXIntercepts: ({
594
- intercept1,
595
- intercept2
596
- }) => `The X-intercepts are at ${intercept1} comma 0 and ${intercept2} comma 0.`,
597
- srQuadraticOneXIntercept: ({
598
- intercept
599
- }) => `The X-intercept is at ${intercept} comma 0.`,
600
- srQuadraticYIntercept: ({
601
- intercept
602
- }) => `The Y-intercept is at 0 comma ${intercept}.`,
603
- srQuadraticPointOrigin: ({
604
- pointNumber
605
- }) => `Point ${pointNumber} on parabola at the origin.`,
606
- srQuadraticPointAxis: ({
607
- pointNumber,
608
- x,
609
- y
610
- }) => `Point ${pointNumber} on parabola at ${x} comma ${y}.`,
611
- srQuadraticPointQuadrant: ({
612
- pointNumber,
613
- x,
614
- y,
615
- quadrant
616
- }) => `Point ${pointNumber} on parabola in quadrant ${quadrant} at ${x} comma ${y}.`,
617
- srQuadraticInteractiveElements: ({
618
- point1X,
619
- point1Y,
620
- point2X,
621
- point2Y,
622
- point3X,
623
- point3Y
624
- }) => `Parabola with points at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, and ${point3X} comma ${point3Y}.`,
788
+ srQuadraticGraphVertexQuadrant: _ref59 => {
789
+ let {
790
+ quadrant
791
+ } = _ref59;
792
+ return `Vertex is in quadrant ${quadrant}.`;
793
+ },
794
+ srQuadraticTwoXIntercepts: _ref60 => {
795
+ let {
796
+ intercept1,
797
+ intercept2
798
+ } = _ref60;
799
+ return `The X-intercepts are at ${intercept1} comma 0 and ${intercept2} comma 0.`;
800
+ },
801
+ srQuadraticOneXIntercept: _ref61 => {
802
+ let {
803
+ intercept
804
+ } = _ref61;
805
+ return `The X-intercept is at ${intercept} comma 0.`;
806
+ },
807
+ srQuadraticYIntercept: _ref62 => {
808
+ let {
809
+ intercept
810
+ } = _ref62;
811
+ return `The Y-intercept is at 0 comma ${intercept}.`;
812
+ },
813
+ srQuadraticPointOrigin: _ref63 => {
814
+ let {
815
+ pointNumber
816
+ } = _ref63;
817
+ return `Point ${pointNumber} on parabola at the origin.`;
818
+ },
819
+ srQuadraticPointAxis: _ref64 => {
820
+ let {
821
+ pointNumber,
822
+ x,
823
+ y
824
+ } = _ref64;
825
+ return `Point ${pointNumber} on parabola at ${x} comma ${y}.`;
826
+ },
827
+ srQuadraticPointQuadrant: _ref65 => {
828
+ let {
829
+ pointNumber,
830
+ x,
831
+ y,
832
+ quadrant
833
+ } = _ref65;
834
+ return `Point ${pointNumber} on parabola in quadrant ${quadrant} at ${x} comma ${y}.`;
835
+ },
836
+ srQuadraticInteractiveElements: _ref66 => {
837
+ let {
838
+ point1X,
839
+ point1Y,
840
+ point2X,
841
+ point2Y,
842
+ point3X,
843
+ point3Y
844
+ } = _ref66;
845
+ return `Parabola with points at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, and ${point3X} comma ${point3Y}.`;
846
+ },
625
847
  srPolygonGraph: "A polygon.",
626
848
  srPolygonGraphCoordinatePlane: "A polygon on a coordinate plane.",
627
- srPolygonGraphPointsNum: ({
628
- num
629
- }) => `The polygon has ${num} points.`,
849
+ srPolygonGraphPointsNum: _ref67 => {
850
+ let {
851
+ num
852
+ } = _ref67;
853
+ return `The polygon has ${num} points.`;
854
+ },
630
855
  srPolygonGraphPointsOne: "The polygon has 1 point.",
631
- srPolygonElementsNum: ({
632
- num
633
- }) => `A polygon with ${num} points.`,
856
+ srPolygonElementsNum: _ref68 => {
857
+ let {
858
+ num
859
+ } = _ref68;
860
+ return `A polygon with ${num} points.`;
861
+ },
634
862
  srPolygonElementsOne: "A polygon with 1 point.",
635
- srPolygonPointAngleApprox: ({
636
- angle
637
- }) => `Angle approximately equal to ${angle} degrees.`,
638
- srPolygonPointAngle: ({
639
- angle
640
- }) => `Angle equal to ${angle} degrees.`,
641
- srPolygonSideLength: ({
642
- pointNum,
643
- length
644
- }) => `A line segment, length equal to ${length} units, connects to point ${pointNum}.`,
645
- srPolygonSideLengthApprox: ({
646
- pointNum,
647
- length
648
- }) => `A line segment, length approximately equal to ${length} units, connects to point ${pointNum}.`,
863
+ srPolygonPointAngleApprox: _ref69 => {
864
+ let {
865
+ angle
866
+ } = _ref69;
867
+ return `Angle approximately equal to ${angle} degrees.`;
868
+ },
869
+ srPolygonPointAngle: _ref70 => {
870
+ let {
871
+ angle
872
+ } = _ref70;
873
+ return `Angle equal to ${angle} degrees.`;
874
+ },
875
+ srPolygonSideLength: _ref71 => {
876
+ let {
877
+ pointNum,
878
+ length
879
+ } = _ref71;
880
+ return `A line segment, length equal to ${length} units, connects to point ${pointNum}.`;
881
+ },
882
+ srPolygonSideLengthApprox: _ref72 => {
883
+ let {
884
+ pointNum,
885
+ length
886
+ } = _ref72;
887
+ return `A line segment, length approximately equal to ${length} units, connects to point ${pointNum}.`;
888
+ },
649
889
  srUnlimitedPolygonEmpty: "An empty coordinate plane.",
650
890
  srSinusoidGraph: "A sinusoid function on a coordinate plane.",
651
- srSinusoidRootPoint: ({
652
- x,
653
- y
654
- }) => `Midline intersection at ${x} comma ${y}.`,
655
- srSinusoidMaxPoint: ({
656
- x,
657
- y
658
- }) => `Maximum point at ${x} comma ${y}.`,
659
- srSinusoidMinPoint: ({
660
- x,
661
- y
662
- }) => `Minimum point at ${x} comma ${y}.`,
663
- srSinusoidFlatPoint: ({
664
- x,
665
- y
666
- }) => `Line through point at ${x} comma ${y}.`,
667
- srSinusoidDescription: ({
668
- minValue,
669
- maxValue,
670
- cycleStart,
671
- cycleEnd
672
- }) => `The graph shows a wave with a minimum value of ${minValue} and a maximum value of ${maxValue}. The wave completes a full cycle from ${cycleStart} to ${cycleEnd}.`,
673
- srSinusoidInteractiveElements: ({
674
- point1X,
675
- point1Y,
676
- point2X,
677
- point2Y
678
- }) => `Sinusoid graph with midline intersection point at ${point1X} comma ${point1Y} and extremum point at ${point2X} comma ${point2Y}.`
891
+ srSinusoidRootPoint: _ref73 => {
892
+ let {
893
+ x,
894
+ y
895
+ } = _ref73;
896
+ return `Midline intersection at ${x} comma ${y}.`;
897
+ },
898
+ srSinusoidMaxPoint: _ref74 => {
899
+ let {
900
+ x,
901
+ y
902
+ } = _ref74;
903
+ return `Maximum point at ${x} comma ${y}.`;
904
+ },
905
+ srSinusoidMinPoint: _ref75 => {
906
+ let {
907
+ x,
908
+ y
909
+ } = _ref75;
910
+ return `Minimum point at ${x} comma ${y}.`;
911
+ },
912
+ srSinusoidFlatPoint: _ref76 => {
913
+ let {
914
+ x,
915
+ y
916
+ } = _ref76;
917
+ return `Line through point at ${x} comma ${y}.`;
918
+ },
919
+ srSinusoidDescription: _ref77 => {
920
+ let {
921
+ minValue,
922
+ maxValue,
923
+ cycleStart,
924
+ cycleEnd
925
+ } = _ref77;
926
+ return `The graph shows a wave with a minimum value of ${minValue} and a maximum value of ${maxValue}. The wave completes a full cycle from ${cycleStart} to ${cycleEnd}.`;
927
+ },
928
+ srSinusoidInteractiveElements: _ref78 => {
929
+ let {
930
+ point1X,
931
+ point1Y,
932
+ point2X,
933
+ point2Y
934
+ } = _ref78;
935
+ return `Sinusoid graph with midline intersection point at ${point1X} comma ${point1Y} and extremum point at ${point2X} comma ${point2Y}.`;
936
+ }
937
+ // The above strings are used for interactive graph SR descriptions.
679
938
  };
939
+
940
+ // This type helps us make sure all error codes are mapped to strings
941
+
942
+ /**
943
+ * Map an error string to a PerseusStrings key
944
+ * that we can use to get the translated error message
945
+ */
680
946
  const errorToString = {
681
947
  MISSING_PERCENT_ERROR: "MISSING_PERCENT_ERROR",
682
948
  NEEDS_TO_BE_SIMPLIFIED_ERROR: "NEEDS_TO_BE_SIMPLFIED_ERROR",
@@ -690,12 +956,18 @@ const errorToString = {
690
956
  NOT_NONE_ABOVE_ERROR: "notNoneOfTheAbove",
691
957
  FILL_ALL_CELLS_ERROR: "fillAllCells"
692
958
  };
693
- function mapErrorToString(err, translatedStrings) {
959
+ function mapErrorToString(
960
+ // the string representing an error code
961
+ err,
962
+ // the translated Perseus strings
963
+ translatedStrings) {
694
964
  if (!err) {
695
965
  return err;
696
966
  }
697
967
  return translatedStrings[errorToString[err]] || err;
698
968
  }
699
969
 
700
- export { mapErrorToString, mockStrings, strings };
970
+ exports.mapErrorToString = mapErrorToString;
971
+ exports.mockStrings = mockStrings;
972
+ exports.strings = strings;
701
973
  //# sourceMappingURL=strings.js.map