@khanacademy/perseus 34.0.0 → 34.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/es/index.js +287 -165
  2. package/dist/es/index.js.map +1 -1
  3. package/dist/index.js +303 -161
  4. package/dist/index.js.map +1 -1
  5. package/dist/perseus-api.d.ts +1 -0
  6. package/dist/perseus-types.d.ts +1 -0
  7. package/dist/server-item-renderer.d.ts +1 -0
  8. package/dist/types.d.ts +1 -1
  9. package/dist/widgets/__shared__/noop-validator.d.ts +2 -2
  10. package/dist/widgets/categorizer/categorizer-validator.d.ts +5 -0
  11. package/dist/widgets/categorizer/categorizer.d.ts +1 -4
  12. package/dist/widgets/categorizer/categorizer.types.d.ts +5 -0
  13. package/dist/widgets/definition/definition.d.ts +3 -3
  14. package/dist/widgets/explanation/explanation.d.ts +3 -5
  15. package/dist/widgets/expression/expression.d.ts +6 -0
  16. package/dist/widgets/image/image.d.ts +3 -3
  17. package/dist/widgets/input-number/input-number-validator.d.ts +41 -0
  18. package/dist/widgets/input-number/input-number.d.ts +1 -1
  19. package/dist/widgets/input-number/input-number.types.d.ts +2 -0
  20. package/dist/widgets/interaction/interaction.d.ts +3 -3
  21. package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +7 -5
  22. package/dist/widgets/interactive-graphs/reducer/interactive-graph-action.d.ts +16 -1
  23. package/dist/widgets/interactive-graphs/types.d.ts +3 -0
  24. package/dist/widgets/label-image/label-image.d.ts +2 -0
  25. package/dist/widgets/molecule/molecule.d.ts +2 -2
  26. package/dist/widgets/passage/passage.d.ts +3 -3
  27. package/dist/widgets/passage-ref/passage-ref.d.ts +3 -3
  28. package/dist/widgets/passage-ref-target/passage-ref-target.d.ts +2 -2
  29. package/dist/widgets/video/video.d.ts +3 -4
  30. package/package.json +1 -1
@@ -108,6 +108,7 @@ export declare const ApiOptions: {
108
108
  } & {
109
109
  "interactive-graph-locked-features-labels"?: boolean | undefined;
110
110
  "locked-point-labels"?: boolean | undefined;
111
+ "locked-line-labels"?: boolean | undefined;
111
112
  }) | undefined;
112
113
  } | undefined;
113
114
  onWidgetStartProps?: ((widgets: import("./perseus-types").PerseusWidgetsMap) => void) | undefined;
@@ -403,6 +403,7 @@ export type LockedLineType = {
403
403
  lineStyle: LockedLineStyle;
404
404
  showPoint1: boolean;
405
405
  showPoint2: boolean;
406
+ labels: LockedLabelType[];
406
407
  };
407
408
  export type LockedVectorType = {
408
409
  type: "vector";
@@ -153,6 +153,7 @@ declare const ref: React.ForwardRefExoticComponent<Omit<Pick<SharedRendererProps
153
153
  } & {
154
154
  "interactive-graph-locked-features-labels"?: boolean | undefined;
155
155
  "locked-point-labels"?: boolean | undefined;
156
+ "locked-line-labels"?: boolean | undefined;
156
157
  }) | undefined;
157
158
  } | undefined;
158
159
  onWidgetStartProps?: ((widgets: import("./perseus-types").PerseusWidgetsMap) => void) | undefined;
package/dist/types.d.ts CHANGED
@@ -75,7 +75,7 @@ type TrackInteractionArgs = {
75
75
  correct?: boolean;
76
76
  } & Partial<TrackingGradedGroupExtraArguments> & Partial<TrackingSequenceExtraArguments>;
77
77
  export declare const MafsGraphTypeFlags: readonly ["angle", "segment", "linear", "linear-system", "ray", "polygon", "circle", "quadratic", "sinusoid", "point", "unlimited-point", "none"];
