@khanacademy/perseus 54.0.0 → 54.1.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 +20 -83
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +21 -85
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/util.d.ts +0 -5
- package/dist/widgets/categorizer/categorizer.d.ts +1 -1
- package/dist/widgets/expression/expression.d.ts +0 -2
- package/dist/widgets/radio/radio.d.ts +1 -1
- package/dist/widgets/sorter/sorter.d.ts +1 -1
- package/package.json +10 -10
package/dist/types.d.ts
CHANGED
|
@@ -108,6 +108,9 @@ type TrackInteractionArgs = {
|
|
|
108
108
|
export type APIOptions = Readonly<{
|
|
109
109
|
isArticle?: boolean;
|
|
110
110
|
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
111
|
+
/**
|
|
112
|
+
* @deprecated - metadata is no longer used by the Group widget
|
|
113
|
+
*/
|
|
111
114
|
GroupMetadataEditor?: React.ComponentType<StubTagEditorType>;
|
|
112
115
|
showAlignmentOptions?: boolean;
|
|
113
116
|
/**
|
|
@@ -315,7 +318,6 @@ export interface PerseusDependenciesV2 {
|
|
|
315
318
|
* widget.
|
|
316
319
|
*/
|
|
317
320
|
export type APIOptionsWithDefaults = Readonly<APIOptions & {
|
|
318
|
-
GroupMetadataEditor: NonNullable<APIOptions["GroupMetadataEditor"]>;
|
|
319
321
|
baseElements: NonNullable<APIOptions["baseElements"]>;
|
|
320
322
|
canScrollPage: NonNullable<APIOptions["canScrollPage"]>;
|
|
321
323
|
crossOutEnabled: NonNullable<APIOptions["crossOutEnabled"]>;
|
package/dist/util.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ type WordAndPosition = {
|
|
|
10
10
|
string: string;
|
|
11
11
|
pos: WordPosition;
|
|
12
12
|
};
|
|
13
|
-
type RNG = () => number;
|
|
14
13
|
export type ParsedValue = {
|
|
15
14
|
value: number;
|
|
16
15
|
exact: boolean;
|
|
@@ -37,7 +36,6 @@ type TouchHandlers = {
|
|
|
37
36
|
* arrays of strings.
|
|
38
37
|
*/
|
|
39
38
|
declare function inputPathsEqual(a?: ReadonlyArray<string> | null, b?: ReadonlyArray<string> | null): boolean;
|
|
40
|
-
declare function shuffle<T>(array: ReadonlyArray<T>, randomSeed: number | RNG, ensurePermuted?: boolean): ReadonlyArray<T>;
|
|
41
39
|
/**
|
|
42
40
|
* Return the first valid interpretation of 'text' as a number, in the form
|
|
43
41
|
* {value: 2.3, exact: true}.
|
|
@@ -166,8 +164,6 @@ declare const Util: {
|
|
|
166
164
|
readonly rTypeFromWidgetId: RegExp;
|
|
167
165
|
readonly rWidgetParts: RegExp;
|
|
168
166
|
readonly snowman: "☃";
|
|
169
|
-
readonly seededRNG: (seed: number) => RNG;
|
|
170
|
-
readonly shuffle: typeof shuffle;
|
|
171
167
|
readonly split: (str: string, r: RegExp) => ReadonlyArray<string>;
|
|
172
168
|
readonly firstNumericalParse: typeof firstNumericalParse;
|
|
173
169
|
readonly stringArrayOfSize: typeof stringArrayOfSize;
|
|
@@ -199,6 +195,5 @@ declare const Util: {
|
|
|
199
195
|
readonly moveCursor: typeof moveCursor;
|
|
200
196
|
};
|
|
201
197
|
readonly unescapeMathMode: (label: string) => string;
|
|
202
|
-
readonly random: RNG;
|
|
203
198
|
};
|
|
204
199
|
export default Util;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
3
|
import type { Widget, WidgetProps } from "../../types";
|
|
5
4
|
import type { CategorizerPromptJSON } from "../../widget-ai-utils/categorizer/categorizer-ai-utils";
|
|
5
|
+
import type { PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
6
|
import type { PerseusCategorizerRubric, PerseusCategorizerUserInput } from "@khanacademy/perseus-score";
|
|
7
7
|
type Props = WidgetProps<RenderProps, PerseusCategorizerRubric> & {
|
|
8
8
|
values: ReadonlyArray<string>;
|
|
@@ -128,7 +128,6 @@ declare const _default: {
|
|
|
128
128
|
editorChangeDelay?: number;
|
|
129
129
|
onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
|
|
130
130
|
}> & {
|
|
131
|
-
GroupMetadataEditor: NonNullable<import("../..").APIOptions["GroupMetadataEditor"]>;
|
|
132
131
|
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
133
132
|
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
134
133
|
crossOutEnabled: NonNullable<import("../..").APIOptions["crossOutEnabled"]>;
|
|
@@ -201,7 +200,6 @@ declare const _default: {
|
|
|
201
200
|
editorChangeDelay?: number;
|
|
202
201
|
onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
|
|
203
202
|
}> & {
|
|
204
|
-
GroupMetadataEditor: NonNullable<import("../..").APIOptions["GroupMetadataEditor"]>;
|
|
205
203
|
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
206
204
|
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
207
205
|
crossOutEnabled: NonNullable<import("../..").APIOptions["crossOutEnabled"]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
1
|
import Radio from "./radio-component";
|
|
3
2
|
import type { RenderProps } from "./radio-component";
|
|
4
3
|
import type { PerseusStrings } from "../../strings";
|
|
4
|
+
import type { PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
5
|
declare const _default: {
|
|
6
6
|
name: string;
|
|
7
7
|
displayName: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type PerseusSorterWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import type { SortableOption } from "../../components/sortable";
|
|
4
3
|
import type { Widget, WidgetProps } from "../../types";
|
|
5
4
|
import type { SorterPromptJSON } from "../../widget-ai-utils/sorter/sorter-ai-utils";
|
|
5
|
+
import type { PerseusSorterWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
6
|
import type { PerseusSorterRubric, PerseusSorterUserInput } from "@khanacademy/perseus-score";
|
|
7
7
|
type RenderProps = PerseusSorterWidgetOptions;
|
|
8
8
|
type Props = WidgetProps<RenderProps, PerseusSorterRubric>;
|
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": "54.
|
|
6
|
+
"version": "54.1.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@khanacademy/kas": "^0.4.
|
|
45
|
-
"@khanacademy/keypad-context": "^1.0.
|
|
46
|
-
"@khanacademy/kmath": "^0.3.
|
|
47
|
-
"@khanacademy/math-input": "^22.2.
|
|
48
|
-
"@khanacademy/perseus-core": "3.
|
|
49
|
-
"@khanacademy/perseus-linter": "^1.2.
|
|
50
|
-
"@khanacademy/perseus-score": "^2.2.
|
|
51
|
-
"@khanacademy/pure-markdown": "^0.3.
|
|
52
|
-
"@khanacademy/simple-markdown": "^0.13.
|
|
44
|
+
"@khanacademy/kas": "^0.4.16",
|
|
45
|
+
"@khanacademy/keypad-context": "^1.0.19",
|
|
46
|
+
"@khanacademy/kmath": "^0.3.5",
|
|
47
|
+
"@khanacademy/math-input": "^22.2.6",
|
|
48
|
+
"@khanacademy/perseus-core": "3.7.0",
|
|
49
|
+
"@khanacademy/perseus-linter": "^1.2.18",
|
|
50
|
+
"@khanacademy/perseus-score": "^2.2.2",
|
|
51
|
+
"@khanacademy/pure-markdown": "^0.3.27",
|
|
52
|
+
"@khanacademy/simple-markdown": "^0.13.20",
|
|
53
53
|
"@types/classnames": "2.2.0",
|
|
54
54
|
"@use-gesture/react": "^10.2.27",
|
|
55
55
|
"mafs": "0.19.0",
|