@khanacademy/perseus-core 3.6.0 → 3.7.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 +10 -3
- package/dist/es/index.js +195 -65
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +190 -55
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/perseus-answer-area.d.ts +2 -0
- package/dist/utils/random-util.d.ts +5 -0
- package/dist/widgets/group/index.d.ts +1 -1
- package/dist/widgets/logic-export.types.d.ts +2 -1
- package/dist/widgets/matcher/matcher-util.d.ts +28 -0
- package/dist/widgets/sorter/sorter-util.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PerseusGroupWidgetOptions } from "../../data-schema";
|
|
2
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
3
|
-
export type GroupDefaultWidgetOptions = Pick<PerseusGroupWidgetOptions, "content" | "widgets" | "images"
|
|
3
|
+
export type GroupDefaultWidgetOptions = Pick<PerseusGroupWidgetOptions, "content" | "widgets" | "images">;
|
|
4
4
|
declare const groupWidgetLogic: WidgetLogic;
|
|
5
5
|
export default groupWidgetLogic;
|
|
@@ -6,6 +6,7 @@ import type getGrapherPublicWidgetOptions from "./grapher/grapher-util";
|
|
|
6
6
|
import type getIFramePublicWidgetOptions from "./iframe/iframe-util";
|
|
7
7
|
import type getInteractiveGraphPublicWidgetOptions from "./interactive-graph/interactive-graph-util";
|
|
8
8
|
import type getLabelImagePublicWidgetOptions from "./label-image/label-image-util";
|
|
9
|
+
import type getMatcherPublicWidgetOptions from "./matcher/matcher-util";
|
|
9
10
|
import type getMatrixPublicWidgetOptions from "./matrix/matrix-util";
|
|
10
11
|
import type getNumberLinePublicWidgetOptions from "./number-line/number-line-util";
|
|
11
12
|
import type getNumericInputPublicWidgetOptions from "./numeric-input/numeric-input-util";
|
|
@@ -25,7 +26,7 @@ export type WidgetOptionsUpgradeMap = {
|
|
|
25
26
|
* TODO(LEMS-2870): figure out how to make this generic so we don't need to be
|
|
26
27
|
* so reliant on a set group of widgets
|
|
27
28
|
*/
|
|
28
|
-
export type PublicWidgetOptionsFunction = typeof getPlotterPublicWidgetOptions | typeof getIFramePublicWidgetOptions | typeof getRadioPublicWidgetOptions | typeof getNumericInputPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getCategorizerPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getInteractiveGraphPublicWidgetOptions | typeof getLabelImagePublicWidgetOptions | typeof getSorterPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getNumberLinePublicWidgetOptions | typeof getTablePublicWidgetOptions | typeof getGrapherPublicWidgetOptions | typeof getMatrixPublicWidgetOptions;
|
|
29
|
+
export type PublicWidgetOptionsFunction = typeof getMatcherPublicWidgetOptions | typeof getPlotterPublicWidgetOptions | typeof getIFramePublicWidgetOptions | typeof getRadioPublicWidgetOptions | typeof getNumericInputPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getCategorizerPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getInteractiveGraphPublicWidgetOptions | typeof getLabelImagePublicWidgetOptions | typeof getSorterPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getNumberLinePublicWidgetOptions | typeof getTablePublicWidgetOptions | typeof getGrapherPublicWidgetOptions | typeof getMatrixPublicWidgetOptions;
|
|
29
30
|
export type WidgetLogic = {
|
|
30
31
|
name: string;
|
|
31
32
|
version?: Version;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PerseusMatcherWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
|
+
type MatcherInfo = {
|
|
3
|
+
left: ReadonlyArray<string>;
|
|
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
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* For details on the individual options, see the
|
|
14
|
+
* PerseusMatcherWidgetOptions type
|
|
15
|
+
*/
|
|
16
|
+
type MatcherPublicWidgetOptions = {
|
|
17
|
+
labels: PerseusMatcherWidgetOptions["labels"];
|
|
18
|
+
left: PerseusMatcherWidgetOptions["left"];
|
|
19
|
+
right: PerseusMatcherWidgetOptions["right"];
|
|
20
|
+
orderMatters: PerseusMatcherWidgetOptions["orderMatters"];
|
|
21
|
+
padding: PerseusMatcherWidgetOptions["padding"];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Given a PerseusMatcherWidgetOptions object, return a new object with only
|
|
25
|
+
* the public options that should be exposed to the client.
|
|
26
|
+
*/
|
|
27
|
+
declare function getMatcherPublicWidgetOptions(options: PerseusMatcherWidgetOptions): MatcherPublicWidgetOptions;
|
|
28
|
+
export default getMatcherPublicWidgetOptions;
|
|
@@ -7,6 +7,7 @@ type SorterPublicWidgetOptions = {
|
|
|
7
7
|
correct: PerseusSorterWidgetOptions["correct"];
|
|
8
8
|
padding: PerseusSorterWidgetOptions["padding"];
|
|
9
9
|
layout: PerseusSorterWidgetOptions["layout"];
|
|
10
|
+
isCorrectShuffled: boolean;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* Given a PerseusSorterWidgetOptions object, return a new object with only
|