@khanacademy/perseus-editor 8.1.0 → 9.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.
Files changed (39) hide show
  1. package/dist/components/angle-input.d.ts +2 -2
  2. package/dist/components/coordinate-pair-input.d.ts +2 -2
  3. package/dist/components/graph-locked-figures/color-select.d.ts +2 -2
  4. package/dist/components/graph-locked-figures/color-swatch.d.ts +2 -2
  5. package/dist/components/graph-locked-figures/defining-point-settings.d.ts +2 -2
  6. package/dist/components/graph-locked-figures/ellipse-swatch.d.ts +2 -2
  7. package/dist/components/graph-locked-figures/labeled-row.d.ts +1 -1
  8. package/dist/components/graph-locked-figures/labeled-switch.d.ts +2 -2
  9. package/dist/components/graph-locked-figures/line-swatch.d.ts +2 -2
  10. package/dist/components/graph-locked-figures/locked-ellipse-settings.d.ts +2 -2
  11. package/dist/components/graph-locked-figures/locked-figure-select.d.ts +2 -2
  12. package/dist/components/graph-locked-figures/locked-figure-settings-actions.d.ts +2 -2
  13. package/dist/components/graph-locked-figures/locked-figure-settings.d.ts +2 -2
  14. package/dist/components/graph-locked-figures/locked-figures-section.d.ts +2 -2
  15. package/dist/components/graph-locked-figures/locked-line-settings.d.ts +2 -2
  16. package/dist/components/graph-locked-figures/locked-point-settings.d.ts +2 -2
  17. package/dist/components/graph-locked-figures/locked-polygon-settings.d.ts +2 -2
  18. package/dist/components/graph-locked-figures/locked-vector-settings.d.ts +2 -2
  19. package/dist/components/graph-locked-figures/polygon-swatch.d.ts +2 -2
  20. package/dist/components/graph-points-count-selector.d.ts +2 -2
  21. package/dist/components/graph-type-selector.d.ts +2 -2
  22. package/dist/components/heading.d.ts +4 -3
  23. package/dist/components/interactive-graph-correct-answer.d.ts +7 -0
  24. package/dist/components/interactive-graph-settings.d.ts +1 -1
  25. package/dist/components/perseus-editor-accordion.d.ts +1 -1
  26. package/dist/components/segment-count-selector.d.ts +2 -2
  27. package/dist/components/start-coord-settings.d.ts +2 -2
  28. package/dist/components/toggleable-caret.d.ts +2 -2
  29. package/dist/components/viewport-resizer.d.ts +2 -2
  30. package/dist/components/widget-editor.d.ts +1 -1
  31. package/dist/es/index.js +77 -48
  32. package/dist/es/index.js.map +1 -1
  33. package/dist/index.js +77 -48
  34. package/dist/index.js.map +1 -1
  35. package/dist/widgets/image-editor.d.ts +2 -2
  36. package/dist/widgets/interaction-editor/mathquill-input.d.ts +2 -2
  37. package/dist/widgets/interactive-graph-editor.d.ts +153 -531
  38. package/dist/widgets/numeric-input-editor.d.ts +1 -1
  39. package/package.json +7 -7
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  type Props = {
3
3
  angle: number;
4
4
  onChange: (angle: number) => void;
5
5
  };
6
- declare const AngleInput: (props: Props) => JSX.Element;
6
+ declare const AngleInput: (props: Props) => React.JSX.Element;
7
7
  export default AngleInput;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { Coord } from "@khanacademy/perseus";
3
3
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
4
4
  type Props = {
@@ -8,5 +8,5 @@ type Props = {
8
8
  style?: StyleType;
9
9
  onChange: (newCoord: Coord) => void;
10
10
  };
11
- declare const CoordinatePairInput: (props: Props) => JSX.Element;
11
+ declare const CoordinatePairInput: (props: Props) => React.JSX.Element;
12
12
  export default CoordinatePairInput;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureColor } from "@khanacademy/perseus";
