@khanacademy/perseus-editor 37.1.1 → 38.1.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.
Files changed (54) hide show
  1. package/dist/all-editors.d.ts +9 -2
  2. package/dist/components/widget-editor.d.ts +1 -1
  3. package/dist/editor-page.d.ts +1 -7
  4. package/dist/es/index.css +3 -3
  5. package/dist/es/index.css.map +1 -1
  6. package/dist/es/index.js +151 -139
  7. package/dist/es/index.js.map +1 -1
  8. package/dist/index.css +3 -3
  9. package/dist/index.css.map +1 -1
  10. package/dist/index.js +156 -142
  11. package/dist/index.js.map +1 -1
  12. package/dist/item-editor.d.ts +5 -5
  13. package/dist/mixins/changeable.d.ts +37 -0
  14. package/dist/mixins/editor-jsonify.d.ts +8 -0
  15. package/dist/widgets/categorizer-editor/categorizer-editor.d.ts +4 -4
  16. package/dist/widgets/cs-program-editor/cs-program-editor.d.ts +3 -3
  17. package/dist/widgets/definition-editor/definition-editor.d.ts +5 -5
  18. package/dist/widgets/dropdown-editor/dropdown-editor.d.ts +2 -2
  19. package/dist/widgets/explanation-editor/explanation-editor.d.ts +4 -4
  20. package/dist/widgets/graded-group-editor/graded-group-editor.d.ts +4 -4
  21. package/dist/widgets/graded-group-set-editor/graded-group-set-editor.d.ts +4 -4
  22. package/dist/widgets/grapher-editor/grapher-editor.d.ts +2 -2
  23. package/dist/widgets/group-editor/group-editor.d.ts +2 -2
  24. package/dist/widgets/iframe-editor/iframe-editor.d.ts +4 -4
  25. package/dist/widgets/image-editor/components/dark-mode-toggle.d.ts +5 -0
  26. package/dist/widgets/image-editor/image-editor.d.ts +2 -2
  27. package/dist/widgets/interaction-editor/constraint-editor.d.ts +2 -2
  28. package/dist/widgets/interaction-editor/function-editor.d.ts +2 -2
  29. package/dist/widgets/interaction-editor/interaction-editor.d.ts +2 -2
  30. package/dist/widgets/interaction-editor/label-editor.d.ts +2 -2
  31. package/dist/widgets/interaction-editor/line-editor.d.ts +2 -2
  32. package/dist/widgets/interaction-editor/movable-line-editor.d.ts +2 -3
  33. package/dist/widgets/interaction-editor/movable-point-editor.d.ts +2 -3
  34. package/dist/widgets/interaction-editor/parametric-editor.d.ts +2 -2
  35. package/dist/widgets/interaction-editor/point-editor.d.ts +2 -2
  36. package/dist/widgets/interaction-editor/rectangle-editor.d.ts +2 -2
  37. package/dist/widgets/interactive-graph-editor/components/interactive-graph-settings.d.ts +1 -5
  38. package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +8 -4
  39. package/dist/widgets/label-image-editor/label-image-editor.d.ts +2 -2
  40. package/dist/widgets/matrix-editor/matrix-editor.d.ts +4 -4
  41. package/dist/widgets/measurer-editor/measurer-editor.d.ts +4 -4
  42. package/dist/widgets/number-line-editor/number-line-editor.d.ts +4 -4
  43. package/dist/widgets/numeric-input-editor/numeric-input-editor.d.ts +1 -2
  44. package/dist/widgets/orderer-editor/orderer-editor.d.ts +1 -6
  45. package/dist/widgets/phet-simulation-editor/phet-simulation-editor.d.ts +3 -3
  46. package/dist/widgets/plotter-editor/plotter-editor.d.ts +2 -2
  47. package/dist/widgets/python-program-editor/python-program-editor.d.ts +4 -4
  48. package/dist/widgets/radio-editor/radio-editor.d.ts +2 -2
  49. package/dist/widgets/sorter-editor/card-editor.d.ts +19 -0
  50. package/dist/widgets/sorter-editor/sorter-editor.d.ts +11 -11
  51. package/dist/widgets/table-editor/table-editor.d.ts +2 -2
  52. package/dist/widgets/video-editor/video-editor.d.ts +2 -2
  53. package/package.json +10 -10
  54. /package/dist/{hint-editor.d.ts → combined-hints-editor.d.ts} +0 -0
