@khanacademy/perseus 31.0.1 → 31.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.css +1 -1
- package/dist/es/index.js +123 -93
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +101 -63
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graphs/graphs/components/movable-point-view.d.ts +8 -4
- package/dist/widgets/interactive-graphs/graphs/components/movable-point.d.ts +2 -1
- package/dist/widgets/interactive-graphs/reducer/interactive-graph-action.d.ts +8 -1
- package/dist/widgets/phet-simulation.d.ts +2 -2
- package/package.json +45 -45
|
@@ -7,13 +7,17 @@ type Props = {
|
|
|
7
7
|
dragging: boolean;
|
|
8
8
|
focusBehavior: FocusBehaviorConfig;
|
|
9
9
|
cursor?: CSSCursor | undefined;
|
|
10
|
+
onClick?: () => unknown;
|
|
10
11
|
};
|
|
11
|
-
type FocusBehaviorConfig =
|
|
12
|
-
|
|
13
|
-
tabIndex: number;
|
|
14
|
-
} | {
|
|
12
|
+
type FocusBehaviorConfig = ControlledFocusBehavior | UncontrolledFocusBehavior;
|
|
13
|
+
type ControlledFocusBehavior = {
|
|
15
14
|
type: "controlled";
|
|
16
15
|
showFocusRing: boolean;
|
|
17
16
|
};
|
|
17
|
+
type UncontrolledFocusBehavior = {
|
|
18
|
+
type: "uncontrolled";
|
|
19
|
+
tabIndex: number;
|
|
20
|
+
onFocusChange: (isFocused: boolean) => unknown;
|
|
21
|
+
};
|
|
18
22
|
export declare const MovablePointView: React.ForwardRefExoticComponent<Props & React.RefAttributes<SVGGElement>>;
|
|
19
23
|
export {};
|
|
@@ -4,10 +4,11 @@ import type { KeyboardMovementConstraint } from "../use-draggable";
|
|
|
4
4
|
import type { vec } from "mafs";
|
|
5
5
|
type Props = {
|
|
6
6
|
point: vec.Vector2;
|
|
7
|
-
onMove
|
|
7
|
+
onMove?: (newPoint: vec.Vector2) => unknown;
|
|
8
8
|
color?: string;
|
|
9
9
|
cursor?: CSSCursor | undefined;
|
|
10
10
|
constrain?: KeyboardMovementConstraint;
|
|
11
|
+
onFocusChange?: (isFocused: boolean) => unknown;
|
|
11
12
|
};
|
|
12
13
|
export declare const MovablePoint: (props: Props) => React.JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InitializeGraphStateParams } from "./initialize-graph-state";
|
|
2
2
|
import type { Interval, vec } from "mafs";
|
|
3
|
-
export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint;
|
|
3
|
+
export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint | RemovePoint;
|
|
4
4
|
export declare const actions: {
|
|
5
5
|
angle: {
|
|
6
6
|
movePoint: typeof movePoint;
|
|
@@ -20,6 +20,7 @@ export declare const actions: {
|
|
|
20
20
|
pointGraph: {
|
|
21
21
|
movePoint: typeof movePoint;
|
|
22
22
|
addPoint: typeof addPoint;
|
|
23
|
+
removePoint: typeof removePoint;
|
|
23
24
|
};
|
|
24
25
|
polygon: {
|
|
25
26
|
movePoint: typeof movePoint;
|
|
@@ -53,6 +54,12 @@ export interface AddPoint {
|
|
|
53
54
|
location: vec.Vector2;
|
|
54
55
|
}
|
|
55
56
|
declare function addPoint(location: vec.Vector2): AddPoint;
|
|
57
|
+
export declare const REMOVE_POINT = "remove-point";
|
|
58
|
+
export interface RemovePoint {
|
|
59
|
+
type: typeof REMOVE_POINT;
|
|
60
|
+
index: number;
|
|
61
|
+
}
|
|
62
|
+
declare function removePoint(index: number): RemovePoint;
|
|
56
63
|
export declare const MOVE_ALL = "move-all";
|
|
57
64
|
export interface MoveAll {
|
|
58
65
|
type: typeof MOVE_ALL;
|
|
@@ -26,16 +26,16 @@ export declare class PhetSimulation extends React.Component<Props, State> {
|
|
|
26
26
|
private readonly locale;
|
|
27
27
|
state: State;
|
|
28
28
|
constructor(props: any);
|
|
29
|
-
getUserInput(): UserInput;
|
|
30
29
|
componentDidMount(): Promise<void>;
|
|
31
30
|
componentDidUpdate(prevProps: any): Promise<void>;
|
|
32
|
-
|
|
31
|
+
getUserInput(): UserInput;
|
|
33
32
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
34
33
|
simpleValidate: (arg1: any) => any;
|
|
35
34
|
getPhetCompatibleLocale: (arg1: string) => string;
|
|
36
35
|
displayLoadFailure: () => void;
|
|
37
36
|
updateSimState(urlString: string): Promise<void>;
|
|
38
37
|
showLocaleWarning(url: URL): Promise<boolean>;
|
|
38
|
+
render(): React.ReactNode;
|
|
39
39
|
}
|
|
40
40
|
export declare const makeSafeUrl: (urlString: string, locale: string) => URL | null;
|
|
41
41
|
declare const _default: Readonly<{
|
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": "31.0
|
|
6
|
+
"version": "31.1.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -41,36 +41,36 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@khanacademy/kas": "^0.3.12",
|
|
44
|
+
"@khanacademy/keypad-context": "^1.0.1",
|
|
44
45
|
"@khanacademy/kmath": "^0.1.13",
|
|
45
|
-
"@khanacademy/
|
|
46
|
-
"@khanacademy/math-input": "^21.0.1",
|
|
46
|
+
"@khanacademy/math-input": "^21.0.2",
|
|
47
47
|
"@khanacademy/perseus-core": "1.5.0",
|
|
48
48
|
"@khanacademy/perseus-linter": "^1.2.0",
|
|
49
|
-
"@khanacademy/pure-markdown": "^0.3.
|
|
50
|
-
"@khanacademy/simple-markdown": "^0.13.
|
|
49
|
+
"@khanacademy/pure-markdown": "^0.3.8",
|
|
50
|
+
"@khanacademy/simple-markdown": "^0.13.1",
|
|
51
51
|
"@use-gesture/react": "^10.2.27",
|
|
52
52
|
"mafs": "0.19.0",
|
|
53
53
|
"uuid": "^10.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@khanacademy/wonder-blocks-banner": "3.
|
|
57
|
-
"@khanacademy/wonder-blocks-button": "6.3.
|
|
58
|
-
"@khanacademy/wonder-blocks-clickable": "4.2.
|
|
59
|
-
"@khanacademy/wonder-blocks-core": "6.4.
|
|
60
|
-
"@khanacademy/wonder-blocks-data": "13.0.
|
|
61
|
-
"@khanacademy/wonder-blocks-dropdown": "5.
|
|
62
|
-
"@khanacademy/wonder-blocks-form": "
|
|
63
|
-
"@khanacademy/wonder-blocks-icon": "4.1.
|
|
64
|
-
"@khanacademy/wonder-blocks-icon-button": "5.
|
|
65
|
-
"@khanacademy/wonder-blocks-layout": "2.
|
|
66
|
-
"@khanacademy/wonder-blocks-link": "6.1.
|
|
67
|
-
"@khanacademy/wonder-blocks-pill": "2.
|
|
68
|
-
"@khanacademy/wonder-blocks-popover": "3.2.
|
|
69
|
-
"@khanacademy/wonder-blocks-progress-spinner": "2.1.
|
|
70
|
-
"@khanacademy/wonder-blocks-switch": "1.1.
|
|
71
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
72
|
-
"@khanacademy/wonder-blocks-tooltip": "2.
|
|
73
|
-
"@khanacademy/wonder-blocks-typography": "2.1.
|
|
56
|
+
"@khanacademy/wonder-blocks-banner": "3.1.7",
|
|
57
|
+
"@khanacademy/wonder-blocks-button": "6.3.8",
|
|
58
|
+
"@khanacademy/wonder-blocks-clickable": "4.2.6",
|
|
59
|
+
"@khanacademy/wonder-blocks-core": "6.4.3",
|
|
60
|
+
"@khanacademy/wonder-blocks-data": "13.0.10",
|
|
61
|
+
"@khanacademy/wonder-blocks-dropdown": "5.4.5",
|
|
62
|
+
"@khanacademy/wonder-blocks-form": "4.9.0",
|
|
63
|
+
"@khanacademy/wonder-blocks-icon": "4.1.3",
|
|
64
|
+
"@khanacademy/wonder-blocks-icon-button": "5.3.4",
|
|
65
|
+
"@khanacademy/wonder-blocks-layout": "2.1.3",
|
|
66
|
+
"@khanacademy/wonder-blocks-link": "6.1.6",
|
|
67
|
+
"@khanacademy/wonder-blocks-pill": "2.4.5",
|
|
68
|
+
"@khanacademy/wonder-blocks-popover": "3.2.13",
|
|
69
|
+
"@khanacademy/wonder-blocks-progress-spinner": "2.1.5",
|
|
70
|
+
"@khanacademy/wonder-blocks-switch": "1.1.20",
|
|
71
|
+
"@khanacademy/wonder-blocks-tokens": "2.0.0",
|
|
72
|
+
"@khanacademy/wonder-blocks-tooltip": "2.4.0",
|
|
73
|
+
"@khanacademy/wonder-blocks-typography": "2.1.14",
|
|
74
74
|
"@khanacademy/wonder-stuff-core": "1.5.2",
|
|
75
75
|
"@phosphor-icons/core": "^2.0.2",
|
|
76
76
|
"@popperjs/core": "^2.10.2",
|
|
@@ -82,30 +82,30 @@
|
|
|
82
82
|
"lodash.debounce": "^4.0.8",
|
|
83
83
|
"perseus-build-settings": "^0.4.1",
|
|
84
84
|
"prop-types": "15.6.1",
|
|
85
|
-
"react": "
|
|
86
|
-
"react-dom": "
|
|
85
|
+
"react": "^18.2.0",
|
|
86
|
+
"react-dom": "^18.2.0",
|
|
87
87
|
"react-popper": "^2.2.5",
|
|
88
88
|
"underscore": "^1.4.4"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@khanacademy/wonder-blocks-banner": "3.
|
|
92
|
-
"@khanacademy/wonder-blocks-button": "6.3.
|
|
93
|
-
"@khanacademy/wonder-blocks-clickable": "4.2.
|
|
94
|
-
"@khanacademy/wonder-blocks-core": "6.4.
|
|
95
|
-
"@khanacademy/wonder-blocks-data": "13.0.
|
|
96
|
-
"@khanacademy/wonder-blocks-dropdown": "5.
|
|
97
|
-
"@khanacademy/wonder-blocks-form": "
|
|
98
|
-
"@khanacademy/wonder-blocks-icon": "4.1.
|
|
99
|
-
"@khanacademy/wonder-blocks-icon-button": "5.
|
|
100
|
-
"@khanacademy/wonder-blocks-layout": "2.
|
|
101
|
-
"@khanacademy/wonder-blocks-link": "6.1.
|
|
102
|
-
"@khanacademy/wonder-blocks-pill": "2.
|
|
103
|
-
"@khanacademy/wonder-blocks-popover": "3.2.
|
|
104
|
-
"@khanacademy/wonder-blocks-progress-spinner": "2.1.
|
|
105
|
-
"@khanacademy/wonder-blocks-switch": "1.1.
|
|
106
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
107
|
-
"@khanacademy/wonder-blocks-tooltip": "2.
|
|
108
|
-
"@khanacademy/wonder-blocks-typography": "2.1.
|
|
91
|
+
"@khanacademy/wonder-blocks-banner": "3.1.7",
|
|
92
|
+
"@khanacademy/wonder-blocks-button": "6.3.8",
|
|
93
|
+
"@khanacademy/wonder-blocks-clickable": "4.2.6",
|
|
94
|
+
"@khanacademy/wonder-blocks-core": "6.4.3",
|
|
95
|
+
"@khanacademy/wonder-blocks-data": "13.0.10",
|
|
96
|
+
"@khanacademy/wonder-blocks-dropdown": "5.4.5",
|
|
97
|
+
"@khanacademy/wonder-blocks-form": "4.9.0",
|
|
98
|
+
"@khanacademy/wonder-blocks-icon": "4.1.3",
|
|
99
|
+
"@khanacademy/wonder-blocks-icon-button": "5.3.4",
|
|
100
|
+
"@khanacademy/wonder-blocks-layout": "2.1.3",
|
|
101
|
+
"@khanacademy/wonder-blocks-link": "6.1.6",
|
|
102
|
+
"@khanacademy/wonder-blocks-pill": "2.4.5",
|
|
103
|
+
"@khanacademy/wonder-blocks-popover": "3.2.13",
|
|
104
|
+
"@khanacademy/wonder-blocks-progress-spinner": "2.1.5",
|
|
105
|
+
"@khanacademy/wonder-blocks-switch": "1.1.20",
|
|
106
|
+
"@khanacademy/wonder-blocks-tokens": "2.0.0",
|
|
107
|
+
"@khanacademy/wonder-blocks-tooltip": "2.4.0",
|
|
108
|
+
"@khanacademy/wonder-blocks-typography": "2.1.14",
|
|
109
109
|
"@khanacademy/wonder-stuff-core": "1.5.2",
|
|
110
110
|
"@phosphor-icons/core": "^2.0.2",
|
|
111
111
|
"@popperjs/core": "^2.10.2",
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
"jquery": "^2.1.1",
|
|
117
117
|
"lodash.debounce": "^4.0.8",
|
|
118
118
|
"prop-types": "15.6.1",
|
|
119
|
-
"react": "
|
|
120
|
-
"react-dom": "
|
|
119
|
+
"react": "^18.2.0",
|
|
120
|
+
"react-dom": "^18.2.0",
|
|
121
121
|
"react-popper": "^2.2.5",
|
|
122
122
|
"underscore": "^1.4.4"
|
|
123
123
|
},
|