@khanacademy/perseus 72.3.0 → 72.5.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/es/index.js +7 -15
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/util/extract-perseus-data.d.ts +1 -25
- package/dist/util/test-utils.d.ts +1 -15
- package/package.json +44 -44
- package/dist/widgets/numeric-input/numeric-input-question-builder.d.ts +0 -14
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
import type { PerseusItem, PerseusWidgetsMap, PerseusRenderer } from "@khanacademy/perseus-core";
|
|
2
|
-
/**
|
|
3
|
-
* This function extracts the answers from the widgets.
|
|
4
|
-
*
|
|
5
|
-
* For each widget type, we first check to make sure the path to the answer exists,
|
|
6
|
-
* then we extract the answer and add it to the list of answers.
|
|
7
|
-
*
|
|
8
|
-
* A list is returned because some widgets, like multi-select radio widgets and groups
|
|
9
|
-
* can have multiple answers.
|
|
10
|
-
*
|
|
11
|
-
* @param {PerseusRenderer["widgets"]} widgets
|
|
12
|
-
* @returns a list of strings that are the answers to the widgets
|
|
13
|
-
*/
|
|
14
|
-
declare function getAnswersFromWidgets(widgets: PerseusRenderer["widgets"]): ReadonlyArray<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Inject a string equivalent of the widgets into the content.
|
|
17
|
-
*
|
|
18
|
-
* Content may contain Perseus widgets, that looks like this: '[[☃ Radio 1]]'.
|
|
19
|
-
* This function replaces those widgets with its equivalent string.
|
|
20
|
-
*
|
|
21
|
-
* @param {string} content
|
|
22
|
-
* @param {PerseusRenderer["widgets"]} widgets
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
declare function injectWidgets(content: string, widgets: PerseusRenderer["widgets"], widgetProps?: PerseusWidgetsMap): string;
|
|
26
2
|
/**
|
|
27
3
|
* Looks through widgets to identify images that do not have alt text.
|
|
28
4
|
*
|
|
@@ -39,4 +15,4 @@ export declare const getAnswerFromUserInput: (widgetType: string, userInput: any
|
|
|
39
15
|
export declare const getCorrectAnswerForWidgetId: (widgetId: string, itemData: PerseusItem) => string | null | undefined;
|
|
40
16
|
export declare const isWidgetIdInContent: (perseusItem: PerseusItem, widgetId: string) => boolean;
|
|
41
17
|
export declare const getValidWidgetIds: (perseusItem: PerseusItem) => Array<string>;
|
|
42
|
-
export {
|
|
18
|
+
export { getImagesWithoutAltData };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CategorizerWidget,
|
|
1
|
+
import type { CategorizerWidget, InteractiveGraphWidget, PerseusRenderer, PerseusWidgetTypes, RadioWidget, PerseusScore, UserInputMap, PerseusItem } from "@khanacademy/perseus-core";
|
|
2
2
|
/**
|
|
3
3
|
* Thin wrapper around scorePerseusItem for internal testing
|
|
4
4
|
*/
|
|
@@ -24,20 +24,6 @@ export declare function generateTestInteractiveGraphWidget(): InteractiveGraphWi
|
|
|
24
24
|
* @returns {InteractiveGraphWidget} skeleton InteractiveGraphWidget for testing
|
|
25
25
|
*/
|
|
26
26
|
export declare function generateTestCategorizerWidget(): CategorizerWidget;
|
|
27
|
-
/**
|
|
28
|
-
* Creates an object with the bare amount
|
|
29
|
-
* of data to be a properly typed ExpressionWidget
|
|
30
|
-
*
|
|
31
|
-
* @returns {ExpressionWidget} skeleton ExpressionWidget for testing
|
|
32
|
-
*/
|
|
33
|
-
export declare function generateTestExpressionWidget(): ExpressionWidget;
|
|
34
|
-
/**
|
|
35
|
-
* Creates an object with the bare amount
|
|
36
|
-
* of data to be a properly typed NumericInputWidget
|
|
37
|
-
*
|
|
38
|
-
* @returns {NumericInputWidget} skeleton NumericInputWidget for testing
|
|
39
|
-
*/
|
|
40
|
-
export declare function generateTestNumericInputWidget(): NumericInputWidget;
|
|
41
27
|
/**
|
|
42
28
|
* Creates an object with the minimum amount
|
|
43
29
|
* of data to be a properly typed PerseusItem
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "72.
|
|
6
|
+
"version": "72.5.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -42,39 +42,39 @@
|
|
|
42
42
|
"tiny-invariant": "1.3.1",
|
|
43
43
|
"uuid": "^10.0.0",
|
|
44
44
|
"@khanacademy/kas": "2.1.6",
|
|
45
|
-
"@khanacademy/keypad-context": "3.2.
|
|
46
|
-
"@khanacademy/kmath": "2.2.
|
|
47
|
-
"@khanacademy/math-input": "26.2.
|
|
48
|
-
"@khanacademy/perseus-core": "20.
|
|
49
|
-
"@khanacademy/perseus-linter": "4.6.
|
|
50
|
-
"@khanacademy/perseus-score": "8.0.
|
|
45
|
+
"@khanacademy/keypad-context": "3.2.21",
|
|
46
|
+
"@khanacademy/kmath": "2.2.21",
|
|
47
|
+
"@khanacademy/math-input": "26.2.24",
|
|
48
|
+
"@khanacademy/perseus-core": "20.4.1",
|
|
49
|
+
"@khanacademy/perseus-linter": "4.6.3",
|
|
50
|
+
"@khanacademy/perseus-score": "8.0.10",
|
|
51
51
|
"@khanacademy/perseus-utils": "2.1.4",
|
|
52
52
|
"@khanacademy/pure-markdown": "2.2.4",
|
|
53
53
|
"@khanacademy/simple-markdown": "2.1.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@khanacademy/wonder-blocks-announcer": "1.0.5",
|
|
57
|
-
"@khanacademy/wonder-blocks-banner": "5.0.
|
|
58
|
-
"@khanacademy/wonder-blocks-button": "11.2.
|
|
59
|
-
"@khanacademy/wonder-blocks-clickable": "8.0.
|
|
57
|
+
"@khanacademy/wonder-blocks-banner": "5.0.6",
|
|
58
|
+
"@khanacademy/wonder-blocks-button": "11.2.10",
|
|
59
|
+
"@khanacademy/wonder-blocks-clickable": "8.0.5",
|
|
60
60
|
"@khanacademy/wonder-blocks-core": "12.4.2",
|
|
61
61
|
"@khanacademy/wonder-blocks-data": "14.1.8",
|
|
62
|
-
"@khanacademy/wonder-blocks-dropdown": "10.
|
|
63
|
-
"@khanacademy/wonder-blocks-form": "7.4.
|
|
64
|
-
"@khanacademy/wonder-blocks-icon-button": "11.0.
|
|
65
|
-
"@khanacademy/wonder-blocks-icon": "5.3.
|
|
66
|
-
"@khanacademy/wonder-blocks-labeled-field": "4.0.
|
|
67
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
68
|
-
"@khanacademy/wonder-blocks-link": "10.0.
|
|
69
|
-
"@khanacademy/wonder-blocks-modal": "8.5.
|
|
70
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
71
|
-
"@khanacademy/wonder-blocks-popover": "6.1.
|
|
72
|
-
"@khanacademy/wonder-blocks-progress-spinner": "3.1.
|
|
73
|
-
"@khanacademy/wonder-blocks-switch": "3.3.
|
|
62
|
+
"@khanacademy/wonder-blocks-dropdown": "10.6.0",
|
|
63
|
+
"@khanacademy/wonder-blocks-form": "7.4.6",
|
|
64
|
+
"@khanacademy/wonder-blocks-icon-button": "11.0.1",
|
|
65
|
+
"@khanacademy/wonder-blocks-icon": "5.3.5",
|
|
66
|
+
"@khanacademy/wonder-blocks-labeled-field": "4.0.12",
|
|
67
|
+
"@khanacademy/wonder-blocks-layout": "3.1.42",
|
|
68
|
+
"@khanacademy/wonder-blocks-link": "10.0.6",
|
|
69
|
+
"@khanacademy/wonder-blocks-modal": "8.5.9",
|
|
70
|
+
"@khanacademy/wonder-blocks-pill": "3.1.48",
|
|
71
|
+
"@khanacademy/wonder-blocks-popover": "6.1.47",
|
|
72
|
+
"@khanacademy/wonder-blocks-progress-spinner": "3.1.42",
|
|
73
|
+
"@khanacademy/wonder-blocks-switch": "3.3.25",
|
|
74
74
|
"@khanacademy/wonder-blocks-timing": "7.0.4",
|
|
75
|
-
"@khanacademy/wonder-blocks-tokens": "14.1.
|
|
76
|
-
"@khanacademy/wonder-blocks-tooltip": "4.1.
|
|
77
|
-
"@khanacademy/wonder-blocks-typography": "4.2.
|
|
75
|
+
"@khanacademy/wonder-blocks-tokens": "14.1.3",
|
|
76
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.60",
|
|
77
|
+
"@khanacademy/wonder-blocks-typography": "4.2.27",
|
|
78
78
|
"@khanacademy/wonder-stuff-core": "3.0.0",
|
|
79
79
|
"@phosphor-icons/core": "2.0.2",
|
|
80
80
|
"@popperjs/core": "2.10.2",
|
|
@@ -93,27 +93,27 @@
|
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@khanacademy/wonder-blocks-announcer": "^1.0.5",
|
|
96
|
-
"@khanacademy/wonder-blocks-banner": "^5.0.
|
|
97
|
-
"@khanacademy/wonder-blocks-button": "^11.2.
|
|
98
|
-
"@khanacademy/wonder-blocks-clickable": "^8.0.
|
|
96
|
+
"@khanacademy/wonder-blocks-banner": "^5.0.6",
|
|
97
|
+
"@khanacademy/wonder-blocks-button": "^11.2.10",
|
|
98
|
+
"@khanacademy/wonder-blocks-clickable": "^8.0.5",
|
|
99
99
|
"@khanacademy/wonder-blocks-core": "^12.4.2",
|
|
100
100
|
"@khanacademy/wonder-blocks-data": "^14.1.8",
|
|
101
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.
|
|
102
|
-
"@khanacademy/wonder-blocks-form": "^7.4.
|
|
103
|
-
"@khanacademy/wonder-blocks-icon": "^5.3.
|
|
104
|
-
"@khanacademy/wonder-blocks-icon-button": "^11.0.
|
|
105
|
-
"@khanacademy/wonder-blocks-labeled-field": "^4.0.
|
|
106
|
-
"@khanacademy/wonder-blocks-layout": "^3.1.
|
|
107
|
-
"@khanacademy/wonder-blocks-link": "^10.0.
|
|
108
|
-
"@khanacademy/wonder-blocks-modal": "^8.5.
|
|
109
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
110
|
-
"@khanacademy/wonder-blocks-popover": "^6.1.
|
|
111
|
-
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.
|
|
112
|
-
"@khanacademy/wonder-blocks-switch": "^3.3.
|
|
101
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.6.0",
|
|
102
|
+
"@khanacademy/wonder-blocks-form": "^7.4.6",
|
|
103
|
+
"@khanacademy/wonder-blocks-icon": "^5.3.5",
|
|
104
|
+
"@khanacademy/wonder-blocks-icon-button": "^11.0.1",
|
|
105
|
+
"@khanacademy/wonder-blocks-labeled-field": "^4.0.12",
|
|
106
|
+
"@khanacademy/wonder-blocks-layout": "^3.1.42",
|
|
107
|
+
"@khanacademy/wonder-blocks-link": "^10.0.6",
|
|
108
|
+
"@khanacademy/wonder-blocks-modal": "^8.5.9",
|
|
109
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.48",
|
|
110
|
+
"@khanacademy/wonder-blocks-popover": "^6.1.47",
|
|
111
|
+
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.42",
|
|
112
|
+
"@khanacademy/wonder-blocks-switch": "^3.3.25",
|
|
113
113
|
"@khanacademy/wonder-blocks-timing": "^7.0.4",
|
|
114
|
-
"@khanacademy/wonder-blocks-tokens": "^14.1.
|
|
115
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.1.
|
|
116
|
-
"@khanacademy/wonder-blocks-typography": "^4.2.
|
|
114
|
+
"@khanacademy/wonder-blocks-tokens": "^14.1.3",
|
|
115
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.1.60",
|
|
116
|
+
"@khanacademy/wonder-blocks-typography": "^4.2.27",
|
|
117
117
|
"@khanacademy/wonder-stuff-core": "^3.0.0",
|
|
118
118
|
"@phosphor-icons/core": "^2.0.2",
|
|
119
119
|
"@popperjs/core": "^2.10.2",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
},
|
|
131
131
|
"keywords": [],
|
|
132
132
|
"khan": {
|
|
133
|
-
"catalogHash": "
|
|
133
|
+
"catalogHash": "82e5cf16c1a8479c"
|
|
134
134
|
},
|
|
135
135
|
"scripts": {}
|
|
136
136
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { PerseusRenderer, PerseusNumericInputAnswer } from "@khanacademy/perseus-core";
|
|
2
|
-
export declare function numericInputQuestionBuilder(): NumericInputQuestionBuilder;
|
|
3
|
-
declare class NumericInputQuestionBuilder {
|
|
4
|
-
private content;
|
|
5
|
-
private static;
|
|
6
|
-
private answers;
|
|
7
|
-
private size;
|
|
8
|
-
private coefficient;
|
|
9
|
-
build(): PerseusRenderer;
|
|
10
|
-
withAnswer(answerInfo: Partial<PerseusNumericInputAnswer>): NumericInputQuestionBuilder;
|
|
11
|
-
withContent(content: string): NumericInputQuestionBuilder;
|
|
12
|
-
withSize(size: "small" | "normal"): NumericInputQuestionBuilder;
|
|
13
|
-
}
|
|
14
|
-
export {};
|