@khanacademy/perseus 31.0.1 → 32.0.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.
Files changed (90) hide show
  1. package/dist/components/input-with-examples.d.ts +1 -1
  2. package/dist/components/number-input.d.ts +1 -1
  3. package/dist/components/range-input.d.ts +1 -1
  4. package/dist/components/sortable.d.ts +5 -5
  5. package/dist/components/text-input.d.ts +1 -1
  6. package/dist/components/text-list-editor.d.ts +1 -1
  7. package/dist/es/index.css +1 -1
  8. package/dist/es/index.js +615 -535
  9. package/dist/es/index.js.map +1 -1
  10. package/dist/index.css +1 -1
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1450 -1369
  13. package/dist/index.js.map +1 -1
  14. package/dist/perseus-types.d.ts +1 -10
  15. package/dist/widget-container.d.ts +1 -1
  16. package/dist/widgets/__shared__/test-keypad-context-wrapper.d.ts +6 -0
  17. package/dist/widgets/{categorizer.d.ts → categorizer/categorizer.d.ts} +14 -14
  18. package/dist/widgets/categorizer/index.d.ts +1 -0
  19. package/dist/widgets/{cs-program.d.ts → cs-program/cs-program.d.ts} +7 -7
  20. package/dist/widgets/cs-program/index.d.ts +1 -0
  21. package/dist/widgets/{definition.d.ts → definition/definition.d.ts} +11 -11
  22. package/dist/widgets/definition/index.d.ts +1 -0
  23. package/dist/widgets/{dropdown.d.ts → dropdown/dropdown.d.ts} +9 -9
  24. package/dist/widgets/dropdown/index.d.ts +1 -0
  25. package/dist/widgets/{explanation.d.ts → explanation/explanation.d.ts} +14 -14
  26. package/dist/widgets/explanation/index.d.ts +1 -0
  27. package/dist/widgets/{expression.d.ts → expression/expression.d.ts} +66 -66
  28. package/dist/widgets/expression/index.d.ts +1 -0
  29. package/dist/widgets/{graded-group-answer-bar.d.ts → graded-group/graded-group-answer-bar.d.ts} +3 -3
  30. package/dist/widgets/{graded-group.d.ts → graded-group/graded-group.d.ts} +11 -11
  31. package/dist/widgets/graded-group/index.d.ts +1 -0
  32. package/dist/widgets/{graded-group-set.d.ts → graded-group-set/graded-group-set.d.ts} +11 -11
  33. package/dist/widgets/graded-group-set/index.d.ts +1 -0
  34. package/dist/widgets/{grapher.d.ts → grapher/grapher.d.ts} +15 -15
  35. package/dist/widgets/grapher/index.d.ts +1 -0
  36. package/dist/widgets/{group.d.ts → group/group.d.ts} +12 -12
  37. package/dist/widgets/group/index.d.ts +1 -0
  38. package/dist/widgets/{iframe.d.ts → iframe/iframe.d.ts} +10 -10
  39. package/dist/widgets/iframe/index.d.ts +1 -0
  40. package/dist/widgets/{image.d.ts → image/image.d.ts} +12 -12
  41. package/dist/widgets/image/index.d.ts +1 -0
  42. package/dist/widgets/input-number/index.d.ts +1 -0
  43. package/dist/widgets/{input-number.d.ts → input-number/input-number.d.ts} +19 -19
  44. package/dist/widgets/interaction/index.d.ts +1 -0
  45. package/dist/widgets/{interaction.d.ts → interaction/interaction.d.ts} +12 -12
  46. package/dist/widgets/interactive-graphs/graphs/components/movable-point-view.d.ts +8 -4
  47. package/dist/widgets/interactive-graphs/graphs/components/movable-point.d.ts +2 -1
  48. package/dist/widgets/interactive-graphs/reducer/interactive-graph-action.d.ts +29 -1
  49. package/dist/widgets/interactive-graphs/types.d.ts +1 -0
  50. package/dist/widgets/label-image/index.d.ts +1 -0
  51. package/dist/widgets/{label-image.d.ts → label-image/label-image.d.ts} +24 -24
  52. package/dist/widgets/matcher/index.d.ts +1 -0
  53. package/dist/widgets/{matcher.d.ts → matcher/matcher.d.ts} +11 -11
  54. package/dist/widgets/matrix/index.d.ts +1 -0
  55. package/dist/widgets/{matrix.d.ts → matrix/matrix.d.ts} +12 -12
  56. package/dist/widgets/measurer/index.d.ts +1 -0
  57. package/dist/widgets/measurer/measurer.d.ts +21 -0
  58. package/dist/widgets/molecule/index.d.ts +1 -0
  59. package/dist/widgets/{molecule.d.ts → molecule/molecule.d.ts} +10 -10
  60. package/dist/widgets/number-line/index.d.ts +1 -0
  61. package/dist/widgets/{number-line.d.ts → number-line/number-line.d.ts} +11 -11
  62. package/dist/widgets/numeric-input/index.d.ts +1 -0
  63. package/dist/widgets/{numeric-input.d.ts → numeric-input/numeric-input.d.ts} +13 -13
  64. package/dist/widgets/orderer/index.d.ts +1 -0
  65. package/dist/widgets/{orderer.d.ts → orderer/orderer.d.ts} +10 -10
  66. package/dist/widgets/passage/index.d.ts +2 -0
  67. package/dist/widgets/{passage.d.ts → passage/passage.d.ts} +15 -15
  68. package/dist/widgets/passage-ref/index.d.ts +1 -0
  69. package/dist/widgets/{passage-ref.d.ts → passage-ref/passage-ref.d.ts} +16 -16
  70. package/dist/widgets/passage-ref-target/index.d.ts +1 -0
  71. package/dist/widgets/{passage-ref-target.d.ts → passage-ref-target/passage-ref-target.d.ts} +12 -12
  72. package/dist/widgets/phet-simulation/index.d.ts +1 -0
  73. package/dist/widgets/{phet-simulation.d.ts → phet-simulation/phet-simulation.d.ts} +13 -15
  74. package/dist/widgets/plotter/index.d.ts +1 -0
  75. package/dist/widgets/{plotter.d.ts → plotter/plotter.d.ts} +11 -11
  76. package/dist/widgets/python-program/index.d.ts +1 -0
  77. package/dist/widgets/{python-program.d.ts → python-program/python-program.d.ts} +7 -7
  78. package/dist/widgets/radio/index.d.ts +2 -0
  79. package/dist/widgets/radio/radio-component.d.ts +66 -0
  80. package/dist/widgets/radio/radio.d.ts +22 -66
  81. package/dist/widgets/sorter/index.d.ts +1 -0
  82. package/dist/widgets/{sorter.d.ts → sorter/sorter.d.ts} +8 -8
  83. package/dist/widgets/table/index.d.ts +1 -0
  84. package/dist/widgets/{table.d.ts → table/table.d.ts} +10 -10
  85. package/dist/widgets/video/index.d.ts +1 -0
  86. package/dist/widgets/{video.d.ts → video/video.d.ts} +11 -11
  87. package/package.json +45 -45
  88. package/dist/widgets/measurer.d.ts +0 -21
  89. package/dist/widgets/radio.d.ts +0 -22
  90. /package/dist/widgets/{video-transcript-link.d.ts → video/video-transcript-link.d.ts} +0 -0
