@khanacademy/perseus 65.0.0 → 65.1.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.
@@ -10,7 +10,7 @@ import type { GetPromptJSONInterface, RendererPromptJSON } from "./widget-ai-uti
10
10
  import type { KeypadAPI } from "@khanacademy/math-input";
11
11
  import type { PerseusRenderer, PerseusWidget, PerseusWidgetOptions, PerseusWidgetsMap, ShowSolutions, PerseusScore, UserInputArray, UserInputMap } from "@khanacademy/perseus-core";
12
12
  import type { LinterContextProps } from "@khanacademy/perseus-linter";
13
- import "./styles/perseus-renderer.less";
13
+ import "./styles/perseus-renderer.css";
14
14
  type WidgetState = {
15
15
  isMobile?: boolean;
16
16
  inTable?: boolean;
@@ -69,6 +69,7 @@ export declare class ServerItemRenderer extends React.Component<Props, State> im
69
69
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
70
70
  componentDidUpdate(prevProps: Props, prevState: State): void;
71
71
  componentWillUnmount(): void;
72
+ maybeCallOnRendered(): void;
72
73
  _handleFocusChange: (newFocus: FocusPath, oldFocus: FocusPath) => void;
73
74
  _setCurrentFocus(newFocus: FocusPath): void;
74
75
  _onRendererBlur(blurPath: FocusPath): void;
@@ -6,6 +6,7 @@ type BaseMarker = {
6
6
  };
7
7
  type UserInputMarker = {
8
8
  label: string;
9
+ answers?: string[];
9
10
  selected?: ReadonlyArray<string>;
10
11
  };
11
12
  export type LabelImagePromptJSON = {
@@ -3,6 +3,7 @@ import type { PerseusRadioUserInput, RecursiveReadonly } from "@khanacademy/pers
3
3
  import type React from "react";
4
4
  type BasicOption = {
5
5
  value: string;
6
+ rationale?: string;
6
7
  };
7
8
  export type RadioPromptJSON = {
8
9
  type: "radio";
@@ -1,7 +1,7 @@
1
1
  import { type PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  import type { APIOptions } from "../../types";
4
- export type ChoiceType = {
4
+ export interface ChoiceType {
5
5
  checked: boolean;
6
6
  content: React.ReactNode;
7
7
  rationale: React.ReactNode;
@@ -14,8 +14,8 @@ export type ChoiceType = {
14
14
  previouslyAnswered: boolean;
15
15
  revealNoneOfTheAbove: boolean;
16
16
  disabled: boolean;
17
- };
18
- type Props = {
17
+ }
18
+ interface BaseRadioProps {
19
19
  apiOptions: APIOptions;
20
20
  choices: ReadonlyArray<ChoiceType>;
21
21
  deselectEnabled?: boolean;
@@ -30,7 +30,7 @@ type Props = {
30
30
  checked: ReadonlyArray<boolean>;
31
31
  }) => void;
32
32
  isLastUsedWidget?: boolean;
33
- };
33
+ }
34
34
  /**
35
35
  * The BaseRadio component is the core component for the radio widget.
36
36
  * It is responsible for rendering the radio choices and handling user interactions.
@@ -41,5 +41,5 @@ type Props = {
41
41
  *
42
42
  * TODO(LEMS-2994): Clean up this file.
43
43
  */
44
- declare const BaseRadio: ({ apiOptions, reviewModeRubric, reviewMode, choices, editMode, multipleSelect, labelWrap, countChoices, numCorrect, isLastUsedWidget, onChange, }: Props) => React.ReactElement;
44
+ declare const BaseRadio: ({ apiOptions, reviewModeRubric, reviewMode, choices, editMode, multipleSelect, labelWrap, countChoices, numCorrect, isLastUsedWidget, onChange, }: BaseRadioProps) => React.ReactElement;
45
45
  export default BaseRadio;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- type ChoiceIconProps = {
2
+ interface ChoiceIconProps {
3
3
  pos: number;
4
4
  checked: boolean;
5
5
  focused: boolean;
@@ -10,7 +10,7 @@ type ChoiceIconProps = {
10
10
  multipleSelect: boolean;
11
11
  reviewMode: boolean;
12
12
  previouslyAnswered: boolean;
13
- };
13
+ }
14
14
  /**
15
15
  * This component is a duplicate of the ChoiceIcon component in choice-icon.tsx
16
16
  * for the Radio Revitalization Project. (LEMS-2933)
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { ChoiceProps } from "./choice.new";
3
- interface Props extends ChoiceProps {
3
+ interface ChoiceNoneAboveProps extends ChoiceProps {
4
4
  showContent?: boolean;
5
5
  }
6
6
  /**
@@ -10,5 +10,5 @@ interface Props extends ChoiceProps {
10
10
  *
11
11
  * TODO(LEMS-2994): Clean up this file.
12
12
  */
13
- declare const ChoiceNoneAbove: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
13
+ declare const ChoiceNoneAbove: React.ForwardRefExoticComponent<ChoiceNoneAboveProps & React.RefAttributes<HTMLButtonElement>>;
14
14
  export default ChoiceNoneAbove;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { APIOptions } from "../../types";
3
- export type ChoiceProps = {
3
+ export interface ChoiceProps {
4
4
  apiOptions?: APIOptions;
5
5
  checked?: boolean;
6
6
  rationale: React.ReactNode;
@@ -16,7 +16,7 @@ export type ChoiceProps = {
16
16
  onChange?: (newValues: {
17
17
  checked: boolean;
18
18
  }) => void;
19
- };
19
+ }
20
20
  /**
21
21
  * This component is a duplicate of the Choice component in choice.tsx
22
22
  * for the Radio Revitalization Project. (LEMS-2933)
@@ -2,12 +2,12 @@
2
2
  * Renders a circular selection ring around the child.
3
3
  */
4
4
  import * as React from "react";
5
- type Props = {
5
+ interface FocusRingProps {
6
6
  children?: React.ReactNode;
7
7
  visible?: boolean;
8
8
  color?: string;
9
9
  multipleSelect?: boolean;
10
- };
10
+ }
11
11
  /**
12
12
  * This component is a duplicate of the FocusRing component in focus-ring.tsx
13
13
  * for the Radio Revitalization Project. (LEMS-2933)
@@ -15,5 +15,5 @@ type Props = {
15
15
  *
16
16
  * TODO(LEMS-2994): Clean up this file.
17
17
  */
18
- declare const FocusRing: ({ visible, color, multipleSelect, children, }: Props) => React.ReactElement;
18
+ declare const FocusRing: ({ visible, color, multipleSelect, children, }: FocusRingProps) => React.ReactElement;
19
19
  export default FocusRing;
@@ -6,12 +6,12 @@
6
6
  * between the states more immediately clear to users.
7
7
  */
8
8
  import * as React from "react";
9
- type Props = {
9
+ interface OptionStatusProps {
10
10
  correct: boolean;
11
11
  checked: boolean;
12
12
  previouslyAnswered: boolean;
13
13
  reviewMode: boolean;
14
- };
14
+ }
15
15
  /**
16
16
  * This component is a duplicate of the OptionStatus component in option-status.tsx
17
17
  * for the Radio Revitalization Project. (LEMS-2933)
@@ -19,5 +19,5 @@ type Props = {
19
19
  *
20
20
  * TODO(LEMS-2994): Clean up this file.
21
21
  */
22
- declare const OptionStatus: ({ checked, correct, previouslyAnswered, reviewMode, }: Props) => React.ReactElement | null;
22
+ declare const OptionStatus: ({ checked, correct, previouslyAnswered, reviewMode, }: OptionStatusProps) => React.ReactElement | null;
23
23
  export default OptionStatus;
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": "65.0.0",
6
+ "version": "65.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -41,16 +41,16 @@
41
41
  "mafs": "0.19.0",
42
42
  "tiny-invariant": "1.3.1",
43
43
  "uuid": "^10.0.0",
44
- "@khanacademy/kas": "2.0.5",
45
- "@khanacademy/keypad-context": "3.0.13",
46
- "@khanacademy/kmath": "2.0.13",
47
- "@khanacademy/math-input": "26.0.2",
48
- "@khanacademy/perseus-core": "14.0.0",
49
- "@khanacademy/perseus-linter": "4.0.0",
50
- "@khanacademy/perseus-score": "7.1.0",
44
+ "@khanacademy/kas": "2.0.6",
45
+ "@khanacademy/keypad-context": "3.0.14",
46
+ "@khanacademy/kmath": "2.0.14",
47
+ "@khanacademy/math-input": "26.0.3",
48
+ "@khanacademy/perseus-core": "14.0.1",
49
+ "@khanacademy/perseus-linter": "4.0.1",
50
+ "@khanacademy/perseus-score": "7.1.1",
51
51
  "@khanacademy/perseus-utils": "2.0.4",
52
- "@khanacademy/pure-markdown": "2.0.5",
53
- "@khanacademy/simple-markdown": "2.0.5"
52
+ "@khanacademy/pure-markdown": "2.0.6",
53
+ "@khanacademy/simple-markdown": "2.0.6"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@khanacademy/wonder-blocks-banner": "4.1.21",
@@ -86,7 +86,7 @@
86
86
  "react-dom": "18.2.0",
87
87
  "react-popper": "^2.2.5",
88
88
  "underscore": "1.4.4",
89
- "perseus-build-settings": "0.6.2",
89
+ "perseus-build-settings": "0.7.0",
90
90
  "raphael": "1.5.4"
91
91
  },
92
92
  "peerDependencies": {