@khanacademy/perseus 59.1.1 → 60.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.
Files changed (48) hide show
  1. package/dist/es/index.js +7 -7
  2. package/dist/es/index.js.map +1 -1
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +6 -7
  5. package/dist/index.js.map +1 -1
  6. package/dist/renderer.d.ts +1 -2
  7. package/dist/server-item-renderer.d.ts +2 -2
  8. package/dist/types.d.ts +6 -2
  9. package/dist/util/scoring.d.ts +1 -2
  10. package/dist/util/test-utils.d.ts +1 -2
  11. package/dist/widget-ai-utils/categorizer/categorizer-ai-utils.d.ts +1 -1
  12. package/dist/widget-ai-utils/dropdown/dropdown-ai-utils.d.ts +1 -1
  13. package/dist/widget-ai-utils/expression/expression-ai-utils.d.ts +1 -1
  14. package/dist/widget-ai-utils/grapher/grapher-ai-utils.d.ts +1 -2
  15. package/dist/widget-ai-utils/input-number/input-number-ai-utils.d.ts +1 -1
  16. package/dist/widget-ai-utils/label-image/label-image-ai-utils.d.ts +1 -1
  17. package/dist/widget-ai-utils/matcher/matcher-ai-utils.d.ts +1 -1
  18. package/dist/widget-ai-utils/matrix/matrix-ai-utils.d.ts +1 -1
  19. package/dist/widget-ai-utils/number-line/number-line-ai-utils.d.ts +1 -1
  20. package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +1 -1
  21. package/dist/widget-ai-utils/orderer/orderer-ai-utils.d.ts +1 -1
  22. package/dist/widget-ai-utils/radio/radio-ai-utils.d.ts +1 -1
  23. package/dist/widget-ai-utils/sorter/sorter-ai-utils.d.ts +1 -1
  24. package/dist/widgets/categorizer/categorizer.d.ts +3 -4
  25. package/dist/widgets/cs-program/cs-program.d.ts +1 -2
  26. package/dist/widgets/dropdown/dropdown.d.ts +1 -2
  27. package/dist/widgets/expression/expression.d.ts +3 -2
  28. package/dist/widgets/graded-group/graded-group.d.ts +1 -2
  29. package/dist/widgets/graded-group-set/graded-group-set.d.ts +1 -2
  30. package/dist/widgets/grapher/grapher.d.ts +1 -2
  31. package/dist/widgets/group/group.d.ts +1 -2
  32. package/dist/widgets/iframe/iframe.d.ts +1 -2
  33. package/dist/widgets/input-number/input-number.d.ts +1 -2
  34. package/dist/widgets/interactive-graph.d.ts +1 -2
  35. package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +1 -2
  36. package/dist/widgets/label-image/label-image.d.ts +1 -2
  37. package/dist/widgets/matcher/matcher.d.ts +1 -2
  38. package/dist/widgets/matrix/matrix.d.ts +1 -2
  39. package/dist/widgets/number-line/number-line.d.ts +1 -2
  40. package/dist/widgets/numeric-input/numeric-input.class.d.ts +1 -2
  41. package/dist/widgets/numeric-input/numeric-input.d.ts +3 -1
  42. package/dist/widgets/orderer/orderer.d.ts +1 -2
  43. package/dist/widgets/plotter/plotter.d.ts +4 -4
  44. package/dist/widgets/radio/radio-component.d.ts +1 -2
  45. package/dist/widgets/sorter/sorter.d.ts +1 -2
  46. package/dist/widgets/table/table.d.ts +1 -2
  47. package/package.json +7 -7
  48. package/dist/widgets/__shared__/test-keypad-context-wrapper.d.ts +0 -6
@@ -1,4 +1,3 @@
1
- import { type PerseusScore, type UserInputArray, type UserInputMap } from "@khanacademy/perseus-score";
2
1
  import * as React from "react";
3
2
  import { PerseusI18nContext } from "./components/i18n-context";
4
3
  import InteractionTracker from "./interaction-tracker";
@@ -9,7 +8,7 @@ import type { PerseusStrings } from "./strings";
9
8
  import type { APIOptions, APIOptionsWithDefaults, FilterCriterion, FocusPath, SerializedState, Widget, WidgetProps } from "./types";
10
9
  import type { GetPromptJSONInterface, RendererPromptJSON } from "./widget-ai-utils/prompt-types";
11
10
  import type { KeypadAPI } from "@khanacademy/math-input";
