@khanacademy/perseus 30.0.0 → 31.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/article-renderer.d.ts +2 -5
- package/dist/es/index.js +4286 -500
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +12 -2
- package/dist/es/strings.js.map +1 -1
- package/dist/hint-renderer.d.ts +2 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4213 -420
- package/dist/index.js.map +1 -1
- package/dist/perseus-api.d.ts +2 -0
- package/dist/perseus-types.d.ts +17 -3
- package/dist/server-item-renderer.d.ts +5 -6
- package/dist/strings.d.ts +5 -0
- package/dist/strings.js +12 -2
- package/dist/strings.js.map +1 -1
- package/dist/types.d.ts +6 -2
- package/dist/util/widget-enum-utils.d.ts +1 -1
- package/dist/widgets/expression.d.ts +12 -0
- package/dist/widgets/interactive-graphs/graph-locked-labels-layer.d.ts +7 -0
- package/dist/widgets/interactive-graphs/graphs/point.d.ts +2 -0
- package/dist/widgets/interactive-graphs/graphs/use-transform.d.ts +2 -0
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +4 -0
- package/dist/widgets/interactive-graphs/locked-figures/locked-label.d.ts +3 -0
- package/dist/widgets/interactive-graphs/mafs-graph.d.ts +1 -0
- package/dist/widgets/interactive-graphs/mafs-supported-graph-types.d.ts +1 -1
- package/dist/widgets/interactive-graphs/reducer/interactive-graph-action.d.ts +8 -1
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +1 -0
- package/dist/widgets/interactive-graphs/types.d.ts +1 -0
- package/dist/widgets/label-image.d.ts +4 -0
- package/dist/widgets/phet-sim.d.ts +61 -0
- package/package.json +5 -4
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a PhET simulation widget. It is used for rendering simulations
|
|
3
|
+
* from https://phet.colorado.edu/.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { PerseusI18nContext } from "../components/i18n-context";
|
|
7
|
+
import type { PerseusPhetSimWidgetOptions } from "../perseus-types";
|
|
8
|
+
import type { WidgetProps } from "../types";
|
|
9
|
+
type RenderProps = PerseusPhetSimWidgetOptions;
|
|
10
|
+
type Props = WidgetProps<RenderProps, PerseusPhetSimWidgetOptions>;
|
|
11
|
+
type UserInput = null;
|
|
12
|
+
type State = {
|
|
13
|
+
banner: {
|
|
14
|
+
message: string;
|
|
15
|
+
kind: "warning" | "critical";
|
|
16
|
+
} | null;
|
|
17
|
+
url: URL | null;
|
|
18
|
+
};
|
|
19
|
+
export declare class PhetSim extends React.Component<Props, State> {
|
|
20
|
+
static contextType: React.Context<{
|
|
21
|
+
strings: import("../strings").PerseusStrings;
|
|
22
|
+
locale: string;
|
|
23
|
+
}>;
|
|
24
|
+
context: React.ContextType<typeof PerseusI18nContext>;
|
|
25
|
+
private readonly iframeRef;
|
|
26
|
+
private readonly locale;
|
|
27
|
+
state: State;
|
|
28
|
+
constructor(props: any);
|
|
29
|
+
getUserInput(): UserInput;
|
|
30
|
+
componentDidMount(): Promise<void>;
|
|
31
|
+
componentDidUpdate(prevProps: any): Promise<void>;
|
|
32
|
+
render(): React.ReactNode;
|
|
33
|
+
change: (...args: ReadonlyArray<unknown>) => any;
|
|
34
|
+
simpleValidate: (arg1: any) => any;
|
|
35
|
+
getPhetCompatibleLocale: (arg1: string) => string;
|
|
36
|
+
displayLoadFailure: () => void;
|
|
37
|
+
updateSimState(urlString: string): Promise<void>;
|
|
38
|
+
showLocaleWarning(url: URL): Promise<boolean>;
|
|
39
|
+
}
|
|
40
|
+
export declare const makeSafeUrl: (urlString: string, locale: string) => URL | null;
|
|
41
|
+
declare const _default: Readonly<{
|
|
42
|
+
name: string;
|
|
43
|
+
displayName: string;
|
|
44
|
+
getWidget?: (() => typeof PhetSim) | undefined;
|
|
45
|
+
widget: typeof PhetSim;
|
|
46
|
+
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
47
|
+
hidden?: boolean | undefined;
|
|
48
|
+
version?: import("../types").Version | undefined;
|
|
49
|
+
supportedAlignments?: readonly import("../types").Alignment[] | undefined;
|
|
50
|
+
defaultAlignment?: import("../types").Alignment | undefined;
|
|
51
|
+
getDefaultAlignment?: (() => import("../types").Alignment) | undefined;
|
|
52
|
+
isLintable?: boolean | undefined;
|
|
53
|
+
tracking?: import("../types").Tracking | undefined;
|
|
54
|
+
traverseChildWidgets?: any;
|
|
55
|
+
transform?: import("../types").WidgetTransform | undefined;
|
|
56
|
+
staticTransform?: import("../types").WidgetTransform | undefined;
|
|
57
|
+
propUpgrades?: {
|
|
58
|
+
[key: string]: (arg1: any) => any;
|
|
59
|
+
} | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
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": "31.0.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@khanacademy/kas": "^0.3.
|
|
43
|
+
"@khanacademy/kas": "^0.3.12",
|
|
44
44
|
"@khanacademy/kmath": "^0.1.13",
|
|
45
45
|
"@khanacademy/keypad-context": "^1.0.0",
|
|
46
|
-
"@khanacademy/math-input": "^21.0.
|
|
46
|
+
"@khanacademy/math-input": "^21.0.1",
|
|
47
47
|
"@khanacademy/perseus-core": "1.5.0",
|
|
48
|
-
"@khanacademy/perseus-linter": "^1.
|
|
48
|
+
"@khanacademy/perseus-linter": "^1.2.0",
|
|
49
49
|
"@khanacademy/pure-markdown": "^0.3.7",
|
|
50
50
|
"@khanacademy/simple-markdown": "^0.13.0",
|
|
51
51
|
"@use-gesture/react": "^10.2.27",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"@khanacademy/wonder-blocks-dropdown": "5.3.0",
|
|
62
62
|
"@khanacademy/wonder-blocks-form": "^4.7.1",
|
|
63
63
|
"@khanacademy/wonder-blocks-icon": "4.1.0",
|
|
64
|
+
"@khanacademy/wonder-blocks-icon-button": "5.2.1",
|
|
64
65
|
"@khanacademy/wonder-blocks-layout": "2.0.32",
|
|
65
66
|
"@khanacademy/wonder-blocks-link": "6.1.1",
|
|
66
67
|
"@khanacademy/wonder-blocks-pill": "2.2.1",
|