@khanacademy/perseus 52.0.1 → 53.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 (60) hide show
  1. package/dist/components/number-input.d.ts +2 -0
  2. package/dist/components/range-input.d.ts +1 -0
  3. package/dist/components/svg-image.d.ts +2 -2
  4. package/dist/es/index.css +0 -30
  5. package/dist/es/index.js +385 -865
  6. package/dist/es/index.js.map +1 -1
  7. package/dist/index.css +0 -30
  8. package/dist/index.d.ts +1 -2
  9. package/dist/index.js +383 -868
  10. package/dist/index.js.map +1 -1
  11. package/dist/perseus-api.d.ts +0 -1
  12. package/dist/renderer.d.ts +1 -1
  13. package/dist/styles/constants.d.ts +0 -2
  14. package/dist/types.d.ts +3 -20
  15. package/dist/util/math-utils.d.ts +1 -0
  16. package/dist/util/scoring.d.ts +0 -15
  17. package/dist/util/test-utils.d.ts +1 -1
  18. package/dist/widget-ai-utils/mock-widget/prompt-utils.d.ts +1 -1
  19. package/dist/widget-container.d.ts +1 -1
  20. package/dist/widgets/categorizer/categorizer.d.ts +0 -3
  21. package/dist/widgets/cs-program/cs-program.d.ts +2 -3
  22. package/dist/widgets/definition/definition.d.ts +0 -2
  23. package/dist/widgets/deprecated-standin/deprecated-standin.d.ts +0 -1
  24. package/dist/widgets/dropdown/dropdown.d.ts +2 -4
  25. package/dist/widgets/explanation/explanation.d.ts +0 -2
  26. package/dist/widgets/expression/expression.d.ts +1 -5
  27. package/dist/widgets/grapher/grapher.d.ts +0 -2
  28. package/dist/widgets/group/group.d.ts +0 -4
  29. package/dist/widgets/iframe/iframe.d.ts +0 -2
  30. package/dist/widgets/image/image.d.ts +0 -3
  31. package/dist/widgets/input-number/input-number.d.ts +0 -3
  32. package/dist/widgets/interaction/interaction.d.ts +0 -1
  33. package/dist/widgets/interactive-graph.d.ts +0 -2
  34. package/dist/widgets/interactive-graphs/backgrounds/axis-ticks.d.ts +1 -0
  35. package/dist/widgets/label-image/label-image.d.ts +2 -2
  36. package/dist/widgets/matcher/matcher.d.ts +0 -2
  37. package/dist/widgets/matrix/matrix.d.ts +0 -3
  38. package/dist/widgets/measurer/measurer.d.ts +0 -1
  39. package/dist/widgets/mock-widgets/mock-widget-types.d.ts +0 -6
  40. package/dist/widgets/mock-widgets/mock-widget.d.ts +2 -5
  41. package/dist/widgets/molecule/molecule.d.ts +0 -1
  42. package/dist/widgets/number-line/number-line.d.ts +2 -3
  43. package/dist/widgets/numeric-input/numeric-input.d.ts +2 -3
  44. package/dist/widgets/orderer/orderer.d.ts +0 -3
  45. package/dist/widgets/passage/passage.d.ts +0 -1
  46. package/dist/widgets/passage-ref/passage-ref.d.ts +0 -2
  47. package/dist/widgets/passage-ref-target/passage-ref-target.d.ts +0 -2
  48. package/dist/widgets/plotter/plotter.d.ts +0 -3
  49. package/dist/widgets/radio/radio.d.ts +0 -3
  50. package/dist/widgets/sorter/sorter.d.ts +2 -4
  51. package/dist/widgets/table/table.d.ts +0 -3
  52. package/dist/widgets/video/video.d.ts +0 -3
  53. package/dist/widgets.d.ts +1 -32
  54. package/package.json +10 -10
  55. package/dist/renderer-util.d.ts +0 -14
  56. package/dist/widgets/__shared__/score-noop.d.ts +0 -11
  57. package/dist/widgets/group/score-group.d.ts +0 -4
  58. package/dist/widgets/group/validate-group.d.ts +0 -4
  59. package/dist/widgets/mock-widgets/score-mock-widget.d.ts +0 -5
  60. package/dist/widgets/mock-widgets/validate-mock-widget.d.ts +0 -4