3
3
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
4
4
  type Props = {
@@ -6,5 +6,5 @@ type Props = {
6
6
  style?: StyleType;
7
7
  onChange: (newValue: string) => void;
8
8
  };
9
- declare const ColorSelect: (props: Props) => JSX.Element;
9
+ declare const ColorSelect: (props: Props) => React.JSX.Element;
10
10
  export default ColorSelect;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { type LockedFigureColor } from "@khanacademy/perseus";
2
+ import * as React from "react";
3
3
  type Props = {
4
4
  color: LockedFigureColor;
5
5
  filled?: boolean;
6
6
  decorative?: boolean;
7
7
  };
8
- declare const ColorSwatch: (props: Props) => JSX.Element;
8
+ declare const ColorSwatch: (props: Props) => React.JSX.Element;
9
9
  export default ColorSwatch;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedPointType } from "@khanacademy/perseus";
3
3
  export type Props = LockedPointType & {
4
4
  /**
@@ -31,5 +31,5 @@ export type Props = LockedPointType & {
31
31
  */
32
32
  onToggle?: (expanded: boolean) => void;
33
33
  };
34
- declare const DefiningPointSettings: (props: Props) => JSX.Element;
34
+ declare const DefiningPointSettings: (props: Props) => React.JSX.Element;
35
35
  export default DefiningPointSettings;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureColor, LockedFigureFillType } from "@khanacademy/perseus";
3
3
  type Props = {
4
4
  color: LockedFigureColor;
5
5
  fillStyle: LockedFigureFillType;
6
6
  strokeStyle: "solid" | "dashed";
7
7
  };
8
- declare const EllipseSwatch: (props: Props) => JSX.Element;
8
+ declare const EllipseSwatch: (props: Props) => React.JSX.Element;
9
9
  export default EllipseSwatch;
@@ -6,5 +6,5 @@ declare const LabeledRow: (props: {
6
6
  labelSide?: "start" | "end";
7
7
  style?: StyleType;
8
8
  children: React.ReactNode;
9
- }) => JSX.Element;
9
+ }) => React.JSX.Element;
10
10
  export default LabeledRow;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
3
3
  type Props = {
4
4
  label: string;
@@ -6,5 +6,5 @@ type Props = {
6
6
  style?: StyleType;
7
7
  onChange: (newValue: boolean) => void;
8
8
  };
9
- declare const LabeledSwitch: (props: Props) => JSX.Element;
9
+ declare const LabeledSwitch: (props: Props) => React.JSX.Element;
10
10
  export default LabeledSwitch;
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
2
1
  import { type LockedFigureColor } from "@khanacademy/perseus";
2
+ import * as React from "react";
3
3
  type Props = {
4
4
  color: LockedFigureColor;
5
5
  lineStyle: "solid" | "dashed";
6
6
  };
7
- declare const LineSwatch: (props: Props) => JSX.Element;
7
+ declare const LineSwatch: (props: Props) => React.JSX.Element;
8
8
  export default LineSwatch;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureSettingsCommonProps } from "./locked-figure-settings";
3
3
  import type { LockedEllipseType } from "@khanacademy/perseus";
4
4
  export type Props = LockedFigureSettingsCommonProps & LockedEllipseType & {
@@ -7,5 +7,5 @@ export type Props = LockedFigureSettingsCommonProps & LockedEllipseType & {
7
7
  */
8
8
  onChangeProps: (newProps: Partial<LockedEllipseType>) => void;
9
9
  };
10
- declare const LockedEllipseSettings: (props: Props) => JSX.Element;
10
+ declare const LockedEllipseSettings: (props: Props) => React.JSX.Element;
11
11
  export default LockedEllipseSettings;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  type Props = {
3
3
  showM2Features: boolean;
4
4
  showM2bFeatures: boolean;
5
5
  id: string;
6
6
  onChange: (value: string) => void;
7
7
  };
8
- declare const LockedFigureSelect: (props: Props) => JSX.Element;
8
+ declare const LockedFigureSelect: (props: Props) => React.JSX.Element;
9
9
  export default LockedFigureSelect;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureType } from "@khanacademy/perseus";
3
3
  export type LockedFigureSettingsMovementType = "back" | "backward" | "forward" | "front";