78
- export declare const InteractiveGraphLockedFeaturesFlags: readonly ["interactive-graph-locked-features-labels", "locked-point-labels"];
78
+ export declare const InteractiveGraphLockedFeaturesFlags: readonly ["interactive-graph-locked-features-labels", "locked-point-labels", "locked-line-labels"];
79
79
  /**
80
80
  * APIOptions provides different ways to customize the behaviour of Perseus.
81
81
  *
@@ -3,9 +3,9 @@ import type { PerseusScore } from "../../types";
3
3
  * Several widgets don't have "right"/"wrong" validation logic,
4
4
  * so this just says to move on past those widgets
5
5
  *
6
- * TODO: widgets that use this probably shouldn't have any
6
+ * TODO(LEMS-2396) widgets that use this probably shouldn't have any
7
7
  * validation logic and the thing validating an exercise
8
8
  * should just know to skip these
9
9
  */
10
- declare function noopValidator(): PerseusScore;
10
+ declare function noopValidator(points?: number): PerseusScore;
11
11
  export default noopValidator;
@@ -0,0 +1,5 @@
1
+ import type { Rubric, UserInput } from "./categorizer.types";
2
+ import type { PerseusStrings } from "../../strings";
3
+ import type { PerseusScore } from "../../types";
4
+ declare function categorizerValidator(userInput: UserInput, rubric: Rubric, strings: PerseusStrings): PerseusScore;
5
+ export default categorizerValidator;
@@ -1,12 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
+ import type { Rubric, UserInput } from "./categorizer.types";
3
4
  import type { PerseusCategorizerWidgetOptions } from "../../perseus-types";
4
5
  import type { PerseusStrings } from "../../strings";
5
6
  import type { PerseusScore, WidgetProps } from "../../types";
6
- type UserInput = {
7
- values: ReadonlyArray<number>;
8
- };
9
- export type Rubric = PerseusCategorizerWidgetOptions;
10
7
  type Props = WidgetProps<RenderProps, Rubric> & {
11
8
  values: ReadonlyArray<string>;
12
9
  };
@@ -0,0 +1,5 @@
1
+ import type { PerseusCategorizerWidgetOptions } from "../../perseus-types";
2
+ export type UserInput = {
3
+ values: ReadonlyArray<number>;
4
+ };
5
+ export type Rubric = PerseusCategorizerWidgetOptions;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { PerseusRenderer, PerseusDefinitionWidgetOptions } from "../../perseus-types";
4
- import type { PerseusScore, WidgetProps } from "../../types";
4
+ import type { WidgetProps } from "../../types";
5
5
  type RenderProps = PerseusDefinitionWidgetOptions;
6
6
  type Rubric = PerseusDefinitionWidgetOptions;
7
7
  type UserInput = Empty;
@@ -19,9 +19,9 @@ declare class Definition extends React.Component<DefinitionProps> {
19
19
  }>;
20
20
  context: React.ContextType<typeof PerseusI18nContext>;
21
21
  static defaultProps: DefaultProps;
22
- static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
22
+ static validate(): import("../../types").PerseusScore;
23
23
  getUserInput: () => UserInput;
24
- simpleValidate: (arg1: Rubric) => PerseusScore;
24
+ simpleValidate(): import("../../types").PerseusScore;
25
25
  render(): React.ReactNode;
26
26
  }
