@khanacademy/perseus-editor 20.2.2 → 22.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.
@@ -5,6 +5,7 @@ import DeprecatedStandinEditor from "./widgets/deprecated-standin-editor";
5
5
  import DropdownEditor from "./widgets/dropdown-editor";
6
6
  import ExplanationEditor from "./widgets/explanation-editor";
7
7
  import ExpressionEditor from "./widgets/expression-editor";
8
+ import FreeResponseEditor from "./widgets/free-response-editor";
8
9
  import GradedGroupEditor from "./widgets/graded-group-editor";
9
10
  import GradedGroupSetEditor from "./widgets/graded-group-set-editor";
10
11
  import GrapherEditor from "./widgets/grapher-editor";
@@ -32,5 +33,5 @@ import RadioEditor from "./widgets/radio/editor";
32
33
  import SorterEditor from "./widgets/sorter-editor";
33
34
  import TableEditor from "./widgets/table-editor";
34
35
  import VideoEditor from "./widgets/video-editor";
35
- declare const _default: (typeof CategorizerEditor | typeof CSProgramEditor | typeof DefinitionEditor | typeof DeprecatedStandinEditor | typeof DropdownEditor | typeof ExplanationEditor | typeof ExpressionEditor | 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)[];
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)[];
36
37
  export default _default;
@@ -23,7 +23,7 @@ declare class WidgetEditor extends React.Component<WidgetEditorProps, WidgetEdit
23
23
  _handleAlignmentChange: (e: React.SyntheticEvent<HTMLSelectElement>) => void;
24
24
  getSaveWarnings: () => any;
25
25
  serialize: () => {
26
- type: "categorizer" | "iframe" | "table" | "video" | "image" | "radio" | "cs-program" | "definition" | "group" | "dropdown" | "explanation" | "expression" | "grapher" | "graded-group-set" | "graded-group" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "matcher" | "matrix" | "measurer" | "molecule-renderer" | "number-line" | "numeric-input" | "orderer" | "passage-ref-target" | "passage-ref" | "passage" | "phet-simulation" | "python-program" | "plotter" | "sorter" | "mock-widget" | "deprecated-standin";
26
+ type: "categorizer" | "iframe" | "table" | "video" | "image" | "radio" | "cs-program" | "definition" | "group" | "dropdown" | "explanation" | "expression" | "free-response" | "grapher" | "graded-group-set" | "graded-group" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "matcher" | "matrix" | "measurer" | "molecule-renderer" | "number-line" | "numeric-input" | "orderer" | "passage-ref-target" | "passage-ref" | "passage" | "phet-simulation" | "python-program" | "plotter" | "sorter" | "mock-widget" | "deprecated-standin";
27
27
  alignment: string | undefined;
28
28
  static: boolean | undefined;
29
29
  graded: boolean | undefined;
@@ -13,11 +13,22 @@ import type { LinterContextProps } from "@khanacademy/perseus-linter";
13
13
  * 100% due to the above `@media` query limitation.
14
14
  */
15
15
  declare function ContentPreview({ question, apiOptions, seamless, linterContext, legacyPerseusLint, previewDevice, }: {
16
+ /** The Perseus question to preview. */
16
17
  question?: PerseusRenderer;
18
+ /** API Options to use when previewing. */
17
19
  apiOptions?: APIOptions;
20
+ /**
21
+ * When `true`, renders a seamless preview without any extra spacing. When
22
+ * `false`, renders a gutter where linting issues are displayed.
23
+ */
18
24
  seamless?: boolean;
19
25
  linterContext?: LinterContextProps;
20
26
  legacyPerseusLint?: ReadonlyArray<string>;
27
+ /**
28
+ * The type of device to simulate the preview for. Note that this preview
29
+ * may not be 100% accurate with regards to styling (due to styles that use
30
+ * media queries based on the screen width).
31
+ */
21
32
  previewDevice: DeviceType;
22
33
  }): React.JSX.Element;
23
34
  export default ContentPreview;
@@ -2,10 +2,10 @@ import * as React from "react";
2
2
  import CombinedHintsEditor from "./hint-editor";
3
3
  import ItemEditor from "./item-editor";
4
4
  import type { APIOptions, APIOptionsWithDefaults, ChangeHandler, DeviceType, ImageUploader } from "@khanacademy/perseus";
5
- import type { Hint, PerseusItem, PerseusRenderer } from "@khanacademy/perseus-core";
5
+ import type { Hint, PerseusAnswerArea, PerseusItem, PerseusRenderer } from "@khanacademy/perseus-core";
6
6
  type Props = {
7
7
  apiOptions?: APIOptions;
8
- answerArea?: any;
8
+ answerArea?: PerseusAnswerArea | null;
9
9
  contentPaths?: ReadonlyArray<string>;
10
10
  developerMode: boolean;
11
11
  frameSource: string;
@@ -20,23 +20,21 @@ type Props = {
20
20
  question?: PerseusRenderer;
21
21
  previewURL: string;
22
22
  };
23
+ type DefaultProps = {
24
+ developerMode: Props["developerMode"];
25
+ jsonMode: Props["jsonMode"];
26
+ onChange: Props["onChange"];
27
+ };
23
28
  type State = {
24
29
  json: PerseusItem;
25
- gradeMessage: string;
26
- wasAnswered: boolean;
27
30
  highlightLint: boolean;
28
31
  widgetsAreOpen: boolean;
29
32
  };
30
33
  declare class EditorPage extends React.Component<Props, State> {
31
34
  _isMounted: boolean;
32
- renderer: any;
33
35
  itemEditor: React.RefObject<ItemEditor>;
34
36
  hintsEditor: React.RefObject<CombinedHintsEditor>;
35
- static defaultProps: {
36
- developerMode: boolean;
37
- jsonMode: boolean;
38
- onChange: () => void;
39
- };
37
+ static defaultProps: DefaultProps;
40
38
  constructor(props: Props);
41
39
  componentDidMount(): void;
42
40
  componentDidUpdate(): void;