4
4
  type Props = {
@@ -7,5 +7,5 @@ type Props = {
7
7
  onMove: (movement: LockedFigureSettingsMovementType) => void;
8
8
  onRemove: () => void;
9
9
  };
10
- declare const LockedFigureSettingsActions: (props: Props) => JSX.Element;
10
+ declare const LockedFigureSettingsActions: (props: Props) => React.JSX.Element;
11
11
  export default LockedFigureSettingsActions;
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Used in the interactive graph editor's locked figures section.
6
6
  */
7
- /// <reference types="react" />
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
10
  import type { Props as LockedLineProps } from "./locked-line-settings";
@@ -32,5 +32,5 @@ export type LockedFigureSettingsCommonProps = {
32
32
  onToggle?: (expanded: boolean) => void;
33
33
  };
34
34
  type Props = LockedFigureSettingsCommonProps & (LockedPointProps | LockedLineProps | LockedEllipseProps | LockedVectorProps | LockedPolygonProps);
35
- declare const LockedFigureSettings: (props: Props) => JSX.Element | null;
35
+ declare const LockedFigureSettings: (props: Props) => React.JSX.Element | null;
36
36
  export default LockedFigureSettings;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { Props as InteractiveGraphEditorProps } from "../../widgets/interactive-graph-editor";
3
3
  import type { LockedFigure } from "@khanacademy/perseus";
4
4
  type Props = {
@@ -7,5 +7,5 @@ type Props = {
7
7
  figures?: Array<LockedFigure>;
8
8
  onChange: (props: Partial<InteractiveGraphEditorProps>) => void;
9
9
  };
10
- declare const LockedFiguresSection: (props: Props) => JSX.Element;
10
+ declare const LockedFiguresSection: (props: Props) => React.JSX.Element;
11
11
  export default LockedFiguresSection;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureSettingsCommonProps } from "./locked-figure-settings";
3
3
  import type { LockedFigure, LockedLineType } from "@khanacademy/perseus";
4
4
  export type Props = LockedLineType & LockedFigureSettingsCommonProps & {
@@ -7,5 +7,5 @@ export type Props = LockedLineType & LockedFigureSettingsCommonProps & {
7
7
  */
8
8
  onChangeProps: (newProps: Partial<LockedFigure>) => void;
9
9
  };
10
- declare const LockedLineSettings: (props: Props) => JSX.Element;
10
+ declare const LockedLineSettings: (props: Props) => React.JSX.Element;
11
11
  export default LockedLineSettings;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureSettingsCommonProps } from "./locked-figure-settings";
3
3
  import type { LockedPointType } from "@khanacademy/perseus";
4
4
  export type Props = LockedFigureSettingsCommonProps & LockedPointType & {
@@ -7,5 +7,5 @@ export type Props = LockedFigureSettingsCommonProps & LockedPointType & {
7
7
  */
8
8
  onChangeProps: (newProps: Partial<LockedPointType>) => void;
9
9
  };
10
- declare const LockedPointSettings: (props: Props) => JSX.Element;
10
+ declare const LockedPointSettings: (props: Props) => React.JSX.Element;
11
11
  export default LockedPointSettings;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { type LockedPolygonType } from "@khanacademy/perseus";
2
+ import * as React from "react";
3
3
  import type { LockedFigureSettingsCommonProps } from "./locked-figure-settings";
4
4
  export type Props = LockedFigureSettingsCommonProps & LockedPolygonType & {
5
5
  /**
@@ -7,5 +7,5 @@ export type Props = LockedFigureSettingsCommonProps & LockedPolygonType & {
7
7
  */
8
8
  onChangeProps: (newProps: Partial<LockedPolygonType>) => void;
9
9
  };
10
- declare const LockedPolygonSettings: (props: Props) => JSX.Element;
10
+ declare const LockedPolygonSettings: (props: Props) => React.JSX.Element;
11
11
  export default LockedPolygonSettings;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureSettingsCommonProps } from "./locked-figure-settings";
3
3
  import type { LockedFigure, LockedVectorType } from "@khanacademy/perseus";
4
4
  export type Props = LockedVectorType & LockedFigureSettingsCommonProps & {
@@ -7,5 +7,5 @@ export type Props = LockedVectorType & LockedFigureSettingsCommonProps & {
7
7
  */
8
8
  onChangeProps: (newProps: Partial<LockedFigure>) => void;
9
9
  };
10
- declare const LockedVectorSettings: (props: Props) => JSX.Element;
10
+ declare const LockedVectorSettings: (props: Props) => React.JSX.Element;
11
11
  export default LockedVectorSettings;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { LockedFigureColor, LockedFigureFillType } from "@khanacademy/perseus";
3
3
  type Props = {
4
4
  color: LockedFigureColor;
5
5
  fillStyle: LockedFigureFillType;
6
6
  strokeStyle: "solid" | "dashed";
7
7
  };
8
- declare const PolygonSwatch: (props: Props) => JSX.Element;
8
+ declare const PolygonSwatch: (props: Props) => React.JSX.Element;
9
9
  export default PolygonSwatch;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { PointValue } from "../util/points";
3
3
  declare const GraphPointsCountSelector: ({ numPoints, onChange, }: {
4
4
  numPoints?: PointValue | undefined;
5
5
  onChange: (points: PointValue) => void;
6
- }) => JSX.Element;
6
+ }) => React.JSX.Element;
7
7
  export default GraphPointsCountSelector;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  type GraphTypeSelectorProps = {
3
3
  graphType: string;
4
4
  onChange: (newGraphType: string) => void;
5
5
  };
