@khanacademy/perseus-core 40.0.1 → 41.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/dist/data-schema.d.ts +16 -10
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/label-image-widget.d.ts +1 -0
- package/dist/parse-perseus-json/regression-tests/item-data/label-image-with-preferredPopoverDirection.d.ts +45 -0
- package/dist/types.d.ts +1 -0
- package/dist/widgets/core-widget-registry.d.ts +5 -0
- package/dist/widgets/definition/index.d.ts +2 -1
- package/dist/widgets/deprecated-standin/index.d.ts +1 -1
- package/dist/widgets/explanation/index.d.ts +2 -1
- package/dist/widgets/graded-group/index.d.ts +2 -1
- package/dist/widgets/graded-group-set/index.d.ts +2 -1
- package/dist/widgets/interaction/index.d.ts +2 -1
- package/dist/widgets/logic-export.types.d.ts +2 -2
- package/dist/widgets/measurer/index.d.ts +2 -1
- package/dist/widgets/phet-simulation/index.d.ts +2 -1
- package/dist/widgets/python-program/index.d.ts +2 -1
- package/dist/widgets/video/index.d.ts +2 -1
- package/package.json +3 -3
|
@@ -17,6 +17,7 @@ export declare const parseLabelImageWidget: import("../parser-types").Parser<imp
|
|
|
17
17
|
}>[];
|
|
18
18
|
hideChoicesFromInstructions: boolean;
|
|
19
19
|
multipleAnswers: boolean;
|
|
20
|
+
preferredPopoverDirection: "UP" | "RIGHT" | "DOWN" | "LEFT" | "NONE" | undefined;
|
|
20
21
|
}>;
|
|
21
22
|
key: number | null | undefined;
|
|
22
23
|
version: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
question: {
|
|
3
|
+
content: string;
|
|
4
|
+
images: {};
|
|
5
|
+
widgets: {
|
|
6
|
+
"label-image 1": {
|
|
7
|
+
type: string;
|
|
8
|
+
alignment: string;
|
|
9
|
+
static: boolean;
|
|
10
|
+
graded: boolean;
|
|
11
|
+
options: {
|
|
12
|
+
static: boolean;
|
|
13
|
+
choices: string[];
|
|
14
|
+
imageAlt: string;
|
|
15
|
+
imageUrl: string;
|
|
16
|
+
imageWidth: number;
|
|
17
|
+
imageHeight: number;
|
|
18
|
+
markers: {
|
|
19
|
+
answers: string[];
|
|
20
|
+
label: string;
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}[];
|
|
24
|
+
multipleAnswers: boolean;
|
|
25
|
+
hideChoicesFromInstructions: boolean;
|
|
26
|
+
preferredPopoverDirection: string;
|
|
27
|
+
};
|
|
28
|
+
version: {
|
|
29
|
+
major: number;
|
|
30
|
+
minor: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
hints: never[];
|
|
36
|
+
answerArea: {
|
|
37
|
+
calculator: boolean;
|
|
38
|
+
financialCalculatorMonthlyPayment: boolean;
|
|
39
|
+
financialCalculatorTotalAmount: boolean;
|
|
40
|
+
financialCalculatorTimeToPayOff: boolean;
|
|
41
|
+
periodicTable: boolean;
|
|
42
|
+
periodicTableWithKey: boolean;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export default _default;
|
package/dist/types.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ export declare const getSupportedAlignments: (type: string) => ReadonlyArray<Ali
|
|
|
30
30
|
* the exports of a widget's module.
|
|
31
31
|
*/
|
|
32
32
|
export declare const getDefaultAlignment: (type: string) => Alignment;
|
|
33
|
+
/**
|
|
34
|
+
* Returns true if the widget should render inline with surrounding content.
|
|
35
|
+
* Uses the widget's default alignment when no alignment is given.
|
|
36
|
+
*/
|
|
37
|
+
export declare const isInlineWidget: (type: string, alignment?: Alignment) => boolean;
|
|
33
38
|
/**
|
|
34
39
|
* Returns the CSS class name corresponding to the specified widget alignment.
|
|
35
40
|
* Uses explicit mapping to make it easy to locate related CSS style definitions.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusDefinitionWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const definitionWidgetLogic: WidgetLogic
|
|
3
|
+
declare const definitionWidgetLogic: WidgetLogic<PerseusDefinitionWidgetOptions>;
|
|
3
4
|
export default definitionWidgetLogic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusExplanationWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const explanationWidgetLogic: WidgetLogic
|
|
3
|
+
declare const explanationWidgetLogic: WidgetLogic<PerseusExplanationWidgetOptions>;
|
|
3
4
|
export default explanationWidgetLogic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusGradedGroupWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const gradedGroupWidgetLogic: WidgetLogic
|
|
3
|
+
declare const gradedGroupWidgetLogic: WidgetLogic<PerseusGradedGroupWidgetOptions>;
|
|
3
4
|
export default gradedGroupWidgetLogic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusGradedGroupSetWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const gradedGroupSetWidgetLogic: WidgetLogic
|
|
3
|
+
declare const gradedGroupSetWidgetLogic: WidgetLogic<PerseusGradedGroupSetWidgetOptions>;
|
|
3
4
|
export default gradedGroupSetWidgetLogic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusInteractionWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const interactionWidgetLogic: WidgetLogic
|
|
3
|
+
declare const interactionWidgetLogic: WidgetLogic<PerseusInteractionWidgetOptions>;
|
|
3
4
|
export default interactionWidgetLogic;
|
|
@@ -30,7 +30,7 @@ export type WidgetOptionsUpgradeMap = {
|
|
|
30
30
|
* so reliant on a set group of widgets
|
|
31
31
|
*/
|
|
32
32
|
export type PublicWidgetOptionsFunction = typeof getCategorizerPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getFillInTheBlankPublicWidgetOptions | 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
|
-
export type WidgetLogic<TWidgetOptions
|
|
33
|
+
export type WidgetLogic<TWidgetOptions, TPublicWidgetOptions = never> = {
|
|
34
34
|
name: string;
|
|
35
35
|
/**
|
|
36
36
|
* The widget version. Any time the _major_ version changes, the widget
|
|
@@ -42,7 +42,7 @@ export type WidgetLogic<TWidgetOptions = never, TPublicWidgetOptions = never> =
|
|
|
42
42
|
* This key defaults to `{major: 0, minor: 0}` if not provided.
|
|
43
43
|
*/
|
|
44
44
|
version?: Version;
|
|
45
|
-
defaultWidgetOptions
|
|
45
|
+
defaultWidgetOptions: TWidgetOptions;
|
|
46
46
|
supportedAlignments?: ReadonlyArray<Alignment>;
|
|
47
47
|
defaultAlignment?: Alignment;
|
|
48
48
|
accessible?: boolean | ((options: TWidgetOptions) => boolean);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusMeasurerWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const measurerWidgetLogic: WidgetLogic
|
|
3
|
+
declare const measurerWidgetLogic: WidgetLogic<PerseusMeasurerWidgetOptions>;
|
|
3
4
|
export default measurerWidgetLogic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusPhetSimulationWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const phetSimulationWidgetLogic: WidgetLogic
|
|
3
|
+
declare const phetSimulationWidgetLogic: WidgetLogic<PerseusPhetSimulationWidgetOptions>;
|
|
3
4
|
export default phetSimulationWidgetLogic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusPythonProgramWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const pythonProgramWidgetLogic: WidgetLogic
|
|
3
|
+
declare const pythonProgramWidgetLogic: WidgetLogic<PerseusPythonProgramWidgetOptions>;
|
|
3
4
|
export default pythonProgramWidgetLogic;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerseusVideoWidgetOptions } from "../../data-schema";
|
|
1
2
|
import type { WidgetLogic } from "../logic-export.types";
|
|
2
|
-
declare const videoWidgetLogic: WidgetLogic
|
|
3
|
+
declare const videoWidgetLogic: WidgetLogic<PerseusVideoWidgetOptions>;
|
|
3
4
|
export default videoWidgetLogic;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Shared Perseus infrastructure",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "41.0.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"tiny-invariant": "1.3.1",
|
|
27
27
|
"@khanacademy/kas": "3.0.0",
|
|
28
|
-
"@khanacademy/
|
|
29
|
-
"@khanacademy/
|
|
28
|
+
"@khanacademy/perseus-utils": "3.0.0",
|
|
29
|
+
"@khanacademy/pure-markdown": "3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@khanacademy/wonder-stuff-core": "3.0.0",
|