package/dist/widgets.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { PerseusStrings } from "./strings";
2
- import type { Alignment, Tracking, WidgetExports, WidgetTransform, WidgetScorerFunction, WidgetValidatorFunction, PublicWidgetOptionsFunction } from "./types";
2
+ import type { Tracking, WidgetExports, WidgetTransform, PublicWidgetOptionsFunction } from "./types";
3
3
  import type { PerseusWidget, Version } from "@khanacademy/perseus-core";
4
4
  import type * as React from "react";
5
5
  type Editor = any;
@@ -28,8 +28,6 @@ export declare const replaceEditor: (name: string, replacementName: string) => v
28
28
  export declare const replaceDeprecatedEditors: () => void;
29
29
  export declare const getWidget: (name: string) => React.ComponentType<any> | null | undefined;
30
30
  export declare const getWidgetExport: (name: string) => WidgetExports | null;
31
- export declare const getWidgetValidator: (name: string) => WidgetValidatorFunction | null;
32
- export declare const getWidgetScorer: (name: string) => WidgetScorerFunction | null;
33
31
  export declare const getPublicWidgetOptionsFunction: (name: string) => PublicWidgetOptionsFunction;
34
32
  export declare const getEditor: (name: string) => Editor | null | undefined;
35
33
  export declare const getTransform: (name: string) => WidgetTransform | null | undefined;
@@ -40,37 +38,8 @@ export declare const getVersionVector: () => {
40
38
  export declare const getPublicWidgets: () => ReadonlyArray<WidgetExports>;
41
39
  export declare const isAccessible: (widgetInfo: PerseusWidget) => boolean;
42
40
  export declare const getAllWidgetTypes: () => ReadonlyArray<string>;
43
- export declare const upgradeWidgetInfoToLatestVersion: (oldWidgetInfo: PerseusWidget) => PerseusWidget;
44
41
  export declare const getRendererPropsForWidgetInfo: (widgetInfo: PerseusWidget, strings: PerseusStrings, problemNum?: number) => PerseusWidget;
45
42
  export declare const traverseChildWidgets: (widgetInfo: PerseusWidget, traverseRenderer: any) => PerseusWidget;
46
- /**
47
- * Handling for the optional alignments for widgets
48
- * See widget-container.jsx for details on how alignments are implemented.
49
- */
50
- /**
51
- * Returns the list of supported alignments for the given (string) widget
52
- * type. This is used primarily at editing time to display the choices
53
- * for the user.
54
- *
55
- * Supported alignments are given as an array of strings in the exports of
56
- * a widget's module.
57
- */
58
- export declare const getSupportedAlignments: (type: string) => ReadonlyArray<Alignment>;
59
- /**
60
- * For the given (string) widget type, determine the default alignment for
61
- * the widget. This is used at rendering time to go from "default" alignment
62
- * to the actual alignment displayed on the screen.
63
- *
64
- * The default alignment is given either as a string (called
65
- * `defaultAlignment`) or a function (called `getDefaultAlignment`) on
66
- * the exports of a widget's module.
67
- */
68
- export declare const getDefaultAlignment: (type: string) => Alignment;
69
- /**
70
- * Used at startup to fail fast if an alignment given by a widget is
71
- * invalid.
72
- */
73
- export declare const validateAlignments: () => void;
74
43
  /**
75
44
  * Handling for static mode for widgets that support it.
76
45
  */
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core Perseus API (includes renderers and widgets)",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "52.0.1",
6
+ "version": "53.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -41,15 +41,15 @@
41
41
  "test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
42
42
  },
