@khanacademy/perseus 32.0.1 → 33.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.
@@ -379,6 +379,8 @@ export type PerseusInteractiveGraphWidgetOptions = {
379
379
  graph: PerseusGraphType;
380
380
  correct: PerseusGraphType;
381
381
  lockedFigures?: ReadonlyArray<LockedFigure>;
382
+ fullGraphAriaLabel?: string;
383
+ fullGraphAriaDescription?: string;
382
384
  };
383
385
  declare const lockedFigureColorNames: readonly ["blue", "green", "grayH", "purple", "pink", "orange", "red"];
384
386
  export type LockedFigureColor = (typeof lockedFigureColorNames)[number];
@@ -450,7 +452,7 @@ export type PerseusGraphTypeAngle = {
450
452
  angleOffsetDeg?: number;
451
453
  snapDegrees?: number;
452
454
  match?: "congruent";
453
- coords?: [Coord, Coord, Coord];
455
+ coords?: [Coord, Coord, Coord] | null;
454
456
  startCoords?: [Coord, Coord, Coord];
455
457
  };
456
458
  export type PerseusGraphTypeCircle = {
@@ -464,18 +466,18 @@ export type PerseusGraphTypeCircle = {
464
466
  } & PerseusGraphTypeCommon;
465
467
  export type PerseusGraphTypeLinear = {
466
468
  type: "linear";
467
- coords?: CollinearTuple;
469
+ coords?: CollinearTuple | null;
468
470
  startCoords?: CollinearTuple;
469
471
  } & PerseusGraphTypeCommon;
470
472
  export type PerseusGraphTypeLinearSystem = {
471
473
  type: "linear-system";
472
- coords?: CollinearTuple[];
474
+ coords?: CollinearTuple[] | null;
473
475
  startCoords?: CollinearTuple[];
474
476
  } & PerseusGraphTypeCommon;
475
477
  export type PerseusGraphTypePoint = {
476
478
  type: "point";
477
479
  numPoints?: number | "unlimited";
478
- coords?: ReadonlyArray<Coord>;
480
+ coords?: ReadonlyArray<Coord> | null;
479
481
  startCoords?: ReadonlyArray<Coord>;
480
482
  } & PerseusGraphTypeCommon;
481
483
  export type PerseusGraphTypePolygon = {
@@ -485,28 +487,28 @@ export type PerseusGraphTypePolygon = {
485
487
  showSides?: boolean;
486
488
  snapTo?: "grid" | "angles" | "sides";
487
489
  match?: "similar" | "congruent" | "approx";
488
- coords?: ReadonlyArray<Coord>;
490
+ coords?: ReadonlyArray<Coord> | null;
489
491
  startCoords?: ReadonlyArray<Coord>;
490
492
  } & PerseusGraphTypeCommon;
491
493
  export type PerseusGraphTypeQuadratic = {
492
494
  type: "quadratic";
493
- coords?: [Coord, Coord, Coord];
495
+ coords?: [Coord, Coord, Coord] | null;
494
496
  startCoords?: [Coord, Coord, Coord];
495
497
  } & PerseusGraphTypeCommon;
496
498
  export type PerseusGraphTypeSegment = {
497
499
  type: "segment";
498
500
  numSegments?: number;
499
- coords?: CollinearTuple[];
501
+ coords?: CollinearTuple[] | null;
500
502
  startCoords?: CollinearTuple[];
501
503
  } & PerseusGraphTypeCommon;
502
504
  export type PerseusGraphTypeSinusoid = {
503
505
  type: "sinusoid";
504
- coords?: ReadonlyArray<Coord>;
506
+ coords?: ReadonlyArray<Coord> | null;
505
507
  startCoords?: ReadonlyArray<Coord>;
506
508
  } & PerseusGraphTypeCommon;
507
509
  export type PerseusGraphTypeRay = {
508
510
  type: "ray";
509
- coords?: CollinearTuple;
511
+ coords?: CollinearTuple | null;
510
512
  startCoords?: CollinearTuple;
511
513
  } & PerseusGraphTypeCommon;
512
514
  export type PerseusLabelImageWidgetOptions = {
@@ -5,6 +5,8 @@ export type LockedFunctionOptions = Omit<Partial<LockedFunctionType>, "type" | "
5
5
  export declare function interactiveGraphQuestionBuilder(): InteractiveGraphQuestionBuilder;
6
6
  declare class InteractiveGraphQuestionBuilder {
7
7
  private content;
8
+ private fullGraphAriaLabel?;
9
+ private fullGraphAriaDescription?;
8
10
  private backgroundImage?;
9
11
  private gridStep;
10
12
  private labels;
@@ -20,6 +22,8 @@ declare class InteractiveGraphQuestionBuilder {
20
22
  private staticMode;
21
23
  build(): PerseusRenderer;
22
24
  withContent(content: string): InteractiveGraphQuestionBuilder;
25
+ withFullGraphAriaLabel(label: string): InteractiveGraphQuestionBuilder;
26
+ withFullGraphAriaDescription(description: string): InteractiveGraphQuestionBuilder;
23
27
  withStaticMode(staticMode: boolean): InteractiveGraphQuestionBuilder;
24
28
  withBackgroundImage(url: string, height: number, width: number, options?: {
25
29
  scale?: number;
@@ -15,6 +15,8 @@ export type MafsGraphProps = {
15
15
  showTooltips: Required<InteractiveGraphProps["showTooltips"]>;
16
16
  showProtractor: boolean;
17
17
  labels: InteractiveGraphProps["labels"];
18
+ fullGraphAriaLabel?: InteractiveGraphProps["fullGraphAriaLabel"];
19
+ fullGraphAriaDescription?: InteractiveGraphProps["fullGraphAriaDescription"];
18
20
  state: InteractiveGraphState;
19
21
  dispatch: React.Dispatch<InteractiveGraphAction>;
20
22
  readOnly: boolean;
@@ -19,6 +19,8 @@ export type StatefulMafsGraphProps = {
19
19
  showTooltips: Required<InteractiveGraphProps["showTooltips"]>;
20
20
  showProtractor: boolean;
21
21
  labels: InteractiveGraphProps["labels"];
22
+ fullGraphAriaLabel?: InteractiveGraphProps["fullGraphAriaLabel"];
23
+ fullGraphAriaDescription?: InteractiveGraphProps["fullGraphAriaDescription"];
22
24
  readOnly: boolean;
23
25
  static: InteractiveGraphProps["static"];
24
26
  };
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": "32.0.1",
6
+ "version": "33.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- import type { ChangeableProps } from "../../mixins/changeable";
3
- type Props = {
4
- value?: string;
5
- } & ChangeableProps;
6
- declare class ArrowPicker extends React.Component<Props> {
7
- static defaultProps: {
8
- value: string;
9
- };
10
- render(): React.ReactNode;
11
- }
12
- export default ArrowPicker;
@@ -1,14 +0,0 @@
1
- import * as React from "react";
2
- import type { ChangeableProps } from "../../mixins/changeable";
3
- type Props = {
4
- lightColors?: boolean;
5
- value?: string;
6
- } & ChangeableProps;
7
- declare class ColorPicker extends React.Component<Props> {
8
- static defaultProps: {
9
- lightColors: boolean;
10
- value: any;
11
- };
12
- render(): React.ReactNode;
13
- }
14
- export default ColorPicker;
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- import type { ChangeableProps } from "../../mixins/changeable";
3
- type Props = {
4
- value?: string;
5
- } & ChangeableProps;
6
- declare class DashPicker extends React.Component<Props> {
7
- static defaultProps: {
8
- value: string;
9
- };
10
- render(): React.ReactNode;
11
- }
12
- export default DashPicker;
@@ -1,22 +0,0 @@
1
- import * as React from "react";
2
- type Props = {
3
- children: React.ReactElement<any> | ReadonlyArray<React.ReactElement<any>>;
4
- initiallyVisible: boolean;
5
- onDelete?: () => void | null | undefined;
6
- onDown?: () => void | null | undefined;
7
- onUp?: () => void | null | undefined;
8
- title: string | React.ReactElement<any>;
9
- };
10
- type State = {
11
- show: boolean;
12
- };
13
- declare class ElementContainer extends React.Component<Props, State> {
14
- static defaultProps: {
15
- initiallyVisible: boolean;
16
- title: string;
17
- };
18
- constructor(props: Props);
19
- toggle: (e: React.SyntheticEvent) => void;
20
- render(): React.ReactNode;
21
- }
22
- export default ElementContainer;