@khanacademy/perseus 54.0.0 → 55.0.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.
Files changed (43) hide show
  1. package/LICENSE +18 -0
  2. package/dist/components/number-input.d.ts +9 -10
  3. package/dist/components/range-input.d.ts +5 -6
  4. package/dist/components/simple-keypad-input.d.ts +5 -0
  5. package/dist/components/stub-tag-editor.d.ts +3 -4
  6. package/dist/components/text-list-editor.d.ts +3 -4
  7. package/dist/es/index.css +16 -6
  8. package/dist/es/index.js +919 -1066
  9. package/dist/es/index.js.map +1 -1
  10. package/dist/es/strings.js +40 -10
  11. package/dist/es/strings.js.map +1 -1
  12. package/dist/index.css +16 -6
  13. package/dist/index.js +1055 -1170
  14. package/dist/index.js.map +1 -1
  15. package/dist/mixins/changeable.d.ts +1 -2
  16. package/dist/perseus-api.d.ts +1 -56
  17. package/dist/shared-utils/add-library-version-to-perseus-debug.d.ts +9 -0
  18. package/dist/strings.d.ts +34 -4
  19. package/dist/strings.js +142 -97
  20. package/dist/strings.js.map +1 -1
  21. package/dist/types.d.ts +3 -1
  22. package/dist/util.d.ts +0 -5
  23. package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +1 -1
  24. package/dist/widgets/categorizer/categorizer.d.ts +1 -1
  25. package/dist/widgets/dropdown/dropdown.d.ts +5 -4
  26. package/dist/widgets/expression/expression.d.ts +0 -2
  27. package/dist/widgets/interactive-graph.d.ts +4 -2
  28. package/dist/widgets/interactive-graphs/graphs/circle.d.ts +7 -0
  29. package/dist/widgets/interactive-graphs/graphs/components/movable-line.d.ts +6 -0
  30. package/dist/widgets/interactive-graphs/graphs/quadratic.d.ts +8 -0
  31. package/dist/widgets/interactive-graphs/graphs/sinusoid.d.ts +7 -0
  32. package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +1 -1
  33. package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +6 -1
  34. package/dist/widgets/numeric-input/index.d.ts +1 -1
  35. package/dist/widgets/numeric-input/input-with-examples.d.ts +8 -0
  36. package/dist/widgets/numeric-input/numeric-input.class.d.ts +66 -0
  37. package/dist/widgets/numeric-input/numeric-input.d.ts +123 -77
  38. package/dist/widgets/numeric-input/utils.d.ts +25 -0
  39. package/dist/widgets/radio/radio.d.ts +1 -1
  40. package/dist/widgets/sorter/sorter.d.ts +1 -1
  41. package/package.json +120 -124
  42. package/dist/components/input-with-examples.d.ts +0 -51
  43. package/dist/components/tooltip.d.ts +0 -85
@@ -6,7 +6,6 @@
6
6
  * This.change takes prop changes as parameters, and calls
7
7
  * this.props.onChange with the modified props.
8
8
  */
9
- import PropTypes from "prop-types";
10
9
  import type { ChangeFn } from "../types";
11
10
  /**
12
11
  * this.change()
@@ -21,7 +20,7 @@ import type { ChangeFn } from "../types";
21
20
  */
22
21
  export declare const change: ChangeFn;
23
22
  export declare const propTypes: {
24
- readonly onChange: PropTypes.Validator<(...args: any[]) => any>;
23
+ readonly onChange: any;
25
24
  };