@@ -1,10 +1,11 @@
1
1
  import * as React from "react";
2
+ import CombinedHintsEditor from "./combined-hints-editor";
2
3
  import { A11yContext } from "./components/a11y-context";
3
4
  import Editor from "./editor";
4
5
  import ItemExtrasEditor from "./item-extras-editor";
5
6
  import type { A11yReport } from "./preview/use-preview-controller";
6
7
  import type { APIOptions, ImageUploader, ChangeHandler, DeviceType } from "@khanacademy/perseus";
7
- import type { PerseusAnswerArea, PerseusRenderer, PerseusItem } from "@khanacademy/perseus-core";
8
+ import type { PerseusAnswerArea, PerseusRenderer, PerseusItem, Hint } from "@khanacademy/perseus-core";
8
9
  type Props = {
9
10
  /** Additional templates that the host application would like to display
10
11
  * within the Perseus Editor.
@@ -15,6 +16,7 @@ type Props = {
15
16
  widgetIsOpen?: boolean;
16
17
  imageUploader?: ImageUploader;
17
18
  question?: PerseusRenderer;
19
+ hints: Hint[];
18
20
  answerArea?: PerseusAnswerArea | null;
19
21
  /** URL of the route to show on initial load of the preview frames. */
20
22
  previewURL: string;
@@ -39,6 +41,7 @@ declare class ItemEditor extends React.Component<Props> {
39
41
  };
40
42
  questionEditor: React.RefObject<Editor>;
41
43
  itemExtrasEditor: React.RefObject<ItemExtrasEditor>;
44
+ hintsEditor: React.RefObject<CombinedHintsEditor>;
42
45
  derivePreviewContent: (inputs: import("./util/derive-question-preview-content").DerivePreviewContentInputs) => {
43
46
  type: "question";
44
47
  data: import("./preview/message-types").QuestionPreviewData;
@@ -48,10 +51,7 @@ declare class ItemEditor extends React.Component<Props> {
48
51
  handleItemExtrasChange: (newProps: Partial<PerseusAnswerArea>) => void;
49
52
  getSaveWarnings: () => any;
50
53
  handleA11yReport: (report: A11yReport | null) => void;
51
- serialize(): {
52
- answerArea: PerseusAnswerArea;
53
- question: PerseusRenderer;
54
- };
54
+ serialize(): PerseusItem;
55
55
  render(): React.ReactNode;
56
56
  }
57
57
  export default ItemEditor;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Changeable
3
+ *
4
+ * Adds a this.change() function to a component
5
+ *
6
+ * This.change takes prop changes as parameters, and calls
7
+ * this.props.onChange with the modified props.
8
+ */
9
+ export type ChangeFn = (newPropsOrSinglePropName: string | {
10
+ [key: string]: any;
11
+ }, propValue?: any, callback?: () => unknown) => any;
12
+ /**
13
+ * this.change()
14
+ *
15
+ * Can be called as follows:
16
+ * this.change(newProps, callback);
17
+ *
18
+ * this.change(propName, propValue, callback);
19
+ *
20
+ * this.change(propName) -> returns a lambda that takes a prop value to
21
+ * set and a callback to call after having set that value.
22
+ *
23
+ * TODO(LEMS-3245) remove Changeable
24
+ *
25
+ * @deprecated
26
+ */
27
+ export declare const deprecatedChangeableChange: ChangeFn;
28
+ /**
29
+ * TODO(LEMS-3245) remove Changeable
30
+ *
31
+ * @deprecated
32
+ */
33
+ export type ChangeableProps = {
34
+ onChange: (values: {
35
+ [key: string]: any;
36
+ }, callback?: (() => unknown) | null | undefined, silent?: boolean) => unknown;
37
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @deprecated do not use EditorJsonify
3
+ * See LEMS-4108 for more details
4
+ */
5
+ declare const EditorJsonify: {
6
+ readonly serialize: () => any;
7
+ };
8
+ export default EditorJsonify;
@@ -1,8 +1,8 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
3
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
4
- import type { CategorizerDefaultWidgetOptions } from "@khanacademy/perseus-core";
5
- interface Props extends CategorizerDefaultWidgetOptions, Changeable.ChangeableProps {
4
+ import type { PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
5
+ interface Props extends PerseusCategorizerWidgetOptions, ChangeableProps {
6
6
  apiOptions?: APIOptionsWithDefaults;
7
7
  }
8
8
  /**
@@ -10,7 +10,7 @@ interface Props extends CategorizerDefaultWidgetOptions, Changeable.ChangeablePr
10
10
  */
11
11
  declare class CategorizerEditor extends React.Component<Props> {
12
12
  static widgetName: "categorizer";
13
- static defaultProps: CategorizerDefaultWidgetOptions;
13
+ static defaultProps: PerseusCategorizerWidgetOptions;
14
14
  change: (arg1: any, arg2: any, arg3: any) => any;
15
15
  serialize: () => any;
16
16
  render(): React.ReactNode;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * This editor is for embedding Khan Academy CS programs.
3
3
  */
4
- import { Changeable } from "@khanacademy/perseus";
5
4
  import * as React from "react";
6
- import type { CSProgramDefaultWidgetOptions } from "@khanacademy/perseus-core";
7
- interface CSProgramEditorProps extends CSProgramDefaultWidgetOptions, Changeable.ChangeableProps {
5
+ import type { ChangeableProps } from "../../mixins/changeable";
6
+ import type { PerseusCSProgramWidgetOptions } from "@khanacademy/perseus-core";
7
+ interface CSProgramEditorProps extends PerseusCSProgramWidgetOptions, ChangeableProps {
8
8
  }
9
9
  /**
10
10
  * This is the main editor for this widget, to specify all the options.
@@ -1,9 +1,9 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
2
  import type { InitializeWidgetOptionsParams } from "../../editor";
3
+ import type { ChangeableProps } from "../../mixins/changeable";
4
4
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
5
- import type { DefinitionDefaultWidgetOptions } from "@khanacademy/perseus-core";
6
- interface Props extends DefinitionDefaultWidgetOptions, Changeable.ChangeableProps {
5
+ import type { PerseusDefinitionWidgetOptions } from "@khanacademy/perseus-core";
6
+ interface Props extends PerseusDefinitionWidgetOptions, ChangeableProps {
7
7
  apiOptions?: APIOptionsWithDefaults;
8
8
  }
9
9
  /**
@@ -12,8 +12,8 @@ interface Props extends DefinitionDefaultWidgetOptions, Changeable.ChangeablePro
12
12
  */
13
13
  declare class DefinitionEditor extends React.Component<Props> {
14
14
  static widgetName: "definition";
15
- static defaultProps: DefinitionDefaultWidgetOptions;
16
- static initializeWidgetOptions(params: InitializeWidgetOptionsParams): DefinitionDefaultWidgetOptions;
15
+ static defaultProps: PerseusDefinitionWidgetOptions;
16
+ static initializeWidgetOptions(params: InitializeWidgetOptionsParams): PerseusDefinitionWidgetOptions;
17
17
  change: (arg1: any, arg2: any, arg3: any) => any;
18
18
  serialize: () => any;
19
19
  render(): React.ReactNode;
@@ -1,4 +1,4 @@
1
- import { type DropdownDefaultWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusDropdownWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  type Props = any;
4
4
  /**
@@ -10,7 +10,7 @@ declare class DropdownEditor extends React.Component<Props> {
10
10
  placeholder: any;
11
11
  };
12
12
  static widgetName: "dropdown";
13
- static defaultProps: DropdownDefaultWidgetOptions;
13
+ static defaultProps: PerseusDropdownWidgetOptions;
14
14
  onVisibleLabelChange: (arg1: string) => void;
15
15
  onAriaLabelChange: (arg1: string) => void;
16
16
  onPlaceholderChange: (arg1: string) => void;
@@ -1,8 +1,8 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
3
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
4
- import type { ExplanationDefaultWidgetOptions } from "@khanacademy/perseus-core";
5
- interface Props extends ExplanationDefaultWidgetOptions, Changeable.ChangeableProps {
4
+ import type { PerseusExplanationWidgetOptions } from "@khanacademy/perseus-core";
5
+ interface Props extends PerseusExplanationWidgetOptions, ChangeableProps {
6
6
  apiOptions?: APIOptionsWithDefaults;
7
7
  }
8
8
  /**
@@ -10,7 +10,7 @@ interface Props extends ExplanationDefaultWidgetOptions, Changeable.ChangeablePr
10
10
  */
11
11
  declare class ExplanationEditor extends React.Component<Props> {
12
12
  static widgetName: "explanation";
13
- static defaultProps: ExplanationDefaultWidgetOptions;
13
+ static defaultProps: PerseusExplanationWidgetOptions;
14
14
  change: (arg1: any, arg2: any, arg3: any) => any;
15
15
  serialize: () => any;
16
16
  render(): React.ReactNode;
@@ -1,14 +1,14 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
2
  import Editor from "../../editor";
3
+ import type { ChangeableProps } from "../../mixins/changeable";
4
4
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
5
- import type { GradedGroupDefaultWidgetOptions } from "@khanacademy/perseus-core";
6
- interface Props extends GradedGroupDefaultWidgetOptions, Changeable.ChangeableProps {
5
+ import type { PerseusGradedGroupWidgetOptions } from "@khanacademy/perseus-core";
6
+ interface Props extends PerseusGradedGroupWidgetOptions, ChangeableProps {
7
7
  apiOptions?: APIOptionsWithDefaults;
8
8
  }
9
9
  declare class GradedGroupEditor extends React.Component<Props> {
10
10
  static widgetName: "graded-group";
11
- static defaultProps: GradedGroupDefaultWidgetOptions;
11
+ static defaultProps: PerseusGradedGroupWidgetOptions;
12
12
  editor: React.RefObject<Editor>;
13
13
  hintEditor: React.RefObject<Editor>;
14
14
  change: (arg1: any, arg2: any, arg3: any) => any;
@@ -1,14 +1,14 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
3
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
4
- import type { GradedGroupSetDefaultWidgetOptions } from "@khanacademy/perseus-core";
5
- interface Props extends GradedGroupSetDefaultWidgetOptions, Changeable.ChangeableProps {
4
+ import type { PerseusGradedGroupSetWidgetOptions } from "@khanacademy/perseus-core";
5
+ interface Props extends PerseusGradedGroupSetWidgetOptions, ChangeableProps {
6
6
  apiOptions?: APIOptionsWithDefaults;
7
7
  }
8
8
  declare class GradedGroupSetEditor extends React.Component<Props> {
9
9
  _editors: Array<any>;
10
10
  static widgetName: "graded-group-set";
11
- static defaultProps: GradedGroupSetDefaultWidgetOptions;
11
+ static defaultProps: PerseusGradedGroupSetWidgetOptions;
12
12
  UNSAFE_componentWillMount(): void;
13
13
  change: (arg1: any, arg2: any, arg3: any) => any;
14
14
  getSaveWarnings: () => ReadonlyArray<any>;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
3
- import type { GrapherAnswerTypes, GrapherDefaultWidgetOptions, PerseusGrapherWidgetOptions } from "@khanacademy/perseus-core";
3
+ import type { GrapherAnswerTypes, PerseusGrapherWidgetOptions } from "@khanacademy/perseus-core";
4
4
  type Props = {
5
5
  onChange: (newProps: Record<string, unknown>) => void;
6
6
  graph: PerseusGrapherWidgetOptions["graph"];
@@ -10,7 +10,7 @@ type Props = {
10
10
  };
11
11
  declare class GrapherEditor extends React.Component<Props> {
12
12
  static widgetName: "grapher";
13
- static defaultProps: GrapherDefaultWidgetOptions;
13
+ static defaultProps: PerseusGrapherWidgetOptions;
14
14
  handleAvailableTypesChange: (newAvailableTypes: Array<any>) => void;
15
15
  serialize: () => any;
16
16
  render(): React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import Editor from "../../editor";
3
- import type { GroupDefaultWidgetOptions, PerseusRenderer } from "@khanacademy/perseus-core";
3
+ import type { PerseusGroupWidgetOptions, PerseusRenderer } from "@khanacademy/perseus-core";
4
4
  type Props = any;
5
5
  declare class GroupEditor extends React.Component<Props> {
6
6
  static propTypes: {
@@ -10,7 +10,7 @@ declare class GroupEditor extends React.Component<Props> {
10
10
  apiOptions: any;
11
11
  };
12
12
  static widgetName: "group";
13
- static defaultProps: GroupDefaultWidgetOptions;
13
+ static defaultProps: PerseusGroupWidgetOptions;
14
14
  editor: React.RefObject<Editor>;
15
15
  getSaveWarnings: () => ReadonlyArray<any>;
16
16
  serialize(): PerseusRenderer;
@@ -1,14 +1,14 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
- import { type IFrameDefaultWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusIFrameWidgetOptions } from "@khanacademy/perseus-core";
3
2
  import * as React from "react";
4
- interface IframeEditorProps extends IFrameDefaultWidgetOptions, Changeable.ChangeableProps {
3
+ import type { ChangeableProps } from "../../mixins/changeable";
4
+ interface IframeEditorProps extends PerseusIFrameWidgetOptions, ChangeableProps {
5
5
  }
6
6
  /**
7
7
  * This is the main editor for this widget, to specify all the options.
8
8
  */
9
9
  declare class IframeEditor extends React.Component<IframeEditorProps> {
10
10
  static widgetName: "iframe";
11
- static defaultProps: IFrameDefaultWidgetOptions;
11
+ static defaultProps: PerseusIFrameWidgetOptions;
12
12
  change: (arg1: any, arg2: any, arg3: any) => any;
13
13
  handleSettingsChange: (arg1: any) => void;
14
14
  serialize: () => any;
@@ -8,4 +8,9 @@ interface Props {
8
8
  onSuppressToggle: ImageEditorProps["onChange"];
9
9
  }
10
10
  export default function DarkModeToggle({ backgroundImage, onShowToggle, onSuppressToggle, editingDisabled, }: Props): React.JSX.Element;
11
+ /**
12
+ * Determines whether an image is a "graphical" type (PNG or SVG) with large
13
+ * flat areas of meaningful color and potentially a transparent background.
14
+ */
15
+ export declare function isGraphicalImage(url: string | null | undefined): boolean;
11
16
  export {};
@@ -1,4 +1,4 @@
1
- import { type ImageDefaultWidgetOptions, type PerseusImageWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusImageWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  import type { APIOptions } from "@khanacademy/perseus";
4
4
  export interface Props extends PerseusImageWidgetOptions {
@@ -11,7 +11,7 @@ export interface Props extends PerseusImageWidgetOptions {
11
11
  declare class ImageEditor extends React.Component<Props> {
12
12
  static displayName: string;
13
13
  static widgetName: string;
14
- static defaultProps: ImageDefaultWidgetOptions;
14
+ static defaultProps: PerseusImageWidgetOptions;
15
15
  serialize(): any;
16
16
  render(): React.JSX.Element;
17
17
  }
@@ -1,6 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
4
4
  constraint: string;
5
5
  constraintFn: string;
6
6
  constraintXMax: string;
@@ -1,6 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
4
4
  value: string;
5
5
  rangeMin: string;
6
6
  rangeMax: string;
@@ -1,4 +1,4 @@
1
- import { type Coords, type InteractionDefaultWidgetOptions, type MarkingsType } from "@khanacademy/perseus-core";
1
+ import { type Coords, type PerseusInteractionWidgetOptions, type MarkingsType } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  type Graph = {
4
4
  box: ReadonlyArray<number>;
@@ -25,7 +25,7 @@ type State = any;
25
25
  */
26
26
  declare class InteractionEditor extends React.Component<Props, State> {
27
27
  static widgetName: "interaction";
28
- static defaultProps: InteractionDefaultWidgetOptions;
28
+ static defaultProps: PerseusInteractionWidgetOptions;
29
29
  state: State;
30
30
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
31
31
  _getAllVarSubscripts(elements: ReadonlyArray<any>): ReadonlyArray<any>;
@@ -1,6 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
4
4
  color: string;
5
5
  coordX: string;
6
6
  coordY: string;
@@ -1,6 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
4
4
  startX: string;
5
5
  startY: string;
6
6
  endX: string;
@@ -1,7 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type ChangeFn = typeof Changeable.change;
4
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps, ChangeFn } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
5
4
  startX: string;
6
5
  startY: string;
7
6
  endX: string;
@@ -1,7 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type ChangeFn = typeof Changeable.change;
4
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps, ChangeFn } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
5
4
  startX: string;
6
5
  startY: string;
7
6
  constraint: string;
@@ -1,6 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
4
4
  x: string;
5
5
  y: string;
6
6
  rangeMin: string;
@@ -1,6 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
4
4
  coordX: string;
5
5
  coordY: string;
6
6
  color: string;
@@ -1,6 +1,6 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- type Props = Changeable.ChangeableProps & {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ type Props = ChangeableProps & {
4
4
  color: string;
5
5
  coordX: string;
6
6
  coordY: string;
@@ -1,11 +1,7 @@
1
- /**
2
- * Used in the editor for the InteractiveGraph widget.
3
- */
4
- import { Changeable } from "@khanacademy/perseus";
5
1
  import * as React from "react";
2
+ import type { ChangeFn } from "../../../mixins/changeable";
6
3
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
7
4
  import type { AxisLabelLocation, ShowAxisArrows, ShowAxisTicks, MarkingsType, PerseusImageBackground } from "@khanacademy/perseus-core";
8
- type ChangeFn = typeof Changeable.change;
9
5
  type Range = [min: number, max: number];
10
6
  interface Props {
11
7
  /**
@@ -1,4 +1,4 @@
1
- import { type LockedFigure, type PerseusImageBackground, type PerseusInteractiveGraphWidgetOptions, type PerseusGraphType, type MarkingsType, type InteractiveGraphDefaultWidgetOptions, type AxisLabelLocation, type ShowAxisArrows, type ShowAxisTicks } from "@khanacademy/perseus-core";
1
+ import { type LockedFigure, type PerseusImageBackground, type PerseusInteractiveGraphWidgetOptions, type PerseusGraphType, type MarkingsType, type AxisLabelLocation, type ShowAxisArrows, type ShowAxisTicks } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
4
4
  import type { PropsFor } from "@khanacademy/wonder-blocks-core";
@@ -42,7 +42,9 @@ declare const InteractiveGraph: {
42
42
  }>) => void;
43
43
  customKeypad?: boolean;
44
44
  isMobile?: boolean;
45
- isMobileApp?: boolean;
45
+ isMobileApp? /**
46
+ * The range of the graph in the x and y directions.
47
+ */: boolean;
46
48
  hintProgressColor?: string;
47
49
  flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
48
50
  }> & {
@@ -368,7 +370,9 @@ declare const InteractiveGraph: {
368
370
  }>) => void;
369
371
  customKeypad?: boolean;
370
372
  isMobile?: boolean;
371
- isMobileApp?: boolean;
373
+ isMobileApp? /**
374
+ * The range of the graph in the x and y directions.
375
+ */: boolean;
372
376
  hintProgressColor?: string;
373
377
  flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
374
378
  }> & {
@@ -770,7 +774,7 @@ declare class InteractiveGraphEditor extends React.Component<Props> {
770
774
  };
771
775
  displayName: string;
772
776
  className: string;
773
- static defaultProps: InteractiveGraphDefaultWidgetOptions & {
777
+ static defaultProps: PerseusInteractiveGraphWidgetOptions & {
774
778
  valid: true | string;
775
779
  };
776
780
  changeStartCoords: (coords: any) => void;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { PreferredPopoverDirection } from "./behavior";
3
3
  import type { APIOptions } from "@khanacademy/perseus";
4
- import type { PerseusLabelImageWidgetOptions, LabelImageDefaultWidgetOptions } from "@khanacademy/perseus-core";
4
+ import type { PerseusLabelImageWidgetOptions } from "@khanacademy/perseus-core";
5
5
  interface Props {
6
6
  apiOptions: APIOptions;
7
7
  choices: string[];
@@ -24,7 +24,7 @@ interface Props {
24
24
  */
25
25
  declare class LabelImageEditor extends React.Component<Props> {
26
26
  private _questionMarkers;
27
- static defaultProps: LabelImageDefaultWidgetOptions;
27
+ static defaultProps: PerseusLabelImageWidgetOptions;
28
28
  static widgetName: "label-image";
29
29
  componentDidUpdate(prevProps: Props): void;
30
30
  getSaveWarnings: () => ReadonlyArray<any | string>;
@@ -1,13 +1,13 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
3
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
4
- import type { MatrixDefaultWidgetOptions } from "@khanacademy/perseus-core";
5
- interface Props extends MatrixDefaultWidgetOptions, Changeable.ChangeableProps {
4
+ import type { PerseusMatrixWidgetOptions } from "@khanacademy/perseus-core";
5
+ interface Props extends PerseusMatrixWidgetOptions, ChangeableProps {
6
6
  apiOptions: APIOptionsWithDefaults;
7
7
  }
8
8
  declare class MatrixEditor extends React.Component<Props> {
9
9
  static widgetName: "matrix";
10
- static defaultProps: MatrixDefaultWidgetOptions;
10
+ static defaultProps: PerseusMatrixWidgetOptions;
11
11
  change: (arg1: any, arg2?: any, arg3?: any) => any;
12
12
  onMatrixBoardSizeChange: (arg1: [number, number]) => void;
13
13
  serialize: () => any;
@@ -1,11 +1,11 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import * as React from "react";
3
- import type { MeasurerDefaultWidgetOptions } from "@khanacademy/perseus-core";
4
- interface Props extends MeasurerDefaultWidgetOptions, Changeable.ChangeableProps {
2
+ import type { ChangeableProps } from "../../mixins/changeable";
3
+ import type { PerseusMeasurerWidgetOptions } from "@khanacademy/perseus-core";
4
+ interface Props extends PerseusMeasurerWidgetOptions, ChangeableProps {
5
5
  }
6
6
  declare class MeasurerEditor extends React.Component<Props> {
7
7
  static widgetName: "measurer";
8
- static defaultProps: MeasurerDefaultWidgetOptions;
8
+ static defaultProps: PerseusMeasurerWidgetOptions;
9
9
  className: string;
10
10
  change: (arg1: any, arg2: any, arg3: any) => any;
11
11
  _changeUrl: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
@@ -1,6 +1,6 @@
1
- import { type NumberLineDefaultWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusNumberLineWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
- import type { Changeable } from "@khanacademy/perseus";
3
+ import type { ChangeableProps } from "../../mixins/changeable";
4
4
  type Range = [number, number];
5
5
  type Props = {
6
6
  range: number[];
@@ -17,14 +17,14 @@ type Props = {
17
17
  isTickCtrl?: boolean;
18
18
  static?: boolean;
19
19
  showTooltips: boolean;
20
- } & Changeable.ChangeableProps;
20
+ } & ChangeableProps;
21
21
  /**
22
22
  * An editor for adding a number line widget that allows users to mark
23
23
  * positions, intervals, and points on a number line.
24
24
  */
25
25
  declare class NumberLineEditor extends React.Component<Props> {
26
26
  static widgetName: "number-line";
27
- static defaultProps: NumberLineDefaultWidgetOptions;
27
+ static defaultProps: PerseusNumberLineWidgetOptions;
28
28
  onRangeChange: (arg1: Range) => void;
29
29
  onLabelRangeChange: (arg1: number, arg2: number) => void;
30
30
  onDivisionRangeChange: (arg1: Range) => void;
@@ -1,8 +1,7 @@
1
- import { Changeable } from "@khanacademy/perseus";
2
1
  import { type PerseusNumericInputWidgetOptions } from "@khanacademy/perseus-core";
3
2
  import * as React from "react";
3
+ import type { ChangeFn } from "../../mixins/changeable";
4
4
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
5
- type ChangeFn = typeof Changeable.change;
6
5
  type Props = Omit<PerseusNumericInputWidgetOptions, "static"> & {
7
6
  onChange: (results: any) => any;
8
7
  apiOptions: APIOptionsWithDefaults;
@@ -1,13 +1,8 @@
1
- import { type PerseusOrdererWidgetOptions, type PerseusRenderer } from "@khanacademy/perseus-core";
1
+ import { type PerseusOrdererWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
3
  type Props = PerseusOrdererWidgetOptions & {
4
4
  onChange: (newOptions: Partial<PerseusOrdererWidgetOptions>, callback?: () => void) => void;
5
5
  };
6
- /**
7
- * The cards the student picks from: the correct answer and the distractors,
8
- * with duplicates and empty cards removed.
9
- */
10
- export declare const mergeCards: (correctOptions: PerseusRenderer[], otherOptions: PerseusRenderer[]) => PerseusRenderer[];
11
6
  declare class OrdererEditor extends React.Component<Props> {
12
7
  static widgetName: "orderer";
13
8
  static defaultProps: PerseusOrdererWidgetOptions;
@@ -1,6 +1,6 @@
1
- import { type PerseusPhetSimulationWidgetOptions, type PhetSimulationDefaultWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusPhetSimulationWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
- type Props = PhetSimulationDefaultWidgetOptions & {
3
+ type Props = PerseusPhetSimulationWidgetOptions & {
4
4
  onChange: (arg1: {
5
5
  url?: Props["url"];
6
6
  description?: Props["description"];
@@ -11,7 +11,7 @@ type Props = PhetSimulationDefaultWidgetOptions & {
11
11
  * with physics simulations.
12
12
  */
13
13
  declare class PhetSimulationEditor extends React.Component<Props> {
14
- static defaultProps: PhetSimulationDefaultWidgetOptions;
14
+ static defaultProps: PerseusPhetSimulationWidgetOptions;
15
15
  static widgetName: "phet-simulation";
16
16
  serialize(): PerseusPhetSimulationWidgetOptions;
17
17
  getSaveWarnings: () => ReadonlyArray<string>;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { APIOptions } from "@khanacademy/perseus";
3
- import type { PerseusPlotterWidgetOptions, PlotterDefaultWidgetOptions } from "@khanacademy/perseus-core";
3
+ import type { PerseusPlotterWidgetOptions } from "@khanacademy/perseus-core";
4
4
  declare const editingStates: string[];
5
5
  type EditingState = (typeof editingStates)[number];
6
6
  type Props = {
@@ -34,7 +34,7 @@ type State = {
34
34
  */
35
35
  declare class PlotterEditor extends React.Component<Props, State> {
36
36
  static widgetName: "plotter";
37
- static defaultProps: PlotterDefaultWidgetOptions;
37
+ static defaultProps: PerseusPlotterWidgetOptions;
38
38
  state: State;
39
39
  UNSAFE_componentWillMount(): void;
40
40
  UNSAFE_componentWillReceiveProps(nextProps: any): void;