43
43
  "dependencies": {
44
- "@khanacademy/kas": "^0.4.12",
45
- "@khanacademy/keypad-context": "^1.0.15",
46
- "@khanacademy/kmath": "^0.3.1",
47
- "@khanacademy/math-input": "^22.2.2",
48
- "@khanacademy/perseus-core": "3.3.0",
49
- "@khanacademy/perseus-linter": "^1.2.14",
50
- "@khanacademy/perseus-score": "^2.0.0",
51
- "@khanacademy/pure-markdown": "^0.3.23",
52
- "@khanacademy/simple-markdown": "^0.13.16",
44
+ "@khanacademy/kas": "^0.4.13",
45
+ "@khanacademy/keypad-context": "^1.0.16",
46
+ "@khanacademy/kmath": "^0.3.2",
47
+ "@khanacademy/math-input": "^22.2.3",
48
+ "@khanacademy/perseus-core": "3.4.0",
49
+ "@khanacademy/perseus-linter": "^1.2.15",
50
+ "@khanacademy/perseus-score": "^2.1.0",
51
+ "@khanacademy/pure-markdown": "^0.3.24",
52
+ "@khanacademy/simple-markdown": "^0.13.17",
53
53
  "@types/classnames": "2.2.0",
54
54
  "@use-gesture/react": "^10.2.27",
55
55
  "mafs": "0.19.0",
@@ -1,14 +0,0 @@
1
- import type { PerseusStrings } from "./strings";
2
- import type { PerseusRenderer, PerseusWidgetsMap } from "@khanacademy/perseus-core";
3
- import type { UserInputMap, PerseusScore, ValidationDataMap } from "@khanacademy/perseus-score";
4
- export declare function getUpgradedWidgetOptions(oldWidgetOptions: PerseusWidgetsMap): PerseusWidgetsMap;
5
- /**
6
- * Checks the given user input to see if any answerable widgets have not been
7
- * "filled in" (ie. if they're empty). Another way to think about this
8
- * function is that its a check to see if we can score the provided input.
9
- */
10
- export declare function emptyWidgetsFunctional(widgets: ValidationDataMap, widgetIds: ReadonlyArray<string>, userInputMap: UserInputMap, strings: PerseusStrings, locale: string): ReadonlyArray<string>;
11
- export declare function scorePerseusItem(perseusRenderData: PerseusRenderer, userInputMap: UserInputMap, strings: PerseusStrings, locale: string): PerseusScore;
12
- export declare function scoreWidgetsFunctional(widgets: PerseusWidgetsMap, widgetIds: ReadonlyArray<string>, userInputMap: UserInputMap, strings: PerseusStrings, locale: string): {
13
- [widgetId: string]: PerseusScore;
14
- };
@@ -1,11 +0,0 @@
1
- import type { PerseusScore } from "@khanacademy/perseus-score";
2
- /**
3
- * Several widgets don't have "right"/"wrong" scoring logic,
4
- * so this just says to move on past those widgets
5
- *
6
- * TODO(LEMS-2543) widgets that use this probably shouldn't have any
7
- * scoring logic and the thing scoring an exercise
8
- * should just know to skip these
9
- */
10
- declare function scoreNoop(points?: number): PerseusScore;
11
- export default scoreNoop;
@@ -1,4 +0,0 @@
1
- import type { PerseusStrings } from "../../strings";
2
- import type { PerseusGroupRubric, PerseusGroupUserInput, PerseusScore } from "@khanacademy/perseus-score";
3
- declare function scoreGroup(userInput: PerseusGroupUserInput, rubric: PerseusGroupRubric, strings: PerseusStrings, locale: string): PerseusScore;
4
- export default scoreGroup;
@@ -1,4 +0,0 @@
1
- import type { PerseusStrings } from "../../strings";
2
- import type { PerseusGroupUserInput, PerseusGroupValidationData, ValidationResult } from "@khanacademy/perseus-score";
3
- declare function validateGroup(userInput: PerseusGroupUserInput, validationData: PerseusGroupValidationData, strings: PerseusStrings, locale: string): ValidationResult;
4
- export default validateGroup;
@@ -1,5 +0,0 @@
1
- import type { PerseusMockWidgetUserInput, PerseusMockWidgetRubric } from "./mock-widget-types";
2
- import type { PerseusStrings } from "../../strings";
3
- import type { PerseusScore } from "@khanacademy/perseus-score";
4
- declare function scoreMockWidget(userInput: PerseusMockWidgetUserInput, rubric: PerseusMockWidgetRubric, strings: PerseusStrings): PerseusScore;
5
- export default scoreMockWidget;
@@ -1,4 +0,0 @@
1
- import type { PerseusMockWidgetUserInput } from "./mock-widget-types";
2
- import type { ValidationResult } from "@khanacademy/perseus-score";
3
- declare function validateMockWidget(userInput: PerseusMockWidgetUserInput): ValidationResult;
4
- export default validateMockWidget;