@khanacademy/perseus 31.0.0 → 31.0.1
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 +437 -3840
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +353 -3755
- package/dist/index.js.map +1 -1
- package/dist/perseus-types.d.ts +5 -5
- package/dist/util/widget-enum-utils.d.ts +1 -1
- package/dist/widgets/{phet-sim.d.ts → phet-simulation.d.ts} +6 -6
- package/package.json +2 -1
package/dist/perseus-types.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export type PerseusWidgetsMap = {
|
|
|
61
61
|
} & {
|
|
62
62
|
[key in `passage-ref-target ${number}`]: PassageRefWidget;
|
|
63
63
|
} & {
|
|
64
|
-
[key in `phet-
|
|
64
|
+
[key in `phet-simulation ${number}`]: PhetSimulationWidget;
|
|
65
65
|
} & {
|
|
66
66
|
[key in `plotter ${number}`]: PlotterWidget;
|
|
67
67
|
} & {
|
|
@@ -158,7 +158,7 @@ export type NumericInputWidget = Widget<'numeric-input', PerseusNumericInputWidg
|
|
|
158
158
|
export type OrdererWidget = Widget<'orderer', PerseusOrdererWidgetOptions>;
|
|
159
159
|
export type PassageRefWidget = Widget<'passage-ref', PerseusPassageRefWidgetOptions>;
|
|
160
160
|
export type PassageWidget = Widget<'passage', PerseusPassageWidgetOptions>;
|
|
161
|
-
export type
|
|
161
|
+
export type PhetSimulationWidget = Widget<'phet-simulation', PerseusPhetSimulationWidgetOptions>;
|
|
162
162
|
export type PlotterWidget = Widget<'plotter', PerseusPlotterWidgetOptions>;
|
|
163
163
|
export type PythonProgramWidget = Widget<'python-program', PerseusPythonProgramWidgetOptions>;
|
|
164
164
|
export type RadioWidget = Widget<'radio', PerseusRadioWidgetOptions>;
|
|
@@ -172,7 +172,7 @@ export type RefTargetWidget = Widget<'passage-ref-target', PerseusPassageRefTarg
|
|
|
172
172
|
export type SimpleMarkdownTesterWidget = Widget<'simple-markdown-tester', PerseusSimpleMarkdownTesterWidgetOptions>;
|
|
173
173
|
export type VideoWidget = Widget<'video', PerseusVideoWidgetOptions>;
|
|
174
174
|
export type AutoCorrectWidget = Widget<'deprecated-standin', PerseusWidgetOptions>;
|
|
175
|
-
export type PerseusWidget = CategorizerWidget | CSProgramWidget | DefinitionWidget | DropdownWidget | ExampleGraphieWidget | ExampleWidget | ExplanationWidget | ExpressionWidget | GradedGroupSetWidget | GradedGroupWidget | GrapherWidget | GroupWidget | IFrameWidget | ImageWidget | InputNumberWidget | InteractionWidget | InteractiveGraphWidget | LabelImageWidget | MatcherWidget | MatrixWidget | MeasurerWidget | MoleculeRendererWidget | NumberLineWidget | NumericInputWidget | OrdererWidget | PassageRefWidget | PassageWidget |
|
|
175
|
+
export type PerseusWidget = CategorizerWidget | CSProgramWidget | DefinitionWidget | DropdownWidget | ExampleGraphieWidget | ExampleWidget | ExplanationWidget | ExpressionWidget | GradedGroupSetWidget | GradedGroupWidget | GrapherWidget | GroupWidget | IFrameWidget | ImageWidget | InputNumberWidget | InteractionWidget | InteractiveGraphWidget | LabelImageWidget | MatcherWidget | MatrixWidget | MeasurerWidget | MoleculeRendererWidget | NumberLineWidget | NumericInputWidget | OrdererWidget | PassageRefWidget | PassageWidget | PhetSimulationWidget | PlotterWidget | PythonProgramWidget | RadioWidget | RefTargetWidget | SimpleMarkdownTesterWidget | SorterWidget | TableWidget | VideoWidget | AutoCorrectWidget;
|
|
176
176
|
export type PerseusImageBackground = {
|
|
177
177
|
url: string | null | undefined;
|
|
178
178
|
width?: number;
|
|
@@ -864,7 +864,7 @@ export type PerseusIFrameWidgetOptions = {
|
|
|
864
864
|
allowTopNavigation?: boolean;
|
|
865
865
|
static: boolean;
|
|
866
866
|
};
|
|
867
|
-
export type
|
|
867
|
+
export type PerseusPhetSimulationWidgetOptions = {
|
|
868
868
|
url: string;
|
|
869
869
|
description: string;
|
|
870
870
|
};
|
|
@@ -896,5 +896,5 @@ export type PerseusSimpleMarkdownTesterWidgetOptions = {
|
|
|
896
896
|
export type PerseusUnitInputWidgetOptions = {
|
|
897
897
|
value: string;
|
|
898
898
|
};
|
|
899
|
-
export type PerseusWidgetOptions = PerseusCategorizerWidgetOptions | PerseusCSProgramWidgetOptions | PerseusDefinitionWidgetOptions | PerseusDropdownWidgetOptions | PerseusExampleGraphieWidgetOptions | PerseusExampleWidgetOptions | PerseusExplanationWidgetOptions | PerseusExpressionWidgetOptions | PerseusGradedGroupSetWidgetOptions | PerseusGradedGroupWidgetOptions | PerseusIFrameWidgetOptions | PerseusImageWidgetOptions | PerseusInputNumberWidgetOptions | PerseusInteractionWidgetOptions | PerseusInteractiveGraphWidgetOptions | PerseusLabelImageWidgetOptions | PerseusMatcherWidgetOptions | PerseusMatrixWidgetOptions | PerseusMeasurerWidgetOptions | PerseusMoleculeRendererWidgetOptions | PerseusNumberLineWidgetOptions | PerseusNumericInputWidgetOptions | PerseusOrdererWidgetOptions | PerseusPassageRefTargetWidgetOptions | PerseusPassageRefWidgetOptions | PerseusPassageWidgetOptions |
|
|
899
|
+
export type PerseusWidgetOptions = PerseusCategorizerWidgetOptions | PerseusCSProgramWidgetOptions | PerseusDefinitionWidgetOptions | PerseusDropdownWidgetOptions | PerseusExampleGraphieWidgetOptions | PerseusExampleWidgetOptions | PerseusExplanationWidgetOptions | PerseusExpressionWidgetOptions | PerseusGradedGroupSetWidgetOptions | PerseusGradedGroupWidgetOptions | PerseusIFrameWidgetOptions | PerseusImageWidgetOptions | PerseusInputNumberWidgetOptions | PerseusInteractionWidgetOptions | PerseusInteractiveGraphWidgetOptions | PerseusLabelImageWidgetOptions | PerseusMatcherWidgetOptions | PerseusMatrixWidgetOptions | PerseusMeasurerWidgetOptions | PerseusMoleculeRendererWidgetOptions | PerseusNumberLineWidgetOptions | PerseusNumericInputWidgetOptions | PerseusOrdererWidgetOptions | PerseusPassageRefTargetWidgetOptions | PerseusPassageRefWidgetOptions | PerseusPassageWidgetOptions | PerseusPhetSimulationWidgetOptions | PerseusPlotterWidgetOptions | PerseusRadioWidgetOptions | PerseusSimpleMarkdownTesterWidgetOptions | PerseusSorterWidgetOptions | PerseusTableWidgetOptions | PerseusUnitInputWidgetOptions | PerseusVideoWidgetOptions;
|
|
900
900
|
export {};
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* PerseusWidgetUsedInProblemAttempt CEDAR event, we needed
|
|
5
5
|
* to: get the type and convert that to an enum value.
|
|
6
6
|
*/
|
|
7
|
-
type WidgetEnum = "CATEGORIZER" | "CS_PROGRAM" | "DEFINITION" | "DEPRECATED_STANDIN" | "DROPDOWN" | "EXPLANATION" | "EXPRESSION" | "GRADED_GROUP" | "GRADED_GROUP_SET" | "GRAPHER" | "GROUP" | "IFRAME" | "IMAGE" | "INPUT_NUMBER" | "INTERACTIVE" | "INTERACTIVE_GRAPH" | "LABEL_IMAGE" | "LIGHTS_PUZZLE" | "MATCHER" | "MATRIX" | "MEASURER" | "MOLECULE" | "NUMBER_LINE" | "NUMERIC_INPUT" | "ORDERER" | "PASSAGE" | "PASSAGE_REF" | "PASSAGE_REF_TARGET" | "
|
|
7
|
+
type WidgetEnum = "CATEGORIZER" | "CS_PROGRAM" | "DEFINITION" | "DEPRECATED_STANDIN" | "DROPDOWN" | "EXPLANATION" | "EXPRESSION" | "GRADED_GROUP" | "GRADED_GROUP_SET" | "GRAPHER" | "GROUP" | "IFRAME" | "IMAGE" | "INPUT_NUMBER" | "INTERACTIVE" | "INTERACTIVE_GRAPH" | "LABEL_IMAGE" | "LIGHTS_PUZZLE" | "MATCHER" | "MATRIX" | "MEASURER" | "MOLECULE" | "NUMBER_LINE" | "NUMERIC_INPUT" | "ORDERER" | "PASSAGE" | "PASSAGE_REF" | "PASSAGE_REF_TARGET" | "PHET_SIMULATION" | "PLOTTER" | "PYTHON_PROGRAM" | "REACTION_DIAGRAM" | "RADIO" | "SEQUENCE" | "SIMULATOR" | "SORTER" | "TABLE" | "UNIT" | "VIDEO";
|
|
8
8
|
export declare function convertWidgetNameToEnum(name: string): WidgetEnum;
|
|
9
9
|
export {};
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { PerseusI18nContext } from "../components/i18n-context";
|
|
7
|
-
import type {
|
|
7
|
+
import type { PerseusPhetSimulationWidgetOptions } from "../perseus-types";
|
|
8
8
|
import type { WidgetProps } from "../types";
|
|
9
|
-
type RenderProps =
|
|
10
|
-
type Props = WidgetProps<RenderProps,
|
|
9
|
+
type RenderProps = PerseusPhetSimulationWidgetOptions;
|
|
10
|
+
type Props = WidgetProps<RenderProps, PerseusPhetSimulationWidgetOptions>;
|
|
11
11
|
type UserInput = null;
|
|
12
12
|
type State = {
|
|
13
13
|
banner: {
|
|
@@ -16,7 +16,7 @@ type State = {
|
|
|
16
16
|
} | null;
|
|
17
17
|
url: URL | null;
|
|
18
18
|
};
|
|
19
|
-
export declare class
|
|
19
|
+
export declare class PhetSimulation extends React.Component<Props, State> {
|
|
20
20
|
static contextType: React.Context<{
|
|
21
21
|
strings: import("../strings").PerseusStrings;
|
|
22
22
|
locale: string;
|
|
@@ -41,8 +41,8 @@ export declare const makeSafeUrl: (urlString: string, locale: string) => URL | n
|
|
|
41
41
|
declare const _default: Readonly<{
|
|
42
42
|
name: string;
|
|
43
43
|
displayName: string;
|
|
44
|
-
getWidget?: (() => typeof
|
|
45
|
-
widget: typeof
|
|
44
|
+
getWidget?: (() => typeof PhetSimulation) | undefined;
|
|
45
|
+
widget: typeof PhetSimulation;
|
|
46
46
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
47
47
|
hidden?: boolean | undefined;
|
|
48
48
|
version?: import("../types").Version | undefined;
|
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.0.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
"@khanacademy/wonder-blocks-dropdown": "5.3.0",
|
|
97
97
|
"@khanacademy/wonder-blocks-form": "^4.7.1",
|
|
98
98
|
"@khanacademy/wonder-blocks-icon": "4.1.0",
|
|
99
|
+
"@khanacademy/wonder-blocks-icon-button": "5.2.1",
|
|
99
100
|
"@khanacademy/wonder-blocks-layout": "2.0.32",
|
|
100
101
|
"@khanacademy/wonder-blocks-link": "6.1.1",
|
|
101
102
|
"@khanacademy/wonder-blocks-pill": "2.2.1",
|