@khanacademy/perseus-editor 27.0.0 → 27.0.2

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,6 +1,9 @@
1
1
  import * as React from "react";
2
2
  import type { CategorizerDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
3
  type Props = any;
4
+ /**
5
+ * An editor for adding a categorizer widget that allows users to sort items into categories.
6
+ */
4
7
  declare class CategorizerEditor extends React.Component<Props> {
5
8
  static propTypes: {
6
9
  apiOptions: any;
@@ -1,6 +1,10 @@
1
1
  import * as React from "react";
2
2
  import type { DefinitionDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
3
  type Props = any;
4
+ /**
5
+ * An editor for adding an interactive definition widget that allows content
6
+ * editors to embed clickable terms with expandable explanations within content.
7
+ */
4
8
  declare class DefinitionEditor extends React.Component<Props> {
5
9
  static propTypes: {
6
10
  togglePrompt: any;
@@ -1,6 +1,9 @@
1
1
  import { type DropdownDefaultWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  type Props = any;
4
+ /**
5
+ * An editor for adding a dropdown widget that allows users to select an option from a predefined list.
6
+ */
4
7
  declare class DropdownEditor extends React.Component<Props> {
5
8
  static propTypes: {
6
9
  choices: any;
@@ -2,6 +2,9 @@ import * as React from "react";
2
2
  import type { ExplanationDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
3
  type Props = any;
4
4
  type State = any;
5
+ /**
6
+ * An editor for adding an explanation widget that provides supplementary information to users.
7
+ */
5
8
  declare class ExplanationEditor extends React.Component<Props, State> {
6
9
  static propTypes: {
7
10
  showPrompt: any;
@@ -10,6 +10,9 @@ type AnswerForm = PerseusExpressionWidgetOptions["answerForms"][number];
10
10
  type State = {
11
11
  functionsInternal: string;
12
12
  };
13
+ /**
14
+ * An editor for adding an expression widget that allows users to enter mathematical expressions.
15
+ */
13
16
  declare class ExpressionEditor extends React.Component<Props, State> {
14
17
  static widgetName: "expression";
15
18
  static defaultProps: ExpressionDefaultWidgetOptions;
@@ -4,6 +4,9 @@ import type { ChangeEventHandler } from "react";
4
4
  type Props = PerseusFreeResponseWidgetOptions & {
5
5
  onChange: (options: Partial<PerseusFreeResponseWidgetOptions>) => void;
6
6
  };
7
+ /**
8
+ * An editor for adding a free response widget that allows users to enter open-ended text answers.
9
+ */
7
10
  declare class FreeResponseEditor extends React.Component<Props> {
8
11
  static defaultProps: FreeResponseDefaultWidgetOptions;
9
12
  static widgetName: "free-response";
@@ -16,6 +16,9 @@ type Props = Changeable.ChangeableProps & {
16
16
  type State = {
17
17
  backgroundImageError?: string;
18
18
  };
19
+ /**
20
+ * An editor for adding an image widget that allows users to display and configure images within content.
21
+ */
19
22
  declare class ImageEditor extends React.Component<Props> {
20
23
  static displayName: string;
21
24
  static widgetName: string;
@@ -20,6 +20,9 @@ type Props = {
20
20
  rightAlign?: Props["rightAlign"];
21
21
  }) => void;
22
22
  };
23
+ /**
24
+ * An editor for adding an input number widget that allows users to enter numerical values.
25
+ */
23
26
  declare class InputNumberEditor extends React.Component<Props> {
24
27
  static widgetName: "input-number";
25
28
  static defaultProps: InputNumberDefaultWidgetOptions;
@@ -15,6 +15,14 @@ type Props = Changeable.ChangeableProps & {
15
15
  graph: Graph;
16
16
  };
17
17
  type State = any;
18
+ /**
19
+ * An editor for the interaction widget that allows users to engage with interactive content.
20
+ *
21
+ * The interaction widget provides a dynamic graph interface with various interactive elements
22
+ * including points, lines, movable points, movable lines, functions, parametric curves,
23
+ * labels, and rectangles. This editor allows content creators to configure those elements
24
+ * and their properties.
25
+ */
18
26
  declare class InteractionEditor extends React.Component<Props, State> {
19
27
  static widgetName: "interaction";
20
28
  static defaultProps: InteractionDefaultWidgetOptions;
@@ -1,10 +1,3 @@
1
- /**
2
- * Direct image labeling widget editor.
3
- *
4
- * Label on image widget enables creating more natural, conceptual questions
5
- * that involve the use of images, and enable learners to demonstrate their
6
- * knowledge by directly interacting with the image.
7
- */
8
1
  import * as React from "react";
9
2
  import QuestionMarkers from "./label-image/question-markers";
10
3
  import type { PerseusLabelImageWidgetOptions, LabelImageDefaultWidgetOptions } from "@khanacademy/perseus-core";
@@ -19,6 +12,13 @@ type Props = {
19
12
  hideChoicesFromInstructions: boolean;
20
13
  onChange: (options: any) => void;
21
14
  };
15
+ /**
16
+ * Direct image labeling widget editor.
17
+ *
18
+ * Label on image widget enables creating more natural, conceptual questions
19
+ * that involve the use of images, and enable learners to demonstrate their
20
+ * knowledge by directly interacting with the image.
21
+ */
22
22
  declare class LabelImageEditor extends React.Component<Props> {
23
23
  _questionMarkers: QuestionMarkers | null | undefined;
24
24
  static defaultProps: LabelImageDefaultWidgetOptions;
@@ -1,6 +1,9 @@
1
1
  import { type MatcherDefaultWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  type Props = any;
4
+ /**
5
+ * An editor for adding a matcher widget that allows users to match items from two different sets.
6
+ */
4
7
  declare class MatcherEditor extends React.Component<Props> {
5
8
  static propTypes: {
6
9
  left: any;
@@ -18,6 +18,10 @@ type Props = {
18
18
  static?: boolean;
19
19
  showTooltips: boolean;
20
20
  } & Changeable.ChangeableProps;
21
+ /**
22
+ * An editor for adding a number line widget that allows users to mark
23
+ * positions, intervals, and points on a number line.
24
+ */
21
25
  declare class NumberLineEditor extends React.Component<Props> {
22
26
  static widgetName: "number-line";
23
27
  static defaultProps: NumberLineDefaultWidgetOptions;
@@ -13,6 +13,10 @@ type State = {
13
13
  showSettings: boolean;
14
14
  showAnswers: boolean;
15
15
  };
16
+ /**
17
+ * An editor for adding a numeric input widget that allows users to enter
18
+ * numerical values with specific validation rules.
19
+ */
16
20
  declare class NumericInputEditor extends React.Component<Props, State> {
17
21
  static widgetName: string;
18
22
  static displayName: string;
@@ -6,6 +6,10 @@ type Props = PhetSimulationDefaultWidgetOptions & {
6
6
  description?: Props["description"];
7
7
  }) => void;
8
8
  };
9
+ /**
10
+ * An editor for adding a PhET simulation widget that allows users to interact
11
+ * with physics simulations.
12
+ */
9
13
  declare class PhetSimulationEditor extends React.Component<Props> {
10
14
  static defaultProps: PhetSimulationDefaultWidgetOptions;
11
15
  static widgetName: "phet-simulation";
@@ -29,6 +29,9 @@ type State = {
29
29
  maxX: number | null;
30
30
  tickStep: number | null;
31
31
  };
32
+ /**
33
+ * An editor for adding a plotter widget that allows users to create and customize data visualizations.
34
+ */
32
35
  declare class PlotterEditor extends React.Component<Props, State> {
33
36
  static widgetName: "plotter";
34
37
  static defaultProps: PlotterDefaultWidgetOptions;
@@ -1,6 +1,3 @@
1
- /**
2
- * This editor is for embedding Khan Academy Python programs.
3
- */
4
1
  import { Changeable } from "@khanacademy/perseus";
5
2
  import * as React from "react";
6
3
  import type { PerseusPythonProgramWidgetOptions, PythonProgramDefaultWidgetOptions } from "@khanacademy/perseus-core";
@@ -10,7 +7,7 @@ type Props = Changeable.ChangeableProps & {
10
7
  };
11
8
  export declare function validateOptions(height: Props["height"], programID: Props["programID"]): ReadonlyArray<string>;
12
9
  /**
13
- * This is the main editor for this widget, to specify all the options.
10
+ * An editor for adding a Python program widget that allows users to write, edit and execute Python code.
14
11
  */
15
12
  declare class PythonProgramEditor extends React.Component<Props> {
16
13
  static widgetName: "python-program";
@@ -12,6 +12,9 @@ export interface RadioEditorProps extends Changeable.ChangeableProps {
12
12
  deselectEnabled: boolean;
13
13
  static: boolean;
14
14
  }
15
+ /**
16
+ * An editor for adding a radio widget that allows users to select a single option from multiple choices.
17
+ */
15
18
  declare class RadioEditor extends React.Component<RadioEditorProps> {
16
19
  static widgetName: "radio";
17
20
  static defaultProps: RadioDefaultWidgetOptions;
@@ -1,6 +1,9 @@
1
1
  import { type SorterDefaultWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  type Props = any;
4
+ /**
5
+ * An editor for adding a sorter widget that allows users to arrange items in a specific order.
6
+ */
4
7
  declare class SorterEditor extends React.Component<Props> {
5
8
  static propTypes: {
6
9
  correct: 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": "27.0.0",
6
+ "version": "27.0.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -38,33 +38,33 @@
38
38
  "@khanacademy/keypad-context": "3.1.1",
39
39
  "@khanacademy/kmath": "2.1.1",
40
40
  "@khanacademy/perseus-linter": "4.2.1",
41
- "@khanacademy/math-input": "26.1.1",
42
- "@khanacademy/perseus": "66.2.0",
41
+ "@khanacademy/math-input": "26.1.2",
42
+ "@khanacademy/perseus": "66.2.2",
43
43
  "@khanacademy/perseus-core": "18.4.0",
44
- "@khanacademy/perseus-score": "7.3.0",
44
+ "@khanacademy/perseus-score": "7.4.0",
45
45
  "@khanacademy/perseus-utils": "2.1.0",
46
46
  "@khanacademy/pure-markdown": "2.2.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@khanacademy/mathjax-renderer": "3.0.0",
50
- "@khanacademy/wonder-blocks-accordion": "3.1.32",
51
- "@khanacademy/wonder-blocks-banner": "4.2.10",
52
- "@khanacademy/wonder-blocks-button": "10.2.14",
53
- "@khanacademy/wonder-blocks-clickable": "7.1.18",
50
+ "@khanacademy/wonder-blocks-accordion": "3.1.33",
51
+ "@khanacademy/wonder-blocks-banner": "4.2.11",
52
+ "@khanacademy/wonder-blocks-button": "10.2.15",
53
+ "@khanacademy/wonder-blocks-clickable": "7.1.19",
54
54
  "@khanacademy/wonder-blocks-core": "12.3.0",
55
- "@khanacademy/wonder-blocks-dropdown": "10.2.8",
56
- "@khanacademy/wonder-blocks-form": "7.2.5",
57
- "@khanacademy/wonder-blocks-icon": "5.2.12",
58
- "@khanacademy/wonder-blocks-icon-button": "10.3.13",
59
- "@khanacademy/wonder-blocks-labeled-field": "3.2.1",
60
- "@khanacademy/wonder-blocks-layout": "3.1.29",
61
- "@khanacademy/wonder-blocks-link": "9.1.18",
62
- "@khanacademy/wonder-blocks-pill": "3.1.33",
63
- "@khanacademy/wonder-blocks-switch": "3.3.11",
55
+ "@khanacademy/wonder-blocks-dropdown": "10.3.0",
56
+ "@khanacademy/wonder-blocks-form": "7.3.1",
57
+ "@khanacademy/wonder-blocks-icon": "5.2.13",
58
+ "@khanacademy/wonder-blocks-icon-button": "10.3.14",
59
+ "@khanacademy/wonder-blocks-labeled-field": "3.2.2",
60
+ "@khanacademy/wonder-blocks-layout": "3.1.30",
61
+ "@khanacademy/wonder-blocks-link": "9.1.19",
62
+ "@khanacademy/wonder-blocks-pill": "3.1.34",
63
+ "@khanacademy/wonder-blocks-switch": "3.3.12",
64
64
  "@khanacademy/wonder-blocks-timing": "7.0.2",
65
- "@khanacademy/wonder-blocks-tokens": "12.0.0",
66
- "@khanacademy/wonder-blocks-tooltip": "4.1.35",
67
- "@khanacademy/wonder-blocks-typography": "4.2.14",
65
+ "@khanacademy/wonder-blocks-tokens": "12.0.1",
66
+ "@khanacademy/wonder-blocks-tooltip": "4.1.36",
67
+ "@khanacademy/wonder-blocks-typography": "4.2.15",
68
68
  "@khanacademy/wonder-stuff-core": "1.5.5",
69
69
  "@phosphor-icons/core": "2.0.2",
70
70
  "aphrodite": "1.2.5",
@@ -79,24 +79,24 @@
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@khanacademy/mathjax-renderer": "^3.0.0",
82
- "@khanacademy/wonder-blocks-accordion": "^3.1.32",
83
- "@khanacademy/wonder-blocks-banner": "^4.2.10",
84
- "@khanacademy/wonder-blocks-button": "^10.2.14",
85
- "@khanacademy/wonder-blocks-clickable": "^7.1.18",
82
+ "@khanacademy/wonder-blocks-accordion": "^3.1.33",
83
+ "@khanacademy/wonder-blocks-banner": "^4.2.11",
84
+ "@khanacademy/wonder-blocks-button": "^10.2.15",
85
+ "@khanacademy/wonder-blocks-clickable": "^7.1.19",
86
86
  "@khanacademy/wonder-blocks-core": "^12.3.0",
87
- "@khanacademy/wonder-blocks-dropdown": "^10.2.8",
88
- "@khanacademy/wonder-blocks-form": "^7.2.5",
89
- "@khanacademy/wonder-blocks-icon": "^5.2.12",
90
- "@khanacademy/wonder-blocks-icon-button": "^10.3.13",
91
- "@khanacademy/wonder-blocks-labeled-field": "^3.2.1",
92
- "@khanacademy/wonder-blocks-layout": "^3.1.29",
93
- "@khanacademy/wonder-blocks-link": "^9.1.18",
94
- "@khanacademy/wonder-blocks-pill": "^3.1.33",
95
- "@khanacademy/wonder-blocks-switch": "^3.3.11",
87
+ "@khanacademy/wonder-blocks-dropdown": "^10.3.0",
88
+ "@khanacademy/wonder-blocks-form": "^7.3.1",
89
+ "@khanacademy/wonder-blocks-icon": "^5.2.13",
90
+ "@khanacademy/wonder-blocks-icon-button": "^10.3.14",
91
+ "@khanacademy/wonder-blocks-labeled-field": "^3.2.2",
92
+ "@khanacademy/wonder-blocks-layout": "^3.1.30",
93
+ "@khanacademy/wonder-blocks-link": "^9.1.19",
94
+ "@khanacademy/wonder-blocks-pill": "^3.1.34",
95
+ "@khanacademy/wonder-blocks-switch": "^3.3.12",
96
96
  "@khanacademy/wonder-blocks-timing": "^7.0.2",
97
- "@khanacademy/wonder-blocks-tokens": "^12.0.0",
98
- "@khanacademy/wonder-blocks-tooltip": "^4.1.35",
99
- "@khanacademy/wonder-blocks-typography": "^4.2.14",
97
+ "@khanacademy/wonder-blocks-tokens": "^12.0.1",
98
+ "@khanacademy/wonder-blocks-tooltip": "^4.1.36",
99
+ "@khanacademy/wonder-blocks-typography": "^4.2.15",
100
100
  "@khanacademy/wonder-stuff-core": "^1.5.5",
101
101
  "@phosphor-icons/core": "^2.0.2",
102
102
  "aphrodite": "^1.2.5",