@@ -21,13 +21,13 @@ declare class Iframe extends React.Component<any> {
21
21
  onChange: PropTypes.Validator<(...args: any[]) => any>;
22
22
  };
23
23
  static defaultProps: any;
24
- getUserInput: () => any;
25
- handleMessageEvent: (arg1: any) => void;
26
24
  componentDidMount(): void;
27
25
  componentWillUnmount(): void;
28
- render(): React.ReactNode;
26
+ getUserInput: () => any;
27
+ handleMessageEvent: (arg1: any) => void;
29
28
  change: (...args: ReadonlyArray<unknown>) => any;
30
29
  simpleValidate: (arg1: any) => any;
30
+ render(): React.ReactNode;
31
31
  }
32
32
  declare const _default: Readonly<{
33
33
  name: string;
@@ -36,15 +36,15 @@ declare const _default: Readonly<{
36
36
  widget: typeof Iframe;
37
37
  accessible?: boolean | ((props: any) => boolean) | undefined;
38
38
  hidden?: boolean | undefined;
39
- version?: import("../types").Version | undefined;
40
- supportedAlignments?: readonly import("../types").Alignment[] | undefined;
41
- defaultAlignment?: import("../types").Alignment | undefined;
42
- getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
39
+ version?: import("../../types").Version | undefined;
40
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
41
+ defaultAlignment?: import("../../types").Alignment | undefined;
42
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
43
43
  isLintable?: boolean | undefined;
44
- tracking?: import("../types").Tracking | undefined;
44
+ tracking?: import("../../types").Tracking | undefined;
45
45
  traverseChildWidgets?: any;
46
- transform?: import("../types").WidgetTransform | undefined;
47
- staticTransform?: import("../types").WidgetTransform | undefined;
46
+ transform?: import("../../types").WidgetTransform | undefined;
47
+ staticTransform?: import("../../types").WidgetTransform | undefined;
48
48
  propUpgrades?: {
49
49
  [key: string]: (arg1: any) => any;
50
50
  } | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./iframe";
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- import { PerseusI18nContext } from "../components/i18n-context";
3
- import type { PerseusImageWidgetOptions } from "../perseus-types";
4
- import type { ChangeFn, PerseusScore, WidgetProps } from "../types";
2
+ import { PerseusI18nContext } from "../../components/i18n-context";
3
+ import type { PerseusImageWidgetOptions } from "../../perseus-types";
4
+ import type { ChangeFn, PerseusScore, WidgetProps } from "../../types";
5
5
  type RenderProps = PerseusImageWidgetOptions;
6
6
  type Rubric = PerseusImageWidgetOptions;
7
7
  type UserInput = null;
@@ -30,17 +30,17 @@ type DefaultProps = {
30
30
  };
31
31
  declare class ImageWidget extends React.Component<Props> {
32
32
  static contextType: React.Context<{
33
- strings: import("../strings").PerseusStrings;
33
+ strings: import("../../strings").PerseusStrings;
34
34
  locale: string;
35
35
  }>;
36
36
  context: React.ContextType<typeof PerseusI18nContext>;
37
37
  static defaultProps: DefaultProps;
38
+ static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
38
39
  change: ChangeFn;
39
40
  getUserInput: () => UserInput;
40
41
  simpleValidate: (arg1: Rubric) => PerseusScore;
41
42
  focus: () => void;
42
43
  render(): React.ReactNode;
43
- static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
44
44
  }
45
45
  declare const _default: Readonly<{
46
46
  name: string;
@@ -49,15 +49,15 @@ declare const _default: Readonly<{
49
49
  widget: typeof ImageWidget;
50
50
  accessible?: boolean | ((props: any) => boolean) | undefined;
51
51
  hidden?: boolean | undefined;
52
- version?: import("../types").Version | undefined;
53
- supportedAlignments?: readonly import("../types").Alignment[] | undefined;
54
- defaultAlignment?: import("../types").Alignment | undefined;
55
- getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
52
+ version?: import("../../types").Version | undefined;
53
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
54
+ defaultAlignment?: import("../../types").Alignment | undefined;
55
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
56
56
  isLintable?: boolean | undefined;
57
- tracking?: import("../types").Tracking | undefined;
57
+ tracking?: import("../../types").Tracking | undefined;
58
58
  traverseChildWidgets?: any;
59
- transform?: import("../types").WidgetTransform | undefined;
60
- staticTransform?: import("../types").WidgetTransform | undefined;
59
+ transform?: import("../../types").WidgetTransform | undefined;
60
+ staticTransform?: import("../../types").WidgetTransform | undefined;
61
61
  propUpgrades?: {
62
62
  [key: string]: (arg1: any) => any;
63
63
  } | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./image";
@@ -0,0 +1 @@
1
+ export { default } from "./input-number";
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
- import { PerseusI18nContext } from "../components/i18n-context";
3
- import type { PerseusInputNumberWidgetOptions } from "../perseus-types";
4
- import type { PerseusStrings } from "../strings";
5
- import type { APIOptions, Path, PerseusScore, WidgetProps } from "../types";
2
+ import { PerseusI18nContext } from "../../components/i18n-context";
3
+ import type { PerseusInputNumberWidgetOptions } from "../../perseus-types";
4
+ import type { PerseusStrings } from "../../strings";
5
+ import type { APIOptions, Path, PerseusScore, WidgetProps } from "../../types";
6
6
  type UserInput = {
7
7
  currentValue: string;
8
8
  };
@@ -37,8 +37,14 @@ declare class InputNumber extends React.Component<Props> {
37
37
  }>;
38
38
  context: React.ContextType<typeof PerseusI18nContext>;
39
39
  static defaultProps: DefaultProps;
40
+ static validate(state: {
41
+ currentValue: string;
42
+ }, rubric: Rubric, strings: PerseusStrings, onInputError?: APIOptions["onInputError"]): PerseusScore;
43
+ static getUserInputFromProps(props: Props): {
44
+ currentValue: string;
45
+ };
46
+ static getOneCorrectAnswerFromRubric(rubric: any): string | null | undefined;
40
47
  shouldShowExamples: () => boolean;
41
- render(): React.ReactNode;
42
48
  handleChange: (arg1: string, arg2: () => void) => void;
43
49
  _handleFocus: () => void;
44
50
  _handleBlur: () => void;
@@ -51,13 +57,7 @@ declare class InputNumber extends React.Component<Props> {
51
57
  getUserInput: () => UserInput;
52
58
  simpleValidate: (rubric: Rubric, onInputError?: APIOptions["onInputError"]) => PerseusScore;
53
59
  examples: () => ReadonlyArray<string>;
54
- static validate(state: {
55
- currentValue: string;
56
- }, rubric: Rubric, strings: PerseusStrings, onInputError?: APIOptions["onInputError"]): PerseusScore;
57
- static getUserInputFromProps(props: Props): {
58
- currentValue: string;
59
- };
60
- static getOneCorrectAnswerFromRubric(rubric: any): string | null | undefined;
60
+ render(): React.ReactNode;
61
61
  }
62
62
  declare const _default: Readonly<{
63
63
  name: string;
@@ -66,15 +66,15 @@ declare const _default: Readonly<{
66
66
  widget: typeof InputNumber;
67
67
  accessible?: boolean | ((props: any) => boolean) | undefined;
68
68
  hidden?: boolean | undefined;
69
- version?: import("../types").Version | undefined;
70
- supportedAlignments?: readonly import("../types").Alignment[] | undefined;
71
- defaultAlignment?: import("../types").Alignment | undefined;
72
- getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
69
+ version?: import("../../types").Version | undefined;
70
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
71
+ defaultAlignment?: import("../../types").Alignment | undefined;
72
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
73
73
  isLintable?: boolean | undefined;
74
- tracking?: import("../types").Tracking | undefined;
74
+ tracking?: import("../../types").Tracking | undefined;
75
75
  traverseChildWidgets?: any;
76
- transform?: import("../types").WidgetTransform | undefined;
77
- staticTransform?: import("../types").WidgetTransform | undefined;
76
+ transform?: import("../../types").WidgetTransform | undefined;
77
+ staticTransform?: import("../../types").WidgetTransform | undefined;
78
78
  propUpgrades?: {
79
79
  [key: string]: (arg1: any) => any;
80
80
  } | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./interaction";
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- import type { Coord } from "../interactive2/types";
3
- import type { PerseusInteractionWidgetOptions } from "../perseus-types";
4
- import type { PerseusScore, WidgetProps } from "../types";
2
+ import type { Coord } from "../../interactive2/types";
3
+ import type { PerseusInteractionWidgetOptions } from "../../perseus-types";
4
+ import type { PerseusScore, WidgetProps } from "../../types";
5
5
  type RenderProps = PerseusInteractionWidgetOptions;
6
6
  type Rubric = PerseusInteractionWidgetOptions;
7
7
  type Props = WidgetProps<RenderProps, Rubric>;
@@ -15,6 +15,7 @@ type State = {
15
15
  };
16
16
  declare class Interaction extends React.Component<Props, State> {
17
17
  static defaultProps: DefaultProps;
18
+ static validate(state: any, rubric: any): PerseusScore;
18
19
  state: State;
19
20
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
20
21
  _setupGraphie: (arg1: any, arg2: any) => void;
@@ -23,10 +24,9 @@ declare class Interaction extends React.Component<Props, State> {
23
24
  _eval: (arg1: any, arg2: any) => number;
24
25
  _extractVars: (arg1: any) => ReadonlyArray<any>;
25
26
  change: (arg1: any, arg2: any, arg3: any) => any;
26
- render(): React.ReactNode;
27
27
  getUserInput: () => any;
28
28
  simpleValidate: (arg1: any) => any;
29
- static validate(state: any, rubric: any): PerseusScore;
29
+ render(): React.ReactNode;
30
30
  }
31
31
  declare const _default: Readonly<{
32
32
  name: string;
@@ -35,15 +35,15 @@ declare const _default: Readonly<{
35
35
  widget: typeof Interaction;
36
36
  accessible?: boolean | ((props: any) => boolean) | undefined;
37
37
  hidden?: boolean | undefined;
38
- version?: import("../types").Version | undefined;
39
- supportedAlignments?: readonly import("../types").Alignment[] | undefined;
40
- defaultAlignment?: import("../types").Alignment | undefined;
41
- getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
38
+ version?: import("../../types").Version | undefined;
39
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
40
+ defaultAlignment?: import("../../types").Alignment | undefined;
41
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
42
42
  isLintable?: boolean | undefined;
43
- tracking?: import("../types").Tracking | undefined;
43
+ tracking?: import("../../types").Tracking | undefined;
44
44
  traverseChildWidgets?: any;
45
- transform?: import("../types").WidgetTransform | undefined;
46
- staticTransform?: import("../types").WidgetTransform | undefined;
45
+ transform?: import("../../types").WidgetTransform | undefined;
46
+ staticTransform?: import("../../types").WidgetTransform | undefined;
47
47
  propUpgrades?: {
48
48
  [key: string]: (arg1: any) => any;
49
49
  } | undefined;
@@ -7,13 +7,17 @@ type Props = {
7
7
  dragging: boolean;
8
8
  focusBehavior: FocusBehaviorConfig;
9
9
  cursor?: CSSCursor | undefined;
10
+ onClick?: () => unknown;
10
11
  };
11
- type FocusBehaviorConfig = {
12
- type: "uncontrolled";
13
- tabIndex: number;
14
- } | {
12
+ type FocusBehaviorConfig = ControlledFocusBehavior | UncontrolledFocusBehavior;
13
+ type ControlledFocusBehavior = {
15
14
  type: "controlled";
16
15
  showFocusRing: boolean;
17
16
  };
17
+ type UncontrolledFocusBehavior = {
18
+ type: "uncontrolled";
19
+ tabIndex: number;
20
+ onFocusChange: (isFocused: boolean) => unknown;
21
+ };
18
22
  export declare const MovablePointView: React.ForwardRefExoticComponent<Props & React.RefAttributes<SVGGElement>>;
19
23
  export {};
@@ -4,10 +4,11 @@ import type { KeyboardMovementConstraint } from "../use-draggable";
4
4
  import type { vec } from "mafs";
5
5
  type Props = {
6
6
  point: vec.Vector2;
7
- onMove: (newPoint: vec.Vector2) => unknown;
7
+ onMove?: (newPoint: vec.Vector2) => unknown;
8
8
  color?: string;
9
9
  cursor?: CSSCursor | undefined;
10
10
  constrain?: KeyboardMovementConstraint;
11
+ onFocusChange?: (isFocused: boolean) => unknown;
11
12
  };
12
13
  export declare const MovablePoint: (props: Props) => React.JSX.Element;
13
14
  export {};
@@ -1,7 +1,10 @@
1
1
  import type { InitializeGraphStateParams } from "./initialize-graph-state";
2
2
  import type { Interval, vec } from "mafs";
3
- export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint;
3
+ export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint | RemovePoint | FocusPoint | BlurPoint | DeleteIntent;
4
4
  export declare const actions: {
5
+ global: {
6
+ deleteIntent: typeof deleteIntent;
7
+ };
5
8
  angle: {
6
9
  movePoint: typeof movePoint;
7
10
  };
@@ -20,6 +23,9 @@ export declare const actions: {
20
23
  pointGraph: {
21
24
  movePoint: typeof movePoint;
22
25
  addPoint: typeof addPoint;
26
+ removePoint: typeof removePoint;
27
+ focusPoint: typeof focusPoint;
28
+ blurPoint: typeof blurPoint;
23
29
  };
24
30
  polygon: {
25
31
  movePoint: typeof movePoint;
@@ -40,6 +46,11 @@ export declare const actions: {
40
46
  movePoint: typeof movePoint;
41
47
  };
42
48
  };
49
+ export declare const DELETE_INTENT = "delete-intent";
50
+ export interface DeleteIntent {
51
+ type: typeof DELETE_INTENT;
52
+ }
53
+ declare function deleteIntent(): DeleteIntent;
43
54
  export declare const MOVE_LINE = "move-line";
44
55
  export interface MoveLine {
45
56
  type: typeof MOVE_LINE;
@@ -53,6 +64,23 @@ export interface AddPoint {
53
64
  location: vec.Vector2;
54
65
  }
55
66
  declare function addPoint(location: vec.Vector2): AddPoint;
67
+ export declare const REMOVE_POINT = "remove-point";
68
+ export interface RemovePoint {
69
+ type: typeof REMOVE_POINT;
70
+ index: number;
71
+ }
72
+ declare function removePoint(index: number): RemovePoint;
73
+ export declare const FOCUS_POINT = "focus-point";
74
+ export interface FocusPoint {
75
+ type: typeof FOCUS_POINT;
76
+ index: number;
77
+ }
78
+ declare function focusPoint(index: number): FocusPoint;
79
+ export declare const BLUR_POINT = "blur-point";
80
+ export interface BlurPoint {
81
+ type: typeof BLUR_POINT;
82
+ }
83
+ declare function blurPoint(): BlurPoint;
56
84
  export declare const MOVE_ALL = "move-all";
57
85
  export interface MoveAll {
58
86
  type: typeof MOVE_ALL;
@@ -30,6 +30,7 @@ export interface PointGraphState extends InteractiveGraphStateCommon {
30
30
  type: "point";
31
31
  coords: Coord[];
32
32
  numPoints?: number | "unlimited";
33
+ focusedPointIndex: number | null;
33
34
  }
34
35
  export interface RayGraphState extends InteractiveGraphStateCommon {
35
36
  type: "ray";
@@ -0,0 +1 @@
1
+ export { default } from "./label-image";
@@ -6,12 +6,12 @@
6
6
  * knowledge by directly interacting with the image.
7
7
  */
8
8
  import * as React from "react";
9
- import { PerseusI18nContext } from "../components/i18n-context";
10
- import Marker from "./label-image/marker";
11
- import type { InteractiveMarkerType, InteractiveMarkerScore } from "./label-image/types";
12
- import type { DependencyProps } from "../dependencies";
13
- import type { ChangeableProps } from "../mixins/changeable";
14
- import type { APIOptions, PerseusScore } from "../types";
9
+ import { PerseusI18nContext } from "../../components/i18n-context";
10
+ import Marker from "./marker";
11
+ import type { InteractiveMarkerType, InteractiveMarkerScore } from "./types";
12
+ import type { DependencyProps } from "../../dependencies";
13
+ import type { ChangeableProps } from "../../mixins/changeable";
14
+ import type { APIOptions, PerseusScore } from "../../types";
15
15
  export type PreferredPopoverDirection = "NONE" | "UP" | "DOWN" | "LEFT" | "RIGHT";
16
16
  type MarkersState = {
17
17
  markers: ReadonlyArray<InteractiveMarkerType>;
@@ -54,7 +54,7 @@ type LabelImageState = {
54
54
  };
55
55
  export declare class LabelImage extends React.Component<LabelImageProps, LabelImageState> {
56
56
  static contextType: React.Context<{
57
- strings: import("../strings").PerseusStrings;
57
+ strings: import("../../strings").PerseusStrings;
58
58
  locale: string;
59
59
  }>;
60
60
  context: React.ContextType<typeof PerseusI18nContext>;
@@ -96,11 +96,11 @@ export declare class LabelImage extends React.Component<LabelImageProps, LabelIm
96
96
  declare const _default: Readonly<{
97
97
  name: string;
98
98
  displayName: string;
99
- getWidget?: (() => React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("../types").PerseusDependenciesV2> & {
99
+ getWidget?: (() => React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("../../types").PerseusDependenciesV2> & {
100
100
  apiOptions: Readonly<{
101
101
  isArticle?: boolean | undefined;
102
102
  onInputError?: ((widgetId: any, value: string, message?: string | null | undefined) => unknown) | undefined;
103
- onFocusChange?: ((newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
103
+ onFocusChange?: ((newFocusPath: import("../../types").FocusPath, oldFocusPath: import("../../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
104
104
  GroupMetadataEditor?: React.ComponentType<any> | undefined;
105
105
  showAlignmentOptions?: boolean | undefined;
106
106
  readOnly?: boolean | undefined;
@@ -115,12 +115,12 @@ declare const _default: Readonly<{
115
115
  baseElements?: {
116
116
  Link: React.ComponentType<any>;
117
117
  } | undefined;
118
- imagePreloader?: ((dimensions: import("../types").Dimensions) => React.ReactNode) | undefined;
118
+ imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
119
119
  trackInteraction?: ((args: {
120
120
  type: string;
121
121
  id: string;
122
122
  correct?: boolean | undefined;
123
- } & Partial<import("../types").TrackingGradedGroupExtraArguments> & Partial<import("../types").TrackingSequenceExtraArguments>) => void) | undefined;
123
+ } & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<import("../../types").TrackingSequenceExtraArguments>) => void) | undefined;
124
124
  customKeypad?: boolean | undefined;
125
125
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
126
126
  isMobile?: boolean | undefined;
@@ -153,7 +153,7 @@ declare const _default: Readonly<{
153
153
  "start-coords-ui-angle"?: boolean | undefined;
154
154
  }) | undefined;
155
155
  } | undefined;
156
- onWidgetStartProps?: ((widgets: import("..").PerseusWidgetsMap) => void) | undefined;
156
+ onWidgetStartProps?: ((widgets: import("../..").PerseusWidgetsMap) => void) | undefined;
157
157
  }>;
158
158
  choices: readonly string[];
159
159
  imageAlt: string;
@@ -166,11 +166,11 @@ declare const _default: Readonly<{
166
166
  questionCompleted: boolean;
167
167
  preferredPopoverDirection?: PreferredPopoverDirection | undefined;
168
168
  }, "analytics"> & React.RefAttributes<LabelImage>>) | undefined;
169
- widget: React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("../types").PerseusDependenciesV2> & {
169
+ widget: React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("../../types").PerseusDependenciesV2> & {
170
170
  apiOptions: Readonly<{
171
171
  isArticle?: boolean | undefined;
172
172
  onInputError?: ((widgetId: any, value: string, message?: string | null | undefined) => unknown) | undefined;
173
- onFocusChange?: ((newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
173
+ onFocusChange?: ((newFocusPath: import("../../types").FocusPath, oldFocusPath: import("../../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
174
174
  GroupMetadataEditor?: React.ComponentType<any> | undefined;
175
175
  showAlignmentOptions?: boolean | undefined;
176
176
  readOnly?: boolean | undefined;
@@ -185,12 +185,12 @@ declare const _default: Readonly<{
185
185
  baseElements?: {
186
186
  Link: React.ComponentType<any>;
187
187
  } | undefined;
188
- imagePreloader?: ((dimensions: import("../types").Dimensions) => React.ReactNode) | undefined;
188
+ imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
189
189
  trackInteraction?: ((args: {
190
190
  type: string;
191
191
  id: string;
192
192
  correct?: boolean | undefined;
193
- } & Partial<import("../types").TrackingGradedGroupExtraArguments> & Partial<import("../types").TrackingSequenceExtraArguments>) => void) | undefined;
193
+ } & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<import("../../types").TrackingSequenceExtraArguments>) => void) | undefined;
194
194
  customKeypad?: boolean | undefined;
195
195
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
196
196
  isMobile?: boolean | undefined;
@@ -223,7 +223,7 @@ declare const _default: Readonly<{
223
223
  "start-coords-ui-angle"?: boolean | undefined;
224
224
  }) | undefined;
225
225
  } | undefined;
226
- onWidgetStartProps?: ((widgets: import("..").PerseusWidgetsMap) => void) | undefined;
226
+ onWidgetStartProps?: ((widgets: import("../..").PerseusWidgetsMap) => void) | undefined;
227
227
  }>;
228
228
  choices: readonly string[];
229
229
  imageAlt: string;
@@ -238,15 +238,15 @@ declare const _default: Readonly<{
238
238
  }, "analytics"> & React.RefAttributes<LabelImage>>;
239
239
  accessible?: boolean | ((props: any) => boolean) | undefined;
240
240
  hidden?: boolean | undefined;
241
- version?: import("../types").Version | undefined;
242
- supportedAlignments?: readonly import("../types").Alignment[] | undefined;
243
- defaultAlignment?: import("../types").Alignment | undefined;
244
- getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
241
+ version?: import("../../types").Version | undefined;
242
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
243
+ defaultAlignment?: import("../../types").Alignment | undefined;
244
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
245
245
  isLintable?: boolean | undefined;
246
- tracking?: import("../types").Tracking | undefined;
246
+ tracking?: import("../../types").Tracking | undefined;
247
247
  traverseChildWidgets?: any;
248
- transform?: import("../types").WidgetTransform | undefined;
249
- staticTransform?: import("../types").WidgetTransform | undefined;
248
+ transform?: import("../../types").WidgetTransform | undefined;
249
+ staticTransform?: import("../../types").WidgetTransform | undefined;
250
250
  propUpgrades?: {
251
251
  [key: string]: (arg1: any) => any;
252
252
  } | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./matcher";
@@ -1,7 +1,7 @@
1
1
  import PropTypes from "prop-types";
2
2
  import * as React from "react";
3
- import { PerseusI18nContext } from "../components/i18n-context";
4
- import type { SortableOption } from "../components/sortable";
3
+ import { PerseusI18nContext } from "../../components/i18n-context";
4
+ import type { SortableOption } from "../../components/sortable";
5
5
  type State = {
6
6
  leftHeight: number;
7
7
  rightHeight: number;
@@ -9,7 +9,7 @@ type State = {
9
9
  };
10
10
  export declare class Matcher extends React.Component<any, any> {
11
11
  static contextType: React.Context<{
12
- strings: import("../strings").PerseusStrings;
12
+ strings: import("../../strings").PerseusStrings;
13
13
  locale: string;
14
14
  }>;
15
15
  context: React.ContextType<typeof PerseusI18nContext>;
@@ -58,7 +58,6 @@ export declare class Matcher extends React.Component<any, any> {
58
58
  };
59
59
  static defaultProps: any;
60
60
  state: State;
61
- render(): React.ReactElement;
62
61
  changeAndTrack: (arg1: any) => void;
63
62
  onMeasureLeft: (arg1: any) => void;
64
63
  onMeasureRight: (arg1: any) => void;
@@ -66,6 +65,7 @@ export declare class Matcher extends React.Component<any, any> {
66
65
  moveLeftOptionToIndex: (option: SortableOption, index: number) => void;
67
66
  moveRightOptionToIndex: (option: SortableOption, index: number) => void;
68
67
  simpleValidate: (arg1: any) => any;
68
+ render(): React.ReactElement;
69
69
  }
70
70
  declare const _default: Readonly<{
71
71
  name: string;
@@ -74,15 +74,15 @@ declare const _default: Readonly<{
74
74
  widget: typeof Matcher;
75
75
  accessible?: boolean | ((props: any) => boolean) | undefined;
76
76
  hidden?: boolean | undefined;
77
- version?: import("../types").Version | undefined;
78
- supportedAlignments?: readonly import("../types").Alignment[] | undefined;
79
- defaultAlignment?: import("../types").Alignment | undefined;
80
- getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
77
+ version?: import("../../types").Version | undefined;
78
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
79
+ defaultAlignment?: import("../../types").Alignment | undefined;
80
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
81
81
  isLintable?: boolean | undefined;
82
- tracking?: import("../types").Tracking | undefined;
82
+ tracking?: import("../../types").Tracking | undefined;
83
83
  traverseChildWidgets?: any;
84
- transform?: import("../types").WidgetTransform | undefined;
85
- staticTransform?: import("../types").WidgetTransform | undefined;
84
+ transform?: import("../../types").WidgetTransform | undefined;
85
+ staticTransform?: import("../../types").WidgetTransform | undefined;
86
86
  propUpgrades?: {
87
87
  [key: string]: (arg1: any) => any;
88
88
  } | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./matrix";
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
- import { PerseusI18nContext } from "../components/i18n-context";
3
- import type { PerseusMatrixWidgetOptions } from "../perseus-types";
4
- import type { PerseusStrings } from "../strings";
5
- import type { WidgetProps, PerseusScore } from "../types";
2
+ import { PerseusI18nContext } from "../../components/i18n-context";
3
+ import type { PerseusMatrixWidgetOptions } from "../../perseus-types";
4
+ import type { PerseusStrings } from "../../strings";
5
+ import type { WidgetProps, PerseusScore } from "../../types";
6
6
  type Rubric = PerseusMatrixWidgetOptions;
7
7
  type ExternalProps = WidgetProps<PerseusMatrixWidgetOptions, Rubric>;
8
8
  type Props = ExternalProps & {
@@ -35,7 +35,6 @@ declare class Matrix extends React.Component<Props, State> {
35
35
  static validate(state: any, rubric: any, strings: PerseusStrings): PerseusScore;
36
36
  state: State;
37
37
  componentDidMount(): void;
38
- render(): React.ReactNode;
39
38
  getInputPaths: () => ReadonlyArray<ReadonlyArray<string>>;
40
39
  getGrammarTypeForPath: (arg1: any) => string;
41
40
  _handleFocus: (arg1: any, arg2: any) => void;
@@ -49,6 +48,7 @@ declare class Matrix extends React.Component<Props, State> {
49
48
  onValueChange: (arg1: any, arg2: any, arg3: any, arg4: any) => void;
50
49
  getUserInput: () => any;
51
50
  simpleValidate: (arg1: any) => any;
51
+ render(): React.ReactNode;
52
52
  }
53
53
  declare const _default: Readonly<{
54
54
  name: string;
@@ -57,15 +57,15 @@ declare const _default: Readonly<{
57
57
  widget: typeof Matrix;
58
58
  accessible?: boolean | ((props: any) => boolean) | undefined;
59
59
  hidden?: boolean | undefined;
60
- version?: import("../types").Version | undefined;
61
- supportedAlignments?: readonly import("../types").Alignment[] | undefined;
62
- defaultAlignment?: import("../types").Alignment | undefined;
63
- getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
60
+ version?: import("../../types").Version | undefined;
61
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
62
+ defaultAlignment?: import("../../types").Alignment | undefined;
63
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
64
64
  isLintable?: boolean | undefined;
65
- tracking?: import("../types").Tracking | undefined;
65
+ tracking?: import("../../types").Tracking | undefined;
66
66
  traverseChildWidgets?: any;
67
- transform?: import("../types").WidgetTransform | undefined;
68
- staticTransform?: import("../types").WidgetTransform | undefined;
67
+ transform?: import("../../types").WidgetTransform | undefined;
68
+ staticTransform?: import("../../types").WidgetTransform | undefined;
69
69
  propUpgrades?: {
70
70
  [key: string]: (arg1: any) => any;
71
71
  } | undefined;
@@ -0,0 +1 @@
1
+ export { default } from "./measurer";
@@ -0,0 +1,21 @@
1
+ declare const _default: Readonly<{
2
+ name: string;
3
+ displayName: string;
4
+ getWidget?: (() => any) | undefined;
5
+ widget: any;
6
+ accessible?: boolean | ((props: any) => boolean) | undefined;
7
+ hidden?: boolean | undefined;
8
+ version?: import("../../types").Version | undefined;
9
+ supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
10
+ defaultAlignment?: import("../../types").Alignment | undefined;
11
+ getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
12
+ isLintable?: boolean | undefined;
13
+ tracking?: import("../../types").Tracking | undefined;
14
+ traverseChildWidgets?: any;
15
+ transform?: import("../../types").WidgetTransform | undefined;
16
+ staticTransform?: import("../../types").WidgetTransform | undefined;
17
+ propUpgrades?: {
18
+ [key: string]: (arg1: any) => any;
19
+ } | undefined;
20
+ }>;
21
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from "./molecule";