@khanacademy/perseus-editor 11.2.0 → 11.3.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-editor.d.ts +2 -2
- package/dist/components/graph-locked-figures/line-stroke-select.d.ts +8 -0
- package/dist/components/graph-locked-figures/locked-figure-settings.d.ts +2 -1
- package/dist/components/graph-locked-figures/locked-function-settings.d.ts +11 -0
- package/dist/components/scrollless-number-text-field.d.ts +21 -0
- package/dist/components/start-coords-angle.d.ts +8 -0
- package/dist/components/start-coords-point.d.ts +8 -0
- package/dist/components/util.d.ts +1 -0
- package/dist/components/widget-editor.d.ts +1 -1
- package/dist/editor.d.ts +2 -2
- package/dist/es/index.css +3 -0
- package/dist/es/index.js +864 -440
- package/dist/es/index.js.map +1 -1
- package/dist/hint-editor.d.ts +1 -2
- package/dist/index.css +3 -0
- package/dist/index.js +861 -435
- package/dist/index.js.map +1 -1
- package/dist/item-editor.d.ts +2 -2
- package/dist/widgets/interactive-graph-editor.d.ts +517 -129
- package/package.json +3 -3
package/dist/article-editor.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* multiple (Renderer) sections concatenated together.
|
|
4
4
|
*/
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import type { APIOptions, Changeable } from "@khanacademy/perseus";
|
|
6
|
+
import type { APIOptions, Changeable, ImageUploader } from "@khanacademy/perseus";
|
|
7
7
|
type RendererProps = {
|
|
8
8
|
content?: string;
|
|
9
9
|
widgets?: any;
|
|
@@ -20,7 +20,7 @@ type DefaultProps = {
|
|
|
20
20
|
};
|
|
21
21
|
type Props = DefaultProps & {
|
|
22
22
|
apiOptions?: APIOptions;
|
|
23
|
-
imageUploader?:
|
|
23
|
+
imageUploader?: ImageUploader;
|
|
24
24
|
previewURL: string;
|
|
25
25
|
} & Changeable.ChangeableProps;
|
|
26
26
|
type State = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type StyleOptions = "solid" | "dashed";
|
|
3
|
+
type Props = {
|
|
4
|
+
selectedValue: StyleOptions;
|
|
5
|
+
onChange: (newValue: string) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const LineStrokeSelect: (props: Props) => React.JSX.Element;
|
|
8
|
+
export default LineStrokeSelect;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import type { Props as LockedEllipseProps } from "./locked-ellipse-settings";
|
|
9
9
|
import type { LockedFigureSettingsMovementType } from "./locked-figure-settings-actions";
|
|
10
|
+
import type { Props as LockedFunctionProps } from "./locked-function-settings";
|
|
10
11
|
import type { Props as LockedLineProps } from "./locked-line-settings";
|
|
11
12
|
import type { Props as LockedPointProps } from "./locked-point-settings";
|
|
12
13
|
import type { Props as LockedPolygonProps } from "./locked-polygon-settings";
|
|
@@ -30,6 +31,6 @@ export type LockedFigureSettingsCommonProps = {
|
|
|
30
31
|
*/
|
|
31
32
|
onToggle?: (expanded: boolean) => void;
|
|
32
33
|
};
|
|
33
|
-
type Props = LockedFigureSettingsCommonProps & (LockedPointProps | LockedLineProps | LockedEllipseProps | LockedVectorProps | LockedPolygonProps);
|
|
34
|
+
type Props = LockedFigureSettingsCommonProps & (LockedPointProps | LockedLineProps | LockedEllipseProps | LockedVectorProps | LockedPolygonProps | LockedFunctionProps);
|
|
34
35
|
declare const LockedFigureSettings: (props: Props) => React.JSX.Element | null;
|
|
35
36
|
export default LockedFigureSettings;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { LockedFigureSettingsCommonProps } from "./locked-figure-settings";
|
|
3
|
+
import type { LockedFunctionType } from "@khanacademy/perseus";
|
|
4
|
+
export type Props = LockedFunctionType & LockedFigureSettingsCommonProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Called when the props (points, color, etc.) are updated.
|
|
7
|
+
*/
|
|
8
|
+
onChangeProps: (newProps: Partial<LockedFunctionType>) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const LockedFunctionSettings: (props: Props) => React.JSX.Element;
|
|
11
|
+
export default LockedFunctionSettings;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TextField } from "@khanacademy/wonder-blocks-form";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
4
|
+
/**
|
|
5
|
+
* This is a custom text field of type="number" for use in Perseus Editors.
|
|
6
|
+
*
|
|
7
|
+
* This makes it so that the text field's input number updates on scroll
|
|
8
|
+
* without scrolling the page.
|
|
9
|
+
*
|
|
10
|
+
* NOTE 1: Native HTML number inputs do not update the number value on scroll,
|
|
11
|
+
* they only scroll the page. Inputs in React do NOT work this way (explanation
|
|
12
|
+
* here: https://stackoverflow.com/a/68266494). By default, scrolling on a
|
|
13
|
+
* focused number input in React causes BOTH the input value to change AND
|
|
14
|
+
* the page to scroll. The behavior in this component is an improvement on
|
|
15
|
+
* the React behavior, but it's the opposite of the native HTML behavior.
|
|
16
|
+
*
|
|
17
|
+
* NOTE 2: Firefox seems to have a custom override for this. Even with this
|
|
18
|
+
* stopPropogation, Firefox matches the native HTML behavior.
|
|
19
|
+
*/
|
|
20
|
+
declare const ScrolllessNumberTextField: (props: PropsFor<typeof TextField>) => React.JSX.Element;
|
|
21
|
+
export default ScrolllessNumberTextField;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Coord, PerseusGraphType } from "@khanacademy/perseus";
|
|
3
|
+
type Props = {
|
|
4
|
+
startCoords: [Coord, Coord, Coord];
|
|
5
|
+
onChange: (startCoords: PerseusGraphType["startCoords"]) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const StartCoordsAngle: (props: Props) => React.JSX.Element;
|
|
8
|
+
export default StartCoordsAngle;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Coord, PerseusGraphType } from "@khanacademy/perseus";
|
|
3
|
+
type Props = {
|
|
4
|
+
startCoords: ReadonlyArray<Coord>;
|
|
5
|
+
onChange: (startCoords: PerseusGraphType["startCoords"]) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const StartCoordsPoint: (props: Props) => React.JSX.Element;
|
|
8
|
+
export default StartCoordsPoint;
|
|
@@ -12,3 +12,4 @@ export declare function radianToDegree(radians: number): number;
|
|
|
12
12
|
export declare function getDefaultGraphStartCoords(graph: PerseusGraphType, range: [x: Range, y: Range], step: [x: number, y: number]): PerseusGraphType["startCoords"];
|
|
13
13
|
export declare const getSinusoidEquation: (startCoords: [Coord, Coord]) => string;
|
|
14
14
|
export declare const getQuadraticEquation: (startCoords: [Coord, Coord, Coord]) => string;
|
|
15
|
+
export declare const shouldShowStartCoordsUI: (flags: any, graph: any) => boolean;
|
|
@@ -21,7 +21,7 @@ declare class WidgetEditor extends React.Component<WidgetEditorProps, WidgetEdit
|
|
|
21
21
|
_handleAlignmentChange: (e: React.SyntheticEvent<HTMLSelectElement>) => void;
|
|
22
22
|
getSaveWarnings: () => any;
|
|
23
23
|
serialize: () => {
|
|
24
|
-
type: "
|
|
24
|
+
type: "definition" | "group" | "radio" | "table" | "categorizer" | "iframe" | "video" | "image" | "cs-program" | "dropdown" | "example-graphie-widget" | "example-widget" | "explanation" | "expression" | "graded-group-set" | "graded-group" | "grapher" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "matcher" | "matrix" | "measurer" | "molecule-renderer" | "number-line" | "numeric-input" | "orderer" | "passage-ref" | "passage" | "plotter" | "python-program" | "passage-ref-target" | "simple-markdown-tester" | "sorter" | "deprecated-standin";
|
|
25
25
|
alignment: string | undefined;
|
|
26
26
|
static: boolean | undefined;
|
|
27
27
|
graded: boolean | undefined;
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./katex-mhchem";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type { ChangeHandler, PerseusWidget } from "@khanacademy/perseus";
|
|
3
|
+
import type { ChangeHandler, ImageUploader, PerseusWidget } from "@khanacademy/perseus";
|
|
4
4
|
type Props = Readonly<{
|
|
5
5
|
apiOptions: any;
|
|
6
6
|
className?: string;
|
|
@@ -17,7 +17,7 @@ type Props = Readonly<{
|
|
|
17
17
|
showWordCount: boolean;
|
|
18
18
|
warnNoPrompt: boolean;
|
|
19
19
|
warnNoWidgets: boolean;
|
|
20
|
-
imageUploader?:
|
|
20
|
+
imageUploader?: ImageUploader;
|
|
21
21
|
onChange: ChangeHandler;
|
|
22
22
|
}>;
|
|
23
23
|
type DefaultProps = {
|