@khanacademy/perseus 77.4.2 → 77.5.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.
@@ -1 +1,5 @@
1
+ /**
2
+ * @deprecated do not use the denylist
3
+ * See LEMS-4108 for more details
4
+ */
1
5
  export declare function excludeDenylistKeys(obj: Record<any, any>): {};
@@ -124,7 +124,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<Pick<SharedRenderer
124
124
  hintProgressColor?: string;
125
125
  canScrollPage?: boolean;
126
126
  editorChangeDelay?: number;
127
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
127
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
128
128
  }> | undefined;
129
129
  linterContext?: PerseusLinter.LinterContextProps | undefined;
130
130
  onRendered?: ((isRendered: boolean) => void) | undefined;
@@ -1,11 +1,11 @@
1
1
  declare const DEFAULT_FEATURE_FLAGS: {
2
2
  "perseus-test-flag-1": boolean;
3
3
  "perseus-test-flag-2": boolean;
4
- "new-radio-widget": boolean;
5
4
  "image-widget-upgrade-gif-controls": boolean;
6
5
  "image-widget-upgrade-scale": boolean;
7
6
  "interactive-graph-vector": boolean;
8
7
  "interactive-graph-not-scored": boolean;
8
+ "input-number-to-numeric-input": boolean;
9
9
  };
10
10
  /** Utility to get feature flags with optional overrides for testing.
11
11
  * sample usage:
@@ -14,10 +14,10 @@ declare const DEFAULT_FEATURE_FLAGS: {
14
14
  export declare function getFeatureFlags(overrides?: Partial<typeof DEFAULT_FEATURE_FLAGS>): {
15
15
  "perseus-test-flag-1": boolean;
16
16
  "perseus-test-flag-2": boolean;
17
- "new-radio-widget": boolean;
18
17
  "image-widget-upgrade-gif-controls": boolean;
19
18
  "image-widget-upgrade-scale": boolean;
20
19
  "interactive-graph-vector": boolean;
21
20
  "interactive-graph-not-scored": boolean;
21
+ "input-number-to-numeric-input": boolean;
22
22
  };
23
23
  export {};
@@ -39,7 +39,7 @@ export declare const useItemRenderer: (item: PerseusItem, apiOptions?: APIOption
39
39
  hintProgressColor?: string;
40
40
  canScrollPage?: boolean;
41
41
  editorChangeDelay?: number;
42
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
42
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
43
43
  };
44
44
  toggleMobile: (isMobile: boolean) => void;
45
45
  toggleRtl: (isRtl: boolean) => void;
@@ -52,7 +52,7 @@ declare const _default: {
52
52
  hintProgressColor?: string;
53
53
  canScrollPage?: boolean;
54
54
  editorChangeDelay?: number;
55
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
55
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
56
56
  }> & {
57
57
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
58
58
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -42,7 +42,7 @@ export declare const Expression: React.ForwardRefExoticComponent<PerseusExpressi
42
42
  hintProgressColor?: string;
43
43
  canScrollPage?: boolean;
44
44
  editorChangeDelay?: number;
45
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
45
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
46
46
  }> & {
47
47
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
48
48
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -122,7 +122,7 @@ declare const _default: {
122
122
  hintProgressColor?: string;
123
123
  canScrollPage?: boolean;
124
124
  editorChangeDelay?: number;
125
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
125
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
126
126
  }> & {
127
127
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
128
128
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -0,0 +1,2 @@
1
+ import type { Props } from "./interactive-graph";
2
+ export declare function getEquationString(props: Props): string;
@@ -1,13 +1,10 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { StatefulMafsGraphType } from "./stateful-mafs-graph";
4
- import type { QuadraticGraphState } from "./types";
5
- import type { Coord } from "../../interactive2/types";
6
4
  import type { WidgetProps } from "../../types";
7
5
  import type { InteractiveGraphPromptJSON } from "../../widget-ai-utils/interactive-graph/interactive-graph-ai-utils";
8
6
  import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
9
- import type { QuadraticCoefficient, SineCoefficient, TangentCoefficient, Range } from "@khanacademy/kmath";
10
- import type { PerseusGraphType, PerseusGraphTypeAngle, PerseusGraphTypePoint, PerseusGraphTypeSegment, PerseusInteractiveGraphWidgetOptions, GraphRange, InteractiveGraphPublicWidgetOptions, LockedFigure, PerseusImageBackground, MarkingsType, PerseusInteractiveGraphUserInput, AxisLabelLocation, ShowAxisArrows } from "@khanacademy/perseus-core";
7
+ import type { PerseusGraphType, PerseusInteractiveGraphWidgetOptions, GraphRange, InteractiveGraphPublicWidgetOptions, LockedFigure, PerseusImageBackground, MarkingsType, PerseusInteractiveGraphUserInput, AxisLabelLocation, ShowAxisArrows } from "@khanacademy/perseus-core";
11
8
  type InteractiveGraphProps = {
12
9
  /**
13
10
  * Where the little black axis lines & labels (ticks) should render.
@@ -111,7 +108,7 @@ type InteractiveGraphProps = {
111
108
  */
