@khanacademy/perseus-editor 35.4.0 → 36.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.
@@ -1,18 +1,14 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import * as React from "react";
3
+ import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
2
4
  import type { CategorizerDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
- type Props = any;
5
+ interface Props extends CategorizerDefaultWidgetOptions, Changeable.ChangeableProps {
6
+ apiOptions?: APIOptionsWithDefaults;
7
+ }
4
8
  /**
5
9
  * An editor for adding a categorizer widget that allows users to sort items into categories.
6
10
  */
7
11
  declare class CategorizerEditor extends React.Component<Props> {
8
- static propTypes: {
9
- apiOptions: any;
10
- items: any;
11
- categories: any;
12
- values: any;
13
- randomizeItems: any;
14
- onChange: any;
15
- };
16
12
  static widgetName: "categorizer";
17
13
  static defaultProps: CategorizerDefaultWidgetOptions;
18
14
  change: (arg1: any, arg2: any, arg3: any) => any;
@@ -1,17 +1,16 @@
1
1
  /**
2
2
  * This editor is for embedding Khan Academy CS programs.
3
3
  */
4
+ import { Changeable } from "@khanacademy/perseus";
4
5
  import * as React from "react";
5
6
  import type { CSProgramDefaultWidgetOptions } from "@khanacademy/perseus-core";
7
+ interface CSProgramEditorProps extends CSProgramDefaultWidgetOptions, Changeable.ChangeableProps {
8
+ }
6
9
  /**
7
10
  * This is the main editor for this widget, to specify all the options.
8
11
  */
9
- declare class CSProgramEditor extends React.Component<any> {
10
- static propTypes: {
11
- onChange: any;
12
- };
12
+ declare class CSProgramEditor extends React.Component<CSProgramEditorProps> {
13
13
  static widgetName: "cs-program";
14
- static defaultProps: CSProgramDefaultWidgetOptions;
15
14
  change: (...args: ReadonlyArray<unknown>) => any;
16
15
  _handleSettingsChange: (arg1: any) => void;
17
16
  _handleProgramIDChange: (arg1: string) => void;
@@ -1,21 +1,19 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import * as React from "react";
2
3
  import type { InitializeWidgetOptionsParams } from "../../editor";
4
+ import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
3
5
  import type { DefinitionDefaultWidgetOptions } from "@khanacademy/perseus-core";
4
- type Props = any;
6
+ interface Props extends DefinitionDefaultWidgetOptions, Changeable.ChangeableProps {
7
+ apiOptions?: APIOptionsWithDefaults;
8
+ }
5
9
  /**
6
10
  * An editor for adding an interactive definition widget that allows content
7
11
  * editors to embed clickable terms with expandable explanations within content.
8
12
  */
9
13
  declare class DefinitionEditor extends React.Component<Props> {
10
- static propTypes: {
11
- togglePrompt: any;
12
- definition: any;
13
- apiOptions: any;
14
- onChange: any;
15
- };
16
14
  static widgetName: "definition";
17
15
  static defaultProps: DefinitionDefaultWidgetOptions;
18
- static initializeWidgetOptions(params: InitializeWidgetOptionsParams): any;
16
+ static initializeWidgetOptions(params: InitializeWidgetOptionsParams): DefinitionDefaultWidgetOptions;
19
17
  change: (arg1: any, arg2: any, arg3: any) => any;
20
18
  serialize: () => any;
21
19
  render(): React.ReactNode;
@@ -1,22 +1,16 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import * as React from "react";
3
+ import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
2
4
  import type { ExplanationDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
- type Props = any;
4
- type State = any;
5
+ interface Props extends ExplanationDefaultWidgetOptions, Changeable.ChangeableProps {
6
+ apiOptions?: APIOptionsWithDefaults;
7
+ }
5
8
  /**
6
9
  * An editor for adding an explanation widget that provides supplementary information to users.
7
10
  */
8
- declare class ExplanationEditor extends React.Component<Props, State> {
9
- static propTypes: {
10
- showPrompt: any;
11
- hidePrompt: any;
12
- explanation: any;
13
- widgets: any;
14
- apiOptions: any;
15
- onChange: any;
16
- };
11
+ declare class ExplanationEditor extends React.Component<Props> {
17
12
  static widgetName: "explanation";
18
13
  static defaultProps: ExplanationDefaultWidgetOptions;
19
- state: State;
20
14
  change: (arg1: any, arg2: any, arg3: any) => any;
21
15
  serialize: () => any;
22
16
  render(): React.ReactNode;
@@ -1,16 +1,12 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import * as React from "react";
2
3
  import Editor from "../../editor";
4
+ import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
3
5
  import type { GradedGroupDefaultWidgetOptions } from "@khanacademy/perseus-core";
4
- type Props = any;
6
+ interface Props extends GradedGroupDefaultWidgetOptions, Changeable.ChangeableProps {
7
+ apiOptions?: APIOptionsWithDefaults;
8
+ }
5
9
  declare class GradedGroupEditor extends React.Component<Props> {
6
- static propTypes: {
7
- title: any;
8
- content: any;
9
- widgets: any;
10
- images: any;
11
- apiOptions: any;
12
- onChange: any;
13
- };
14
10
  static widgetName: "graded-group";
15
11
  static defaultProps: GradedGroupDefaultWidgetOptions;
16
12
  editor: React.RefObject<Editor>;
@@ -1,13 +1,12 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import * as React from "react";
3
+ import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
2
4
  import type { GradedGroupSetDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
- type Props = any;
5
+ interface Props extends GradedGroupSetDefaultWidgetOptions, Changeable.ChangeableProps {
6
+ apiOptions?: APIOptionsWithDefaults;
7
+ }
4
8
  declare class GradedGroupSetEditor extends React.Component<Props> {
5
9
  _editors: Array<any>;
6
- static propTypes: {
7
- apiOptions: any;
8
- gradedGroups: any;
9
- onChange: any;
10
- };
11
10
  static widgetName: "graded-group-set";
12
11
  static defaultProps: GradedGroupSetDefaultWidgetOptions;
13
12
  UNSAFE_componentWillMount(): void;
@@ -16,7 +15,7 @@ declare class GradedGroupSetEditor extends React.Component<Props> {
16
15
  serialize: () => {
17
16
  gradedGroups: any;
18
17
  };
19
- renderGroups: () => React.ReactElement;
18
+ renderGroups: () => React.ReactNode;
20
19
  addGroup: () => void;
21
20
  render(): React.ReactNode;
22
21
  }
@@ -1,13 +1,12 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import { type IFrameDefaultWidgetOptions } from "@khanacademy/perseus-core";
2
3
  import * as React from "react";
3
- type IframeEditorProps = any;
4
+ interface IframeEditorProps extends IFrameDefaultWidgetOptions, Changeable.ChangeableProps {
5
+ }
4
6
  /**
5
7
  * This is the main editor for this widget, to specify all the options.
6
8
  */
7
9
  declare class IframeEditor extends React.Component<IframeEditorProps> {
8
- static propTypes: {
9
- onChange: any;
10
- };
11
10
  static widgetName: "iframe";
12
11
  static defaultProps: IFrameDefaultWidgetOptions;
13
12
  change: (arg1: any, arg2: any, arg3: any) => any;
@@ -1,15 +1,11 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import * as React from "react";
3
+ import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
2
4
  import type { MatrixDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
- type Props = any;
5
+ interface Props extends MatrixDefaultWidgetOptions, Changeable.ChangeableProps {
6
+ apiOptions: APIOptionsWithDefaults;
7
+ }
4
8
  declare class MatrixEditor extends React.Component<Props> {
5
- static propTypes: {
6
- matrixBoardSize: any;
7
- answers: any;
8
- prefix: any;
9
- suffix: any;
10
- cursorPosition: any;
11
- onChange: any;
12
- };
13
9
  static widgetName: "matrix";
14
10
  static defaultProps: MatrixDefaultWidgetOptions;
15
11
  change: (arg1: any, arg2?: any, arg3?: any) => any;
@@ -1,19 +1,10 @@
1
+ import { Changeable } from "@khanacademy/perseus";
1
2
  import * as React from "react";
2
3
  import type { MeasurerDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
- type Props = any;
4
+ interface Props extends MeasurerDefaultWidgetOptions, Changeable.ChangeableProps {
5
+ }
4
6
  declare class MeasurerEditor extends React.Component<Props> {
5
7
  static widgetName: "measurer";
6
- static propTypes: {
7
- box: any;
8
- image: any;
9
- showProtractor: any;
10
- showRuler: any;
11
- rulerLabel: any;
12
- rulerTicks: any;
13
- rulerPixels: any;
14
- rulerLength: any;
15
- onChange: any;
16
- };
17
8
  static defaultProps: MeasurerDefaultWidgetOptions;
18
9
  className: string;
19
10
  change: (arg1: any, arg2: any, arg3: any) => any;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Perseus editors",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "35.4.0",
6
+ "version": "36.0.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -35,13 +35,13 @@
35
35
  "katex": "0.11.1",
36
36
  "mafs": "^0.19.0",
37
37
  "tiny-invariant": "1.3.1",
38
+ "@khanacademy/keypad-context": "3.2.82",
39
+ "@khanacademy/kmath": "2.4.41",
38
40
  "@khanacademy/kas": "2.2.6",
39
- "@khanacademy/keypad-context": "3.2.81",
40
- "@khanacademy/kmath": "2.4.40",
41
- "@khanacademy/math-input": "27.0.1",
42
- "@khanacademy/perseus": "83.1.0",
43
- "@khanacademy/perseus-core": "34.1.0",
44
- "@khanacademy/perseus-linter": "5.1.21",
41
+ "@khanacademy/math-input": "27.0.2",
42
+ "@khanacademy/perseus-core": "35.0.0",
43
+ "@khanacademy/perseus-linter": "5.1.22",
44
+ "@khanacademy/perseus": "84.0.1",
45
45
  "@khanacademy/perseus-utils": "2.1.5"
46
46
  },
47
47
  "devDependencies": {