27
27
  declare const _default: Readonly<{
@@ -1,10 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { PerseusExplanationWidgetOptions } from "../../perseus-types";
4
- import type { PerseusScore, WidgetProps } from "../../types";
4
+ import type { WidgetProps } from "../../types";
5
5
  type RenderProps = PerseusExplanationWidgetOptions;
6
- type Rubric = PerseusExplanationWidgetOptions;
7
- type UserInput = Empty;
8
6
  type Props = WidgetProps<RenderProps, PerseusExplanationWidgetOptions>;
9
7
  type DefaultProps = {
10
8
  showPrompt: Props["showPrompt"];
@@ -25,13 +23,13 @@ declare class Explanation extends React.Component<Props, State> {
25
23
  state: State;
26
24
  _mounted: boolean;
27
25
  static defaultProps: DefaultProps;
28
- static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
26
+ static validate(): import("../../types").PerseusScore;
29
27
  componentDidMount(): void;
30
28
  componentWillUnmount(): void;
31
29
  change: (arg1: any, arg2: any, arg3: any) => any;
32
30
  _onClick: () => void;
33
31
  getUserInput: () => Empty;
34
- simpleValidate: (arg1: Rubric) => PerseusScore;
32
+ simpleValidate(): import("../../types").PerseusScore;
35
33
  render(): React.ReactNode;
36
34
  }
37
35
  declare const _default: Readonly<{
@@ -149,6 +149,7 @@ declare const _default: Readonly<{
149
149
  } & {
150
150
  "interactive-graph-locked-features-labels"?: boolean | undefined;
151
151
  "locked-point-labels"?: boolean | undefined;
152
+ "locked-line-labels"?: boolean | undefined;
152
153
  }) | undefined;
153
154
  } | undefined;
154
155
  onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
@@ -230,6 +231,7 @@ declare const _default: Readonly<{
230
231
  } & {
231
232
  "interactive-graph-locked-features-labels"?: boolean | undefined;
232
233
  "locked-point-labels"?: boolean | undefined;
234
+ "locked-line-labels"?: boolean | undefined;
233
235
  }) | undefined;
234
236
  } | undefined;
235
237
  onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
@@ -311,6 +313,7 @@ declare const _default: Readonly<{
311
313
  } & {
312
314
  "interactive-graph-locked-features-labels"?: boolean | undefined;
313
315
  "locked-point-labels"?: boolean | undefined;
316
+ "locked-line-labels"?: boolean | undefined;
314
317
  }) | undefined;
315
318
  } | undefined;
316
319
  onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
@@ -391,6 +394,7 @@ declare const _default: Readonly<{
391
394
  } & {
392
395
  "interactive-graph-locked-features-labels"?: boolean | undefined;
393
396
  "locked-point-labels"?: boolean | undefined;
397
+ "locked-line-labels"?: boolean | undefined;
394
398
  }) | undefined;
395
399
  } | undefined;
396
400
  onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
@@ -472,6 +476,7 @@ declare const _default: Readonly<{
472
476
  } & {
473
477
  "interactive-graph-locked-features-labels"?: boolean | undefined;
474
478
  "locked-point-labels"?: boolean | undefined;
479
+ "locked-line-labels"?: boolean | undefined;
475
480
  }) | undefined;
476
481
  } | undefined;
477
482
  onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
@@ -553,6 +558,7 @@ declare const _default: Readonly<{
553
558
  } & {
554
559
  "interactive-graph-locked-features-labels"?: boolean | undefined;
555
560
  "locked-point-labels"?: boolean | undefined;
561
+ "locked-line-labels"?: boolean | undefined;
556
562
  }) | undefined;
557
563
  } | undefined;
558
564
  onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { PerseusImageWidgetOptions } from "../../perseus-types";
4
- import type { ChangeFn, PerseusScore, WidgetProps } from "../../types";
4
+ import type { ChangeFn, WidgetProps } from "../../types";
5
5
  type RenderProps = PerseusImageWidgetOptions;
6
6
  type Rubric = PerseusImageWidgetOptions;
7
7
  type UserInput = null;
@@ -35,10 +35,10 @@ declare class ImageWidget extends React.Component<Props> {
35
35
  }>;
36
36
  context: React.ContextType<typeof PerseusI18nContext>;
37
37
  static defaultProps: DefaultProps;
38
- static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
38
+ static validate(): import("../../types").PerseusScore;
39
39
  change: ChangeFn;