6
- declare const GraphTypeSelector: (props: GraphTypeSelectorProps) => JSX.Element;
6
+ declare const GraphTypeSelector: (props: GraphTypeSelectorProps) => React.JSX.Element;
7
7
  export default GraphTypeSelector;
@@ -1,7 +1,8 @@
1
- /// <reference types="react" />
2
- declare function Heading({ title, isOpen, onToggle, }: {
1
+ import * as React from "react";
2
+ declare function Heading({ title, isOpen, isCollapsible, onToggle, }: {
3
3
  title: string;
4
4
  isOpen: boolean;
5
+ isCollapsible: boolean;
5
6
  onToggle?: (isOpen: boolean) => void;
6
- }): JSX.Element;
7
+ }): React.JSX.Element;
7
8
  export default Heading;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ type Props = {
3
+ equationString: string;
4
+ children: React.ReactNode;
5
+ };
6
+ export declare function InteractiveGraphCorrectAnswer(props: Props): React.JSX.Element;
7
+ export {};
@@ -137,6 +137,6 @@ declare class InteractiveGraphSettings extends React.Component<Props, State> {
137
137
  changeSnapStep: (snapStep: any) => void;
138
138
  changeGridStep: (gridStep: any) => void;
139
139
  changeGraph: () => void;
140
- render(): JSX.Element;
140
+ render(): React.JSX.Element;
141
141
  }
142
142
  export default InteractiveGraphSettings;
@@ -8,5 +8,5 @@ type Props = {
8
8
  panelStyle?: StyleType;
9
9
  onToggle?: (expanded: boolean) => void;
10
10
  };
11
- declare const PerseusEditorAccordion: (props: Props) => JSX.Element;
11
+ declare const PerseusEditorAccordion: (props: Props) => React.JSX.Element;
12
12
  export default PerseusEditorAccordion;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  declare const SegmentCountSelector: ({ numSegments, onChange, }: {
3
3
  numSegments?: number | undefined;
4
4
  onChange: (numSegments: number) => void;
5
- }) => JSX.Element;
5
+ }) => React.JSX.Element;
6
6
  export default SegmentCountSelector;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { PerseusGraphType, Range, CollinearTuple } from "@khanacademy/perseus";
3
3
  type Props = PerseusGraphType & {
4
4
  range: [x: Range, y: Range];
5
5
  step: [x: number, y: number];
6
6
  onChange: (startCoords: CollinearTuple) => void;
7
7
  };
8
- declare const StartCoordSettings: (props: Props) => JSX.Element | null;
8
+ declare const StartCoordSettings: (props: Props) => React.JSX.Element | null;
9
9
  export default StartCoordSettings;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  type Props = {
3
3
  isExpanded: boolean;
4
4
  };
