@khanacademy/perseus 71.6.0 → 72.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.
@@ -99,7 +99,6 @@ declare class Plotter extends React.Component<Props, State> implements Widget {
99
99
  apiOptions: Readonly<Readonly<{
100
100
  isArticle?: boolean;
101
101
  onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
102
- GroupMetadataEditor?: React.ComponentType<any>;
103
102
  showAlignmentOptions?: boolean;
104
103
  readOnly?: boolean;
105
104
  editingDisabled?: boolean;
@@ -108,7 +107,6 @@ declare class Plotter extends React.Component<Props, State> implements Widget {
108
107
  interactionCallback?: (widgetData: {
109
108
  [widgetId: string]: any;
110
109
  }) => void;
111
- groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
112
110
  imagePlaceholder?: React.ReactNode;
113
111
  widgetPlaceholder?: React.ReactNode;
114
112
  baseElements?: {
@@ -135,7 +133,6 @@ declare class Plotter extends React.Component<Props, State> implements Widget {
135
133
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
136
134
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
137
135
  editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
138
- groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
139
136
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
140
137
  isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
141
138
  isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
@@ -48,7 +48,6 @@ declare const Radio: React.ForwardRefExoticComponent<RadioProps & {
48
48
  apiOptions: Readonly<Readonly<{
49
49
  isArticle?: boolean;
50
50
  onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
51
- GroupMetadataEditor?: React.ComponentType<any>;
52
51
  showAlignmentOptions?: boolean;
53
52
  readOnly?: boolean;
54
53
  editingDisabled?: boolean;
@@ -57,7 +56,6 @@ declare const Radio: React.ForwardRefExoticComponent<RadioProps & {
57
56
  interactionCallback?: (widgetData: {
58
57
  [widgetId: string]: any;
59
58
  }) => void;
60
- groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
61
59
  imagePlaceholder?: React.ReactNode;
62
60
  widgetPlaceholder?: React.ReactNode;
63
61
  baseElements?: {
@@ -84,7 +82,6 @@ declare const Radio: React.ForwardRefExoticComponent<RadioProps & {
84
82
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
85
83
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
86
84
  editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
87
- groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
88
85
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
89
86
  isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
90
87
  isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
@@ -47,7 +47,6 @@ declare class Radio extends RadioOld {
47
47
  apiOptions: Readonly<Readonly<{
48
48
  isArticle?: boolean;
49
49
  onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
50
- GroupMetadataEditor?: React.ComponentType<any>;
51
50
  showAlignmentOptions?: boolean;
52
51
  readOnly?: boolean;
53
52
  editingDisabled?: boolean;
@@ -56,7 +55,6 @@ declare class Radio extends RadioOld {
56
55
  interactionCallback?: (widgetData: {
57
56
  [widgetId: string]: any;
58
57
  }) => void;
59
- groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
60
58
  imagePlaceholder?: React.ReactNode;
61
59
  widgetPlaceholder?: React.ReactNode;
62
60
  baseElements?: {
@@ -83,7 +81,6 @@ declare class Radio extends RadioOld {
83
81
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
84
82
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
85
83
  editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
86
- groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
87
84
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
88
85
  isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
89
86
  isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
@@ -1,37 +1,9 @@
1
1
  import * as React from "react";
2
- import type { SortableOption } from "../../components/sortable";
3
- import type { Widget, WidgetProps } from "../../types";
4
- import type { SorterPromptJSON } from "../../widget-ai-utils/sorter/sorter-ai-utils";
2
+ import type { PerseusDependenciesV2, WidgetProps } from "../../types";
5
3
  import type { PerseusSorterWidgetOptions, PerseusSorterUserInput, SorterPublicWidgetOptions } from "@khanacademy/perseus-core";
6
- type Props = WidgetProps<PerseusSorterWidgetOptions, PerseusSorterUserInput>;
7
- type DefaultProps = {
8
- correct: Props["correct"];
9
- layout: Props["layout"];
10
- padding: Props["padding"];
11
- problemNum: Props["problemNum"];
12
- linterContext: Props["linterContext"];
4
+ type Props = WidgetProps<PerseusSorterWidgetOptions, PerseusSorterUserInput> & {
5
+ dependencies: PerseusDependenciesV2;
13
6
  };
14
- declare class Sorter extends React.Component<Props> implements Widget {
15
- _isMounted: boolean;
16
- static defaultProps: DefaultProps;
17
- componentDidMount(): void;
18
- componentWillUnmount(): void;
19
- handleChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
20
- /**
21
- * This is kind of a problem. Sortable maintains an internal state
22
- * but we also want the user input state to include the same state.
23
- * This is to help keep the two in sync for now.
24
- */
25
- _getOptionsFromSortable(): string[];
26
- getPromptJSON(): SorterPromptJSON;
27
- moveOptionToIndex: (option: SortableOption, index: number) => void;
28
- /**
29
- * @deprecated and likely very broken API
30
- * [LEMS-3185] do not trust serializedState
31
- */
32
- getSerializedState(): any;
33
- render(): React.ReactNode;
34
- }
35
7
  declare function getStartUserInput(options: SorterPublicWidgetOptions, problemNum: number): PerseusSorterUserInput;
36
8
  /**
37
9
  * @deprecated and likely a very broken API
@@ -41,7 +13,7 @@ declare function getUserInputFromSerializedState(serializedState: any): PerseusS
41
13
  declare const _default: {
42
14
  name: string;
43
15
  displayName: string;
44
- widget: typeof Sorter;
16
+ widget: React.ForwardRefExoticComponent<Omit<Props, "dependencies"> & React.RefAttributes<any>>;
45
17
  isLintable: true;
46
18
  getStartUserInput: typeof getStartUserInput;
47
19
  getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
@@ -53,7 +53,6 @@ declare class Table extends React.Component<Props> implements Widget {
53
53
  apiOptions: Readonly<Readonly<{
54
54
  isArticle?: boolean;
55
55
  onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
56
- GroupMetadataEditor?: React.ComponentType<any>;
57
56
  showAlignmentOptions?: boolean;
58
57
  readOnly?: boolean;
59
58
  editingDisabled?: boolean;
@@ -62,7 +61,6 @@ declare class Table extends React.Component<Props> implements Widget {
62
61
  interactionCallback?: (widgetData: {
63
62
  [widgetId: string]: any;
64
63
  }) => void;
65
- groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
66
64
  imagePlaceholder?: React.ReactNode;
67
65
  widgetPlaceholder?: React.ReactNode;
68
66
  baseElements?: {
@@ -89,7 +87,6 @@ declare class Table extends React.Component<Props> implements Widget {
89
87
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
90
88
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
91
89
  editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
92
- groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
93
90
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
94
91
  isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
95
92
  isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
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": "71.6.0",
6
+ "version": "72.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.1.3",
45
- "@khanacademy/keypad-context": "3.2.15",
46
- "@khanacademy/kmath": "2.2.15",
47
- "@khanacademy/math-input": "26.2.17",
48
- "@khanacademy/perseus-core": "20.1.3",
49
- "@khanacademy/perseus-linter": "4.4.5",
50
- "@khanacademy/perseus-score": "8.0.4",
51
- "@khanacademy/perseus-utils": "2.1.1",
52
- "@khanacademy/pure-markdown": "2.2.1",
53
- "@khanacademy/simple-markdown": "2.1.1"
44
+ "@khanacademy/kas": "2.1.4",
45
+ "@khanacademy/keypad-context": "3.2.16",
46
+ "@khanacademy/kmath": "2.2.16",
47
+ "@khanacademy/math-input": "26.2.18",
48
+ "@khanacademy/perseus-core": "20.1.4",
49
+ "@khanacademy/perseus-linter": "4.4.6",
50
+ "@khanacademy/perseus-score": "8.0.5",
51
+ "@khanacademy/perseus-utils": "2.1.2",
52
+ "@khanacademy/pure-markdown": "2.2.2",
53
+ "@khanacademy/simple-markdown": "2.1.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@khanacademy/wonder-blocks-announcer": "1.0.4",
@@ -88,8 +88,8 @@
88
88
  "react-dom": "18.2.0",
89
89
  "react-popper": "^2.2.5",
90
90
  "underscore": "1.4.4",
91
- "raphael": "1.5.4",
92
- "perseus-build-settings": "0.9.0"
91
+ "perseus-build-settings": "0.9.0",
92
+ "raphael": "1.5.4"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@khanacademy/wonder-blocks-announcer": "^1.0.4",
@@ -1,24 +0,0 @@
1
- import * as React from "react";
2
- /**
3
- * Stub Tag Editor.
4
- *
5
- * This is stupidly used by Perseus Zero because I didn't implement
6
- * the <TagEditor> for Perseus Zero (since everyone wants me to
7
- * delete it anyways).
8
- *
9
- * This is a small wrapper for a TextListEditor that allows us to
10
- * edit raw Tag ID strings in perseus zero (please don't use this).
11
- *
12
- * It also gives a nicer interface for the group metadata editor
13
- * in local demo mode.
14
- */
15
- declare class StubTagEditor extends React.Component<any> {
16
- static propTypes: {
17
- value: any;
18
- onChange: any;
19
- showTitle: any;
20
- };
21
- static defaultProps: any;
22
- render(): React.ReactNode;
23
- }
24
- export default StubTagEditor;