40
40
  getUserInput: () => UserInput;
41
- simpleValidate: (arg1: Rubric) => PerseusScore;
41
+ simpleValidate(): import("../../types").PerseusScore;
42
42
  focus: () => void;
43
43
  render(): React.ReactNode;
44
44
  }
@@ -0,0 +1,41 @@
1
+ import type { Rubric } from "./input-number.types";
2
+ import type { PerseusStrings } from "../../strings";
3
+ import type { APIOptions, PerseusScore } from "@khanacademy/perseus";
4
+ export declare const answerTypes: {
5
+ readonly number: {
6
+ readonly name: "Numbers";
7
+ readonly forms: "integer, decimal, proper, improper, mixed";
8
+ };
9
+ readonly decimal: {
10
+ readonly name: "Decimals";
11
+ readonly forms: "decimal";
12
+ };
13
+ readonly integer: {
14
+ readonly name: "Integers";
15
+ readonly forms: "integer";
16
+ };
17
+ readonly rational: {
18
+ readonly name: "Fractions and mixed numbers";
19
+ readonly forms: "integer, proper, improper, mixed";
20
+ };
21
+ readonly improper: {
22
+ readonly name: "Improper numbers (no mixed)";
23
+ readonly forms: "integer, proper, improper";
24
+ };
25
+ readonly mixed: {
26
+ readonly name: "Mixed numbers (no improper)";
27
+ readonly forms: "integer, proper, mixed";
28
+ };
29
+ readonly percent: {
30
+ readonly name: "Numbers or percents";
31
+ readonly forms: "integer, decimal, proper, improper, mixed, percent";
32
+ };
33
+ readonly pi: {
34
+ readonly name: "Numbers with pi";
35
+ readonly forms: "pi";
36
+ };
37
+ };
38
+ declare function inputNumberValidator(state: {
39
+ currentValue: string;
40
+ }, rubric: Rubric, strings: PerseusStrings, onInputError?: APIOptions["onInputError"]): PerseusScore;
41
+ export default inputNumberValidator;
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
+ import type { Rubric } from "./input-number.types";
3
4
  import type { PerseusInputNumberWidgetOptions } from "../../perseus-types";
4
5
  import type { PerseusStrings } from "../../strings";
5
6
  import type { APIOptions, Path, PerseusScore, WidgetProps } from "../../types";
@@ -12,7 +13,6 @@ type RenderProps = {
12
13
  answerType: PerseusInputNumberWidgetOptions["answerType"];
13
14
  rightAlign: PerseusInputNumberWidgetOptions["rightAlign"];
14
15
  };
15
- type Rubric = PerseusInputNumberWidgetOptions;
16
16
  type ExternalProps = WidgetProps<RenderProps, Rubric>;
17
17
  type Props = ExternalProps & {
18
18
  apiOptions: NonNullable<ExternalProps["apiOptions"]>;
@@ -0,0 +1,2 @@
1
+ import type { PerseusInputNumberWidgetOptions } from "@khanacademy/perseus";
2
+ export type Rubric = PerseusInputNumberWidgetOptions;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Coord } from "../../interactive2/types";
3
3
  import type { PerseusInteractionWidgetOptions } from "../../perseus-types";
4
- import type { PerseusScore, WidgetProps } from "../../types";
4
+ import type { WidgetProps } from "../../types";
5
5
  type RenderProps = PerseusInteractionWidgetOptions;
6
6
  type Rubric = PerseusInteractionWidgetOptions;
7
7
  type Props = WidgetProps<RenderProps, Rubric>;
@@ -15,7 +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
+ static validate(): import("../../types").PerseusScore;
19
19
  state: State;
20
20
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
21
21
  _setupGraphie: (arg1: any, arg2: any) => void;
