@khanacademy/perseus-editor 6.2.3 → 6.4.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.
@@ -2,7 +2,6 @@
2
2
  import type { LockedFigureColor } from "@khanacademy/perseus";
3
3
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
4
4
  type Props = {
5
- id: string;
6
5
  selectedValue: LockedFigureColor;
7
6
  style?: StyleType;
8
7
  onChange: (newValue: string) => void;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { LockedPointType } from "@khanacademy/perseus";
3
+ type Props = {
4
+ coord: [number, number];
5
+ onChangeProps: (newProps: Partial<LockedPointType>) => void;
6
+ };
7
+ declare const CoordinatePairInput: (props: Props) => JSX.Element;
8
+ export default CoordinatePairInput;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import type { AccordionProps } from "./locked-figure-settings";
3
+ import type { LockedPointType } from "@khanacademy/perseus";
4
+ export type Props = AccordionProps & LockedPointType & {
5
+ /**
6
+ * Optional label for the point to display in the header summary.
7
+ * Defaults to "Point".
8
+ */
9
+ label: string;
10
+ /**
11
+ * Whether the extra point settings are toggled open.
12
+ */
13
+ showPoint?: boolean;
14
+ /**
15
+ * Called when the extra settings toggle switch is changed.
16
+ */
17
+ onTogglePoint?: (newValue: any) => void;
18
+ /**
19
+ * Called when the props (coords, color, etc.) are updated.
20
+ */
21
+ onChangeProps: (newProps: Partial<LockedPointType>) => void;
22
+ };
23
+ declare const DefiningPointSettings: (props: Props) => JSX.Element;
24
+ export default DefiningPointSettings;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { type LockedFigureColor } from "@khanacademy/perseus";
3
+ type Props = {
4
+ color: LockedFigureColor;
5
+ lineStyle: "solid" | "dashed";
6
+ };
7
+ declare const LineSwatch: (props: Props) => JSX.Element;
8
+ export default LineSwatch;
@@ -3,8 +3,10 @@ import type { StyleType } from "@khanacademy/wonder-blocks-core";
3
3
  type Props = {
4
4
  children: React.ReactNode | React.ReactNode[];
5
5
  header: string | React.ReactElement;
6
+ expanded?: boolean;
6
7
  containerStyle?: StyleType;
7
8
  panelStyle?: StyleType;
9
+ onToggle?: (expanded: boolean) => void;
8
10
  };
9
11
  declare const LockedFigureSettingsAccordion: (props: Props) => JSX.Element;
10
12
  export default LockedFigureSettingsAccordion;
@@ -7,6 +7,16 @@
7
7
  /// <reference types="react" />
8
8
  import type { Props as LockedLineProps } from "./locked-line-settings";
9
9
  import type { Props as LockedPointProps } from "./locked-point-settings";
10
- type Props = LockedPointProps | LockedLineProps;
10
+ export type AccordionProps = {
11
+ /**
12
+ * Whether this accordion is expanded.
13
+ */
14
+ expanded?: boolean;
15
+ /**
16
+ * Called when the accordion is expanded or collapsed.
17
+ */
18
+ onToggle?: (expanded: boolean) => void;
19
+ };
20
+ type Props = AccordionProps & (LockedPointProps | LockedLineProps);
11
21
  declare const LockedFigureSettings: (props: Props) => JSX.Element | null;
12
22
  export default LockedFigureSettings;
@@ -1,7 +1,14 @@
1
1
  /// <reference types="react" />
2
+ import type { AccordionProps } from "./locked-figure-settings";
2
3
  import type { LockedFigure, LockedLineType } from "@khanacademy/perseus";
3
- export type Props = LockedLineType & {
4
+ export type Props = LockedLineType & AccordionProps & {
5
+ /**
6
+ * Called when the delete button is pressed.
7
+ */
4
8
  onRemove: () => void;
9
+ /**
10
+ * Called when the props (points, color, etc.) are updated.
11
+ */
5
12
  onChangeProps: (newProps: Partial<LockedFigure>) => void;
6
13
  };
7
14
  declare const LockedLineSettings: (props: Props) => JSX.Element;
@@ -1,12 +1,14 @@
1
1
  /// <reference types="react" />
2
+ import type { AccordionProps } from "./locked-figure-settings";
2
3
  import type { LockedPointType } from "@khanacademy/perseus";
3
- import type { StyleType } from "@khanacademy/wonder-blocks-core";
4
- export type Props = LockedPointType & {
5
- label?: string;
6
- toggled?: boolean;
7
- style?: StyleType;
8
- onRemove?: () => void;
9
- onToggle?: (newValue: any) => void;
4
+ export type Props = AccordionProps & LockedPointType & {
5
+ /**
6
+ * Called when the delete button is pressed.
7
+ */
8
+ onRemove: () => void;
9
+ /**
10
+ * Called when the props (coords, color, etc.) are updated.
11
+ */
10
12
  onChangeProps: (newProps: Partial<LockedPointType>) => void;
11
13
  };
12
14
  declare const LockedPointSettings: (props: Props) => JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import type { LockedFigure, LockedFigureType, LockedPointType, LockedLineType } from "@khanacademy/perseus";
2
2
  export declare function focusWithChromeStickyFocusBugWorkaround(element: Element): void;
3
- export declare function getValidNumberFromString(value: string): number;
4
3
  export declare function getDefaultFigureForType(type: "point"): LockedPointType;
5
4
  export declare function getDefaultFigureForType(type: "line"): LockedLineType;
6
5
  export declare function getDefaultFigureForType(type: LockedFigureType): LockedFigure;