@khanacademy/perseus 22.7.0 → 23.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.
@@ -54,10 +54,8 @@ export declare const ApiOptions: {
54
54
  nativeKeypadProxy: PropTypes.Requireable<(...args: any[]) => any>;
55
55
  isMobile: PropTypes.Requireable<boolean>;
56
56
  setDrawingAreaAvailable: PropTypes.Requireable<(...args: any[]) => any>;
57
- useDraftEditor: PropTypes.Requireable<boolean>;
58
57
  hintProgressColor: PropTypes.Requireable<string>;
59
58
  canScrollPage: PropTypes.Requireable<boolean>;
60
- inModal: PropTypes.Requireable<boolean>;
61
59
  crossOutEnabled: PropTypes.Requireable<boolean>;
62
60
  editorChangeDelay: PropTypes.Requireable<number>;
63
61
  }>>>;
@@ -89,10 +87,8 @@ export declare const ApiOptions: {
89
87
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
90
88
  isMobile?: boolean | undefined;
91
89
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
92
- useDraftEditor?: boolean | undefined;
93
90
  hintProgressColor?: string | undefined;
94
91
  canScrollPage?: boolean | undefined;
95
- inModal?: boolean | undefined;
96
92
  crossOutEnabled?: boolean | undefined;
97
93
  editorChangeDelay?: number | undefined;
98
94
  flags?: {
@@ -100,6 +96,7 @@ export declare const ApiOptions: {
100
96
  circle?: boolean | undefined;
101
97
  polygon?: boolean | undefined;
102
98
  linear?: boolean | undefined;
99
+ quadratic?: boolean | undefined;
103
100
  segment?: boolean | undefined;
104
101
  "linear-system"?: boolean | undefined;
105
102
  ray?: boolean | undefined;
@@ -117,7 +114,6 @@ export declare const ApiOptions: {
117
114
  crossOutEnabled: NonNullable<boolean | undefined>;
118
115
  editorChangeDelay: number;
119
116
  groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
120
- inModal: NonNullable<boolean | undefined>;
121
117
  isArticle: NonNullable<boolean | undefined>;
122
118
  isMobile: NonNullable<boolean | undefined>;
123
119
  onFocusChange: (newFocusPath: import("./types").FocusPath, oldFocusPath: import("./types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
@@ -125,7 +121,6 @@ export declare const ApiOptions: {
125
121
  readOnly: NonNullable<boolean | undefined>;
126
122
  setDrawingAreaAvailable: (arg1: boolean) => unknown;
127
123
  showAlignmentOptions: NonNullable<boolean | undefined>;
128
- useDraftEditor: NonNullable<boolean | undefined>;
129
124
  }>;
130
125
  };
131
126
  export declare const ClassNames: {
@@ -4,7 +4,6 @@ export type Range = Interval;
4
4
  export type Size = [number, number];
5
5
  export type CollinearTuple = readonly [vec.Vector2, vec.Vector2];
6
6
  export type ShowSolutions = "all" | "selected" | "none";
7
- type Empty = Record<never, never>;
8
7
  export type PerseusWidgetsMap = {
9
8
  [key in `categorizer ${number}`]: CategorizerWidget;
10
9
  } & {
@@ -409,7 +408,7 @@ export type PerseusGraphTypePolygon = {
409
408
  } & PerseusGraphTypeCommon;
410
409
  export type PerseusGraphTypeQuadratic = {
411
410
  type: "quadratic";
412
- coords?: ReadonlyArray<Coord>;
411
+ coords?: [Coord, Coord, Coord];
413
412
  } & PerseusGraphTypeCommon;
414
413
  export type PerseusGraphTypeSegment = {
415
414
  type: "segment";
@@ -134,10 +134,8 @@ declare const ref: React.ForwardRefExoticComponent<Omit<Pick<OwnProps & HOCProps
134
134
  nativeKeypadProxy?: ((blur: () => void) => KeypadAPI) | undefined;
135
135
  isMobile?: boolean | undefined;
136
136
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
137
- useDraftEditor?: boolean | undefined;
138
137
  hintProgressColor?: string | undefined;
139
138
  canScrollPage?: boolean | undefined;
140
- inModal?: boolean | undefined;
141
139
  crossOutEnabled?: boolean | undefined;
142
140
  editorChangeDelay?: number | undefined;
143
141
  flags?: {
@@ -145,6 +143,7 @@ declare const ref: React.ForwardRefExoticComponent<Omit<Pick<OwnProps & HOCProps
145
143
  circle?: boolean | undefined;
146
144
  polygon?: boolean | undefined;
147
145
  linear?: boolean | undefined;
146
+ quadratic?: boolean | undefined;
148
147
  segment?: boolean | undefined;
149
148
  "linear-system"?: boolean | undefined;
150
149
  ray?: boolean | undefined;
package/dist/types.d.ts CHANGED
@@ -10,7 +10,6 @@ import type { LinterContextProps } from "@khanacademy/perseus-linter";
10
10
  import type { Result } from "@khanacademy/wonder-blocks-data";
11
11
  import type * as React from "react";
12
12
  export type FocusPath = ReadonlyArray<string> | null | undefined;
13
- type Empty = Record<never, never>;
14
13
  export type Dimensions = {
15
14
  width?: number;
16
15
  height?: number;
@@ -78,7 +77,7 @@ type TrackInteractionArgs = {
78
77
  id: string;
79
78
  correct?: boolean;
80
79
  } & Partial<TrackingGradedGroupExtraArguments> & Partial<TrackingSequenceExtraArguments>;
81
- export declare const MafsGraphTypeFlags: readonly ["segment", "linear", "linear-system", "ray", "polygon", "circle"];
80
+ export declare const MafsGraphTypeFlags: readonly ["segment", "linear", "linear-system", "ray", "polygon", "circle", "quadratic"];
82
81
  export declare const InteractiveGraphLockedFeaturesFlags: readonly ["interactive-graph-locked-features-m1"];
83
82
  /**
84
83
  * APIOptions provides different ways to customize the behaviour of Perseus.
@@ -164,8 +163,6 @@ export type APIOptions = Readonly<{
164
163
  * Previously handled by `Khan.scratchpad.enable/disable`
165
164
  */
166
165
  setDrawingAreaAvailable?: (arg1: boolean) => unknown;
167
- /** Whether to use the Draft.js editor or the legacy textarea */
168
- useDraftEditor?: boolean;
169
166
  /** The color used for the hint progress indicator (eg. 1 / 3) */
170
167
  hintProgressColor?: string;
171
168
  /**
@@ -177,8 +174,6 @@ export type APIOptions = Readonly<{
177
174
  * Defaults to `false`.
178
175
  */
179
176
  canScrollPage?: boolean;
180
- /** Whether or not we are rendering content inside of a modal. */
181
- inModal?: boolean;
182
177
  /**
183
178
  * Whether to enable the cross-out feature on multiple-choice radio
184
179
  * widgets. This allows users to note which answers they believe to
@@ -306,7 +301,6 @@ export type APIOptionsWithDefaults = Readonly<APIOptions & {
306
301
  crossOutEnabled: NonNullable<APIOptions["crossOutEnabled"]>;
307
302
  editorChangeDelay: NonNullable<APIOptions["editorChangeDelay"]>;
308
303
  groupAnnotator: NonNullable<APIOptions["groupAnnotator"]>;
309
- inModal: NonNullable<APIOptions["inModal"]>;
310
304
  isArticle: NonNullable<APIOptions["isArticle"]>;
311
305
  isMobile: NonNullable<APIOptions["isMobile"]>;
312
306
  onFocusChange: NonNullable<APIOptions["onFocusChange"]>;
@@ -314,7 +308,6 @@ export type APIOptionsWithDefaults = Readonly<APIOptions & {
314
308
  readOnly: NonNullable<APIOptions["readOnly"]>;
315
309
  setDrawingAreaAvailable: NonNullable<APIOptions["setDrawingAreaAvailable"]>;
316
310
  showAlignmentOptions: NonNullable<APIOptions["showAlignmentOptions"]>;
317
- useDraftEditor: NonNullable<APIOptions["useDraftEditor"]>;
318
311
  }>;
319
312
  export type Tracking = "" | "all";
320
313
  export type TrackingGradedGroupExtraArguments = {
@@ -2,7 +2,6 @@ import * as React from "react";
2
2
  import { PerseusI18nContext } from "../components/i18n-context";
3
3
  import type { PerseusRenderer, PerseusDefinitionWidgetOptions } from "../perseus-types";
4
4
  import type { PerseusScore, WidgetProps } from "../types";
5
- type Empty = Record<never, never>;
6
5
  type RenderProps = PerseusDefinitionWidgetOptions;
7
6
  type Rubric = PerseusDefinitionWidgetOptions;
8
7
  type UserInput = Empty;
@@ -2,7 +2,6 @@ import * as React from "react";
2
2
  import { PerseusI18nContext } from "../components/i18n-context";
3
3
  import type { PerseusExplanationWidgetOptions } from "../perseus-types";
4
4
  import type { PerseusScore, WidgetProps } from "../types";
5
- type Empty = Record<never, never>;
6
5
  type RenderProps = PerseusExplanationWidgetOptions;
7
6
  type Rubric = PerseusExplanationWidgetOptions;
8
7
  type UserInput = Empty;
@@ -128,10 +128,8 @@ declare const _default: Readonly<{
128
128
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
129
129
  isMobile?: boolean | undefined;
130
130
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
131
- useDraftEditor?: boolean | undefined;
132
131
  hintProgressColor?: string | undefined;
133
132
  canScrollPage?: boolean | undefined;
134
- inModal?: boolean | undefined;
135
133
  crossOutEnabled?: boolean | undefined;
136
134
  editorChangeDelay?: number | undefined;
137
135
  flags?: {
@@ -139,6 +137,7 @@ declare const _default: Readonly<{
139
137
  circle?: boolean | undefined;
140
138
  polygon?: boolean | undefined;
141
139
  linear?: boolean | undefined;
140
+ quadratic?: boolean | undefined;
142
141
  segment?: boolean | undefined;
143
142
  "linear-system"?: boolean | undefined;
144
143
  ray?: boolean | undefined;
@@ -156,7 +155,6 @@ declare const _default: Readonly<{
156
155
  crossOutEnabled: NonNullable<boolean | undefined>;
157
156
  editorChangeDelay: number;
158
157
  groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
159
- inModal: NonNullable<boolean | undefined>;
160
158
  isArticle: NonNullable<boolean | undefined>;
161
159
  isMobile: NonNullable<boolean | undefined>;
162
160
  onFocusChange: (newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
@@ -164,7 +162,6 @@ declare const _default: Readonly<{
164
162
  readOnly: NonNullable<boolean | undefined>;
165
163
  setDrawingAreaAvailable: (arg1: boolean) => unknown;
166
164
  showAlignmentOptions: NonNullable<boolean | undefined>;
167
- useDraftEditor: NonNullable<boolean | undefined>;
168
165
  }>;
169
166
  keypadElement?: any;
170
167
  questionCompleted?: boolean | undefined;
@@ -173,7 +170,7 @@ declare const _default: Readonly<{
173
170
  findWidgets: (arg1: import("../types").FilterCriterion) => readonly any[];
174
171
  reviewModeRubric: PerseusExpressionWidgetOptions;
175
172
  onChange: import("../types").ChangeHandler;
176
- trackInteraction: (extraData?: {} | undefined) => void;
173
+ trackInteraction: (extraData?: Empty | undefined) => void;
177
174
  isLastUsedWidget: boolean;
178
175
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
179
176
  containerSizeClass: import("../util/sizing-utils").SizeClass;
@@ -206,10 +203,8 @@ declare const _default: Readonly<{
206
203
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
207
204
  isMobile?: boolean | undefined;
208
205
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
209
- useDraftEditor?: boolean | undefined;
210
206
  hintProgressColor?: string | undefined;
211
207
  canScrollPage?: boolean | undefined;
212
- inModal?: boolean | undefined;
213
208
  crossOutEnabled?: boolean | undefined;
214
209
  editorChangeDelay?: number | undefined;
215
210
  flags?: {
@@ -217,6 +212,7 @@ declare const _default: Readonly<{
217
212
  circle?: boolean | undefined;
218
213
  polygon?: boolean | undefined;
219
214
  linear?: boolean | undefined;
215
+ quadratic?: boolean | undefined;
220
216
  segment?: boolean | undefined;
221
217
  "linear-system"?: boolean | undefined;
222
218
  ray?: boolean | undefined;
@@ -234,7 +230,6 @@ declare const _default: Readonly<{
234
230
  crossOutEnabled: NonNullable<boolean | undefined>;
235
231
  editorChangeDelay: number;
236
232
  groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
237
- inModal: NonNullable<boolean | undefined>;
238
233
  isArticle: NonNullable<boolean | undefined>;
239
234
  isMobile: NonNullable<boolean | undefined>;
240
235
  onFocusChange: (newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
@@ -242,7 +237,6 @@ declare const _default: Readonly<{
242
237
  readOnly: NonNullable<boolean | undefined>;
243
238
  setDrawingAreaAvailable: (arg1: boolean) => unknown;
244
239
  showAlignmentOptions: NonNullable<boolean | undefined>;
245
- useDraftEditor: NonNullable<boolean | undefined>;
246
240
  }>;
247
241
  buttonSets: import("../perseus-types").LegacyButtonSets;
248
242
  functions: readonly string[];
@@ -284,10 +278,8 @@ declare const _default: Readonly<{
284
278
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
285
279
  isMobile?: boolean | undefined;
286
280
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
287
- useDraftEditor?: boolean | undefined;
288
281
  hintProgressColor?: string | undefined;
289
282
  canScrollPage?: boolean | undefined;
290
- inModal?: boolean | undefined;
291
283
  crossOutEnabled?: boolean | undefined;
292
284
  editorChangeDelay?: number | undefined;
293
285
  flags?: {
@@ -295,6 +287,7 @@ declare const _default: Readonly<{
295
287
  circle?: boolean | undefined;
296
288
  polygon?: boolean | undefined;
297
289
  linear?: boolean | undefined;
290
+ quadratic?: boolean | undefined;
298
291
  segment?: boolean | undefined;
299
292
  "linear-system"?: boolean | undefined;
300
293
  ray?: boolean | undefined;
@@ -312,7 +305,6 @@ declare const _default: Readonly<{
312
305
  crossOutEnabled: NonNullable<boolean | undefined>;
313
306
  editorChangeDelay: number;
314
307
  groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
315
- inModal: NonNullable<boolean | undefined>;
316
308
  isArticle: NonNullable<boolean | undefined>;
317
309
  isMobile: NonNullable<boolean | undefined>;
318
310
  onFocusChange: (newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
@@ -320,7 +312,6 @@ declare const _default: Readonly<{
320
312
  readOnly: NonNullable<boolean | undefined>;
321
313
  setDrawingAreaAvailable: (arg1: boolean) => unknown;
322
314
  showAlignmentOptions: NonNullable<boolean | undefined>;
323
- useDraftEditor: NonNullable<boolean | undefined>;
324
315
  }> | undefined;
325
316
  functions?: readonly string[] | undefined;
326
317
  times?: boolean | undefined;
@@ -359,10 +350,8 @@ declare const _default: Readonly<{
359
350
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
360
351
  isMobile?: boolean | undefined;
361
352
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
362
- useDraftEditor?: boolean | undefined;
363
353
  hintProgressColor?: string | undefined;
364
354
  canScrollPage?: boolean | undefined;
365
- inModal?: boolean | undefined;
366
355
  crossOutEnabled?: boolean | undefined;
367
356
  editorChangeDelay?: number | undefined;
368
357
  flags?: {
@@ -370,6 +359,7 @@ declare const _default: Readonly<{
370
359
  circle?: boolean | undefined;
371
360
  polygon?: boolean | undefined;
372
361
  linear?: boolean | undefined;
362
+ quadratic?: boolean | undefined;
373
363
  segment?: boolean | undefined;
374
364
  "linear-system"?: boolean | undefined;
375
365
  ray?: boolean | undefined;
@@ -387,7 +377,6 @@ declare const _default: Readonly<{
387
377
  crossOutEnabled: NonNullable<boolean | undefined>;
388
378
  editorChangeDelay: number;
389
379
  groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
390
- inModal: NonNullable<boolean | undefined>;
391
380
  isArticle: NonNullable<boolean | undefined>;
392
381
  isMobile: NonNullable<boolean | undefined>;
393
382
  onFocusChange: (newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
@@ -395,7 +384,6 @@ declare const _default: Readonly<{
395
384
  readOnly: NonNullable<boolean | undefined>;
396
385
  setDrawingAreaAvailable: (arg1: boolean) => unknown;
397
386
  showAlignmentOptions: NonNullable<boolean | undefined>;
398
- useDraftEditor: NonNullable<boolean | undefined>;
399
387
  }>;
400
388
  keypadElement?: any;
401
389
  questionCompleted?: boolean | undefined;
@@ -404,7 +392,7 @@ declare const _default: Readonly<{
404
392
  findWidgets: (arg1: import("../types").FilterCriterion) => readonly any[];
405
393
  reviewModeRubric: PerseusExpressionWidgetOptions;
406
394
  onChange: import("../types").ChangeHandler;
407
- trackInteraction: (extraData?: {} | undefined) => void;
395
+ trackInteraction: (extraData?: Empty | undefined) => void;
408
396
  isLastUsedWidget: boolean;
409
397
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
410
398
  containerSizeClass: import("../util/sizing-utils").SizeClass;
@@ -437,10 +425,8 @@ declare const _default: Readonly<{
437
425
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
438
426
  isMobile?: boolean | undefined;
439
427
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
440
- useDraftEditor?: boolean | undefined;
441
428
  hintProgressColor?: string | undefined;
442
429
  canScrollPage?: boolean | undefined;
443
- inModal?: boolean | undefined;
444
430
  crossOutEnabled?: boolean | undefined;
445
431
  editorChangeDelay?: number | undefined;
446
432
  flags?: {
@@ -448,6 +434,7 @@ declare const _default: Readonly<{
448
434
  circle?: boolean | undefined;
449
435
  polygon?: boolean | undefined;
450
436
  linear?: boolean | undefined;
437
+ quadratic?: boolean | undefined;
451
438
  segment?: boolean | undefined;
452
439
  "linear-system"?: boolean | undefined;
453
440
  ray?: boolean | undefined;
@@ -465,7 +452,6 @@ declare const _default: Readonly<{
465
452
  crossOutEnabled: NonNullable<boolean | undefined>;
466
453
  editorChangeDelay: number;
467
454
  groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
468
- inModal: NonNullable<boolean | undefined>;
469
455
  isArticle: NonNullable<boolean | undefined>;
470
456
  isMobile: NonNullable<boolean | undefined>;
471
457
  onFocusChange: (newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
@@ -473,7 +459,6 @@ declare const _default: Readonly<{
473
459
  readOnly: NonNullable<boolean | undefined>;
474
460
  setDrawingAreaAvailable: (arg1: boolean) => unknown;
475
461
  showAlignmentOptions: NonNullable<boolean | undefined>;
476
- useDraftEditor: NonNullable<boolean | undefined>;
477
462
  }>;
478
463
  buttonSets: import("../perseus-types").LegacyButtonSets;
479
464
  functions: readonly string[];
@@ -515,10 +500,8 @@ declare const _default: Readonly<{
515
500
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
516
501
  isMobile?: boolean | undefined;
517
502
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
518
- useDraftEditor?: boolean | undefined;
519
503
  hintProgressColor?: string | undefined;
520
504
  canScrollPage?: boolean | undefined;
521
- inModal?: boolean | undefined;
522
505
  crossOutEnabled?: boolean | undefined;
523
506
  editorChangeDelay?: number | undefined;
524
507
  flags?: {
@@ -526,6 +509,7 @@ declare const _default: Readonly<{
526
509
  circle?: boolean | undefined;
527
510
  polygon?: boolean | undefined;
528
511
  linear?: boolean | undefined;
512
+ quadratic?: boolean | undefined;
529
513
  segment?: boolean | undefined;
530
514
  "linear-system"?: boolean | undefined;
531
515
  ray?: boolean | undefined;
@@ -543,7 +527,6 @@ declare const _default: Readonly<{
543
527
  crossOutEnabled: NonNullable<boolean | undefined>;
544
528
  editorChangeDelay: number;
545
529
  groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
546
- inModal: NonNullable<boolean | undefined>;
547
530
  isArticle: NonNullable<boolean | undefined>;
548
531
  isMobile: NonNullable<boolean | undefined>;
549
532
  onFocusChange: (newFocusPath: import("../types").FocusPath, oldFocusPath: import("../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
@@ -551,7 +534,6 @@ declare const _default: Readonly<{
551
534
  readOnly: NonNullable<boolean | undefined>;
552
535
  setDrawingAreaAvailable: (arg1: boolean) => unknown;
553
536
  showAlignmentOptions: NonNullable<boolean | undefined>;
554
- useDraftEditor: NonNullable<boolean | undefined>;
555
537
  }> | undefined;
556
538
  functions?: readonly string[] | undefined;
557
539
  times?: boolean | undefined;
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../components/i18n-context";
3
+ import type { QuadraticGraphState } from "./interactive-graphs/types";
3
4
  import type { Coord } from "../interactive2/types";
4
5
  import type { PerseusGraphType, PerseusGraphTypeAngle, PerseusGraphTypePoint, PerseusGraphTypePolygon, PerseusGraphTypeSegment, PerseusInteractiveGraphWidgetOptions } from "../perseus-types";
5
6
  import type { Widget } from "../renderer";
@@ -152,7 +153,7 @@ declare class InteractiveGraph extends React.Component<Props, State> {
152
153
  static pointsFromNormalized(props: Props, coordsList: ReadonlyArray<Coord>, noSnap?: boolean): ReadonlyArray<Coord>;
153
154
  static getLinearEquationString(props: Props): string;
154
155
  static getCurrentQuadraticCoefficients(props: Props): QuadraticCoefficient;
155
- static defaultQuadraticCoords(props: Props): ReadonlyArray<Coord>;
156
+ static defaultQuadraticCoords(props: Props): QuadraticGraphState["coords"];
156
157
  static getQuadraticEquationString(props: Props): string;
157
158
  static getCurrentSinusoidCoefficients(props: Props): SineCoefficient;
158
159
  static defaultSinusoidCoords(props: Props): ReadonlyArray<Coord>;
@@ -3,3 +3,4 @@ export { LinearGraph } from "./linear";
3
3
  export { RayGraph } from "./ray";
4
4
  export { PolygonGraph } from "./polygon";
5
5
  export { CircleGraph } from "./circle";
6
+ export { QuadraticGraph } from "./quadratic";
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { QuadraticGraphState, MafsGraphProps } from "../types";
3
+ import type { vec } from "mafs";
4
+ type QuadraticGraphProps = MafsGraphProps<QuadraticGraphState>;
5
+ type QuadraticCoefficient = [number, number, number];
6
+ export declare function QuadraticGraph(props: QuadraticGraphProps): JSX.Element;
7
+ export declare const isValidDestination: (destination: vec.Vector2, elementId: number, coords: [import("../../..").Coord, import("../../..").Coord, import("../../..").Coord]) => boolean;
8
+ export declare const getQuadraticCoefficients: (coords: [import("../../..").Coord, import("../../..").Coord, import("../../..").Coord]) => QuadraticCoefficient | undefined;
9
+ export {};
@@ -1,3 +1,3 @@
1
- export declare const mafsSupportedGraphTypes: readonly ["segment", "linear", "linear-system", "ray", "polygon", "point", "circle"];
1
+ export declare const mafsSupportedGraphTypes: readonly ["segment", "linear", "linear-system", "ray", "polygon", "point", "circle", "quadratic"];
2
2
  export type MafsSupportedGraphType = (typeof mafsSupportedGraphTypes)[number];
3
3
  export declare const trueForAllMafsSupportedGraphTypes: Record<MafsSupportedGraphType, true>;
@@ -13,7 +13,7 @@ export interface InitializeGraphStateParams<T extends PerseusGraphType> {
13
13
  range: [Interval, Interval];
14
14
  step: vec.Vector2;
15
15
  }
16
- export type InteractiveGraphState = SegmentGraphState | LinearGraphState | RayGraphState | PolygonGraphState | PointGraphState | CircleGraphState;
16
+ export type InteractiveGraphState = SegmentGraphState | LinearGraphState | RayGraphState | PolygonGraphState | PointGraphState | CircleGraphState | QuadraticGraphState;
17
17
  export interface InteractiveGraphStateCommon {
18
18
  hasBeenInteractedWith: boolean;
19
19
  range: [xRange: Interval, yRange: Interval];
@@ -46,6 +46,10 @@ export interface CircleGraphState extends InteractiveGraphStateCommon {
46
46
  center: Coord;
47
47
  radiusPoint: Coord;
48
48
  }
49
+ export interface QuadraticGraphState extends InteractiveGraphStateCommon {
50
+ type: "quadratic";
51
+ coords: [Coord, Coord, Coord];
52
+ }
49
53
  export type PairOfPoints = [Coord, Coord];
50
54
  export type GraphDimensions = {
51
55
  range: [Interval, Interval];
@@ -122,10 +122,8 @@ declare const _default: Readonly<{
122
122
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
123
123
  isMobile?: boolean | undefined;
124
124
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
125
- useDraftEditor?: boolean | undefined;
126
125
  hintProgressColor?: string | undefined;
127
126
  canScrollPage?: boolean | undefined;
128
- inModal?: boolean | undefined;
129
127
  crossOutEnabled?: boolean | undefined;
130
128
  editorChangeDelay?: number | undefined;
131
129
  flags?: {
@@ -133,6 +131,7 @@ declare const _default: Readonly<{
133
131
  circle?: boolean | undefined;
134
132
  polygon?: boolean | undefined;
135
133
  linear?: boolean | undefined;
134
+ quadratic?: boolean | undefined;
136
135
  segment?: boolean | undefined;
137
136
  "linear-system"?: boolean | undefined;
138
137
  ray?: boolean | undefined;
@@ -182,10 +181,8 @@ declare const _default: Readonly<{
182
181
  nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
183
182
  isMobile?: boolean | undefined;
184
183
  setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
185
- useDraftEditor?: boolean | undefined;
186
184
  hintProgressColor?: string | undefined;
187
185
  canScrollPage?: boolean | undefined;
188
- inModal?: boolean | undefined;
189
186
  crossOutEnabled?: boolean | undefined;
190
187
  editorChangeDelay?: number | undefined;
191
188
  flags?: {
@@ -193,6 +190,7 @@ declare const _default: Readonly<{
193
190
  circle?: boolean | undefined;
194
191
  polygon?: boolean | undefined;
195
192
  linear?: boolean | undefined;
193
+ quadratic?: boolean | undefined;
196
194
  segment?: boolean | undefined;
197
195
  "linear-system"?: boolean | undefined;
198
196
  ray?: boolean | undefined;
@@ -36,10 +36,8 @@ export declare class Matcher extends React.Component<any, any> {
36
36
  nativeKeypadProxy: PropTypes.Requireable<(...args: any[]) => any>;
37
37
  isMobile: PropTypes.Requireable<boolean>;
38
38
  setDrawingAreaAvailable: PropTypes.Requireable<(...args: any[]) => any>;
39
- useDraftEditor: PropTypes.Requireable<boolean>;
40
39
  hintProgressColor: PropTypes.Requireable<string>;
41
40
  canScrollPage: PropTypes.Requireable<boolean>;
42
- inModal: PropTypes.Requireable<boolean>;
43
41
  crossOutEnabled: PropTypes.Requireable<boolean>;
44
42
  editorChangeDelay: PropTypes.Requireable<number>;
45
43
  }>>>;
@@ -26,10 +26,8 @@ declare class Sorter extends React.Component<any, any> {
26
26
  nativeKeypadProxy: PropTypes.Requireable<(...args: any[]) => any>;
27
27
  isMobile: PropTypes.Requireable<boolean>;
28
28
  setDrawingAreaAvailable: PropTypes.Requireable<(...args: any[]) => any>;
29
- useDraftEditor: PropTypes.Requireable<boolean>;
30
29
  hintProgressColor: PropTypes.Requireable<string>;
31
30
  canScrollPage: PropTypes.Requireable<boolean>;
32
- inModal: PropTypes.Requireable<boolean>;
33
31
  crossOutEnabled: PropTypes.Requireable<boolean>;
34
32
  editorChangeDelay: PropTypes.Requireable<number>;
35
33
  }>>>;
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": "22.7.0",
6
+ "version": "23.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -44,9 +44,9 @@
44
44
  "@khanacademy/math-input": "^19.1.0",
45
45
  "@khanacademy/perseus-core": "1.4.2",
46
46
  "@khanacademy/perseus-linter": "^0.4.0",
47
- "@khanacademy/pure-markdown": "^0.3.4",
48
- "@khanacademy/simple-markdown": "^0.11.4",
49
- "mafs": "0.18.5"
47
+ "@khanacademy/pure-markdown": "^0.3.5",
48
+ "@khanacademy/simple-markdown": "^0.12.0",
49
+ "mafs": "0.18.7"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@khanacademy/wonder-blocks-banner": "3.0.42",