@khanacademy/perseus-editor 28.7.0 → 28.8.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/all-editors.d.ts +1 -1
- package/dist/components/image-preview.d.ts +31 -0
- package/dist/editor.d.ts +0 -2
- package/dist/es/index.js +46 -44
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +44 -42
- package/dist/index.js.map +1 -1
- package/dist/preview/message-types.d.ts +99 -0
- package/dist/widgets/radio/radio-image-editor.d.ts +4 -2
- package/dist/widgets/video-editor/video-editor.d.ts +15 -0
- package/dist/widgets/video-editor/video-settings.d.ts +6 -0
- package/package.json +25 -22
- package/dist/components/auto-resizing-text-area.d.ts +0 -6
- package/dist/widgets/video-editor.d.ts +0 -18
package/dist/all-editors.d.ts
CHANGED
|
@@ -32,6 +32,6 @@ import PythonProgramEditor from "./widgets/python-program-editor";
|
|
|
32
32
|
import RadioEditor from "./widgets/radio/editor";
|
|
33
33
|
import SorterEditor from "./widgets/sorter-editor";
|
|
34
34
|
import TableEditor from "./widgets/table-editor";
|
|
35
|
-
import VideoEditor from "./widgets/video-editor";
|
|
35
|
+
import VideoEditor from "./widgets/video-editor/video-editor";
|
|
36
36
|
declare const _default: (typeof CategorizerEditor | typeof CSProgramEditor | typeof DefinitionEditor | typeof DeprecatedStandinEditor | typeof DropdownEditor | typeof ExplanationEditor | typeof ExpressionEditor | typeof FreeResponseEditor | typeof GradedGroupEditor | typeof GradedGroupSetEditor | typeof GrapherEditor | typeof GroupEditor | typeof IframeEditor | typeof ImageEditor | typeof InputNumberEditor | typeof InteractionEditor | typeof InteractiveGraphEditor | typeof LabelImageEditor | typeof MatcherEditor | typeof MatrixEditor | typeof MeasurerEditor | typeof MoleculeEditor | typeof NumberLineEditor | typeof NumericInputEditor | typeof OrdererEditor | typeof PassageEditor | typeof PassageRefEditor | typeof PassageRefTargetEditor | typeof PhetSimulationEditor | typeof PlotterEditor | typeof PythonProgramEditor | typeof RadioEditor | typeof SorterEditor | typeof TableEditor | typeof VideoEditor)[];
|
|
37
37
|
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface ImagePreviewProps {
|
|
3
|
+
/**
|
|
4
|
+
* The URL of the image to display.
|
|
5
|
+
* Can be a regular image URL or a web+graphie URL.
|
|
6
|
+
*/
|
|
7
|
+
src: string;
|
|
8
|
+
/**
|
|
9
|
+
* Alternative text for the image.
|
|
10
|
+
* Used for accessibility and shown when the image fails to load.
|
|
11
|
+
*/
|
|
12
|
+
alt: string;
|
|
13
|
+
/**
|
|
14
|
+
* The width of the image in pixels.
|
|
15
|
+
* When provided with height, enables responsive rendering with proper aspect ratio.
|
|
16
|
+
* If not provided, the image will render at its natural size.
|
|
17
|
+
*/
|
|
18
|
+
width?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The height of the image in pixels.
|
|
21
|
+
* When provided with width, enables responsive rendering with proper aspect ratio.
|
|
22
|
+
* If not provided, the image will render at its natural size.
|
|
23
|
+
*/
|
|
24
|
+
height?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Shared component for previewing images in editors.
|
|
28
|
+
* Displays an SvgImage with proper containment to prevent overflow.
|
|
29
|
+
*/
|
|
30
|
+
export default function ImagePreview({ src, alt, width, height, }: ImagePreviewProps): React.ReactElement;
|
|
31
|
+
export {};
|
package/dist/editor.d.ts
CHANGED
|
@@ -42,7 +42,6 @@ type State = {
|
|
|
42
42
|
};
|
|
43
43
|
declare class Editor extends React.Component<Props, State> {
|
|
44
44
|
lastUserValue: string | null | undefined;
|
|
45
|
-
deferredChange: any | null | undefined;
|
|
46
45
|
widgetIds: any | null | undefined;
|
|
47
46
|
underlay: React.RefObject<HTMLDivElement>;
|
|
48
47
|
textarea: React.RefObject<HTMLTextAreaElement>;
|
|
@@ -51,7 +50,6 @@ declare class Editor extends React.Component<Props, State> {
|
|
|
51
50
|
componentDidMount(): void;
|
|
52
51
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
53
52
|
componentDidUpdate(prevProps: Props): void;
|
|
54
|
-
componentWillUnmount(): void;
|
|
55
53
|
getWidgetEditor(id: string, type: PerseusWidget["type"]): undefined | React.ReactNode;
|
|
56
54
|
_handleWidgetEditorChange: (id: string, newWidgetInfo: PerseusWidget, cb?: () => unknown, silent?: boolean) => void;
|
|
57
55
|
_handleWidgetEditorRemove: (id: string) => void;
|