112
109
  fullGraphAriaDescription?: string;
113
110
  };
114
- type Props = WidgetProps<InteractiveGraphProps, PerseusInteractiveGraphUserInput>;
111
+ export type Props = WidgetProps<InteractiveGraphProps, PerseusInteractiveGraphUserInput>;
115
112
  type DefaultProps = {
116
113
  labels: string[];
117
114
  labelLocation: Props["labelLocation"];
@@ -130,6 +127,7 @@ declare class InteractiveGraph extends React.Component<Props, State> {
130
127
  context: React.ContextType<typeof PerseusI18nContext>;
131
128
  mafsRef: React.RefObject<StatefulMafsGraphType>;
132
129
  static defaultProps: DefaultProps;
130
+ static getEquationString(props: Props): string;
133
131
  getUserInput(): PerseusInteractiveGraphUserInput;
134
132
  getPromptJSON(): InteractiveGraphPromptJSON | UnsupportedWidgetPromptJSON;
135
133
  /**
@@ -195,7 +193,7 @@ declare class InteractiveGraph extends React.Component<Props, State> {
195
193
  hintProgressColor?: string;
196
194
  canScrollPage?: boolean;
197
195
  editorChangeDelay?: number;
198
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
196
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
199
197
  }> & {
200
198
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
201
199
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -220,63 +218,6 @@ declare class InteractiveGraph extends React.Component<Props, State> {
220
218
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
221
219
  };
222
220
  render(): React.JSX.Element;
223
- /**
224
- * @param {object} graph Like props.graph or props.correct
225
- * @param {object} props of an InteractiveGraph instance
226
- */
227
- static getLineCoords(graph: PerseusGraphType, props: Props): Coord[];
228
- /**
229
- * @param {object} graph Like props.graph or props.correct
230
- * @param {object} props of an InteractiveGraph instance
231
- */
232
- static getPointCoords(graph: PerseusGraphTypePoint, props: Props): Coord[];
233
- /**
234
- * @param {object} graph Like props.graph or props.correct
235
- * @param {object} props of an InteractiveGraph instance
236
- */
237
- static getLinearSystemCoords(graph: PerseusGraphType, props: Props): [Coord, Coord][];
238
- /**
239
- * @param {object} graph Like props.graph or props.correct
240
- * @param {object} props of an InteractiveGraph instance
241
- */
242
- static getPolygonCoords(graph: PerseusGraphType, props: Props): Coord[];
243
- /**
244
- * @param {object} graph Like props.graph or props.correct
245
- * @param {object} props of an InteractiveGraph instance
246
- */
247
- static getSegmentCoords(graph: PerseusGraphTypeSegment, props: Props): Coord[][];
248
- /**
249
- * @param {object} graph Like props.graph or props.correct
250
- * @param {object} props of an InteractiveGraph instance
251
- */
252
- static getAngleCoords(graph: PerseusGraphTypeAngle, props: Props): [Coord, Coord, Coord];
253
- static normalizeCoords(coordsList: Coord[], ranges: [Range, Range]): Coord[];
254
- static getEquationString(props: Props): string;
255
- static pointsFromNormalized(props: Props, coordsList: Coord[], noSnap?: boolean): Coord[];
256
- static getNoneEquationString(): string;
257
- static getLinearEquationString(props: Props): string;
258
- static getCurrentQuadraticCoefficients(props: Props): QuadraticCoefficient;
259
- static defaultQuadraticCoords(props: Props): QuadraticGraphState["coords"];
260
- static getQuadraticEquationString(props: Props): string;
261
- static getCurrentSinusoidCoefficients(props: Props): SineCoefficient;
262
- static defaultSinusoidCoords(props: Props): Coord[];
263
- static getSinusoidEquationString(props: Props): string;
264
- static defaultExponentialCoords(props: Props): Coord[];
265
- static getExponentialEquationString(props: Props): string;
266
- static defaultLogarithmCoords(props: Props): Coord[];
267
- static getLogarithmEquationString(props: Props): string;
268
- static getAbsoluteValueEquationString(props: Props): string;
269
- static getCurrentTangentCoefficients(props: Props): TangentCoefficient;
270
- static defaultTangentCoords(props: Props): Coord[];
271
- static getTangentEquationString(props: Props): string;
272
- static getCircleEquationString(props: Props): string;
273
- static getLinearSystemEquationString(props: Props): string;
274
- static getPointEquationString(props: Props): string;
275
- static getSegmentEquationString(props: Props): string;
276
- static getRayEquationString(props: Props): string;
277
- static getPolygonEquationString(props: Props): string;
278
- static getAngleEquationString(props: Props): string;
279
- static getVectorEquationString(props: Props): string;
280
221
  }
281
222
  /**
282
223
  * @deprecated and likely a very broken API
@@ -151,7 +151,7 @@ declare const _default: {
151
151
  hintProgressColor?: string;
152
152
  canScrollPage?: boolean;
153
153
  editorChangeDelay?: number;
154
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
154
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
155
155
  }> & {
156
156
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
157
157
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -75,7 +75,7 @@ declare class MockWidgetComponent extends React.Component<Props> implements Widg
75
75
  hintProgressColor?: string;
76
76
  canScrollPage?: boolean;
77
77
  editorChangeDelay?: number;
78
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
78
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
79
79
  }> & {
80
80
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
81
81
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -82,7 +82,7 @@ export declare class NumericInput extends React.Component<NumericInputProps> imp
82
82
  hintProgressColor?: string;
83
83
  canScrollPage?: boolean;
84
84
  editorChangeDelay?: number;
85
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
85
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
86
86
  }> & {
87
87
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
88
88
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -45,7 +45,7 @@ export declare const NumericInputComponent: React.ForwardRefExoticComponent<impo
45
45
  hintProgressColor?: string;
46
46
  canScrollPage?: boolean;
47
47
  editorChangeDelay?: number;
48
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
48
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
49
49
  }> & {
50
50
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
51
51
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -104,7 +104,7 @@ export declare const NumericInputComponent: React.ForwardRefExoticComponent<impo
104
104
  hintProgressColor?: string;
105
105
  canScrollPage?: boolean;
106
106
  editorChangeDelay?: number;
107
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
107
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
108
108
  }> & {
109
109
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
110
110
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
@@ -83,7 +83,7 @@ declare class Table extends React.Component<Props> implements Widget {
83
83
  hintProgressColor?: string;
84
84
  canScrollPage?: boolean;
85
85
  editorChangeDelay?: number;
86
- flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
86
+ flags?: Record<"image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "input-number-to-numeric-input" | "interactive-graph-vector" | "interactive-graph-not-scored", boolean>;
87
87
  }> & {
88
88
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
89
89
  canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core Perseus API (includes renderers and widgets)",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "77.4.2",
6
+ "version": "77.5.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -42,16 +42,16 @@
42
42
  "mafs": "0.19.0",
43
43
  "tiny-invariant": "1.3.1",
44
44
  "uuid": "^10.0.0",
45
- "@khanacademy/kas": "2.2.2",
46
- "@khanacademy/kmath": "2.4.5",
47
- "@khanacademy/math-input": "26.4.19",
48
- "@khanacademy/keypad-context": "3.2.47",
49
- "@khanacademy/perseus-core": "26.0.2",
50
- "@khanacademy/perseus-linter": "5.0.2",
51
- "@khanacademy/perseus-score": "8.8.1",
52
- "@khanacademy/pure-markdown": "2.2.7",
53
- "@khanacademy/simple-markdown": "2.2.2",
54
- "@khanacademy/perseus-utils": "2.1.5"
45
+ "@khanacademy/kas": "2.2.3",
46
+ "@khanacademy/keypad-context": "3.2.49",
47
+ "@khanacademy/kmath": "2.4.7",
48
+ "@khanacademy/math-input": "26.4.21",
49
+ "@khanacademy/perseus-core": "26.1.0",
50
+ "@khanacademy/perseus-linter": "5.0.4",
51
+ "@khanacademy/perseus-score": "8.9.0",
52
+ "@khanacademy/perseus-utils": "2.1.5",
53
+ "@khanacademy/pure-markdown": "2.2.8",
54
+ "@khanacademy/simple-markdown": "2.2.3"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@khanacademy/wonder-blocks-announcer": "1.1.0",