@khanacademy/perseus-core 28.0.1 → 28.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/data-schema.d.ts +14 -6
- package/dist/es/index.item-splitting.js +5 -5
- package/dist/es/index.item-splitting.js.map +1 -1
- package/dist/es/index.js +15 -13
- package/dist/es/index.js.map +1 -1
- package/dist/feature-flags.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.item-splitting.js +5 -5
- package/dist/index.item-splitting.js.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/expression-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/grapher-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/interactive-graph-user-input.d.ts +2 -2
- package/dist/parse-perseus-json/perseus-parsers/interactive-graph-widget.d.ts +6 -6
- package/dist/parse-perseus-json/perseus-parsers/legacy-button-sets.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/perseus-answer-area.d.ts +5 -2
- package/dist/parse-perseus-json/regression-tests/item-data/measurer-missing-version.d.ts +49 -0
- package/dist/utils/generators/grapher-widget-generator.d.ts +2 -0
- package/dist/widgets/grapher/grapher-util.typetest.d.ts +1 -0
- package/dist/widgets/grapher/to-interactive-graph.d.ts +5 -0
- package/dist/widgets/logic-export.types.d.ts +9 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export declare const parseExpressionWidget: import("../parser-types").Parser<imp
|
|
|
10
10
|
times: boolean;
|
|
11
11
|
visibleLabel: string | undefined;
|
|
12
12
|
ariaLabel: string | undefined;
|
|
13
|
-
buttonSets: ("basic" | "basic+div" | "trig" | "prealgebra" | "logarithms" | "basic relations" | "advanced relations"
|
|
13
|
+
buttonSets: ("scientific" | "basic" | "basic+div" | "trig" | "prealgebra" | "logarithms" | "basic relations" | "advanced relations")[];
|
|
14
14
|
buttonsVisible: "always" | "never" | "focused" | undefined;
|
|
15
15
|
extraKeys: ("PLUS" | "MINUS" | "NEGATIVE" | "TIMES" | "DIVIDE" | "DECIMAL" | "PERIOD" | "PERCENT" | "CDOT" | "EQUAL" | "NEQ" | "GT" | "LT" | "GEQ" | "LEQ" | "FRAC_INCLUSIVE" | "FRAC_EXCLUSIVE" | "FRAC" | "EXP" | "EXP_2" | "EXP_3" | "SQRT" | "CUBE_ROOT" | "RADICAL" | "LEFT_PAREN" | "RIGHT_PAREN" | "LN" | "LOG" | "LOG_N" | "SIN" | "COS" | "TAN" | "PI" | "THETA" | "UP" | "RIGHT" | "DOWN" | "LEFT" | "BACKSPACE" | "DISMISS" | "JUMP_OUT_PARENTHESES" | "JUMP_OUT_EXPONENT" | "JUMP_OUT_BASE" | "JUMP_INTO_NUMERATOR" | "JUMP_OUT_NUMERATOR" | "JUMP_OUT_DENOMINATOR" | "NUM_0" | "NUM_1" | "NUM_2" | "NUM_3" | "NUM_4" | "NUM_5" | "NUM_6" | "NUM_7" | "NUM_8" | "NUM_9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined;
|
|
16
16
|
}>>>;
|
|
@@ -24,7 +24,7 @@ export declare const parseGrapherWidget: Parser<import("../..").WidgetOptions<"g
|
|
|
24
24
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
25
25
|
type: "tangent";
|
|
26
26
|
coords: [[number, number], [number, number]] | null;
|
|
27
|
-
}
|
|
27
|
+
}> | undefined;
|
|
28
28
|
graph: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
29
29
|
backgroundImage: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
30
30
|
bottom: number | undefined;
|
|
@@ -79,7 +79,7 @@ export declare const parseInteractiveGraphUserInput: import("../parser-types").P
|
|
|
79
79
|
showPointLabels: boolean | undefined;
|
|
80
80
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
81
81
|
type: "exponential";
|
|
82
|
-
coords: [number, number][] | null | undefined;
|
|
82
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
83
83
|
asymptote: number | null | undefined;
|
|
84
84
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
85
85
|
coords: [[number, number], [number, number]];
|
|
@@ -101,7 +101,7 @@ export declare const parseInteractiveGraphUserInput: import("../parser-types").P
|
|
|
101
101
|
showPointLabels: boolean | undefined;
|
|
102
102
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
103
103
|
type: "logarithm";
|
|
104
|
-
coords: [number, number][] | null | undefined;
|
|
104
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
105
105
|
asymptote: number | null | undefined;
|
|
106
106
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
107
107
|
coords: [[number, number], [number, number]];
|
|
@@ -79,7 +79,7 @@ export declare const parsePerseusGraphType: import("../parser-types").Parser<imp
|
|
|
79
79
|
showPointLabels: boolean | undefined;
|
|
80
80
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
81
81
|
type: "exponential";
|
|
82
|
-
coords: [number, number][] | null | undefined;
|
|
82
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
83
83
|
asymptote: number | null | undefined;
|
|
84
84
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
85
85
|
coords: [[number, number], [number, number]];
|
|
@@ -101,7 +101,7 @@ export declare const parsePerseusGraphType: import("../parser-types").Parser<imp
|
|
|
101
101
|
showPointLabels: boolean | undefined;
|
|
102
102
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
103
103
|
type: "logarithm";
|
|
104
|
-
coords: [number, number][] | null | undefined;
|
|
104
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
105
105
|
asymptote: number | null | undefined;
|
|
106
106
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
107
107
|
coords: [[number, number], [number, number]];
|
|
@@ -229,7 +229,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
|
|
|
229
229
|
showPointLabels: boolean | undefined;
|
|
230
230
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
231
231
|
type: "exponential";
|
|
232
|
-
coords: [number, number][] | null | undefined;
|
|
232
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
233
233
|
asymptote: number | null | undefined;
|
|
234
234
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
235
235
|
coords: [[number, number], [number, number]];
|
|
@@ -251,7 +251,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
|
|
|
251
251
|
showPointLabels: boolean | undefined;
|
|
252
252
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
253
253
|
type: "logarithm";
|
|
254
|
-
coords: [number, number][] | null | undefined;
|
|
254
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
255
255
|
asymptote: number | null | undefined;
|
|
256
256
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
257
257
|
coords: [[number, number], [number, number]];
|
|
@@ -346,7 +346,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
|
|
|
346
346
|
showPointLabels: boolean | undefined;
|
|
347
347
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
348
348
|
type: "exponential";
|
|
349
|
-
coords: [number, number][] | null | undefined;
|
|
349
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
350
350
|
asymptote: number | null | undefined;
|
|
351
351
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
352
352
|
coords: [[number, number], [number, number]];
|
|
@@ -368,7 +368,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
|
|
|
368
368
|
showPointLabels: boolean | undefined;
|
|
369
369
|
}> | import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
370
370
|
type: "logarithm";
|
|
371
|
-
coords: [number, number][] | null | undefined;
|
|
371
|
+
coords: [[number, number], [number, number]] | null | undefined;
|
|
372
372
|
asymptote: number | null | undefined;
|
|
373
373
|
startCoords: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
374
374
|
coords: [[number, number], [number, number]];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const parseLegacyButtonSets: import("../parser-types").Parser<("basic" | "basic+div" | "trig" | "prealgebra" | "logarithms" | "basic relations" | "advanced relations"
|
|
1
|
+
export declare const parseLegacyButtonSets: import("../parser-types").Parser<("scientific" | "basic" | "basic+div" | "trig" | "prealgebra" | "logarithms" | "basic relations" | "advanced relations")[]>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
type CalculatorVariant = "scientific" | "graphing" | "four_function";
|
|
2
|
+
export declare const parsePerseusAnswerArea: import("../parser-types").Parser<{
|
|
3
|
+
calculatorVariant: CalculatorVariant | null;
|
|
2
4
|
calculator: boolean;
|
|
3
5
|
financialCalculatorMonthlyPayment: boolean;
|
|
4
6
|
financialCalculatorTotalAmount: boolean;
|
|
5
7
|
financialCalculatorTimeToPayOff: boolean;
|
|
6
8
|
periodicTable: boolean;
|
|
7
9
|
periodicTableWithKey: boolean;
|
|
8
|
-
}
|
|
10
|
+
}>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
answerArea: {
|
|
3
|
+
calculator: boolean;
|
|
4
|
+
options: {
|
|
5
|
+
content: string;
|
|
6
|
+
images: {};
|
|
7
|
+
widgets: {};
|
|
8
|
+
};
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
hints: {
|
|
12
|
+
content: string;
|
|
13
|
+
images: {};
|
|
14
|
+
widgets: {};
|
|
15
|
+
}[];
|
|
16
|
+
question: {
|
|
17
|
+
content: string;
|
|
18
|
+
images: {};
|
|
19
|
+
widgets: {
|
|
20
|
+
"dropdown 1": {
|
|
21
|
+
graded: boolean;
|
|
22
|
+
options: {
|
|
23
|
+
choices: {
|
|
24
|
+
content: string;
|
|
25
|
+
correct: boolean;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
"measurer 1": {
|
|
31
|
+
graded: boolean;
|
|
32
|
+
options: {
|
|
33
|
+
box: number[];
|
|
34
|
+
imageLeft: number;
|
|
35
|
+
imageTop: number;
|
|
36
|
+
imageUrl: string;
|
|
37
|
+
rulerLabel: string;
|
|
38
|
+
rulerLength: number;
|
|
39
|
+
rulerPixels: number;
|
|
40
|
+
rulerTicks: number;
|
|
41
|
+
showProtractor: boolean;
|
|
42
|
+
showRuler: boolean;
|
|
43
|
+
};
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PerseusGrapherWidgetOptions, PerseusInteractiveGraphWidgetOptions } from "../../data-schema";
|
|
2
|
+
import type { PerseusGrapherUserInput, PerseusInteractiveGraphUserInput } from "../../validation.types";
|
|
3
|
+
export declare function convertGrapherOptionsToInteractiveGraph(grapherOptions: PerseusGrapherWidgetOptions): PerseusInteractiveGraphWidgetOptions | null;
|
|
4
|
+
export declare function convertGrapherUserInputToInteractiveGraph(grapherUserInput: PerseusGrapherUserInput): PerseusInteractiveGraphUserInput;
|
|
5
|
+
export declare function convertInteractiveGraphUserInputToGrapher(interactiveGraphUserInput: PerseusInteractiveGraphUserInput): PerseusGrapherUserInput;
|
|
@@ -32,6 +32,15 @@ export type WidgetOptionsUpgradeMap = {
|
|
|
32
32
|
export type PublicWidgetOptionsFunction = typeof getCategorizerPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getFreeResponsePublicWidgetOptions | typeof getGrapherPublicWidgetOptions | typeof getGroupPublicWidgetOptions | typeof getIFramePublicWidgetOptions | typeof getInputNumberPublicWidgetOptions | typeof getInteractiveGraphPublicWidgetOptions | typeof getLabelImagePublicWidgetOptions | typeof getMatcherPublicWidgetOptions | typeof getMatrixPublicWidgetOptions | typeof getNumberLinePublicWidgetOptions | typeof getNumericInputPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getPlotterPublicWidgetOptions | typeof getRadioPublicWidgetOptions | typeof getSorterPublicWidgetOptions | typeof getTablePublicWidgetOptions;
|
|
33
33
|
export type WidgetLogic<TWidgetOptions = never, TPublicWidgetOptions = never> = {
|
|
34
34
|
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* The widget version. Any time the _major_ version changes, the widget
|
|
37
|
+
* should provide a new entry in the widget parser to migrate from the
|
|
38
|
+
* older version to the current (new) version.
|
|
39
|
+
*
|
|
40
|
+
* The minor version is not used.
|
|
41
|
+
*
|
|
42
|
+
* This key defaults to `{major: 0, minor: 0}` if not provided.
|
|
43
|
+
*/
|
|
35
44
|
version?: Version;
|
|
36
45
|
defaultWidgetOptions?: any;
|
|
37
46
|
supportedAlignments?: ReadonlyArray<Alignment>;
|