@khanacademy/perseus-core 3.7.0 → 4.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/LICENSE +18 -0
- package/dist/data-schema.d.ts +15 -4
- package/dist/es/index.js +92 -2100
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +115 -2104
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/interactive-graph-widget.d.ts +1 -0
- package/dist/widgets/dropdown/dropdown-util.d.ts +1 -1
- package/dist/widgets/interactive-graph/interactive-graph-util.d.ts +1 -2
- package/dist/widgets/numeric-input/numeric-input-util.d.ts +3 -2
- package/package.json +33 -32
- /package/dist/{utils → shared-utils}/add-library-version-to-perseus-debug.d.ts +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Copyright 2022 Khan Academy
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to use,
|
|
6
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
7
|
+
Software, and to permit persons to whom the Software is furnished to do so, subject
|
|
8
|
+
to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
15
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
16
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
17
|
+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/data-schema.d.ts
CHANGED
|
@@ -565,9 +565,20 @@ export type LockedFunctionType = {
|
|
|
565
565
|
type: "function";
|
|
566
566
|
color: LockedFigureColor;
|
|
567
567
|
strokeStyle: LockedLineStyle;
|
|
568
|
+
/**
|
|
569
|
+
* This is the user-defined equation (as it was typed)
|
|
570
|
+
*/
|
|
568
571
|
equation: string;
|
|
572
|
+
/**
|
|
573
|
+
* The independent variable of this function
|
|
574
|
+
*/
|
|
569
575
|
directionalAxis: "x" | "y";
|
|
570
|
-
|
|
576
|
+
/**
|
|
577
|
+
* The minimum and maximum values along the `directionalAxis` at which
|
|
578
|
+
* this function should be graphed. Values of -Infinity and Infinity are
|
|
579
|
+
* allowed. Note that infinite values are serialized as `null` in JSON.
|
|
580
|
+
*/
|
|
581
|
+
domain: [min: number, max: number];
|
|
571
582
|
labels?: LockedLabelType[];
|
|
572
583
|
ariaLabel?: string;
|
|
573
584
|
};
|
|
@@ -745,9 +756,10 @@ export type PerseusMeasurerWidgetOptions = {
|
|
|
745
756
|
};
|
|
746
757
|
export type MathFormat = "integer" | "mixed" | "improper" | "proper" | "decimal" | "percent" | "pi";
|
|
747
758
|
export type PerseusNumericInputAnswerForm = {
|
|
748
|
-
simplify:
|
|
759
|
+
simplify: PerseusNumericInputSimplify | null | undefined;
|
|
749
760
|
name: MathFormat;
|
|
750
761
|
};
|
|
762
|
+
export type PerseusNumericInputSimplify = "required" | "correct" | "enforced" | "optional";
|
|
751
763
|
export type PerseusNumericInputWidgetOptions = {
|
|
752
764
|
answers: ReadonlyArray<PerseusNumericInputAnswer>;
|
|
753
765
|
labelText?: string | undefined;
|
|
@@ -755,7 +767,6 @@ export type PerseusNumericInputWidgetOptions = {
|
|
|
755
767
|
coefficient: boolean;
|
|
756
768
|
rightAlign?: boolean;
|
|
757
769
|
static: boolean;
|
|
758
|
-
answerForms?: ReadonlyArray<PerseusNumericInputAnswerForm>;
|
|
759
770
|
};
|
|
760
771
|
export type PerseusNumericInputAnswer = {
|
|
761
772
|
message: string;
|
|
@@ -764,7 +775,7 @@ export type PerseusNumericInputAnswer = {
|
|
|
764
775
|
answerForms?: ReadonlyArray<MathFormat>;
|
|
765
776
|
strict: boolean;
|
|
766
777
|
maxError: number | null | undefined;
|
|
767
|
-
simplify:
|
|
778
|
+
simplify: PerseusNumericInputSimplify | null | undefined;
|
|
768
779
|
};
|
|
769
780
|
export type PerseusNumberLineWidgetOptions = {
|
|
770
781
|
range: ReadonlyArray<number>;
|