@khanacademy/perseus 86.0.1 → 87.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/components/button-group.d.ts +0 -2
- package/dist/components/drag-and-drop/answer-tile/answer-tile.d.ts +88 -0
- package/dist/components/drag-and-drop/answer-tile/index.d.ts +2 -0
- package/dist/components/drag-and-drop/blank/blank-component.d.ts +41 -0
- package/dist/components/drag-and-drop/blank/index.d.ts +2 -0
- package/dist/components/drag-and-drop/choice-bank.d.ts +10 -3
- package/dist/components/drag-and-drop/dnd-action-menu/dnd-action-menu.d.ts +39 -0
- package/dist/components/drag-and-drop/dnd-action-menu/index.d.ts +2 -0
- package/dist/components/drag-and-drop/dnd-action-menu/merged-ref-opener.d.ts +21 -0
- package/dist/components/drag-and-drop/drag-ids.d.ts +23 -0
- package/dist/components/drag-and-drop/perseus-dnd-provider.d.ts +34 -0
- package/dist/components/drag-and-drop/temp-strings.d.ts +36 -0
- package/dist/components/drag-and-drop/tile-placements.d.ts +33 -0
- package/dist/components/drag-and-drop/use-tile-move-actions.d.ts +28 -0
- package/dist/es/index.css +1 -1
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +21 -16
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +23 -18
- package/dist/index.js.map +1 -1
- package/dist/widgets/categorizer/categorizer.d.ts +3 -5
- package/dist/widgets/dropdown/dropdown.d.ts +3 -4
- package/dist/widgets/graded-group/graded-group.d.ts +18 -37
- package/dist/widgets/graded-group-set/graded-group-set.d.ts +3 -6
- package/dist/widgets/matcher/matcher.d.ts +3 -4
- package/dist/widgets/number-line/number-line.d.ts +6 -4
- package/dist/widgets/python-program/python-program.d.ts +3 -4
- package/package.json +31 -30
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Widget, WidgetProps } from "../../types";
|
|
3
3
|
import type { PerseusCategorizerUserInput, PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
-
|
|
5
|
-
dependencies: PerseusDependenciesV2;
|
|
6
|
-
}
|
|
4
|
+
type Props = WidgetProps<PerseusCategorizerWidgetOptions, PerseusCategorizerUserInput>;
|
|
7
5
|
/**
|
|
8
6
|
* @deprecated and likely a very broken API
|
|
9
7
|
* [LEMS-3185] do not trust serializedState
|
|
@@ -18,7 +16,7 @@ declare function getStartUserInput(): PerseusCategorizerUserInput;
|
|
|
18
16
|
declare const _default: {
|
|
19
17
|
name: string;
|
|
20
18
|
displayName: string;
|
|
21
|
-
widget: React.ForwardRefExoticComponent<
|
|
19
|
+
widget: React.ForwardRefExoticComponent<Props & React.RefAttributes<Widget>>;
|
|
22
20
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
|
23
21
|
getCorrectUserInput: typeof getCorrectUserInput;
|
|
24
22
|
getStartUserInput: typeof getStartUserInput;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Widget, WidgetProps } from "../../types";
|
|
3
3
|
import type { PerseusDropdownUserInput, PerseusDropdownWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
+
type Props = WidgetProps<PerseusDropdownWidgetOptions, PerseusDropdownUserInput>;
|
|
4
5
|
/**
|
|
5
6
|
* @deprecated and likely a very broken API
|
|
6
7
|
* [LEMS-3185] do not trust serializedState
|
|
@@ -11,9 +12,7 @@ declare function getCorrectUserInput(options: PerseusDropdownWidgetOptions): Per
|
|
|
11
12
|
declare const _default: {
|
|
12
13
|
name: string;
|
|
13
14
|
displayName: string;
|
|
14
|
-
widget: React.ForwardRefExoticComponent<
|
|
15
|
-
dependencies: PerseusDependenciesV2;
|
|
16
|
-
} & React.RefAttributes<Widget>, "dependencies">, "ref"> & React.RefAttributes<any>>;
|
|
15
|
+
widget: React.ForwardRefExoticComponent<Props & React.RefAttributes<Widget>>;
|
|
17
16
|
getStartUserInput: typeof getStartUserInput;
|
|
18
17
|
getCorrectUserInput: typeof getCorrectUserInput;
|
|
19
18
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
|
@@ -1,47 +1,28 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import Renderer from "../../renderer";
|
|
4
|
-
import type { ANSWER_BAR_STATES } from "./graded-group-answer-bar";
|
|
5
|
-
import type { FocusPath, PerseusDependenciesV2, TrackingGradedGroupExtraArguments, Widget, WidgetProps } from "../../types";
|
|
2
|
+
import type { FocusPath, TrackingGradedGroupExtraArguments, WidgetProps } from "../../types";
|
|
6
3
|
import type { GradedGroupPromptJSON } from "../../widget-ai-utils/graded-group/graded-group-ai-utils";
|
|
7
|
-
import type { PerseusGradedGroupWidgetOptions
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
type Props = WidgetProps<PerseusGradedGroupWidgetOptions, Empty, TrackingGradedGroupExtraArguments> & {
|
|
15
|
-
inGradedGroupSet?: boolean;
|
|
16
|
-
onNextQuestion?: () => unknown;
|
|
17
|
-
dependencies: PerseusDependenciesV2;
|
|
18
|
-
};
|
|
19
|
-
type State = {
|
|
20
|
-
status: (typeof GRADING_STATUSES)[keyof typeof GRADING_STATUSES];
|
|
21
|
-
showHint: boolean;
|
|
22
|
-
message: string;
|
|
23
|
-
answerBarState: ANSWER_BAR_STATES;
|
|
24
|
-
};
|
|
25
|
-
export declare class GradedGroup extends React.Component<Props, State> implements Widget {
|
|
26
|
-
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
27
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
28
|
-
state: State;
|
|
29
|
-
rendererRef: React.RefObject<Renderer>;
|
|
30
|
-
hintRendererRef: React.RefObject<Renderer>;
|
|
31
|
-
componentDidMount(): void;
|
|
32
|
-
_handleUserInput(_userInput: UserInputMap, widgetsEmpty: boolean): void;
|
|
33
|
-
_checkAnswer: () => void;
|
|
34
|
-
getInputPaths: () => ReadonlyArray<FocusPath>;
|
|
4
|
+
import type { PerseusGradedGroupWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
/**
|
|
6
|
+
* Provides a more specific interface than Widget for GradedGroupSet to use.
|
|
7
|
+
*/
|
|
8
|
+
export interface GradedGroupHandle {
|
|
9
|
+
getInputPaths(): ReadonlyArray<FocusPath>;
|
|
35
10
|
getPromptJSON(): GradedGroupPromptJSON;
|
|
36
|
-
focus
|
|
37
|
-
focusInputPath
|
|
38
|
-
blurInputPath
|
|
39
|
-
render(): React.ReactNode;
|
|
11
|
+
focus(): boolean;
|
|
12
|
+
focusInputPath(path: FocusPath): void;
|
|
13
|
+
blurInputPath(path: FocusPath): void;
|
|
40
14
|
}
|
|
15
|
+
export declare const GradedGroup: React.ForwardRefExoticComponent<WidgetProps<PerseusGradedGroupWidgetOptions, Empty, TrackingGradedGroupExtraArguments> & {
|
|
16
|
+
inGradedGroupSet?: boolean;
|
|
17
|
+
onNextQuestion?: () => unknown;
|
|
18
|
+
} & React.RefAttributes<GradedGroupHandle>>;
|
|
41
19
|
declare const _default: {
|
|
42
20
|
name: string;
|
|
43
21
|
displayName: string;
|
|
44
|
-
widget: React.ForwardRefExoticComponent<
|
|
22
|
+
widget: React.ForwardRefExoticComponent<WidgetProps<PerseusGradedGroupWidgetOptions, Empty, TrackingGradedGroupExtraArguments> & {
|
|
23
|
+
inGradedGroupSet?: boolean;
|
|
24
|
+
onNextQuestion?: () => unknown;
|
|
25
|
+
} & React.RefAttributes<GradedGroupHandle>>;
|
|
45
26
|
hidden: false;
|
|
46
27
|
tracking: "all";
|
|
47
28
|
isLintable: true;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Widget, WidgetProps } from "../../types";
|
|
3
3
|
import type { PerseusGradedGroupSetWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
-
type Props = WidgetProps<PerseusGradedGroupSetWidgetOptions
|
|
5
|
-
trackInteraction: () => void;
|
|
6
|
-
dependencies: PerseusDependenciesV2;
|
|
7
|
-
};
|
|
4
|
+
type Props = WidgetProps<PerseusGradedGroupSetWidgetOptions>;
|
|
8
5
|
declare const _default: {
|
|
9
6
|
name: string;
|
|
10
7
|
displayName: string;
|
|
11
|
-
widget: React.ForwardRefExoticComponent<
|
|
8
|
+
widget: React.ForwardRefExoticComponent<Props & React.RefAttributes<Widget>>;
|
|
12
9
|
hidden: false;
|
|
13
10
|
tracking: "all";
|
|
14
11
|
isLintable: true;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { SortableOption } from "../../components/sortable";
|
|
3
|
-
import type { WidgetProps, Widget
|
|
3
|
+
import type { WidgetProps, Widget } from "../../types";
|
|
4
4
|
import type { PerseusMatcherWidgetOptions, PerseusMatcherUserInput, MatcherPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
type Props = WidgetProps<PerseusMatcherWidgetOptions, PerseusMatcherUserInput>;
|
|
5
6
|
/**
|
|
6
7
|
* The imperative API the Matcher widget exposes to its parent renderer. On top
|
|
7
8
|
* of the usual `Widget` methods, it can move a named option to a given index
|
|
@@ -21,9 +22,7 @@ declare const _default: {
|
|
|
21
22
|
name: string;
|
|
22
23
|
displayName: string;
|
|
23
24
|
hidden: true;
|
|
24
|
-
widget: React.ForwardRefExoticComponent<
|
|
25
|
-
dependencies: PerseusDependenciesV2;
|
|
26
|
-
} & React.RefAttributes<MatcherHandle>, "dependencies">, "ref"> & React.RefAttributes<any>>;
|
|
25
|
+
widget: React.ForwardRefExoticComponent<Props & React.RefAttributes<MatcherHandle>>;
|
|
27
26
|
isLintable: true;
|
|
28
27
|
getStartUserInput: typeof getStartUserInput;
|
|
29
28
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Widget, WidgetProps } from "../../types";
|
|
3
3
|
import type { NumberLinePublicWidgetOptions, PerseusNumberLineUserInput, PerseusNumberLineWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
+
/**
|
|
5
|
+
* The type of the props passed to the NumberLine widget.
|
|
6
|
+
*/
|
|
7
|
+
type Props = WidgetProps<PerseusNumberLineWidgetOptions, PerseusNumberLineUserInput>;
|
|
4
8
|
/**
|
|
5
9
|
* @deprecated and likely a very broken API
|
|
6
10
|
* [LEMS-3185] do not trust serializedState
|
|
@@ -11,9 +15,7 @@ declare function getStartUserInput(options: NumberLinePublicWidgetOptions): Pers
|
|
|
11
15
|
declare const _default: {
|
|
12
16
|
name: string;
|
|
13
17
|
displayName: string;
|
|
14
|
-
widget: React.ForwardRefExoticComponent<
|
|
15
|
-
dependencies: PerseusDependenciesV2;
|
|
16
|
-
} & React.RefAttributes<Widget>, "dependencies">, "ref"> & React.RefAttributes<any>>;
|
|
18
|
+
widget: React.ForwardRefExoticComponent<Props & React.RefAttributes<Widget>>;
|
|
17
19
|
getCorrectUserInput: typeof getCorrectUserInput;
|
|
18
20
|
getStartUserInput: typeof getStartUserInput;
|
|
19
21
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Widget, WidgetProps } from "../../types";
|
|
3
3
|
import type { PerseusPythonProgramWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
+
type Props = WidgetProps<PerseusPythonProgramWidgetOptions>;
|
|
4
5
|
type WidgetHandle = Pick<Widget, "getPromptJSON">;
|
|
5
6
|
declare const _default: {
|
|
6
7
|
name: string;
|
|
7
8
|
displayName: string;
|
|
8
|
-
widget: React.ForwardRefExoticComponent<
|
|
9
|
-
dependencies: PerseusDependenciesV2;
|
|
10
|
-
} & React.RefAttributes<WidgetHandle>, "dependencies">, "ref"> & React.RefAttributes<any>>;
|
|
9
|
+
widget: React.ForwardRefExoticComponent<Props & React.RefAttributes<WidgetHandle>>;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
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": "
|
|
6
|
+
"version": "87.1.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -37,46 +37,47 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@dnd-kit/dom": "^0.5.0",
|
|
40
41
|
"@dnd-kit/react": "^0.5.0",
|
|
41
42
|
"@use-gesture/react": "^10.2.27",
|
|
42
43
|
"gifuct-js": "^2.1.2",
|
|
44
|
+
"jquery": "^2.1.1",
|
|
43
45
|
"mafs": "0.19.0",
|
|
44
46
|
"tiny-invariant": "1.3.1",
|
|
45
47
|
"uuid": "^10.0.0",
|
|
46
|
-
"jquery": "^2.1.1",
|
|
47
48
|
"@khanacademy/kas": "2.2.6",
|
|
48
49
|
"@khanacademy/keypad-context": "3.2.89",
|
|
49
50
|
"@khanacademy/kmath": "2.4.48",
|
|
50
|
-
"@khanacademy/math-input": "27.0.
|
|
51
|
+
"@khanacademy/math-input": "27.0.12",
|
|
51
52
|
"@khanacademy/perseus-core": "38.1.1",
|
|
52
|
-
"@khanacademy/perseus-linter": "5.
|
|
53
|
+
"@khanacademy/perseus-linter": "5.3.0",
|
|
53
54
|
"@khanacademy/perseus-score": "8.12.21",
|
|
54
|
-
"@khanacademy/pure-markdown": "2.3.2",
|
|
55
55
|
"@khanacademy/simple-markdown": "3.0.1",
|
|
56
|
+
"@khanacademy/pure-markdown": "2.3.2",
|
|
56
57
|
"@khanacademy/perseus-utils": "2.1.5"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@khanacademy/wonder-blocks-announcer": "1.1.1",
|
|
60
|
-
"@khanacademy/wonder-blocks-banner": "5.1.
|
|
61
|
-
"@khanacademy/wonder-blocks-button": "11.7.
|
|
61
|
+
"@khanacademy/wonder-blocks-banner": "5.1.12",
|
|
62
|
+
"@khanacademy/wonder-blocks-button": "11.7.8",
|
|
62
63
|
"@khanacademy/wonder-blocks-clickable": "8.2.9",
|
|
63
64
|
"@khanacademy/wonder-blocks-core": "12.4.4",
|
|
64
65
|
"@khanacademy/wonder-blocks-data": "15.0.3",
|
|
65
|
-
"@khanacademy/wonder-blocks-dropdown": "10.12.
|
|
66
|
-
"@khanacademy/wonder-blocks-form": "7.6.
|
|
67
|
-
"@khanacademy/wonder-blocks-icon": "
|
|
68
|
-
"@khanacademy/wonder-blocks-icon-button": "11.4.
|
|
66
|
+
"@khanacademy/wonder-blocks-dropdown": "10.12.2",
|
|
67
|
+
"@khanacademy/wonder-blocks-form": "7.6.11",
|
|
68
|
+
"@khanacademy/wonder-blocks-icon": "6.0.0",
|
|
69
|
+
"@khanacademy/wonder-blocks-icon-button": "11.4.6",
|
|
69
70
|
"@khanacademy/wonder-blocks-labeled-field": "4.1.9",
|
|
70
71
|
"@khanacademy/wonder-blocks-layout": "3.1.60",
|
|
71
|
-
"@khanacademy/wonder-blocks-link": "10.3.
|
|
72
|
-
"@khanacademy/wonder-blocks-modal": "8.7.
|
|
73
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
74
|
-
"@khanacademy/wonder-blocks-popover": "6.3.
|
|
72
|
+
"@khanacademy/wonder-blocks-link": "10.3.10",
|
|
73
|
+
"@khanacademy/wonder-blocks-modal": "8.7.12",
|
|
74
|
+
"@khanacademy/wonder-blocks-pill": "3.1.74",
|
|
75
|
+
"@khanacademy/wonder-blocks-popover": "6.3.14",
|
|
75
76
|
"@khanacademy/wonder-blocks-progress-spinner": "3.1.60",
|
|
76
|
-
"@khanacademy/wonder-blocks-switch": "3.4.
|
|
77
|
+
"@khanacademy/wonder-blocks-switch": "3.4.10",
|
|
77
78
|
"@khanacademy/wonder-blocks-timing": "7.1.0",
|
|
78
79
|
"@khanacademy/wonder-blocks-tokens": "17.3.0",
|
|
79
|
-
"@khanacademy/wonder-blocks-tooltip": "4.2.
|
|
80
|
+
"@khanacademy/wonder-blocks-tooltip": "4.2.3",
|
|
80
81
|
"@khanacademy/wonder-blocks-typography": "5.0.3",
|
|
81
82
|
"@khanacademy/wonder-stuff-core": "3.0.0",
|
|
82
83
|
"@phosphor-icons/core": "2.0.2",
|
|
@@ -93,26 +94,26 @@
|
|
|
93
94
|
},
|
|
94
95
|
"peerDependencies": {
|
|
95
96
|
"@khanacademy/wonder-blocks-announcer": "^1.1.1",
|
|
96
|
-
"@khanacademy/wonder-blocks-banner": "^5.1.
|
|
97
|
-
"@khanacademy/wonder-blocks-button": "^11.7.
|
|
97
|
+
"@khanacademy/wonder-blocks-banner": "^5.1.12",
|
|
98
|
+
"@khanacademy/wonder-blocks-button": "^11.7.8",
|
|
98
99
|
"@khanacademy/wonder-blocks-clickable": "^8.2.9",
|
|
99
100
|
"@khanacademy/wonder-blocks-core": "^12.4.4",
|
|
100
101
|
"@khanacademy/wonder-blocks-data": "^15.0.3",
|
|
101
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.12.
|
|
102
|
-
"@khanacademy/wonder-blocks-form": "^7.6.
|
|
103
|
-
"@khanacademy/wonder-blocks-icon": "^
|
|
104
|
-
"@khanacademy/wonder-blocks-icon-button": "^11.4.
|
|
102
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.12.2",
|
|
103
|
+
"@khanacademy/wonder-blocks-form": "^7.6.11",
|
|
104
|
+
"@khanacademy/wonder-blocks-icon": "^6.0.0",
|
|
105
|
+
"@khanacademy/wonder-blocks-icon-button": "^11.4.6",
|
|
105
106
|
"@khanacademy/wonder-blocks-labeled-field": "^4.1.9",
|
|
106
107
|
"@khanacademy/wonder-blocks-layout": "^3.1.60",
|
|
107
|
-
"@khanacademy/wonder-blocks-link": "^10.3.
|
|
108
|
-
"@khanacademy/wonder-blocks-modal": "^8.7.
|
|
109
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
110
|
-
"@khanacademy/wonder-blocks-popover": "^6.3.
|
|
108
|
+
"@khanacademy/wonder-blocks-link": "^10.3.10",
|
|
109
|
+
"@khanacademy/wonder-blocks-modal": "^8.7.12",
|
|
110
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.74",
|
|
111
|
+
"@khanacademy/wonder-blocks-popover": "^6.3.14",
|
|
111
112
|
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.60",
|
|
112
|
-
"@khanacademy/wonder-blocks-switch": "^3.4.
|
|
113
|
+
"@khanacademy/wonder-blocks-switch": "^3.4.10",
|
|
113
114
|
"@khanacademy/wonder-blocks-timing": "^7.1.0",
|
|
114
115
|
"@khanacademy/wonder-blocks-tokens": "^17.3.0",
|
|
115
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.2.
|
|
116
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.2.3",
|
|
116
117
|
"@khanacademy/wonder-blocks-typography": "^5.0.3",
|
|
117
118
|
"@khanacademy/wonder-stuff-core": "^3.0.0",
|
|
118
119
|
"@phosphor-icons/core": "^2.0.2",
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
},
|
|
128
129
|
"keywords": [],
|
|
129
130
|
"khan": {
|
|
130
|
-
"catalogHash": "
|
|
131
|
+
"catalogHash": "4d0d17f2aff2db67"
|
|
131
132
|
},
|
|
132
133
|
"scripts": {}
|
|
133
134
|
}
|