@khanacademy/perseus 41.1.0 → 41.2.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 +90 -111
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +91 -110
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +1 -8
- package/dist/perseus-types.d.ts +48 -0
- package/dist/util/is-real-json-parse.d.ts +1 -0
- package/dist/validation.types.d.ts +2 -2
- package/dist/widgets/interactive-graphs/utils.d.ts +6 -0
- package/package.json +1 -1
package/dist/init.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
export type PerseusOptions = {
|
|
2
|
-
skipMathJax: boolean;
|
|
3
|
-
};
|
|
4
1
|
/**
|
|
5
2
|
* This should be called by all clients, specifying whether extra widgets are
|
|
6
3
|
* needed via `loadExtraWidgets`. It is idempotent, so it's not a problem to
|
|
7
4
|
* call it multiple times.
|
|
8
|
-
*
|
|
9
|
-
* skipMathJax:
|
|
10
|
-
* If false/undefined, MathJax will be configured, and the
|
|
11
|
-
* promise will wait for MathJax to load (if it hasn't already).
|
|
12
5
|
*/
|
|
13
|
-
declare const init: (
|
|
6
|
+
declare const init: () => void;
|
|
14
7
|
export default init;
|
package/dist/perseus-types.d.ts
CHANGED
|
@@ -511,6 +511,54 @@ export type PerseusGraphTypeRay = {
|
|
|
511
511
|
coords?: CollinearTuple | null;
|
|
512
512
|
startCoords?: CollinearTuple;
|
|
513
513
|
} & PerseusGraphTypeCommon;
|
|
514
|
+
type AngleGraphCorrect = {
|
|
515
|
+
type: "angle";
|
|
516
|
+
allowReflexAngles: boolean;
|
|
517
|
+
match: "congruent";
|
|
518
|
+
coords: [Coord, Coord, Coord];
|
|
519
|
+
};
|
|
520
|
+
type CircleGraphCorrect = {
|
|
521
|
+
type: "circle";
|
|
522
|
+
center: Coord;
|
|
523
|
+
radius: number;
|
|
524
|
+
};
|
|
525
|
+
type LinearGraphCorrect = {
|
|
526
|
+
type: "linear";
|
|
527
|
+
coords: CollinearTuple;
|
|
528
|
+
};
|
|
529
|
+
type LinearSystemGraphCorrect = {
|
|
530
|
+
type: "linear-system";
|
|
531
|
+
coords: [CollinearTuple, CollinearTuple];
|
|
532
|
+
};
|
|
533
|
+
type NoneGraphCorrect = {
|
|
534
|
+
type: "none";
|
|
535
|
+
};
|
|
536
|
+
type PointGraphCorrect = {
|
|
537
|
+
type: "point";
|
|
538
|
+
coords: ReadonlyArray<Coord>;
|
|
539
|
+
};
|
|
540
|
+
type PolygonGraphCorrect = {
|
|
541
|
+
type: "polygon";
|
|
542
|
+
match: "similar" | "congruent" | "approx";
|
|
543
|
+
coords: ReadonlyArray<Coord>;
|
|
544
|
+
};
|
|
545
|
+
type QuadraticGraphCorrect = {
|
|
546
|
+
type: "quadratic";
|
|
547
|
+
coords: [Coord, Coord, Coord];
|
|
548
|
+
};
|
|
549
|
+
type SegmentGraphCorrect = {
|
|
550
|
+
type: "segment";
|
|
551
|
+
coords: CollinearTuple[];
|
|
552
|
+
};
|
|
553
|
+
type SinusoidGraphCorrect = {
|
|
554
|
+
type: "sinusoid";
|
|
555
|
+
coords: CollinearTuple;
|
|
556
|
+
};
|
|
557
|
+
type RayGraphCorrect = {
|
|
558
|
+
type: "ray";
|
|
559
|
+
coords: CollinearTuple;
|
|
560
|
+
};
|
|
561
|
+
export type PerseusGraphCorrectType = AngleGraphCorrect | CircleGraphCorrect | LinearGraphCorrect | LinearSystemGraphCorrect | NoneGraphCorrect | PointGraphCorrect | PolygonGraphCorrect | QuadraticGraphCorrect | RayGraphCorrect | SegmentGraphCorrect | SinusoidGraphCorrect;
|
|
514
562
|
export type PerseusLabelImageWidgetOptions = {
|
|
515
563
|
choices: ReadonlyArray<string>;
|
|
516
564
|
imageUrl: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isRealJSONParse(jsonParse: typeof JSON.parse): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumberLineWidgetOptions, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusPlotterWidgetOptions, PerseusRadioChoice, PerseusTableWidgetOptions } from "./perseus-types";
|
|
1
|
+
import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumberLineWidgetOptions, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusPlotterWidgetOptions, PerseusRadioChoice, PerseusTableWidgetOptions, PerseusGraphCorrectType } from "./perseus-types";
|
|
2
2
|
import type { InteractiveMarkerType } from "./widgets/label-image/types";
|
|
3
3
|
import type { Relationship } from "./widgets/number-line/number-line";
|
|
4
4
|
export type UserInputStatus = "correct" | "incorrect" | "incomplete";
|
|
@@ -47,7 +47,7 @@ export type PerseusInputNumberUserInput = {
|
|
|
47
47
|
currentValue: string;
|
|
48
48
|
};
|
|
49
49
|
export type PerseusInteractiveGraphRubric = {
|
|
50
|
-
correct:
|
|
50
|
+
correct: PerseusGraphCorrectType;
|
|
51
51
|
graph: PerseusGraphType;
|
|
52
52
|
};
|
|
53
53
|
export type PerseusInteractiveGraphUserInput = PerseusGraphType;
|
|
@@ -16,3 +16,9 @@ export declare function bound({ snapStep, range, point, }: {
|
|
|
16
16
|
point: vec.Vector2;
|
|
17
17
|
}): vec.Vector2;
|
|
18
18
|
export declare function isUnlimitedGraphState(state: InteractiveGraphState): state is UnlimitedGraphState;
|
|
19
|
+
/**
|
|
20
|
+
* Replace all text outside of the $ TeX blocks with `\\text{...}`
|
|
21
|
+
* This way, the entire resulting string can be rendered within <TeX>
|
|
22
|
+
* and the text outside of the $ blocks will be non-TeX text.
|
|
23
|
+
*/
|
|
24
|
+
export declare function replaceOutsideTeX(mathString: string): string;
|