@khanacademy/perseus 75.0.1 → 75.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.
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import type { ChoiceState, ChangeHandler } from "../../types";
2
+ import type { ChoiceState } from "../../types";
3
3
  import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
4
4
  import type { PerseusRadioChoice, PerseusRadioRubric, PerseusRadioUserInput } from "@khanacademy/perseus-core";
5
5
  import type { LinterContextProps } from "@khanacademy/perseus-linter";
@@ -31,7 +31,6 @@ export type RadioProps = {
31
31
  editMode?: boolean;
32
32
  labelWrap?: boolean;
33
33
  randomize?: boolean;
34
- onChange: ChangeHandler;
35
34
  };
36
35
  export type RadioWidgetHandle = {
37
36
  getPromptJSON(): RadioPromptJSON;
@@ -2,7 +2,7 @@ import { type PerseusRadioRubric, type PerseusRadioUserInput } from "@khanacadem
2
2
  import * as React from "react";
3
3
  import { PerseusI18nContext } from "../../components/i18n-context";
4
4
  import type { RadioProps, RadioWidgetHandle } from "./multiple-choice-widget";
5
- import type { ChangeHandler, ChoiceState, Widget, WidgetProps } from "../../types";
5
+ import type { ChoiceState, Widget, WidgetProps } from "../../types";
6
6
  import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
7
7
  type Props = WidgetProps<RadioProps, PerseusRadioUserInput, PerseusRadioRubric>;
8
8
  type ChoiceStateWithoutSelected = Omit<ChoiceState, "selected">;
@@ -16,7 +16,9 @@ type State = {
16
16
  * This is necessary to ensure that we do not interrupt the assessment studies
17
17
  * that are currently running.
18
18
  *
19
- * TODO(LEMS-2994): Clean up this file.
19
+ * TODO(LEMS-2994): Clean up this file. State, initChoiceStates, the
20
+ * constructor, and UNSAFE_componentWillUpdate are all now only providing
21
+ * static defaults that never update on user interaction.
20
22
  */
21
23
  declare class Radio extends React.Component<Props> implements Widget {
22
24
  static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
@@ -39,12 +41,10 @@ declare class Radio extends React.Component<Props> implements Widget {
39
41
  choiceStates?: ChoiceState[];
40
42
  editMode?: boolean;
41
43
  labelWrap?: boolean;
42
- onChange: ChangeHandler;
43
44
  trackInteraction: (extraData?: PerseusRadioRubric | undefined) => void;
44
45
  widgetId: string;
45
46
  widgetIndex: number;
46
47
  alignment: string | null | undefined;
47
- static: boolean | null | undefined;
48
48
  problemNum: number | null | undefined;
49
49
  apiOptions: Readonly<Readonly<{
50
50
  isArticle?: boolean;
@@ -104,11 +104,7 @@ declare class Radio extends React.Component<Props> implements Widget {
104
104
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
105
105
  };
106
106
  getPromptJSON(): RadioPromptJSON;
107
- _handleChange(arg: {
108
- choiceStates?: ReadonlyArray<ChoiceState>;
109
- }): void;
110
107
  _mergePropsAndState(): Props & {
111
- onChange: ChangeHandler;
112
108
  numCorrect: number;
113
109
  };
114
110
  render(): React.ReactNode;
@@ -3,21 +3,19 @@ import type { RadioChoiceWithMetadata } from "../multiple-choice-widget";
3
3
  import type { ShowSolutions } from "@khanacademy/perseus-core";
4
4
  interface GetChoiceStatesProps {
5
5
  choices: ReadonlyArray<RadioChoiceWithMetadata>;
6
- isStatic?: boolean | null;
7
6
  showSolutions?: ShowSolutions;
8
7
  choiceStates?: ReadonlyArray<ChoiceState>;
9
8
  reviewMode?: boolean;
10
9
  }
11
10
  /**
12
11
  * Determine the updated choice states for the Radio widget, based on the
13
- * widget's static / showSolutions / reviewMode states, and choiceStates.
12
+ * widget's showSolutions / reviewMode states, and choiceStates.
14
13
  *
15
14
  * @param choices - The choices for the Radio widget.
16
- * @param isStatic - Whether the widget is static.
17
15
  * @param showSolutions - Whether the widget is in showSolutions mode.
18
16
  * @param reviewMode - Whether the widget is in review mode.
19
17
  * @param choiceStates - The choice states for the widget. (The user's current selection states.)
20
18
  * @returns The updated choice states for the widget.
21
19
  */
22
- export declare const getChoiceStates: ({ choices, isStatic, showSolutions, choiceStates, reviewMode, }: GetChoiceStatesProps) => ReadonlyArray<ChoiceState>;
20
+ export declare const getChoiceStates: ({ choices, showSolutions, choiceStates, reviewMode, }: GetChoiceStatesProps) => ReadonlyArray<ChoiceState>;
23
21
  export {};
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": "75.0.1",
6
+ "version": "75.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -44,9 +44,9 @@
44
44
  "@khanacademy/kas": "2.1.7",
45
45
  "@khanacademy/keypad-context": "3.2.32",
46
46
  "@khanacademy/kmath": "2.2.32",
47
- "@khanacademy/math-input": "26.3.13",
47
+ "@khanacademy/math-input": "26.4.0",
48
48
  "@khanacademy/perseus-core": "23.0.2",
49
- "@khanacademy/perseus-linter": "4.7.2",
49
+ "@khanacademy/perseus-linter": "4.8.0",
50
50
  "@khanacademy/perseus-score": "8.2.9",
51
51
  "@khanacademy/perseus-utils": "2.1.4",
52
52
  "@khanacademy/pure-markdown": "2.2.6",
@@ -59,7 +59,7 @@
59
59
  "@khanacademy/wonder-blocks-clickable": "8.1.3",
60
60
  "@khanacademy/wonder-blocks-core": "12.4.3",
61
61
  "@khanacademy/wonder-blocks-data": "15.0.1",
62
- "@khanacademy/wonder-blocks-dropdown": "10.7.1",
62
+ "@khanacademy/wonder-blocks-dropdown": "10.8.0",
63
63
  "@khanacademy/wonder-blocks-form": "7.5.4",
64
64
  "@khanacademy/wonder-blocks-icon-button": "11.1.4",
65
65
  "@khanacademy/wonder-blocks-icon": "5.3.7",
@@ -96,7 +96,7 @@
96
96
  "@khanacademy/wonder-blocks-clickable": "^8.1.3",
97
97
  "@khanacademy/wonder-blocks-core": "^12.4.3",
98
98
  "@khanacademy/wonder-blocks-data": "^15.0.1",
99
- "@khanacademy/wonder-blocks-dropdown": "^10.7.1",
99
+ "@khanacademy/wonder-blocks-dropdown": "^10.8.0",
100
100
  "@khanacademy/wonder-blocks-form": "^7.5.4",
101
101
  "@khanacademy/wonder-blocks-icon": "^5.3.7",
102
102
  "@khanacademy/wonder-blocks-icon-button": "^11.1.4",
@@ -126,7 +126,7 @@
126
126
  },
127
127
  "keywords": [],
128
128
  "khan": {
129
- "catalogHash": "cb75588f4bb498b6"
129
+ "catalogHash": "de80c3f23f09f09c"
130
130
  },
131
131
  "scripts": {}
132
132
  }