@@ -25,7 +25,7 @@ declare class Interaction extends React.Component<Props, State> {
25
25
  _extractVars: (arg1: any) => ReadonlyArray<any>;
26
26
  change: (arg1: any, arg2: any, arg3: any) => any;
27
27
  getUserInput: () => any;
28
- simpleValidate: (arg1: any) => any;
28
+ simpleValidate(): import("../../types").PerseusScore;
29
29
  render(): React.ReactNode;
30
30
  }
31
31
  declare const _default: Readonly<{
@@ -7,6 +7,11 @@ export type LockedFunctionOptions = {
7
7
  directionalAxis?: "x" | "y";
8
8
  domain?: Interval;
9
9
  };
10
+ type LockedFigureLabelOptions = {
11
+ text: string;
12
+ coord?: Coord;
13
+ size?: "small" | "medium" | "large";
14
+ };
10
15
  export declare function interactiveGraphQuestionBuilder(): InteractiveGraphQuestionBuilder;
11
16
  declare class InteractiveGraphQuestionBuilder {
12
17
  private content;
@@ -103,11 +108,7 @@ declare class InteractiveGraphQuestionBuilder {
103
108
  addLockedPointAt(x: number, y: number, options?: {
104
109
  color?: LockedFigureColor;
105
110
  filled?: boolean;
106
- labels?: {
107
- text: string;
108
- coord?: Coord;
109
- size?: "small" | "medium" | "large";
110
- }[];
111
+ labels?: LockedFigureLabelOptions[];
111
112
  }): InteractiveGraphQuestionBuilder;
112
113
  addLockedLine(point1: vec.Vector2, point2: vec.Vector2, options?: {
113
114
  kind?: "line" | "ray" | "segment";
@@ -116,6 +117,7 @@ declare class InteractiveGraphQuestionBuilder {
116
117
  filled?: [boolean, boolean];
117
118
  showPoint1?: boolean;
118
119
  showPoint2?: boolean;
120
+ labels?: LockedFigureLabelOptions[];
119
121
  }): InteractiveGraphQuestionBuilder;
120
122
  addLockedVector(tail: vec.Vector2, tip: vec.Vector2, color?: LockedFigureColor): InteractiveGraphQuestionBuilder;
121
123
  addLockedEllipse(center: vec.Vector2, radius: [x: number, y: number], options?: {
@@ -1,9 +1,12 @@
1
1
  import type { InitializeGraphStateParams } from "./initialize-graph-state";
2
+ import type { InteractionMode } from "../types";
2
3
  import type { Interval, vec } from "mafs";
3
- export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint | RemovePoint | FocusPoint | BlurPoint | DeleteIntent | ClickPoint;
4
+ export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint | RemovePoint | FocusPoint | BlurPoint | DeleteIntent | ClickPoint | ChangeInteractionMode | ChangeKeyboardInvitationVisibility;
4
5
  export declare const actions: {
5
6
  global: {
6
7
  deleteIntent: typeof deleteIntent;
8
+ changeInteractionMode: typeof changeInteractionMode;
9
+ changeKeyboardInvitationVisibility: typeof changeKeyboardInvitationVisibility;
7
10
  };
8
11
  angle: {
9
12
  movePoint: typeof movePoint;
@@ -88,6 +91,18 @@ export interface ClickPoint {
88
91
  index: number;
89
92
  }
90
93
  declare function clickPoint(index: number): ClickPoint;
94
+ export declare const CHANGE_INTERACTION_MODE = "point-change-interaction-mode";
95
+ export interface ChangeInteractionMode {
96
+ type: typeof CHANGE_INTERACTION_MODE;
97
+ mode: InteractionMode;
98
+ }
99
+ declare function changeInteractionMode(mode: InteractionMode): ChangeInteractionMode;
100
+ export declare const CHANGE_KEYBOARD_INVITATION_VISIBILITY = "change-keyboard-interaction-invitation-visibility";
101
+ export interface ChangeKeyboardInvitationVisibility {
102
+ type: typeof CHANGE_KEYBOARD_INVITATION_VISIBILITY;
103
+ shouldShow: boolean;
104
+ }
105
+ declare function changeKeyboardInvitationVisibility(shouldShow: boolean): ChangeKeyboardInvitationVisibility;
91
106
  export declare const MOVE_ALL = "move-all";
92
107
  export interface MoveAll {
93
108
  type: typeof MOVE_ALL;
@@ -26,6 +26,7 @@ export interface LinearSystemGraphState extends InteractiveGraphStateCommon {
26
26
  type: "linear-system";
27
27
  coords: PairOfPoints[];
28
28
  }
29
+ export type InteractionMode = "mouse" | "keyboard";
29
30
  export interface NoneGraphState extends InteractiveGraphStateCommon {
30
31
  type: "none";
31
32
  }
@@ -35,6 +36,8 @@ export interface PointGraphState extends InteractiveGraphStateCommon {
35
36
  numPoints?: number | "unlimited";
36
37
  focusedPointIndex: number | null;
37
38
  showRemovePointButton: boolean;
39
+ interactionMode: InteractionMode;
40
+ showKeyboardInteractionInvitation: boolean;
38
41
  }
39
42
  export interface RayGraphState extends InteractiveGraphStateCommon {
40
43
  type: "ray";
@@ -146,6 +146,7 @@ declare const _default: Readonly<{
146
146
  } & {
147
147
  "interactive-graph-locked-features-labels"?: boolean | undefined;
148
148
  "locked-point-labels"?: boolean | undefined;
149
+ "locked-line-labels"?: boolean | undefined;
149
150
  }) | undefined;
150
151
  } | undefined;
151
152
  onWidgetStartProps?: ((widgets: import("../..").PerseusWidgetsMap) => void) | undefined;
@@ -211,6 +212,7 @@ declare const _default: Readonly<{
211
212
  } & {
212
213
  "interactive-graph-locked-features-labels"?: boolean | undefined;
213
214
  "locked-point-labels"?: boolean | undefined;
215
+ "locked-line-labels"?: boolean | undefined;
214
216
  }) | undefined;
215
217
  } | undefined;
216
218
  onWidgetStartProps?: ((widgets: import("../..").PerseusWidgetsMap) => void) | undefined;
@@ -31,9 +31,9 @@ type DefaultProps = {
31
31
  };
32
32
  declare class MoleculeWidget extends React.Component<Props> {
33
33
  static defaultProps: DefaultProps;
34
- simpleValidate: (arg1: any) => any;
34
+ simpleValidate(): import("../../types").PerseusScore;
35
35
  getUserInput: () => ReadonlyArray<ReadonlyArray<string>>;
36
- validate: (arg1: any, arg2: any) => any;
36
+ validate(): import("../../types").PerseusScore;
37
37
  render(): React.ReactNode;
38
38
  }
39
39
  declare const _default: Readonly<{
@@ -4,7 +4,7 @@ import type { ParseState } from "./passage-markdown";
4
4
  import type { SerializedHighlightSet } from "../../components/highlighting/types";
5
5
  import type { ChangeableProps } from "../../mixins/changeable";
6
6
  import type { PerseusPassageWidgetOptions, PerseusWidget } from "../../perseus-types";
7
- import type { PerseusScore, WidgetProps } from "../../types";
7
+ import type { WidgetProps } from "../../types";
8
8
  import type { SingleASTNode } from "@khanacademy/simple-markdown";
9
9
  export declare class LineHeightMeasurer extends React.Component<Record<any, any>> {
10
10
  _line: HTMLDivElement | null | undefined;
@@ -54,7 +54,7 @@ export declare class Passage extends React.Component<PassageProps, PassageState>
54
54
  _stylesAppiedTimer: number;
55
55
  static defaultProps: DefaultPassageProps;
56
56
  state: PassageState;
57
- static validate(state: UserInput, rubric: Rubric): PerseusScore;
57
+ static validate(): import("../../types").PerseusScore;
58
58
  componentDidMount(): void;
59
59
  shouldComponentUpdate(nextProps: PassageProps, nextState: PassageState): any | boolean;
60
60
  componentDidUpdate(): void;
@@ -95,7 +95,7 @@ export declare class Passage extends React.Component<PassageProps, PassageState>
95
95
  * These are misc widget functions used for the widget API
96
96
  */
97
97
  getUserInput(): UserInput;
98
- simpleValidate(rubric: Rubric): PerseusScore;
98
+ simpleValidate(): import("../../types").PerseusScore;
99
99
  /**
100
100
  * Rendering
101
101
  *
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { PerseusPassageRefWidgetOptions } from "../../perseus-types";
4
- import type { ChangeFn, PerseusScore, WidgetProps } from "../../types";
4
+ import type { ChangeFn, WidgetProps } from "../../types";
5
5
  import type { LinterContextProps } from "@khanacademy/perseus-linter";
6
6
  type UserInput = RenderProps & {
7
7
  static: boolean | null | undefined;
@@ -37,7 +37,7 @@ declare class PassageRef extends React.Component<Props, State> {
37
37
  _throttledUpdateRange: () => void;
38
38
  static defaultProps: DefaultProps;
39
39
  state: State;
40
- static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
40
+ static validate(): import("../../types").PerseusScore;
41
41
  componentDidMount(): void;
42
42
  shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
43
43
  componentDidUpdate(): void;
@@ -46,7 +46,7 @@ declare class PassageRef extends React.Component<Props, State> {
46
46
  change: ChangeFn;
47
47
  _deferredUpdateRange: () => void;
48
48
  _updateRange: () => void;
49
- simpleValidate: (arg1: Rubric) => PerseusScore;
49
+ simpleValidate(): import("../../types").PerseusScore;
50
50
  render(): React.ReactNode;
51
51
  }
52
52
  declare const _default: Readonly<{
@@ -20,10 +20,10 @@ declare class PassageRefTarget extends React.Component<Props> {
20
20
  }>;
21
21
  context: React.ContextType<typeof PerseusI18nContext>;
22
22
  static defaultProps: DefaultProps;
23
- static validate(state: any, rubric: any): any;
23
+ static validate(): import("../../types").PerseusScore;
24
24
  getUserInput: () => any;
25
25
  change: (arg1: any, arg2: any, arg3: any) => any;
26
- simpleValidate: (arg1: any) => any;
26
+ simpleValidate(): import("../../types").PerseusScore;
27
27
  render(): React.ReactNode;
28
28
  }
29
29
  declare const _default: Readonly<{
@@ -4,8 +4,7 @@
4
4
  import * as React from "react";
5
5
  import { PerseusI18nContext } from "../../components/i18n-context";
6
6
  import type { PerseusVideoWidgetOptions } from "../../perseus-types";
7
- import type { PerseusScore, WidgetProps } from "../../types";
8
- type UserInput = null;
7
+ import type { WidgetProps } from "../../types";
9
8
  type Rubric = PerseusVideoWidgetOptions;
10
9
  type RenderProps = PerseusVideoWidgetOptions;
11
10
  type Props = WidgetProps<RenderProps, Rubric> & {
@@ -25,9 +24,9 @@ declare class Video extends React.Component<Props> {
25
24
  * Points for videos are tallied by the embedded video itself, in the case
26
25
  * of Khan Academy videos.
27
26
  */
28
- static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
27
+ static validate(): import("../../types").PerseusScore;
29
28
  getUserInput: () => undefined | null | undefined;
30
- simpleValidate: (arg1: Rubric) => PerseusScore;
29
+ simpleValidate(): import("../../types").PerseusScore;
31
30
  change: (...args: ReadonlyArray<unknown>) => any;
32
31
  render(): React.ReactNode;
33
32
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core Perseus API (includes renderers and widgets)",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "34.0.0",
6
+ "version": "34.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },