@khanacademy/perseus-editor 12.0.0 → 13.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.
@@ -27,6 +27,7 @@ import OrdererEditor from "./widgets/orderer-editor";
27
27
  import PassageEditor from "./widgets/passage-editor";
28
28
  import PassageRefEditor from "./widgets/passage-ref-editor";
29
29
  import PassageRefTargetEditor from "./widgets/passage-ref-target-editor";
30
+ import PhetSimEditor from "./widgets/phet-sim-editor";
30
31
  import PlotterEditor from "./widgets/plotter-editor";
31
32
  import PythonProgramEditor from "./widgets/python-program-editor";
32
33
  import RadioEditor from "./widgets/radio/editor";
@@ -34,5 +35,5 @@ import SimpleMarkdownTesterEditor from "./widgets/simple-markdown-tester-editor"
34
35
  import SorterEditor from "./widgets/sorter-editor";
35
36
  import TableEditor from "./widgets/table-editor";
36
37
  import VideoEditor from "./widgets/video-editor";
37
- declare const _default: (typeof CategorizerEditor | typeof CSProgramEditor | typeof DefinitionEditor | typeof DeprecatedStandinEditor | typeof DropdownEditor | typeof ExampleGraphieWidgetEditor | typeof ExampleWidgetEditor | 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 PlotterEditor | typeof PythonProgramEditor | typeof RadioEditor | typeof SimpleMarkdownTesterEditor | typeof SorterEditor | typeof TableEditor | typeof VideoEditor)[];
38
+ declare const _default: (typeof CategorizerEditor | typeof CSProgramEditor | typeof DefinitionEditor | typeof DeprecatedStandinEditor | typeof DropdownEditor | typeof ExampleGraphieWidgetEditor | typeof ExampleWidgetEditor | 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 PhetSimEditor | typeof PlotterEditor | typeof PythonProgramEditor | typeof RadioEditor | typeof SimpleMarkdownTesterEditor | typeof SorterEditor | typeof TableEditor | typeof VideoEditor)[];
38
39
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  type Props = {
3
3
  showM2bFeatures: boolean;
4
+ showLabelsFlag?: boolean;
4
5
  id: string;
5
6
  onChange: (value: string) => void;
6
7
  };
@@ -8,12 +8,14 @@ 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
10
  import type { Props as LockedFunctionProps } from "./locked-function-settings";
11
+ import type { Props as LockedLabelProps } from "./locked-label-settings";
11
12
  import type { Props as LockedLineProps } from "./locked-line-settings";
12
13
  import type { Props as LockedPointProps } from "./locked-point-settings";
13
14
  import type { Props as LockedPolygonProps } from "./locked-polygon-settings";
14
15
  import type { Props as LockedVectorProps } from "./locked-vector-settings";
15
16
  export type LockedFigureSettingsCommonProps = {
16
17
  showM2bFeatures?: boolean;
18
+ showLabelsFlag?: boolean;
17
19
  /**
18
20
  * Called when a movement button (top, up, down, bottom) is pressed.
19
21
  */
@@ -31,6 +33,6 @@ export type LockedFigureSettingsCommonProps = {
31
33
  */
32
34
  onToggle?: (expanded: boolean) => void;
33
35
  };
34
- type Props = LockedFigureSettingsCommonProps & (LockedPointProps | LockedLineProps | LockedEllipseProps | LockedVectorProps | LockedPolygonProps | LockedFunctionProps);
36
+ type Props = LockedFigureSettingsCommonProps & (LockedPointProps | LockedLineProps | LockedEllipseProps | LockedVectorProps | LockedPolygonProps | LockedFunctionProps | LockedLabelProps);
35
37
  declare const LockedFigureSettings: (props: Props) => React.JSX.Element | null;
36
38
  export default LockedFigureSettings;
@@ -3,6 +3,7 @@ import type { Props as InteractiveGraphEditorProps } from "../../widgets/interac
3
3
  import type { LockedFigure } from "@khanacademy/perseus";
4
4
  type Props = {
5
5
  showM2bFeatures: boolean;
6
+ showLabelsFlag?: boolean;
6
7
  figures?: Array<LockedFigure>;
7
8
  onChange: (props: Partial<InteractiveGraphEditorProps>) => void;
8
9
  };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * LockedLabelSettings is a component that allows the user to edit the
3
+ * settings of specifically a locked label on the graph within the
4
+ * Interactive Graph widget.
5
+ *
6
+ * Used in the interactive graph editor's locked figures section.
7
+ */
8
+ import { type LockedFigure, type LockedLabelType } from "@khanacademy/perseus";
9
+ import * as React from "react";
10
+ import type { LockedFigureSettingsCommonProps } from "./locked-figure-settings";
11
+ export type Props = LockedLabelType & LockedFigureSettingsCommonProps & {
12
+ /**
13
+ * Called when the props (coord, color, etc.) are updated.
14
+ */
15
+ onChangeProps: (newProps: Partial<LockedFigure>) => void;
16
+ };
17
+ export default function LockedLabelSettings(props: Props): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { Range, LockedFigure, LockedFigureType, LockedPointType, LockedLineType, LockedEllipseType, LockedVectorType, LockedPolygonType, LockedFunctionType, PerseusGraphType, Coord } from "@khanacademy/perseus";
1
+ import type { Range, LockedFigure, LockedFigureType, LockedPointType, LockedLineType, LockedEllipseType, LockedVectorType, LockedPolygonType, LockedFunctionType, LockedLabelType, PerseusGraphType, Coord } from "@khanacademy/perseus";
2
2
  export declare function focusWithChromeStickyFocusBugWorkaround(element: Element): void;
3
3
  export declare function getDefaultFigureForType(type: "point"): LockedPointType;
4
4
  export declare function getDefaultFigureForType(type: "line"): LockedLineType;
@@ -6,6 +6,7 @@ export declare function getDefaultFigureForType(type: "vector"): LockedVectorTyp
6
6
  export declare function getDefaultFigureForType(type: "ellipse"): LockedEllipseType;
7
7
  export declare function getDefaultFigureForType(type: "polygon"): LockedPolygonType;
8
8
  export declare function getDefaultFigureForType(type: "function"): LockedFunctionType;
9
+ export declare function getDefaultFigureForType(type: "label"): LockedLabelType;
9
10
  export declare function getDefaultFigureForType(type: LockedFigureType): LockedFigure;
10
11
  export declare function degreeToRadian(degrees: number): number;
11
12
  export declare function radianToDegree(radians: number): number;
@@ -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: "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";
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" | "phet-sim" | "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;