@@ -6,5 +6,5 @@ type Props = {
6
6
  * Displays a caret in either expanded or collapsed state. For use in headings
7
7
  * that collapse a region.
8
8
  */
9
- declare function ToggleableCaret(props: Props): JSX.Element;
9
+ declare function ToggleableCaret(props: Props): React.JSX.Element;
10
10
  export default ToggleableCaret;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { DeviceType } from "@khanacademy/perseus";
3
3
  type Props = {
4
4
  /** The current device type that is selected. */
@@ -9,5 +9,5 @@ type Props = {
9
9
  */
10
10
  onViewportSizeChanged: (deviceType: DeviceType) => unknown;
11
11
  };
12
- declare const ViewportResizer: (props: Props) => JSX.Element;
12
+ declare const ViewportResizer: (props: Props) => React.JSX.Element;
13
13
  export default ViewportResizer;
@@ -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: "categorizer" | "iframe" | "table" | "video" | "image" | "radio" | "cs-program" | "definition" | "group" | "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" | "unit-input" | "deprecated-standin";
24
+ type: "categorizer" | "image" | "radio" | "table" | "cs-program" | "iframe" | "video" | "definition" | "group" | "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" | "unit-input" | "deprecated-standin";
25
25
  alignment: string | undefined;
26
26
  static: boolean | undefined;
27
27
  graded: boolean | undefined;
package/dist/es/index.js CHANGED
@@ -20,7 +20,7 @@ import { isTruthy, UnreachableCaseError } from '@khanacademy/wonder-stuff-core';
20
20
  import { useMathInputI18n, createMathField } from '@khanacademy/math-input';
21
21
  import { ActionMenu, ActionItem, SingleSelect, OptionItem } from '@khanacademy/wonder-blocks-dropdown';
22
22
  import { TextField, Checkbox as Checkbox$1 } from '@khanacademy/wonder-blocks-form';
23
- import { LabelSmall, LabelMedium, LabelLarge, BodyMonospace } from '@khanacademy/wonder-blocks-typography';
23
+ import { LabelSmall, LabelLarge, LabelMedium, LabelXSmall, BodyMonospace } from '@khanacademy/wonder-blocks-typography';
24
24
  import Button from '@khanacademy/wonder-blocks-button';
25
25
  import { AccordionSection } from '@khanacademy/wonder-blocks-accordion';
26
26
  import IconButton from '@khanacademy/wonder-blocks-icon-button';
@@ -37,7 +37,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
37
37
 
38
38
  // This file is processed by a Rollup plugin (replace) to inject the production
39
39
  const libName = "@khanacademy/perseus-editor";
40
- const libVersion = "8.1.0";
40
+ const libVersion = "9.0.0";
41
41
  addLibraryVersionToPerseusDebug(libName, libVersion);
42
42
 
43
43
  function _extends() {
@@ -29157,7 +29157,7 @@ class InteractionEditor extends React.Component {
29157
29157
  gridStep: this.props.graph.gridStep,
29158
29158
  markings: this.props.graph.markings,
29159
29159
  onChange: this._updateGraphProps
29160
- }), this.props.graph.valid !== true && /*#__PURE__*/React.createElement("div", null, this.props.graph.valid)), _.map(this.props.elements, function (element, n) {
29160
+ }), /*#__PURE__*/React.createElement(React.Fragment, null, this.props.graph.valid !== true && /*#__PURE__*/React.createElement("div", null, this.props.graph.valid))), _.map(this.props.elements, function (element, n) {
29161
29161
  if (element.type === "movable-point") {
29162
29162
  return /*#__PURE__*/React.createElement(ElementContainer, {
29163
29163
  title: /*#__PURE__*/React.createElement("span", null, "Movable point", " ", /*#__PURE__*/React.createElement(TeX, null, "(x_{" + element.options.varSubscript + "}, y_{" + element.options.varSubscript + "})"))
@@ -29593,6 +29593,38 @@ const strutStyle = size => {
29593
29593
  };
29594
29594
  };
29595
29595
 
29596
+ function Heading({
29597
+ title,
29598
+ isOpen,
29599
+ isCollapsible,
29600
+ onToggle
29601
+ }) {
29602
+ return /*#__PURE__*/React.createElement(View, {
29603
+ style: {
29604
+ flexDirection: "row",
29605
+ justifyContent: "space-between",
29606
+ backgroundColor: color.offBlack8,
29607
+ padding: spacing.xSmall_8,
29608
+ marginTop: spacing.small_12,
29609
+ // NOTE(jeremy): This is the inverse of the @editorPadding CSS
29610
+ // variable found in perseus-editor.less. For now, it must
29611
+ // match otherwise there's a gap from this header to the edge
29612
+ // of the editor borders.
29613
+ marginInline: -10,
29614
+ cursor: isCollapsible ? "pointer" : "default",
29615
+ userSelect: "none"
29616
+ },
29617
+ onClick: () => isCollapsible && (onToggle == null ? void 0 : onToggle(!isOpen))
29618
+ }, /*#__PURE__*/React.createElement(LabelLarge, {
29619
+ style: {
29620
+ fontSize: 14,
29621
+ fontWeight: 600
29622
+ }
29623
+ }, title), isCollapsible && /*#__PURE__*/React.createElement(ToggleableCaret, {
29624
+ isExpanded: isOpen
29625
+ }));
29626
+ }
29627
+
29596
29628
  function focusWithChromeStickyFocusBugWorkaround(element) {
29597
29629
  // NOTE(marksandstrom) Chrome sticky focus bug.
29598
29630
  //
@@ -29721,7 +29753,7 @@ const LockedFigureSelect = props => {
29721
29753
  key: `${id}-${figureType}`,
29722
29754
  label: figureType,
29723
29755
  onClick: () => onChange(figureType)
29724
- }, figureType))));
29756
+ }))));
29725
29757
  };
