@khanacademy/perseus 32.0.0 → 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.
- package/dist/es/index.js +81 -199
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +79 -203
- package/dist/index.js.map +1 -1
- package/dist/perseus-types.d.ts +11 -9
- package/dist/util.d.ts +0 -1
- package/dist/widgets/interactive-graph.d.ts +0 -2
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +4 -0
- package/dist/widgets/interactive-graphs/mafs-graph.d.ts +2 -0
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +2 -0
- package/package.json +1 -1
- package/dist/widgets/interaction/arrow-picker.d.ts +0 -12
- package/dist/widgets/interaction/color-picker.d.ts +0 -14
- package/dist/widgets/interaction/dash-picker.d.ts +0 -12
- package/dist/widgets/interaction/element-container.d.ts +0 -22
package/dist/perseus-types.d.ts
CHANGED
|
@@ -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 = {
|
package/dist/util.d.ts
CHANGED
|
@@ -219,7 +219,6 @@ declare const Util: {
|
|
|
219
219
|
readonly gridStepFromTickStep: typeof gridStepFromTickStep;
|
|
220
220
|
readonly tickStepFromNumTicks: typeof tickStepFromNumTicks;
|
|
221
221
|
readonly constrainedTickStepsFromTickSteps: typeof constrainedTickStepsFromTickSteps;
|
|
222
|
-
readonly DeprecationMixin: any;
|
|
223
222
|
readonly eq: typeof eq;
|
|
224
223
|
readonly deepEq: typeof deepEq;
|
|
225
224
|
readonly parseQueryString: typeof parseQueryString;
|
|
@@ -47,12 +47,10 @@ declare class LegacyInteractiveGraph extends React.Component<Props, State> {
|
|
|
47
47
|
vertHairline: any | null | undefined;
|
|
48
48
|
static defaultProps: DefaultProps;
|
|
49
49
|
state: State;
|
|
50
|
-
UNSAFE_componentWillMount(): void;
|
|
51
50
|
componentDidMount(): void;
|
|
52
51
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
53
52
|
componentDidUpdate(prevProps: Props, prevState: State): void;
|
|
54
53
|
_getShouldShowInstructions: (arg1?: Props | null | undefined) => boolean;
|
|
55
|
-
deprecatedProps: any;
|
|
56
54
|
setGraphie: (arg1: any) => void;
|
|
57
55
|
handleAddPointsMouseDown: (arg1: Coord) => void;
|
|
58
56
|
resetGraphie: () => void;
|
|
@@ -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
|
@@ -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;
|