@khanacademy/perseus-editor 30.1.1 → 30.2.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.
@@ -3917,6 +3917,174 @@ declare const InteractiveGraph: {
3917
3917
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
3918
3918
  containerSizeClass: import("../../../../perseus/src/util/sizing-utils").SizeClass;
3919
3919
  }): string;
3920
+ defaultLogarithmCoords(props: {
3921
+ step: [number, number];
3922
+ gridStep?: [x: number, y: number];
3923
+ snapStep?: [x: number, y: number];
3924
+ backgroundImage?: PerseusImageBackground;
3925
+ markings: MarkingsType;
3926
+ labels: string[];
3927
+ labelLocation: AxisLabelLocation;
3928
+ showProtractor: boolean;
3929
+ showRuler?: boolean;
3930
+ showTooltips?: boolean;
3931
+ rulerLabel?: string;
3932
+ rulerTicks?: number;
3933
+ range: import("@khanacademy/perseus-core").GraphRange;
3934
+ showAxisArrows: ShowAxisArrows;
3935
+ graph: PerseusGraphType;
3936
+ correct?: PerseusGraphType;
3937
+ lockedFigures: LockedFigure[];
3938
+ fullGraphAriaLabel?: string;
3939
+ fullGraphAriaDescription?: string;
3940
+ } & {
3941
+ trackInteraction: (extraData?: Empty | undefined) => void;
3942
+ widgetId: string;
3943
+ widgetIndex: number;
3944
+ alignment: string | null | undefined;
3945
+ static: boolean | null | undefined;
3946
+ problemNum: number | null | undefined;
3947
+ apiOptions: Readonly<Readonly<{
3948
+ isArticle?: boolean;
3949
+ onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
3950
+ showAlignmentOptions?: boolean;
3951
+ readOnly?: boolean;
3952
+ editingDisabled?: boolean;
3953
+ answerableCallback?: (arg1: boolean) => unknown;
3954
+ getAnotherHint?: () => unknown;
3955
+ interactionCallback?: (widgetData: {
3956
+ [widgetId: string]: any;
3957
+ }) => void;
3958
+ imagePlaceholder?: React.ReactNode;
3959
+ widgetPlaceholder?: React.ReactNode;
3960
+ baseElements?: {
3961
+ Link: React.ComponentType<any>;
3962
+ };
3963
+ imagePreloader?: (dimensions: import("../../../../perseus/src/types").Dimensions) => React.ReactNode;
3964
+ trackInteraction?: (args: {
3965
+ type: string;
3966
+ id: string;
3967
+ correct?: boolean;
3968
+ } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
3969
+ visible: number;
3970
+ }>) => void;
3971
+ customKeypad?: boolean;
3972
+ nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
3973
+ isMobile?: boolean;
3974
+ isMobileApp?: boolean;
3975
+ setDrawingAreaAvailable?: (arg1: boolean) => unknown;
3976
+ hintProgressColor?: string;
3977
+ canScrollPage?: boolean;
3978
+ editorChangeDelay?: number;
3979
+ flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-absolute-value" | "interactive-graph-tangent" | "interactive-graph-logarithm" | "interactive-graph-exponent" | "interactive-graph-vector", boolean>;
3980
+ }> & {
3981
+ baseElements: NonNullable<import("@khanacademy/perseus").APIOptions["baseElements"]>;
3982
+ canScrollPage: NonNullable<import("@khanacademy/perseus").APIOptions["canScrollPage"]>;
3983
+ editorChangeDelay: NonNullable<import("@khanacademy/perseus").APIOptions["editorChangeDelay"]>;
3984
+ isArticle: NonNullable<import("@khanacademy/perseus").APIOptions["isArticle"]>;
3985
+ isMobile: NonNullable<import("@khanacademy/perseus").APIOptions["isMobile"]>;
3986
+ isMobileApp: NonNullable<import("@khanacademy/perseus").APIOptions["isMobileApp"]>;
3987
+ editingDisabled: NonNullable<import("@khanacademy/perseus").APIOptions["editingDisabled"]>;
3988
+ onFocusChange: NonNullable<import("@khanacademy/perseus").APIOptions["onFocusChange"]>;
3989
+ readOnly: NonNullable<import("@khanacademy/perseus").APIOptions["readOnly"]>;
3990
+ setDrawingAreaAvailable: NonNullable<import("@khanacademy/perseus").APIOptions["setDrawingAreaAvailable"]>;
3991
+ showAlignmentOptions: NonNullable<import("@khanacademy/perseus").APIOptions["showAlignmentOptions"]>;
3992
+ }>;
3993
+ keypadElement?: any;
3994
+ onFocus: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
3995
+ onBlur: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
3996
+ findWidgets: (criterion: import("../../../../perseus/src/types").FilterCriterion) => ReadonlyArray<import("../../../../perseus/src/types").Widget>;
3997
+ reviewMode: boolean;
3998
+ showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
3999
+ handleUserInput: (newUserInput: PerseusGraphType, cb?: () => void, silent?: boolean) => void;
4000
+ userInput: PerseusGraphType;
4001
+ linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
4002
+ containerSizeClass: import("../../../../perseus/src/util/sizing-utils").SizeClass;
4003
+ }): import("@khanacademy/perseus").Coord[];
4004
+ getLogarithmEquationString(props: {
4005
+ step: [number, number];
4006
+ gridStep?: [x: number, y: number];
4007
+ snapStep?: [x: number, y: number];
4008
+ backgroundImage?: PerseusImageBackground;
4009
+ markings: MarkingsType;
4010
+ labels: string[];
4011
+ labelLocation: AxisLabelLocation;
4012
+ showProtractor: boolean;
4013
+ showRuler?: boolean;
4014
+ showTooltips?: boolean;
4015
+ rulerLabel?: string;
4016
+ rulerTicks?: number;
4017
+ range: import("@khanacademy/perseus-core").GraphRange;
4018
+ showAxisArrows: ShowAxisArrows;
4019
+ graph: PerseusGraphType;
4020
+ correct?: PerseusGraphType;
4021
+ lockedFigures: LockedFigure[];
4022
+ fullGraphAriaLabel?: string;
4023
+ fullGraphAriaDescription?: string;
4024
+ } & {
4025
+ trackInteraction: (extraData?: Empty | undefined) => void;
4026
+ widgetId: string;
4027
+ widgetIndex: number;
4028
+ alignment: string | null | undefined;
4029
+ static: boolean | null | undefined;
4030
+ problemNum: number | null | undefined;
4031
+ apiOptions: Readonly<Readonly<{
4032
+ isArticle?: boolean;
4033
+ onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
4034
+ showAlignmentOptions?: boolean;
4035
+ readOnly?: boolean;
4036
+ editingDisabled?: boolean;
4037
+ answerableCallback?: (arg1: boolean) => unknown;
4038
+ getAnotherHint?: () => unknown;
4039
+ interactionCallback?: (widgetData: {
4040
+ [widgetId: string]: any;
4041
+ }) => void;
4042
+ imagePlaceholder?: React.ReactNode;
4043
+ widgetPlaceholder?: React.ReactNode;
4044
+ baseElements?: {
4045
+ Link: React.ComponentType<any>;
4046
+ };
4047
+ imagePreloader?: (dimensions: import("../../../../perseus/src/types").Dimensions) => React.ReactNode;
4048
+ trackInteraction?: (args: {
4049
+ type: string;
4050
+ id: string;
4051
+ correct?: boolean;
4052
+ } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
4053
+ visible: number;
4054
+ }>) => void;
4055
+ customKeypad?: boolean;
4056
+ nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
4057
+ isMobile?: boolean;
4058
+ isMobileApp?: boolean;
4059
+ setDrawingAreaAvailable?: (arg1: boolean) => unknown;
4060
+ hintProgressColor?: string;
4061
+ canScrollPage?: boolean;
4062
+ editorChangeDelay?: number;
4063
+ flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-absolute-value" | "interactive-graph-tangent" | "interactive-graph-logarithm" | "interactive-graph-exponent" | "interactive-graph-vector", boolean>;
4064
+ }> & {
4065
+ baseElements: NonNullable<import("@khanacademy/perseus").APIOptions["baseElements"]>;
4066
+ canScrollPage: NonNullable<import("@khanacademy/perseus").APIOptions["canScrollPage"]>;
4067
+ editorChangeDelay: NonNullable<import("@khanacademy/perseus").APIOptions["editorChangeDelay"]>;
4068
+ isArticle: NonNullable<import("@khanacademy/perseus").APIOptions["isArticle"]>;
4069
+ isMobile: NonNullable<import("@khanacademy/perseus").APIOptions["isMobile"]>;
4070
+ isMobileApp: NonNullable<import("@khanacademy/perseus").APIOptions["isMobileApp"]>;
4071
+ editingDisabled: NonNullable<import("@khanacademy/perseus").APIOptions["editingDisabled"]>;
4072
+ onFocusChange: NonNullable<import("@khanacademy/perseus").APIOptions["onFocusChange"]>;
4073
+ readOnly: NonNullable<import("@khanacademy/perseus").APIOptions["readOnly"]>;
4074
+ setDrawingAreaAvailable: NonNullable<import("@khanacademy/perseus").APIOptions["setDrawingAreaAvailable"]>;
4075
+ showAlignmentOptions: NonNullable<import("@khanacademy/perseus").APIOptions["showAlignmentOptions"]>;
4076
+ }>;
4077
+ keypadElement?: any;
4078
+ onFocus: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
4079
+ onBlur: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
4080
+ findWidgets: (criterion: import("../../../../perseus/src/types").FilterCriterion) => ReadonlyArray<import("../../../../perseus/src/types").Widget>;
4081
+ reviewMode: boolean;
4082
+ showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
4083
+ handleUserInput: (newUserInput: PerseusGraphType, cb?: () => void, silent?: boolean) => void;
4084
+ userInput: PerseusGraphType;
4085
+ linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
4086
+ containerSizeClass: import("../../../../perseus/src/util/sizing-utils").SizeClass;
4087
+ }): string;
3920
4088
  getAbsoluteValueEquationString(props: {
3921
4089
  step: [number, number];
3922
4090
  gridStep?: [x: number, y: number];
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import type { Coord } from "@khanacademy/perseus";
3
+ type LogarithmStartCoords = {
4
+ coords: [Coord, Coord];
5
+ asymptote: number;
6
+ };
7
+ type Props = {
8
+ startCoords: LogarithmStartCoords;
9
+ onChange: (startCoords: LogarithmStartCoords) => void;
10
+ };
11
+ declare const StartCoordsLogarithm: (props: Props) => React.JSX.Element;
12
+ export default StartCoordsLogarithm;
@@ -23,6 +23,8 @@ type GraphTypesThatHaveStartCoords = {
23
23
  type: "sinusoid";
24
24
  } | {
25
25
  type: "exponential";
26
+ } | {
27
+ type: "logarithm";
26
28
  } | {
27
29
  type: "tangent";
28
30
  };
@@ -5,5 +5,6 @@ export declare function getDefaultGraphStartCoords(graph: PerseusGraphType, rang
5
5
  export declare const getSinusoidEquation: (startCoords: [Coord, Coord]) => string;
6
6
  export declare const getTangentEquation: (startCoords: [Coord, Coord]) => string;
7
7
  export declare const getQuadraticEquation: (startCoords: [Coord, Coord, Coord]) => string;
8
+ export declare const getLogarithmEquation: (coords: [Coord, Coord], asymptote: number) => string;
8
9
  export declare const getAngleEquation: (startCoords: [Coord, Coord, Coord], allowReflexAngles?: boolean) => string;
9
10
  export declare const shouldShowStartCoordsUI: (graph: PerseusGraphType, isStatic?: boolean) => boolean;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Perseus editors",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "30.1.1",
6
+ "version": "30.2.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -36,13 +36,13 @@
36
36
  "mafs": "^0.19.0",
37
37
  "tiny-invariant": "1.3.1",
38
38
  "@khanacademy/kas": "2.2.1",
39
- "@khanacademy/keypad-context": "3.2.41",
40
- "@khanacademy/kmath": "2.3.1",
41
- "@khanacademy/math-input": "26.4.12",
42
- "@khanacademy/perseus": "77.1.0",
43
- "@khanacademy/perseus-core": "24.0.0",
44
- "@khanacademy/perseus-linter": "4.9.1",
45
- "@khanacademy/perseus-score": "8.5.0",
39
+ "@khanacademy/keypad-context": "3.2.42",
40
+ "@khanacademy/kmath": "2.4.0",
41
+ "@khanacademy/math-input": "26.4.13",
42
+ "@khanacademy/perseus": "77.2.0",
43
+ "@khanacademy/perseus-core": "24.1.0",
44
+ "@khanacademy/perseus-linter": "4.9.2",
45
+ "@khanacademy/perseus-score": "8.6.0",
46
46
  "@khanacademy/perseus-utils": "2.1.5"
47
47
  },
48
48
  "devDependencies": {