29726
29758
  const styles$x = StyleSheet.create({
29727
29759
  container: {
@@ -29956,7 +29988,7 @@ const ColorSelect = props => {
29956
29988
  color: colorName,
29957
29989
  decorative: true
29958
29990
  })
29959
- }, colorName)))));
29991
+ })))));
29960
29992
  };
29961
29993
  const styles$s = StyleSheet.create({
29962
29994
  row: {
@@ -30151,7 +30183,7 @@ const LockedEllipseSettings = props => {
30151
30183
  key: option,
30152
30184
  value: option,
30153
30185
  label: option
30154
- }, option))))), /*#__PURE__*/React.createElement(LabelMedium, {
30186
+ }))))), /*#__PURE__*/React.createElement(LabelMedium, {
30155
30187
  tag: "label",
30156
30188
  style: styles$p.row
30157
30189
  }, "stroke", /*#__PURE__*/React.createElement(Strut, {
@@ -30167,10 +30199,10 @@ const LockedEllipseSettings = props => {
30167
30199
  }, /*#__PURE__*/React.createElement(OptionItem, {
30168
30200
  value: "solid",
30169
30201
  label: "solid"
30170
- }, "solid"), /*#__PURE__*/React.createElement(OptionItem, {
30202
+ }), /*#__PURE__*/React.createElement(OptionItem, {
30171
30203
  value: "dashed",
30172
30204
  label: "dashed"
30173
- }, "dashed"))), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30205
+ }))), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30174
30206
  showM2Features: props.showM2Features,
30175
30207
  figureType: props.type,
30176
30208
  onMove: onMove,