26
25
  export type ChangeableProps = {
27
26
  onChange: (values: {
@@ -1,61 +1,6 @@
1
- /**
2
- * [Most of] the Perseus client API.
3
- *
4
- * If making a change to this file, or otherwise to the perseus
5
- * API, you should increment:
6
- * * the perseus api major version if it is a breaking change
7
- * * the perseus api minor version if it is an additive-only change
8
- * * nothing if it is purely a bug fix.
9
- *
10
- * Callbacks passed to Renderer/ItemRenderer:
11
- * * onFocusChange: (newFocusPath, oldFocusPath, keypadDOMNode)
12
- * Called when the user focus changes. The first two parameters are `path`
13
- * arrays uniquely identifying the respect inputs. The third parameter,
14
- * `keypadDOMNode`, is the DOM node of the custom keypad, or `null` if the
15
- * keypad is disabled, which can be used by clients to accommodate for the
16
- * appearance of the keypad on the screen.
17
- * When focus changes to or from nothing being selected, `path` will be null.
18
- * * interactionCallback: Called when the user interacts with a widget.
19
- * * answerableCallback: Called with the current `answerability` of the
20
- * problem, e.g. whether all required fields have input.
21
- * * getAnotherHint: If provided, a button is rendered at the bottom of the
22
- * hints (only when at least one hint has been shown, and not all hints
23
- * have been shown) allowing the user to take another hint. This function
24
- * is then called when the user clicks the button.
25
- *
26
- * Stable CSS ClassNames:
27
- * These are css class names that will continue to preserve their
28
- * semantic meaning across the same perseus api major version.
29
- */
30
- import PropTypes from "prop-types";
31
1
  import type { APIOptionsWithDefaults } from "./types";
32
2
  export declare const ApiOptions: {
33
- readonly propTypes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
34
- isArticle: PropTypes.Validator<boolean>;
35
- onFocusChange: PropTypes.Validator<(...args: any[]) => any>;
36
- GroupMetadataEditor: PropTypes.Validator<(...args: any[]) => any>;
37
- showAlignmentOptions: PropTypes.Validator<boolean>;
38
- readOnly: PropTypes.Validator<boolean>;
39
- answerableCallback: PropTypes.Requireable<(...args: any[]) => any>;
40
- getAnotherHint: PropTypes.Requireable<(...args: any[]) => any>;
41
- interactionCallback: PropTypes.Requireable<(...args: any[]) => any>;
42
- groupAnnotator: PropTypes.Validator<(...args: any[]) => any>;
43
- imagePlaceholder: PropTypes.Requireable<PropTypes.ReactNodeLike>;
44
- widgetPlaceholder: PropTypes.Requireable<PropTypes.ReactNodeLike>;
45
- baseElements: PropTypes.Requireable<PropTypes.InferProps<{
46
- Link: PropTypes.Requireable<(...args: any[]) => any>;
47
- }>>;
48
- imagePreloader: PropTypes.Requireable<(...args: any[]) => any>;
49
- trackInteraction: PropTypes.Requireable<(...args: any[]) => any>;
50
- customKeypad: PropTypes.Requireable<boolean>;
51
- nativeKeypadProxy: PropTypes.Requireable<(...args: any[]) => any>;
52
- isMobile: PropTypes.Requireable<boolean>;
53
- setDrawingAreaAvailable: PropTypes.Requireable<(...args: any[]) => any>;
54
- hintProgressColor: PropTypes.Requireable<string>;
55
- canScrollPage: PropTypes.Requireable<boolean>;
56
- crossOutEnabled: PropTypes.Requireable<boolean>;
57
- editorChangeDelay: PropTypes.Requireable<number>;
58
- }>>>;
3
+ readonly propTypes: any;
59
4
  readonly defaults: APIOptionsWithDefaults;
60
5
  };
61
6
  export declare const ClassNames: {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Adds the given perseus library version information to the __perseus_debug__
3
+ * object and ensures that the object is attached to `globalThis` (`window` in
4
+ * browser environments).
5
+ *
6
+ * This allows each library to provide runtime version information to assist in
7
+ * debugging in production environments.
8
+ */
9
+ export declare const addLibraryVersionToPerseusDebug: (libraryName: string, libraryVersion: string) => void;
package/dist/strings.d.ts CHANGED
@@ -201,7 +201,11 @@ export type PerseusStrings = {
201
201
  centerX: string;
202
202
  centerY: string;
203
203
  }) => string;
204
- srCircleRadiusPoint: ({ radiusPointX, radiusPointY, }: {
204
+ srCircleRadiusPointRight: ({ radiusPointX, radiusPointY, }: {
205
+ radiusPointX: string;
206
+ radiusPointY: string;
207
+ }) => string;
208
+ srCircleRadiusPointLeft: ({ radiusPointX, radiusPointY, }: {
205
209
  radiusPointX: string;
206
210
  radiusPointY: string;
207
211
  }) => string;
@@ -332,6 +336,18 @@ export type PerseusStrings = {
332
336
  x: string;
333
337
  y: string;
334
338
  }): string;
339
+ srLinearSystemGrabHandle({ lineNumber, point1X, point1Y, point2X, point2Y, }: {
340
+ lineNumber: number;
341
+ point1X: string;
342
+ point1Y: string;
343
+ point2X: string;
344
+ point2Y: string;
345
+ }): string;
346
+ srLinearSystemIntersection({ x, y }: {
347
+ x: string;
348
+ y: string;
349
+ }): string;
350
+ srLinearSystemParallel: string;
335
351
  srRayGraph: string;
336
352
  srRayPoints: ({ point1X, point1Y, point2X, point2Y, }: {
337
353
  point1X: string;
@@ -424,7 +440,15 @@ export type PerseusStrings = {
424
440
  x: string;
425
441
  y: string;
426
442
  }) => string;
427
- srSinusoidPeakPoint: ({ x, y }: {
443
+ srSinusoidMaxPoint: ({ x, y }: {
444
+ x: string;
445
+ y: string;
446
+ }) => string;
447
+ srSinusoidMinPoint: ({ x, y }: {
448
+ x: string;
449
+ y: string;
450
+ }) => string;
451
+ srSinusoidFlatPoint: ({ x, y }: {
428
452
  x: string;
429
453
  y: string;
430
454
  }) => string;
@@ -596,7 +620,8 @@ export declare const strings: {
596
620
  srPointAtCoordinates: string;
597
621
  srCircleGraph: string;
598
622
  srCircleShape: string;
599
- srCircleRadiusPoint: string;
623
+ srCircleRadiusPointRight: string;
624
+ srCircleRadiusPointLeft: string;
600
625
  srCircleRadius: string;
601
626
  srCircleOuterPoints: string;
602
627
  srLinearGraph: string;
@@ -628,6 +653,9 @@ export declare const strings: {
628
653
  srLinearSystemGraph: string;
629
654
  srLinearSystemPoints: string;
630
655
  srLinearSystemPoint: string;
656
+ srLinearSystemGrabHandle: string;
657
+ srLinearSystemIntersection: string;
658
+ srLinearSystemParallel: string;
631
659
  srRayGraph: string;
632
660
  srRayPoints: string;
633
661
  srRayGrabHandle: string;
@@ -660,7 +688,9 @@ export declare const strings: {
660
688
  srUnlimitedPolygonEmpty: string;
661
689
  srSinusoidGraph: string;
662
690
  srSinusoidRootPoint: string;
663
- srSinusoidPeakPoint: string;
691
+ srSinusoidMaxPoint: string;
692
+ srSinusoidMinPoint: string;
693
+ srSinusoidFlatPoint: string;
664
694
  srSinusoidDescription: string;
665
695
  srSinusoidInteractiveElements: string;
666
696
  };