@khanacademy/perseus-core 16.1.0 → 16.1.1
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 +3 -3
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/number-line-user-input.d.ts +0 -2
- package/dist/types.d.ts +6 -1
- package/dist/validation.types.d.ts +8 -8
- package/dist/widgets/matcher/matcher-util.d.ts +2 -10
- package/dist/widgets/sorter/sorter-util.d.ts +2 -5
- package/package.json +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare const parseNumberLineUserInput: import("../parser-types").Parser<import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
2
|
-
isTickCrtl: boolean | undefined;
|
|
3
2
|
numLinePosition: number;
|
|
4
3
|
rel: "eq" | "lt" | "gt" | "le" | "ge";
|
|
5
4
|
numDivisions: number;
|
|
6
|
-
divisionRange: number[];
|
|
7
5
|
}>>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
type State = any;
|
|
2
2
|
export interface RendererInterface {
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated - do not use in new code.
|
|
5
|
+
*/
|
|
3
6
|
getSerializedState(): State;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated - do not use in new code.
|
|
9
|
+
*/
|
|
4
10
|
restoreSerializedState(state: State, callback?: () => void): void;
|
|
5
11
|
blur(): void;
|
|
6
12
|
focus(): boolean | null | undefined;
|
|
@@ -21,7 +27,6 @@ export type MarkerType = {
|
|
|
21
27
|
y: number;
|
|
22
28
|
};
|
|
23
29
|
export type InteractiveMarkerType = MarkerType & {
|
|
24
|
-
selected?: string[];
|
|
25
30
|
showCorrectness?: "correct" | "incorrect";
|
|
26
31
|
focused?: boolean;
|
|
27
32
|
};
|
|
@@ -80,7 +80,7 @@ export type PerseusGradedGroupSetRubric = PerseusGradedGroupSetWidgetOptions;
|
|
|
80
80
|
export type PerseusGrapherRubric = {
|
|
81
81
|
correct: GrapherAnswerTypes;
|
|
82
82
|
};
|
|
83
|
-
export type PerseusGrapherUserInput =
|
|
83
|
+
export type PerseusGrapherUserInput = GrapherAnswerTypes;
|
|
84
84
|
export type PerseusIFrameUserInput = {
|
|
85
85
|
status: UserInputStatus;
|
|
86
86
|
message: string | null;
|
|
@@ -106,11 +106,12 @@ export type PerseusLabelImageRubric = {
|
|
|
106
106
|
label: string;
|
|
107
107
|
}>;
|
|
108
108
|
};
|
|
109
|
+
export type PerseusLabelImageUserInputMarker = {
|
|
110
|
+
selected?: string[];
|
|
111
|
+
label: string;
|
|
112
|
+
};
|
|
109
113
|
export type PerseusLabelImageUserInput = {
|
|
110
|
-
markers:
|
|
111
|
-
selected?: string[];
|
|
112
|
-
label: string;
|
|
113
|
-
}>;
|
|
114
|
+
markers: PerseusLabelImageUserInputMarker[];
|
|
114
115
|
};
|
|
115
116
|
export type PerseusMatcherRubric = {
|
|
116
117
|
left: string[];
|
|
@@ -133,13 +134,13 @@ export type PerseusNumberLineRubric = {
|
|
|
133
134
|
range: number[];
|
|
134
135
|
initialX: number | null | undefined;
|
|
135
136
|
isInequality: boolean;
|
|
137
|
+
isTickCtrl?: boolean;
|
|
138
|
+
divisionRange: number[];
|
|
136
139
|
};
|
|
137
140
|
export type PerseusNumberLineUserInput = {
|
|
138
|
-
isTickCrtl?: boolean;
|
|
139
141
|
numLinePosition: number;
|
|
140
142
|
rel: Relationship | "eq";
|
|
141
143
|
numDivisions: number;
|
|
142
|
-
divisionRange: number[];
|
|
143
144
|
};
|
|
144
145
|
export type PerseusNumericInputRubric = {
|
|
145
146
|
answers: PerseusNumericInputAnswer[];
|
|
@@ -192,7 +193,6 @@ export interface RubricRegistry {
|
|
|
192
193
|
"graded-group": PerseusGradedGroupRubric;
|
|
193
194
|
grapher: PerseusGrapherRubric;
|
|
194
195
|
group: PerseusGroupRubric;
|
|
195
|
-
image: PerseusLabelImageRubric;
|
|
196
196
|
"input-number": PerseusInputNumberRubric;
|
|
197
197
|
"interactive-graph": PerseusInteractiveGraphRubric;
|
|
198
198
|
"label-image": PerseusLabelImageRubric;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import type { PerseusMatcherWidgetOptions } from "../../data-schema";
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
right: ReadonlyArray<string>;
|
|
5
|
-
orderMatters: boolean;
|
|
6
|
-
problemNum: number | null | undefined;
|
|
7
|
-
};
|
|
8
|
-
export declare const shuffleMatcher: (props: MatcherInfo) => {
|
|
9
|
-
left: ReadonlyArray<string>;
|
|
10
|
-
right: ReadonlyArray<string>;
|
|
11
|
-
};
|
|
2
|
+
import type { PerseusMatcherUserInput } from "../../validation.types";
|
|
3
|
+
export declare const shuffleMatcher: (options: Pick<MatcherPublicWidgetOptions, "left" | "right" | "orderMatters">, problemNum: number) => PerseusMatcherUserInput;
|
|
12
4
|
/**
|
|
13
5
|
* For details on the individual options, see the
|
|
14
6
|
* PerseusMatcherWidgetOptions type
|
|
@@ -3,7 +3,7 @@ import type { PerseusSorterWidgetOptions } from "../../data-schema";
|
|
|
3
3
|
* For details on the individual options, see the
|
|
4
4
|
* PerseusSorterWidgetOptions type
|
|
5
5
|
*/
|
|
6
|
-
type SorterPublicWidgetOptions = {
|
|
6
|
+
export type SorterPublicWidgetOptions = {
|
|
7
7
|
correct: PerseusSorterWidgetOptions["correct"];
|
|
8
8
|
padding: PerseusSorterWidgetOptions["padding"];
|
|
9
9
|
layout: PerseusSorterWidgetOptions["layout"];
|
|
@@ -13,8 +13,5 @@ type SorterPublicWidgetOptions = {
|
|
|
13
13
|
* the public options that should be exposed to the client.
|
|
14
14
|
*/
|
|
15
15
|
declare function getSorterPublicWidgetOptions(options: PerseusSorterWidgetOptions): SorterPublicWidgetOptions;
|
|
16
|
-
export declare function shuffleSorter(
|
|
17
|
-
correct: string[];
|
|
18
|
-
problemNum: number | null | undefined;
|
|
19
|
-
}): string[];
|
|
16
|
+
export declare function shuffleSorter(options: Pick<SorterPublicWidgetOptions, "correct">, problemNum: number): string[];
|
|
20
17
|
export default getSorterPublicWidgetOptions;
|