12
- import type { PerseusRenderer, PerseusWidget, PerseusWidgetOptions, PerseusWidgetsMap, ShowSolutions } from "@khanacademy/perseus-core";
11
+ import type { PerseusRenderer, PerseusWidget, PerseusWidgetOptions, PerseusWidgetsMap, ShowSolutions, PerseusScore, UserInputArray, UserInputMap } from "@khanacademy/perseus-core";
13
12
  import type { LinterContextProps } from "@khanacademy/perseus-linter";
14
13
  import "./styles/perseus-renderer.less";
15
14
  type WidgetState = {
@@ -13,8 +13,7 @@ import Renderer from "./renderer";
13
13
  import type { FocusPath, PerseusDependenciesV2, SharedRendererProps } from "./types";
14
14
  import type { GetPromptJSONInterface, RendererPromptJSON } from "./widget-ai-utils/prompt-types";
15
15
  import type { KeypadAPI } from "@khanacademy/math-input";
16
- import type { PerseusItem, ShowSolutions, KeypadContextRendererInterface, RendererInterface, KEScore } from "@khanacademy/perseus-core";
17
- import type { UserInputArray, UserInputMap } from "@khanacademy/perseus-score";
16
+ import type { PerseusItem, ShowSolutions, KeypadContextRendererInterface, RendererInterface, KEScore, UserInputArray, UserInputMap } from "@khanacademy/perseus-core";
18
17
  type OwnProps = {
19
18
  hintsVisible?: number;
20
19
  item: PerseusItem;
@@ -150,6 +149,7 @@ declare const ref: React.ForwardRefExoticComponent<Omit<Pick<SharedRendererProps
150
149
  canScrollPage?: boolean;
151
150
  crossOutEnabled?: boolean;
152
151
  editorChangeDelay?: number;
152
+ flags?: Record<string, boolean>;
153
153
  onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
154
154
  }> | undefined;
155
155
  linterContext?: PerseusLinter.LinterContextProps | undefined;
package/dist/types.d.ts CHANGED
@@ -3,9 +3,8 @@ import type { PerseusStrings } from "./strings";
3
3
  import type { SizeClass } from "./util/sizing-utils";
4
4
  import type { WidgetPromptJSON } from "./widget-ai-utils/prompt-types";
5
5
  import type { KeypadAPI } from "@khanacademy/math-input";
6
- import type { Hint, PerseusAnswerArea, PerseusGraphType, PerseusWidget, PerseusWidgetsMap, AnalyticsEventHandlerFn, Version, WidgetOptionsUpgradeMap } from "@khanacademy/perseus-core";
6
+ import type { Hint, PerseusAnswerArea, PerseusGraphType, PerseusWidget, PerseusWidgetsMap, AnalyticsEventHandlerFn, Version, WidgetOptionsUpgradeMap, Rubric, UserInput, UserInputArray, UserInputMap } from "@khanacademy/perseus-core";
7
7
  import type { LinterContextProps } from "@khanacademy/perseus-linter";
8
- import type { Rubric, UserInput, UserInputArray, UserInputMap } from "@khanacademy/perseus-score";
9
8
  import type { Result } from "@khanacademy/wonder-blocks-data";
10
9
  import type * as React from "react";
11
10
  export type FocusPath = ReadonlyArray<string> | null | undefined;
@@ -222,6 +221,11 @@ export type APIOptions = Readonly<{
222
221
  * only after a good few seconds.
223
222
  */
224
223
  editorChangeDelay?: number;
224
+ /**
225
+ * Feature flags that can be passed from consuming application.
226
+ * Define the feature flag name in packages/perseus-core/src/feature-flags.ts
227
+ */
228
+ flags?: Record<string, boolean>;
225
229
  /**
226
230
  * This is a callback function that returns all of the Widget props
227
231
  * after they have been transformed by the widget's transform function.
@@ -1,4 +1,3 @@
1
- import type { KEScore } from "@khanacademy/perseus-core";
2
- import type { PerseusScore, UserInputArray } from "@khanacademy/perseus-score";
1
+ import type { KEScore, PerseusScore, UserInputArray } from "@khanacademy/perseus-core";
3
2
  export declare function isCorrect(score: PerseusScore): boolean;
4
3
  export declare function keScoreFromPerseusScore(score: PerseusScore, guess: UserInputArray | [UserInputArray, []], state: any): KEScore;
@@ -1,5 +1,4 @@
1
- import { type PerseusScore, type UserInputMap } from "@khanacademy/perseus-score";
2
- import type { CategorizerWidget, ExpressionWidget, InteractiveGraphWidget, NumericInputWidget, PerseusItem, PerseusRenderer, RadioWidget } from "@khanacademy/perseus-core";
1
+ import type { CategorizerWidget, ExpressionWidget, InteractiveGraphWidget, NumericInputWidget, PerseusItem, PerseusRenderer, RadioWidget, PerseusScore, UserInputMap } from "@khanacademy/perseus-core";
3
2
  export declare const genericPerseusItemData: PerseusItem;
4
3
  /**
5
4
  * Thin wrapper around scorePerseusItem for internal testing
@@ -1,5 +1,5 @@
1
1
  import type categorizer from "../../widgets/categorizer/categorizer";
2
- import type { PerseusCategorizerUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusCategorizerUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type CategorizerPromptJSON = {
5
5
  type: "categorizer";
@@ -1,5 +1,5 @@
1
1
  import type dropdown from "../../widgets/dropdown/dropdown";
2
- import type { PerseusDropdownUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusDropdownUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type DropdownPromptJSON = {
5
5
  type: "dropdown";
@@ -1,5 +1,5 @@
1
1
  import type expression from "../../widgets/expression/expression";
2
- import type { PerseusExpressionUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusExpressionUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type ExpressionPromptJSON = {
5
5
  type: "expression";
@@ -1,6 +1,5 @@
1
1
  import type grapher from "../../widgets/grapher/grapher";
2
- import type { GrapherAnswerTypes } from "@khanacademy/perseus-core";
3
- import type { PerseusGrapherUserInput } from "@khanacademy/perseus-score";
2
+ import type { GrapherAnswerTypes, PerseusGrapherUserInput } from "@khanacademy/perseus-core";
4
3
  import type React from "react";
5
4
  export type GrapherPromptJSON = {
6
5
  type: "grapher";
@@ -1,5 +1,5 @@
1
1
  import type inputNumber from "../../widgets/input-number/input-number";
2
- import type { PerseusInputNumberUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusInputNumberUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type InputNumberPromptJSON = {
5
5
  type: "input-number";
@@ -1,5 +1,5 @@
1
1
  import type labelImage from "../../widgets/label-image/label-image";
2
- import type { PerseusLabelImageUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusLabelImageUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  type BaseMarker = {
5
5
  label: string;
@@ -1,5 +1,5 @@
1
1
  import type matcher from "../../widgets/matcher/matcher";
2
- import type { PerseusMatcherUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusMatcherUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type MatcherPromptJSON = {
5
5
  type: "matcher";
@@ -1,5 +1,5 @@
1
1
  import type matrix from "../../widgets/matrix/matrix";
2
- import type { PerseusMatrixUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusMatrixUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type MatrixPromptJSON = {
5
5
  type: "matrix";
@@ -1,5 +1,5 @@
1
1
  import type numberLine from "../../widgets/number-line/number-line";
2
- import type { PerseusNumberLineUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusNumberLineUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type NumberLinePromptJSON = {
5
5
  type: "number-line";
@@ -1,5 +1,5 @@
1
1
  import type numericInput from "../../widgets/numeric-input/numeric-input.class";
2
- import type { PerseusNumericInputUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusNumericInputUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type NumericInputPromptJSON = {
5
5
  type: "numeric-input";
@@ -1,5 +1,5 @@
1
1
  import type orderer from "../../widgets/orderer/orderer";
2
- import type { PerseusOrdererUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusOrdererUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  export type OrdererPromptJSON = {
5
5
  type: "orderer";
@@ -1,5 +1,5 @@
1
1
  import type radio from "../../widgets/radio/radio";
2
- import type { PerseusRadioUserInput } from "@khanacademy/perseus-score";
2
+ import type { PerseusRadioUserInput } from "@khanacademy/perseus-core";
3
3
  import type React from "react";
4
4
  type BasicOption = {
5
5
  value: string;
@@ -1,4 +1,4 @@
1
- import type { PerseusSorterUserInput } from "@khanacademy/perseus-score";
1
+ import type { PerseusSorterUserInput } from "@khanacademy/perseus-core";
2
2
  export type SorterPromptJSON = {
3
3
  type: "sorter";
4
4
  userInput: {
@@ -2,9 +2,8 @@ import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { Widget, WidgetProps } from "../../types";
4
4
  import type { CategorizerPromptJSON } from "../../widget-ai-utils/categorizer/categorizer-ai-utils";
5
- import type { PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
6
- import type { PerseusCategorizerRubric, PerseusCategorizerUserInput } from "@khanacademy/perseus-score";
7
- type Props = WidgetProps<RenderProps, PerseusCategorizerRubric> & {
5
+ import type { PerseusCategorizerWidgetOptions, PerseusCategorizerUserInput, CategorizerPublicWidgetOptions } from "@khanacademy/perseus-core";
6
+ type Props = WidgetProps<RenderProps> & {
8
7
  values: ReadonlyArray<string>;
9
8
  };
10
9
  type DefaultProps = {
@@ -39,7 +38,7 @@ declare const _default: {
39
38
  displayName: string;
40
39
  hidden: true;
41
40
  widget: typeof Categorizer;
42
- transform: (widgetOptions: PerseusCategorizerWidgetOptions) => RenderProps;
41
+ transform: (widgetOptions: CategorizerPublicWidgetOptions) => RenderProps;
43
42
  staticTransform: (editorProps: PerseusCategorizerWidgetOptions) => RenderProps;
44
43
  isLintable: true;
45
44
  };
@@ -4,8 +4,7 @@
4
4
  import * as React from "react";
5
5
  import type { Widget, WidgetProps } from "../../types";
6
6
  import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
7
- import type { PerseusCSProgramWidgetOptions } from "@khanacademy/perseus-core";
8
- import type { PerseusCSProgramUserInput } from "@khanacademy/perseus-score";
7
+ import type { PerseusCSProgramWidgetOptions, PerseusCSProgramUserInput } from "@khanacademy/perseus-core";
9
8
  type RenderProps = PerseusCSProgramWidgetOptions & PerseusCSProgramUserInput;
10
9
  type Props = WidgetProps<RenderProps>;
11
10
  type DefaultProps = {
@@ -2,8 +2,7 @@ import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { Widget, WidgetProps } from "../../types";
4
4
  import type { DropdownPromptJSON } from "../../widget-ai-utils/dropdown/dropdown-ai-utils";
5
- import type { DropdownPublicWidgetOptions, PerseusDropdownWidgetOptions } from "@khanacademy/perseus-core";
6
- import type { PerseusDropdownUserInput } from "@khanacademy/perseus-score";
5
+ import type { DropdownPublicWidgetOptions, PerseusDropdownWidgetOptions, PerseusDropdownUserInput } from "@khanacademy/perseus-core";
7
6
  type Props = WidgetProps<RenderProps> & {
8
7
  selected: number;
9
8
  };
@@ -3,8 +3,7 @@ import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { DependenciesContext } from "../../dependencies";
4
4
  import type { WidgetProps, Widget, FocusPath } from "../../types";
5
5
  import type { ExpressionPromptJSON } from "../../widget-ai-utils/expression/expression-ai-utils";
6
- import type { PerseusExpressionWidgetOptions, ExpressionPublicWidgetOptions, KeypadConfiguration, KeypadKey } from "@khanacademy/perseus-core";
7
- import type { PerseusExpressionRubric, PerseusExpressionUserInput } from "@khanacademy/perseus-score";
6
+ import type { PerseusExpressionWidgetOptions, ExpressionPublicWidgetOptions, KeypadConfiguration, KeypadKey, PerseusExpressionRubric, PerseusExpressionUserInput } from "@khanacademy/perseus-core";
8
7
  type InputPath = ReadonlyArray<string>;
9
8
  type RenderProps = {
10
9
  buttonSets: PerseusExpressionWidgetOptions["buttonSets"];
@@ -113,6 +112,7 @@ declare const _default: {
113
112
  canScrollPage?: boolean;
114
113
  crossOutEnabled?: boolean;
115
114
  editorChangeDelay?: number;
115
+ flags?: Record<string, boolean>;
116
116
  onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
117
117
  }> & {
118
118
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
@@ -185,6 +185,7 @@ declare const _default: {
185
185
  canScrollPage?: boolean;
186
186
  crossOutEnabled?: boolean;
187
187
  editorChangeDelay?: number;
188
+ flags?: Record<string, boolean>;
188
189
  onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
189
190
  }> & {
190
191
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
@@ -4,8 +4,7 @@ import Renderer from "../../renderer";
4
4
  import type { ANSWER_BAR_STATES } from "./graded-group-answer-bar";
5
5
  import type { FocusPath, TrackingGradedGroupExtraArguments, Widget, WidgetProps } from "../../types";
6
6
  import type { GradedGroupPromptJSON } from "../../widget-ai-utils/graded-group/graded-group-ai-utils";
7
- import type { PerseusGradedGroupWidgetOptions } from "@khanacademy/perseus-core";
8
- import type { PerseusGradedGroupRubric } from "@khanacademy/perseus-score";
7
+ import type { PerseusGradedGroupWidgetOptions, PerseusGradedGroupRubric } from "@khanacademy/perseus-core";
9
8
  declare const GRADING_STATUSES: {
10
9
  readonly ungraded: "ungraded";
11
10
  readonly correct: "correct";
@@ -3,8 +3,7 @@ import * as Changeable from "../../mixins/changeable";
3
3
  import { GradedGroup } from "../graded-group/graded-group";
4
4
  import type { FocusPath, Widget, WidgetProps } from "../../types";
5
5
  import type { GradedGroupSetPromptJSON } from "../../widget-ai-utils/graded-group-set/graded-group-set-ai-utils";
6
- import type { PerseusGradedGroupSetWidgetOptions } from "@khanacademy/perseus-core";
7
- import type { PerseusGradedGroupSetRubric } from "@khanacademy/perseus-score";
6
+ import type { PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupSetRubric } from "@khanacademy/perseus-core";
8
7
  type RenderProps = PerseusGradedGroupSetWidgetOptions;
9
8
  type Props = Changeable.ChangeableProps & WidgetProps<RenderProps, PerseusGradedGroupSetRubric> & {
10
9
  trackInteraction: () => void;
@@ -4,8 +4,7 @@ import type { Coord } from "../../interactive2/types";
4
4
  import type { Widget, WidgetProps } from "../../types";
5
5
  import type { GridDimensions } from "../../util";
6
6
  import type { GrapherPromptJSON } from "../../widget-ai-utils/grapher/grapher-ai-utils";
7
- import type { MarkingsType, PerseusGrapherWidgetOptions } from "@khanacademy/perseus-core";
8
- import type { PerseusGrapherRubric, PerseusGrapherUserInput } from "@khanacademy/perseus-score";
7
+ import type { MarkingsType, PerseusGrapherWidgetOptions, PerseusGrapherRubric, PerseusGrapherUserInput } from "@khanacademy/perseus-core";
9
8
  import type { PropsFor } from "@khanacademy/wonder-blocks-core";
10
9
  type RenderProps = {
11
10
  availableTypes: PerseusGrapherWidgetOptions["availableTypes"];
@@ -3,8 +3,7 @@ import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import Renderer from "../../renderer";
4
4
  import type { ChangeFn, FocusPath, Widget, WidgetProps } from "../../types";
5
5
  import type { GroupPromptJSON } from "../../widget-ai-utils/group/group-ai-utils";
6
- import type { PerseusGroupWidgetOptions } from "@khanacademy/perseus-core";
7
- import type { PerseusGroupRubric, UserInputArray, UserInputMap } from "@khanacademy/perseus-score";
6
+ import type { PerseusGroupWidgetOptions, PerseusGroupRubric, UserInputArray, UserInputMap } from "@khanacademy/perseus-core";
8
7
  type RenderProps = PerseusGroupWidgetOptions;
9
8
  type Props = WidgetProps<RenderProps, PerseusGroupRubric>;
10
9
  type DefaultProps = {
@@ -6,11 +6,10 @@
6
6
  * It's particularly well suited for embedding our ProcessingJS programs,
7
7
  * but could also be used for embedding viz's hosted elsewhere.
8
8
  */
9
- import { type PerseusIFrameWidgetOptions } from "@khanacademy/perseus-core";
10
9
  import * as React from "react";
11
10
  import type { WidgetProps, Widget } from "../../types";
12
11
  import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
13
- import type { PerseusIFrameUserInput, UserInputStatus } from "@khanacademy/perseus-score";
12
+ import type { PerseusIFrameUserInput, UserInputStatus, PerseusIFrameWidgetOptions } from "@khanacademy/perseus-core";
14
13
  type RenderProps = PerseusIFrameWidgetOptions & {
15
14
  status: UserInputStatus;
16
15
  message: string | null;
@@ -2,8 +2,7 @@ import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { Path, Widget, WidgetProps } from "../../types";
4
4
  import type { InputNumberPromptJSON } from "../../widget-ai-utils/input-number/input-number-ai-utils";
5
- import type { PerseusInputNumberWidgetOptions } from "@khanacademy/perseus-core";
6
- import type { PerseusInputNumberRubric, PerseusInputNumberUserInput } from "@khanacademy/perseus-score";
5
+ import type { PerseusInputNumberWidgetOptions, PerseusInputNumberRubric, PerseusInputNumberUserInput } from "@khanacademy/perseus-core";
7
6
  type RenderProps = {
8
7
  simplify: PerseusInputNumberWidgetOptions["simplify"];
9
8
  size: PerseusInputNumberWidgetOptions["size"];
@@ -6,8 +6,7 @@ import type { WidgetProps } from "../types";
6
6
  import type { InteractiveGraphPromptJSON } from "../widget-ai-utils/interactive-graph/interactive-graph-ai-utils";
7
7
  import type { UnsupportedWidgetPromptJSON } from "../widget-ai-utils/unsupported-widget";
8
8
  import type { QuadraticCoefficient, SineCoefficient, Range } from "@khanacademy/kmath";
9
- import type { PerseusGraphType, PerseusGraphTypeAngle, PerseusGraphTypePoint, PerseusGraphTypeSegment, GraphRange, LockedFigure, PerseusImageBackground, MarkingsType } from "@khanacademy/perseus-core";
10
- import type { PerseusInteractiveGraphRubric, PerseusInteractiveGraphUserInput } from "@khanacademy/perseus-score";
9
+ import type { PerseusGraphType, PerseusGraphTypeAngle, PerseusGraphTypePoint, PerseusGraphTypeSegment, GraphRange, LockedFigure, PerseusImageBackground, MarkingsType, PerseusInteractiveGraphRubric, PerseusInteractiveGraphUserInput } from "@khanacademy/perseus-core";
11
10
  type RenderProps = {
12
11
  /**
13
12
  * Where the little black axis lines & labels (ticks) should render.
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { InteractiveGraphProps } from "./types";
3
- import type { PerseusGraphType } from "@khanacademy/perseus-core";
4
- import type { PerseusInteractiveGraphUserInput } from "@khanacademy/perseus-score";
3
+ import type { PerseusGraphType, PerseusInteractiveGraphUserInput } from "@khanacademy/perseus-core";
5
4
  export type StatefulMafsGraphProps = {
6
5
  box: [number, number];
7
6
  backgroundImage?: InteractiveGraphProps["backgroundImage"];
@@ -12,8 +12,7 @@ import type { DependencyProps } from "../../dependencies";
12
12
  import type { ChangeableProps } from "../../mixins/changeable";
13
13
  import type { APIOptions, Widget } from "../../types";
14
14
  import type { LabelImagePromptJSON } from "../../widget-ai-utils/label-image/label-image-ai-utils";
15
- import type { InteractiveMarkerType, PerseusLabelImageWidgetOptions } from "@khanacademy/perseus-core";
16
- import type { PerseusLabelImageUserInput } from "@khanacademy/perseus-score";
15
+ import type { InteractiveMarkerType, PerseusLabelImageWidgetOptions, PerseusLabelImageUserInput } from "@khanacademy/perseus-core";
17
16
  type PreferredPopoverDirection = "NONE" | "UP" | "DOWN" | "LEFT" | "RIGHT";
18
17
  /**
19
18
  * Represents a direction vector.
@@ -3,8 +3,7 @@ import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { SortableOption } from "../../components/sortable";
4
4
  import type { WidgetProps, Widget } from "../../types";
5
5
  import type { MatcherPromptJSON } from "../../widget-ai-utils/matcher/matcher-ai-utils";
6
- import type { PerseusMatcherWidgetOptions } from "@khanacademy/perseus-core";
7
- import type { PerseusMatcherRubric, PerseusMatcherUserInput } from "@khanacademy/perseus-score";
6
+ import type { PerseusMatcherWidgetOptions, PerseusMatcherRubric, PerseusMatcherUserInput } from "@khanacademy/perseus-core";
8
7
  type RenderProps = PerseusMatcherWidgetOptions;
9
8
  type Props = WidgetProps<RenderProps, PerseusMatcherRubric>;
10
9
  type DefaultProps = {
@@ -1,9 +1,8 @@
1
- import { type PerseusMatrixWidgetAnswers } from "@khanacademy/perseus-core";
1
+ import { type PerseusMatrixRubric, type PerseusMatrixUserInput, type PerseusMatrixWidgetAnswers } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  import { PerseusI18nContext } from "../../components/i18n-context";
4
4
  import type { FocusPath, Widget, WidgetProps } from "../../types";
5
5
  import type { MatrixPromptJSON } from "../../widget-ai-utils/matrix/matrix-ai-utils";
6
- import type { PerseusMatrixRubric, PerseusMatrixUserInput } from "@khanacademy/perseus-score";
7
6
  type ExternalProps = WidgetProps<{
8
7
  prefix: string;
9
8
  suffix: string;
@@ -3,8 +3,7 @@ import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { ChangeableProps } from "../../mixins/changeable";
4
4
  import type { APIOptions, FocusPath, Widget } from "../../types";
5
5
  import type { NumberLinePromptJSON } from "../../widget-ai-utils/number-line/number-line-ai-utils";
6
- import type { Relationship } from "@khanacademy/perseus-core";
7
- import type { PerseusNumberLineUserInput } from "@khanacademy/perseus-score";
6
+ import type { Relationship, PerseusNumberLineUserInput } from "@khanacademy/perseus-core";
8
7
  type Props = ChangeableProps & {
9
8
  range: [number, number];
10
9
  labelRange: ReadonlyArray<number | null>;
@@ -1,8 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { FocusPath, Widget, WidgetProps } from "../../types";
3
3
  import type { NumericInputPromptJSON } from "../../widget-ai-utils/numeric-input/prompt-utils";
4
- import type { PerseusNumericInputWidgetOptions, PerseusNumericInputAnswerForm } from "@khanacademy/perseus-core";
5
- import type { PerseusNumericInputRubric, PerseusNumericInputUserInput } from "@khanacademy/perseus-score";
4
+ import type { PerseusNumericInputWidgetOptions, PerseusNumericInputAnswerForm, PerseusNumericInputRubric, PerseusNumericInputUserInput } from "@khanacademy/perseus-core";
6
5
  type ExternalProps = WidgetProps<PerseusNumericInputWidgetOptions, PerseusNumericInputRubric>;
7
6
  export type NumericInputProps = ExternalProps & {
8
7
  size: NonNullable<ExternalProps["size"]>;
@@ -42,6 +42,7 @@ export declare const NumericInputComponent: React.ForwardRefExoticComponent<impo
42
42
  canScrollPage?: boolean;
43
43
  crossOutEnabled?: boolean;
44
44
  editorChangeDelay?: number;
45
+ flags?: Record<string, boolean>;
45
46
  onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
46
47
  }> & {
47
48
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
@@ -61,7 +62,7 @@ export declare const NumericInputComponent: React.ForwardRefExoticComponent<impo
61
62
  onFocus: (blurPath: import("../..").FocusPath) => void;
62
63
  onBlur: (blurPath: import("../..").FocusPath) => void;
63
64
  findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<import("../../types").Widget>;
64
- reviewModeRubric?: import("@khanacademy/perseus-score").PerseusNumericInputRubric | null | undefined;
65
+ reviewModeRubric?: import("@khanacademy/perseus-core").PerseusNumericInputRubric | null | undefined;
65
66
  reviewMode: boolean;
66
67
  onChange: import("../..").ChangeHandler;
67
68
  trackInteraction: (extraData?: Empty | undefined) => void;
@@ -104,6 +105,7 @@ export declare const NumericInputComponent: React.ForwardRefExoticComponent<impo
104
105
  canScrollPage?: boolean;
105
106
  crossOutEnabled?: boolean;
106
107
  editorChangeDelay?: number;
108
+ flags?: Record<string, boolean>;
107
109
  onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
108
110
  }> & {
109
111
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
@@ -1,8 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Widget, WidgetProps } from "../../types";
3
3
  import type { OrdererPromptJSON } from "../../widget-ai-utils/orderer/orderer-ai-utils";
4
- import type { PerseusOrdererWidgetOptions } from "@khanacademy/perseus-core";
5
- import type { PerseusOrdererRubric, PerseusOrdererUserInput } from "@khanacademy/perseus-score";
4
+ import type { PerseusOrdererWidgetOptions, PerseusOrdererRubric, PerseusOrdererUserInput } from "@khanacademy/perseus-core";
6
5
  type Position = {
7
6
  left: number;
8
7
  top: number;
@@ -2,8 +2,7 @@ import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { Widget, WidgetProps } from "../../types";
4
4
  import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
5
- import type { PerseusPlotterWidgetOptions } from "@khanacademy/perseus-core";
6
- import type { PerseusPlotterRubric, PerseusPlotterUserInput } from "@khanacademy/perseus-score";
5
+ import type { PerseusPlotterWidgetOptions, PerseusPlotterRubric, PerseusPlotterUserInput } from "@khanacademy/perseus-core";
7
6
  type RenderProps = PerseusPlotterWidgetOptions;
8
7
  type Props = WidgetProps<RenderProps, PerseusPlotterRubric> & {
9
8
  labelInterval: NonNullable<PerseusPlotterWidgetOptions["labelInterval"]>;
@@ -29,11 +28,12 @@ type State = {
29
28
  export declare class Plotter extends React.Component<Props, State> implements Widget {
30
29
  static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
31
30
  context: React.ContextType<typeof PerseusI18nContext>;
32
- shouldSetupGraphie: boolean;
33
31
  _isMounted: boolean;
32
+ shouldSetupGraphie: boolean;
33
+ graphieDiv: React.RefObject<HTMLDivElement>;
34
+ graphie: any;
34
35
  horizHairline: any;
35
36
  hairlineRange: any;
36
- graphie: any;
37
37
  static defaultProps: DefaultProps;
38
38
  state: State;
39
39
  componentDidMount(): void;
@@ -3,8 +3,7 @@ import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { FocusFunction } from "./base-radio";
4
4
  import type { WidgetProps, ChoiceState, Widget } from "../../types";
5
5
  import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
6
- import type { PerseusRadioChoice, PerseusRadioWidgetOptions, ShowSolutions } from "@khanacademy/perseus-core";
7
- import type { PerseusRadioRubric, PerseusRadioUserInput } from "@khanacademy/perseus-score";
6
+ import type { PerseusRadioChoice, PerseusRadioWidgetOptions, ShowSolutions, PerseusRadioRubric, PerseusRadioUserInput } from "@khanacademy/perseus-core";
8
7
  export type RenderProps = {
9
8
  numCorrect: number;
10
9
  hasNoneOfTheAbove?: boolean;
@@ -2,8 +2,7 @@ import * as React from "react";
2
2
  import type { SortableOption } from "../../components/sortable";
3
3
  import type { Widget, WidgetProps } from "../../types";
4
4
  import type { SorterPromptJSON } from "../../widget-ai-utils/sorter/sorter-ai-utils";
5
- import type { PerseusSorterWidgetOptions } from "@khanacademy/perseus-core";
6
- import type { PerseusSorterRubric, PerseusSorterUserInput } from "@khanacademy/perseus-score";
5
+ import type { PerseusSorterWidgetOptions, PerseusSorterRubric, PerseusSorterUserInput } from "@khanacademy/perseus-core";
7
6
  type RenderProps = PerseusSorterWidgetOptions;
8
7
  type Props = WidgetProps<RenderProps, PerseusSorterRubric>;
9
8
  type DefaultProps = {
@@ -2,8 +2,7 @@ import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { ChangeableProps } from "../../mixins/changeable";
4
4
  import type { Widget, WidgetProps } from "../../types";
5
- import type { PerseusTableWidgetOptions } from "@khanacademy/perseus-core";
6
- import type { PerseusTableRubric, PerseusTableUserInput } from "@khanacademy/perseus-score";
5
+ import type { PerseusTableWidgetOptions, PerseusTableRubric, PerseusTableUserInput } from "@khanacademy/perseus-core";
7
6
  type RenderProps = PerseusTableWidgetOptions & {
8
7
  editableHeaders: boolean;
9
8
  Editor: any;
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": "59.1.1",
6
+ "version": "60.0.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -41,12 +41,12 @@
41
41
  "mafs": "0.19.0",
42
42
  "uuid": "^10.0.0",
43
43
  "@khanacademy/kas": "2.0.1",
44
- "@khanacademy/keypad-context": "3.0.2",
45
- "@khanacademy/kmath": "2.0.2",
46
- "@khanacademy/math-input": "25.0.2",
47
- "@khanacademy/perseus-core": "7.0.2",
48
- "@khanacademy/perseus-linter": "3.0.2",
49
- "@khanacademy/perseus-score": "4.1.0",
44
+ "@khanacademy/keypad-context": "3.0.4",
45
+ "@khanacademy/kmath": "2.0.4",
46
+ "@khanacademy/math-input": "25.0.4",
47
+ "@khanacademy/perseus-core": "7.1.1",
48
+ "@khanacademy/perseus-linter": "3.0.4",
49
+ "@khanacademy/perseus-score": "5.0.1",
50
50
  "@khanacademy/perseus-utils": "2.0.1",
51
51
  "@khanacademy/pure-markdown": "2.0.1",
52
52
  "@khanacademy/simple-markdown": "2.0.1"
@@ -1,6 +0,0 @@
1
- import * as React from "react";
2
- type Props = {
3
- children: React.ReactElement;
4
- };
5
- declare const TestKeypadContextWrapper: (props: Props) => React.ReactElement;
6
- export default TestKeypadContextWrapper;