@@ -30638,7 +30670,7 @@ const LockedPolygonSettings = props => {
30638
30670
  key: option,
30639
30671
  value: option,
30640
30672
  label: option
30641
- }, option))))), /*#__PURE__*/React.createElement(LabelMedium, {
30673
+ }))))), /*#__PURE__*/React.createElement(LabelMedium, {
30642
30674
  tag: "label",
30643
30675
  style: [styles$i.row, styles$i.spaceUnder]
30644
30676
  }, "stroke", /*#__PURE__*/React.createElement(Strut, {
@@ -30654,10 +30686,10 @@ const LockedPolygonSettings = props => {
30654
30686
  }, /*#__PURE__*/React.createElement(OptionItem, {
30655
30687
  value: "solid",
30656
30688
  label: "solid"
30657
- }, "solid"), /*#__PURE__*/React.createElement(OptionItem, {
30689
+ }), /*#__PURE__*/React.createElement(OptionItem, {
30658
30690
  value: "dashed",
30659
30691
  label: "dashed"
30660
- }, "dashed"))), /*#__PURE__*/React.createElement(LabeledSwitch, {
30692
+ }))), /*#__PURE__*/React.createElement(LabeledSwitch, {
30661
30693
  label: "show vertices",
30662
30694
  checked: showVertices,
30663
30695
  onChange: newValue => onChangeProps({
@@ -30885,6 +30917,7 @@ const LockedFiguresSection = props => {
30885
30917
  // expand/collapse all button. Set the whole array to false initially.
30886
30918
  const collapsedStateArray = Array(((_props$figures = props.figures) != null ? _props$figures : []).length).fill(false);
30887
30919
  const [expandedStates, setExpandedStates] = React.useState(collapsedStateArray);
30920
+ const [isExpanded, setIsExpanded] = React.useState(true);
30888
30921
  const uniqueId = useUniqueIdWithMock().get("locked-figures-section");
30889
30922
  const {
30890
30923
  figures,
@@ -30971,7 +31004,12 @@ const LockedFiguresSection = props => {
30971
31004
  const allCollapsed = expandedStates.every(value => !value);
30972
31005
  const buttonLabel = allCollapsed ? "Expand all" : "Collapse all";
30973
31006
  const showExpandButton = !!(figures != null && figures.length);
30974
- return /*#__PURE__*/React.createElement(View, null, figures == null ? void 0 : figures.map((figure, index) => {
31007
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Heading, {
31008
+ title: "Locked Figures",
31009
+ isOpen: isExpanded,
31010
+ onToggle: () => setIsExpanded(!isExpanded),
31011
+ isCollapsible: true
31012
+ }), isExpanded && /*#__PURE__*/React.createElement(View, null, figures == null ? void 0 : figures.map((figure, index) => {
30975
31013
  if (figure.type === "function") {
30976
31014
  // TODO(LEMS-1947): Add locked function settings.
30977
31015
  // Remove this block once function locked figure settings are
@@ -31006,7 +31044,7 @@ const LockedFiguresSection = props => {
31006
31044
  kind: "secondary",
31007
31045
  onClick: () => toggleExpanded(allCollapsed),
31008
31046
  style: styles$g.button
31009
- }, buttonLabel)));
31047
+ }, buttonLabel))));
31010
31048
  };
31011
31049
  const styles$g = StyleSheet.create({
31012
31050
  buttonContainer: {
@@ -31108,29 +31146,27 @@ const styles$e = StyleSheet.create({
31108
31146
  }
31109
31147
  });
31110
31148
 
31111
- function Heading({
31112
- title,
31113
- isOpen,
31114
- onToggle
31115
- }) {
31116
- return /*#__PURE__*/React.createElement(View, {
31149
+ function InteractiveGraphCorrectAnswer(props) {
31150
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Heading, {
31151
+ title: "Correct Answer",
31152
+ isOpen: true,
31153
+ isCollapsible: false
31154
+ }), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(LabelXSmall, {
31117
31155
  style: {
31118
- flexDirection: "row",
31119
- justifyContent: "space-between",
31120
- backgroundColor: color.offBlack8,
31121
- padding: spacing.xSmall_8,
31122
- marginTop: spacing.small_12,
31123
- // NOTE(jeremy): This is the inverse of the @editorPadding CSS
31124
- // variable found in perseus-editor.less. For now, it must
31125
- // match otherwise there's a gap from this header to the edge
31126
- // of the editor borders.
31127
- marginInline: -10,
31128
- cursor: "pointer"
31129
- },
31130
- onClick: () => onToggle == null ? void 0 : onToggle(!isOpen)
31131
- }, /*#__PURE__*/React.createElement(LabelSmall, null, title), /*#__PURE__*/React.createElement(ToggleableCaret, {
31132
- isExpanded: isOpen
31133
- }));
31156
+ paddingTop: spacing.xxSmall_6,
31157
+ paddingBottom: spacing.xxSmall_6,
31158
+ color: color.offBlack64
31159
+ }
31160
+ }, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer."), /*#__PURE__*/React.createElement(BodyMonospace, {
31161
+ style: {
31162
+ fontSize: 12,
31163
+ backgroundColor: "#eee",
31164
+ paddingInline: spacing.xxSmall_6,
31165
+ borderColor: "#ccc",
31166
+ borderStyle: "solid",
31167
+ borderWidth: 1
31168
+ }
31169
+ }, props.equationString)), props.children));
31134
31170
  }
31135
31171
 
31136
31172
  const {
@@ -31423,6 +31459,7 @@ class InteractiveGraphSettings extends React.Component {
31423
31459
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Heading, {
31424
31460
  title: "Common Graph Settings",
31425
31461
  isOpen: this.state.isExpanded,
31462
+ isCollapsible: true,
31426
31463
  onToggle: () => this.setState({
31427
31464
  isExpanded: !this.state.isExpanded
31428
31465
  })
@@ -31733,6 +31770,7 @@ const StartCoordSettings = props => {
31733
31770
  return /*#__PURE__*/React.createElement(View, {
31734
31771
  style: styles$b.container
31735
31772
  }, /*#__PURE__*/React.createElement(Heading, {
31773
+ isCollapsible: true,
31736
31774
  title: "Start coordinates",
31737
31775
  isOpen: isOpen,
31738
31776
  onToggle: () => setIsOpen(!isOpen)
@@ -31915,7 +31953,9 @@ class InteractiveGraphEditor extends React.Component {
31915
31953
  }
31916
31954
  });
31917
31955
  }
31918
- })), ((_this$props$correct = this.props.correct) == null ? void 0 : _this$props$correct.type) === "point" && /*#__PURE__*/React.createElement(LabeledRow, {
31956
+ })), /*#__PURE__*/React.createElement(InteractiveGraphCorrectAnswer, {
31957
+ equationString: equationString
31958
+ }, graph), ((_this$props$correct = this.props.correct) == null ? void 0 : _this$props$correct.type) === "point" && /*#__PURE__*/React.createElement(LabeledRow, {
31919
31959
  label: "Number of Points:"
31920
31960
  }, /*#__PURE__*/React.createElement(GraphPointsCountSelector, {
31921
31961
  numPoints: (_this$props$correct2 = this.props.correct) == null ? void 0 : _this$props$correct2.numPoints,
@@ -32095,18 +32135,7 @@ class InteractiveGraphEditor extends React.Component {
32095
32135
  }), /*#__PURE__*/React.createElement(OptionItem, {
32096
32136
  value: "congruent",
32097
32137
  label: "be congruent"
32098
- })), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Congruency requires only that the angle measures are the same. An exact match implies congruency, but also requires that the angles have the same orientation and that the vertices are in the same position."))), /*#__PURE__*/React.createElement(LabeledRow, {
32099
- label: "Correct answer:"
32100
- }, /*#__PURE__*/React.createElement(BodyMonospace, {
32101
- style: {
32102
- fontSize: 12,
32103
- backgroundColor: "#eee",
32104
- paddingInline: spacing.xxSmall_6,
32105
- borderColor: "#ccc",
32106
- borderStyle: "solid",
32107
- borderWidth: 1
32108
- }
32109
- }, equationString), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer."))), graph,
32138
+ })), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Congruency requires only that the angle measures are the same. An exact match implies congruency, but also requires that the angles have the same orientation and that the vertices are in the same position."))),
32110
32139
  // Only show the "Add locked figure" dropdown if the graph
32111
32140
  // is using Mafs.
32112
32141
  this.props.graph && ((_this$props$apiOption2 = this.props.apiOptions) == null || (_this$props$apiOption2 = _this$props$apiOption2.flags) == null || (_this$props$apiOption2 = _this$props$apiOption2.mafs) == null ? void 0 : _this$props$apiOption2[this.props.graph.type]) && /*#__PURE__*/React.createElement(LockedFiguresSection, {