@khanacademy/perseus-editor 43.0.2 → 44.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.
@@ -1,702 +1,6 @@
1
- import { type LockedFigure, type PerseusImageBackground, type PerseusInteractiveGraphWidgetOptions, type PerseusGraphType, type MarkingsType, type AxisLabelLocation, type ShowAxisArrows, type ShowAxisTicks } from "@khanacademy/perseus-core";
2
1
  import * as React from "react";
3
2
  import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
4
- import type { PropsFor } from "@khanacademy/wonder-blocks-core";
5
- declare const InteractiveGraph: {
6
- new (props: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props): {
7
- context: React.ContextType<typeof import("@khanacademy/perseus").PerseusI18nContext>;
8
- mafsRef: React.RefObject<import("../../../../perseus/src/widgets/interactive-graphs/stateful-mafs-graph").StatefulMafsGraphType>;
9
- getUserInput(): import("@khanacademy/perseus-core").PerseusInteractiveGraphUserInput;
10
- getPromptJSON(): import("@khanacademy/perseus").InteractiveGraphPromptJSON | import("@khanacademy/perseus").UnsupportedWidgetPromptJSON;
11
- getSerializedState(): {
12
- graph: PerseusGraphType;
13
- trackInteraction: (extraData?: Empty | undefined) => void;
14
- widgetId: string;
15
- widgetIndex: number;
16
- alignment: import("@khanacademy/perseus-core").Alignment | null | undefined;
17
- static: boolean | null | undefined;
18
- graded?: boolean | null;
19
- problemNum: number | null | undefined;
20
- apiOptions: Readonly<Readonly<{
21
- isArticle?: boolean;
22
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
23
- showAlignmentOptions?: boolean;
24
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
25
- readOnly?: boolean;
26
- editingDisabled?: boolean;
27
- answerableCallback?: (arg1: boolean) => unknown;
28
- getAnotherHint?: () => unknown;
29
- interactionCallback? /**
30
- * The labels for the x and y axes.
31
- */: (widgetData: {
32
- [widgetId: string]: any;
33
- }) => void;
34
- imagePlaceholder?: React.ReactNode;
35
- widgetPlaceholder?: React.ReactNode;
36
- baseElements?: {
37
- Link: React.ComponentType<any>;
38
- };
39
- trackInteraction?: (args: {
40
- type: string;
41
- id: string;
42
- correct?: boolean;
43
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
44
- visible: number;
45
- }>) => void;
46
- customKeypad?: boolean;
47
- isMobile?: boolean;
48
- isMobileApp?: boolean;
49
- hintProgressColor?: string;
50
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
51
- }> & {
52
- baseElements: NonNullable<Readonly<{
53
- isArticle?: boolean;
54
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
55
- showAlignmentOptions?: boolean;
56
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
57
- readOnly?: boolean;
58
- editingDisabled?: boolean;
59
- answerableCallback?: (arg1: boolean) => unknown;
60
- getAnotherHint?: () => unknown;
61
- interactionCallback?: (widgetData: {
62
- [widgetId: string]: any;
63
- }) => void;
64
- imagePlaceholder?: React.ReactNode;
65
- widgetPlaceholder?: React.ReactNode;
66
- baseElements?: {
67
- Link: React.ComponentType<any>;
68
- };
69
- trackInteraction?: (args: {
70
- type: string;
71
- id: string;
72
- correct?: boolean;
73
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
74
- visible: number;
75
- }>) => void;
76
- customKeypad?: boolean;
77
- isMobile?: boolean;
78
- isMobileApp?: boolean;
79
- hintProgressColor?: string;
80
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
81
- }>["baseElements"]>;
82
- isArticle: NonNullable<Readonly<{
83
- isArticle?: boolean;
84
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
85
- showAlignmentOptions?: boolean;
86
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
87
- readOnly?: boolean;
88
- editingDisabled?: boolean;
89
- answerableCallback?: (arg1: boolean) => unknown;
90
- getAnotherHint?: () => unknown;
91
- interactionCallback?: (widgetData: {
92
- [widgetId: string]: any;
93
- }) => void;
94
- imagePlaceholder?: React.ReactNode;
95
- widgetPlaceholder?: React.ReactNode;
96
- baseElements?: {
97
- Link: React.ComponentType<any>;
98
- };
99
- trackInteraction?: (args: {
100
- type: string;
101
- id: string;
102
- correct?: boolean;
103
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
104
- visible: number;
105
- }>) => void;
106
- customKeypad?: boolean;
107
- isMobile?: boolean;
108
- isMobileApp?: boolean;
109
- hintProgressColor?: string;
110
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
111
- }>["isArticle"]>;
112
- isMobile: NonNullable<Readonly<{
113
- isArticle?: boolean;
114
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
115
- showAlignmentOptions?: boolean;
116
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
117
- readOnly?: boolean;
118
- editingDisabled?: boolean;
119
- answerableCallback?: (arg1: boolean) => unknown;
120
- getAnotherHint?: () => unknown;
121
- interactionCallback?: (widgetData: {
122
- [widgetId: string]: any;
123
- }) => void;
124
- imagePlaceholder?: React.ReactNode;
125
- widgetPlaceholder?: React.ReactNode;
126
- baseElements?: {
127
- Link: React.ComponentType<any>;
128
- };
129
- trackInteraction?: (args: {
130
- type: string;
131
- id: string;
132
- correct?: boolean;
133
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
134
- visible: number;
135
- }>) => void;
136
- customKeypad?: boolean;
137
- isMobile?: boolean;
138
- isMobileApp?: boolean;
139
- hintProgressColor?: string;
140
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
141
- }>["isMobile"]>;
142
- isMobileApp: NonNullable<Readonly<{
143
- isArticle?: boolean;
144
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
145
- showAlignmentOptions?: boolean;
146
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
147
- readOnly?: boolean;
148
- editingDisabled?: boolean;
149
- answerableCallback?: (arg1: boolean) => unknown;
150
- getAnotherHint?: () => unknown;
151
- interactionCallback?: (widgetData: {
152
- [widgetId: string]: any;
153
- }) => void;
154
- imagePlaceholder?: React.ReactNode;
155
- widgetPlaceholder?: React.ReactNode;
156
- baseElements?: {
157
- Link: React.ComponentType<any>;
158
- };
159
- trackInteraction?: (args: {
160
- type: string;
161
- id: string;
162
- correct?: boolean;
163
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
164
- visible: number;
165
- }>) => void;
166
- customKeypad?: boolean;
167
- isMobile?: boolean;
168
- isMobileApp?: boolean;
169
- hintProgressColor?: string;
170
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
171
- }>["isMobileApp"]>;
172
- editingDisabled: NonNullable<Readonly<{
173
- isArticle?: boolean;
174
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
175
- showAlignmentOptions?: boolean;
176
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
177
- readOnly?: boolean;
178
- editingDisabled?: boolean;
179
- answerableCallback?: (arg1: boolean) => unknown;
180
- getAnotherHint?: () => unknown;
181
- interactionCallback?: (widgetData: {
182
- [widgetId: string]: any;
183
- }) => void;
184
- imagePlaceholder?: React.ReactNode;
185
- widgetPlaceholder?: React.ReactNode;
186
- baseElements?: {
187
- Link: React.ComponentType<any>;
188
- };
189
- trackInteraction?: (args: {
190
- type: string;
191
- id: string;
192
- correct?: boolean;
193
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
194
- visible: number;
195
- }>) => void;
196
- customKeypad?: boolean;
197
- isMobile?: boolean;
198
- isMobileApp?: boolean;
199
- hintProgressColor?: string;
200
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
201
- }>["editingDisabled"]>;
202
- onFocusChange: NonNullable<Readonly<{
203
- isArticle?: boolean;
204
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
205
- showAlignmentOptions?: boolean;
206
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
207
- readOnly?: boolean;
208
- editingDisabled?: boolean;
209
- answerableCallback?: (arg1: boolean) => unknown;
210
- getAnotherHint?: () => unknown;
211
- interactionCallback?: (widgetData: {
212
- [widgetId: string]: any;
213
- }) => void;
214
- imagePlaceholder?: React.ReactNode;
215
- widgetPlaceholder?: React.ReactNode;
216
- baseElements?: {
217
- Link: React.ComponentType<any>;
218
- };
219
- trackInteraction?: (args: {
220
- type: string;
221
- id: string;
222
- correct?: boolean;
223
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
224
- visible: number;
225
- }>) => void;
226
- customKeypad?: boolean;
227
- isMobile?: boolean;
228
- isMobileApp?: boolean;
229
- hintProgressColor?: string;
230
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
231
- }>["onFocusChange"]>;
232
- readOnly: NonNullable<Readonly<{
233
- isArticle?: boolean;
234
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
235
- showAlignmentOptions?: boolean;
236
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
237
- readOnly?: boolean;
238
- editingDisabled?: boolean;
239
- answerableCallback?: (arg1: boolean) => unknown;
240
- getAnotherHint?: () => unknown;
241
- interactionCallback?: (widgetData: {
242
- [widgetId: string]: any;
243
- }) => void;
244
- imagePlaceholder?: React.ReactNode;
245
- widgetPlaceholder?: React.ReactNode;
246
- baseElements?: {
247
- Link: React.ComponentType<any>;
248
- };
249
- trackInteraction?: (args: {
250
- type: string;
251
- id: string;
252
- correct?: boolean;
253
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
254
- visible: number;
255
- }>) => void;
256
- customKeypad?: boolean;
257
- isMobile?: boolean;
258
- isMobileApp?: boolean;
259
- hintProgressColor?: string;
260
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
261
- }>["readOnly"]>;
262
- showAlignmentOptions: NonNullable<Readonly<{
263
- isArticle?: boolean;
264
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
265
- showAlignmentOptions?: boolean;
266
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
267
- readOnly?: boolean;
268
- editingDisabled?: boolean;
269
- answerableCallback?: (arg1: boolean) => unknown;
270
- getAnotherHint?: () => unknown;
271
- interactionCallback?: (widgetData: {
272
- [widgetId: string]: any;
273
- }) => void;
274
- imagePlaceholder?: React.ReactNode;
275
- widgetPlaceholder?: React.ReactNode;
276
- baseElements?: {
277
- Link: React.ComponentType<any>;
278
- };
279
- trackInteraction?: (args: {
280
- type: string;
281
- id: string;
282
- correct?: boolean;
283
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
284
- visible: number;
285
- }>) => void;
286
- customKeypad?: boolean;
287
- isMobile?: boolean;
288
- isMobileApp?: boolean;
289
- hintProgressColor?: string;
290
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
291
- }>["showAlignmentOptions"]>;
292
- }>;
293
- keypadElement?: any;
294
- onFocus: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
295
- onBlur: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
296
- findWidgets: import("../../../../perseus/src/types").FindWidgetsFunction;
297
- reviewMode: boolean;
298
- showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
299
- handleUserInput: (newUserInput: PerseusGraphType, cb
300
- /**
301
- * Whether to show tooltips on the graph.
302
- * (Currently not used, but will be in the future.)
303
- */
304
- ? /**
305
- * Whether to show tooltips on the graph.
306
- * (Currently not used, but will be in the future.)
307
- */: () => void, silent?: boolean) => void;
308
- linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
309
- containerSizeClass: import("../../../../perseus/src/util/sizing-utils").SizeClass;
310
- step: [number, number];
311
- gridStep?: [x: number, y: number];
312
- snapStep?: [x: number, y: number];
313
- backgroundImage: import("@khanacademy/perseus-core").PerseusImageBackground;
314
- markings: import("@khanacademy/perseus-core").MarkingsType;
315
- labels: string[];
316
- labelLocation: import("@khanacademy/perseus-core").AxisLabelLocation;
317
- showAxisArrows: import("@khanacademy/perseus-core").ShowAxisArrows;
318
- showAxisTicks: import("@khanacademy/perseus-core").ShowAxisTicks;
319
- showProtractor: boolean;
320
- showRuler?: boolean;
321
- showTooltips: boolean;
322
- rulerLabel?: string;
323
- rulerTicks?: number;
324
- range: import("@khanacademy/perseus-core").GraphRange;
325
- correct: PerseusGraphType;
326
- lockedFigures: import("@khanacademy/perseus-core").LockedFigure[];
327
- fullGraphAriaLabel?: string;
328
- fullGraphAriaDescription?: string;
329
- };
330
- render(): React.JSX.Element;
331
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
332
- forceUpdate(callback?: (() => void) | undefined): void;
333
- readonly props: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>;
334
- state: Readonly<{}>;
335
- refs: {
336
- [key: string]: React.ReactInstance;
337
- };
338
- componentDidMount?(): void;
339
- shouldComponentUpdate?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextState: Readonly<{}>, nextContext: any): boolean;
340
- componentWillUnmount?(): void;
341
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
342
- getSnapshotBeforeUpdate?(prevProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, prevState: Readonly<{}>): any;
343
- componentDidUpdate?(prevProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, prevState: Readonly<{}>, snapshot?: any): void;
344
- componentWillMount?(): void;
345
- UNSAFE_componentWillMount?(): void;
346
- componentWillReceiveProps?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextContext: any): void;
347
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextContext: any): void;
348
- componentWillUpdate?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextState: Readonly<{}>, nextContext: any): void;
349
- UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextState: Readonly<{}>, nextContext: any): void;
350
- };
351
- new (props: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props, context: any): {
352
- context: React.ContextType<typeof import("@khanacademy/perseus").PerseusI18nContext>;
353
- mafsRef: React.RefObject<import("../../../../perseus/src/widgets/interactive-graphs/stateful-mafs-graph").StatefulMafsGraphType>;
354
- getUserInput(): import("@khanacademy/perseus-core").PerseusInteractiveGraphUserInput;
355
- getPromptJSON(): import("@khanacademy/perseus").InteractiveGraphPromptJSON | import("@khanacademy/perseus").UnsupportedWidgetPromptJSON;
356
- getSerializedState(): {
357
- graph: PerseusGraphType;
358
- trackInteraction: (extraData?: Empty | undefined) => void;
359
- widgetId: string;
360
- widgetIndex: number;
361
- alignment: import("@khanacademy/perseus-core").Alignment | null | undefined;
362
- static: boolean | null | undefined;
363
- graded?: boolean | null;
364
- problemNum: number | null | undefined;
365
- apiOptions: Readonly<Readonly<{
366
- isArticle?: boolean;
367
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
368
- showAlignmentOptions?: boolean;
369
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
370
- readOnly?: boolean;
371
- editingDisabled?: boolean;
372
- answerableCallback?: (arg1: boolean) => unknown;
373
- getAnotherHint?: () => unknown;
374
- interactionCallback? /**
375
- * The labels for the x and y axes.
376
- */: (widgetData: {
377
- [widgetId: string]: any;
378
- }) => void;
379
- imagePlaceholder?: React.ReactNode;
380
- widgetPlaceholder?: React.ReactNode;
381
- baseElements?: {
382
- Link: React.ComponentType<any>;
383
- };
384
- trackInteraction?: (args: {
385
- type: string;
386
- id: string;
387
- correct?: boolean;
388
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
389
- visible: number;
390
- }>) => void;
391
- customKeypad?: boolean;
392
- isMobile?: boolean;
393
- isMobileApp?: boolean;
394
- hintProgressColor?: string;
395
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
396
- }> & {
397
- baseElements: NonNullable<Readonly<{
398
- isArticle?: boolean;
399
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
400
- showAlignmentOptions?: boolean;
401
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
402
- readOnly?: boolean;
403
- editingDisabled?: boolean;
404
- answerableCallback?: (arg1: boolean) => unknown;
405
- getAnotherHint?: () => unknown;
406
- interactionCallback?: (widgetData: {
407
- [widgetId: string]: any;
408
- }) => void;
409
- imagePlaceholder?: React.ReactNode;
410
- widgetPlaceholder?: React.ReactNode;
411
- baseElements?: {
412
- Link: React.ComponentType<any>;
413
- };
414
- trackInteraction?: (args: {
415
- type: string;
416
- id: string;
417
- correct?: boolean;
418
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
419
- visible: number;
420
- }>) => void;
421
- customKeypad?: boolean;
422
- isMobile?: boolean;
423
- isMobileApp?: boolean;
424
- hintProgressColor?: string;
425
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
426
- }>["baseElements"]>;
427
- isArticle: NonNullable<Readonly<{
428
- isArticle?: boolean;
429
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
430
- showAlignmentOptions?: boolean;
431
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
432
- readOnly?: boolean;
433
- editingDisabled?: boolean;
434
- answerableCallback?: (arg1: boolean) => unknown;
435
- getAnotherHint?: () => unknown;
436
- interactionCallback?: (widgetData: {
437
- [widgetId: string]: any;
438
- }) => void;
439
- imagePlaceholder?: React.ReactNode;
440
- widgetPlaceholder?: React.ReactNode;
441
- baseElements?: {
442
- Link: React.ComponentType<any>;
443
- };
444
- trackInteraction?: (args: {
445
- type: string;
446
- id: string;
447
- correct?: boolean;
448
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
449
- visible: number;
450
- }>) => void;
451
- customKeypad?: boolean;
452
- isMobile?: boolean;
453
- isMobileApp?: boolean;
454
- hintProgressColor?: string;
455
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
456
- }>["isArticle"]>;
457
- isMobile: NonNullable<Readonly<{
458
- isArticle?: boolean;
459
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
460
- showAlignmentOptions?: boolean;
461
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
462
- readOnly?: boolean;
463
- editingDisabled?: boolean;
464
- answerableCallback?: (arg1: boolean) => unknown;
465
- getAnotherHint?: () => unknown;
466
- interactionCallback?: (widgetData: {
467
- [widgetId: string]: any;
468
- }) => void;
469
- imagePlaceholder?: React.ReactNode;
470
- widgetPlaceholder?: React.ReactNode;
471
- baseElements?: {
472
- Link: React.ComponentType<any>;
473
- };
474
- trackInteraction?: (args: {
475
- type: string;
476
- id: string;
477
- correct?: boolean;
478
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
479
- visible: number;
480
- }>) => void;
481
- customKeypad?: boolean;
482
- isMobile?: boolean;
483
- isMobileApp?: boolean;
484
- hintProgressColor?: string;
485
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
486
- }>["isMobile"]>;
487
- isMobileApp: NonNullable<Readonly<{
488
- isArticle?: boolean;
489
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
490
- showAlignmentOptions?: boolean;
491
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
492
- readOnly?: boolean;
493
- editingDisabled?: boolean;
494
- answerableCallback?: (arg1: boolean) => unknown;
495
- getAnotherHint?: () => unknown;
496
- interactionCallback?: (widgetData: {
497
- [widgetId: string]: any;
498
- }) => void;
499
- imagePlaceholder?: React.ReactNode;
500
- widgetPlaceholder?: React.ReactNode;
501
- baseElements?: {
502
- Link: React.ComponentType<any>;
503
- };
504
- trackInteraction?: (args: {
505
- type: string;
506
- id: string;
507
- correct?: boolean;
508
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
509
- visible: number;
510
- }>) => void;
511
- customKeypad?: boolean;
512
- isMobile?: boolean;
513
- isMobileApp?: boolean;
514
- hintProgressColor?: string;
515
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
516
- }>["isMobileApp"]>;
517
- editingDisabled: NonNullable<Readonly<{
518
- isArticle?: boolean;
519
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
520
- showAlignmentOptions?: boolean;
521
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
522
- readOnly?: boolean;
523
- editingDisabled?: boolean;
524
- answerableCallback?: (arg1: boolean) => unknown;
525
- getAnotherHint?: () => unknown;
526
- interactionCallback?: (widgetData: {
527
- [widgetId: string]: any;
528
- }) => void;
529
- imagePlaceholder?: React.ReactNode;
530
- widgetPlaceholder?: React.ReactNode;
531
- baseElements?: {
532
- Link: React.ComponentType<any>;
533
- };
534
- trackInteraction?: (args: {
535
- type: string;
536
- id: string;
537
- correct?: boolean;
538
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
539
- visible: number;
540
- }>) => void;
541
- customKeypad?: boolean;
542
- isMobile?: boolean;
543
- isMobileApp?: boolean;
544
- hintProgressColor?: string;
545
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
546
- }>["editingDisabled"]>;
547
- onFocusChange: NonNullable<Readonly<{
548
- isArticle?: boolean;
549
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
550
- showAlignmentOptions?: boolean;
551
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
552
- readOnly?: boolean;
553
- editingDisabled?: boolean;
554
- answerableCallback?: (arg1: boolean) => unknown;
555
- getAnotherHint?: () => unknown;
556
- interactionCallback?: (widgetData: {
557
- [widgetId: string]: any;
558
- }) => void;
559
- imagePlaceholder?: React.ReactNode;
560
- widgetPlaceholder?: React.ReactNode;
561
- baseElements?: {
562
- Link: React.ComponentType<any>;
563
- };
564
- trackInteraction?: (args: {
565
- type: string;
566
- id: string;
567
- correct?: boolean;
568
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
569
- visible: number;
570
- }>) => void;
571
- customKeypad?: boolean;
572
- isMobile?: boolean;
573
- isMobileApp?: boolean;
574
- hintProgressColor?: string;
575
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
576
- }>["onFocusChange"]>;
577
- readOnly: NonNullable<Readonly<{
578
- isArticle?: boolean;
579
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
580
- showAlignmentOptions?: boolean;
581
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
582
- readOnly?: boolean;
583
- editingDisabled?: boolean;
584
- answerableCallback?: (arg1: boolean) => unknown;
585
- getAnotherHint?: () => unknown;
586
- interactionCallback?: (widgetData: {
587
- [widgetId: string]: any;
588
- }) => void;
589
- imagePlaceholder?: React.ReactNode;
590
- widgetPlaceholder?: React.ReactNode;
591
- baseElements?: {
592
- Link: React.ComponentType<any>;
593
- };
594
- trackInteraction?: (args: {
595
- type: string;
596
- id: string;
597
- correct?: boolean;
598
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
599
- visible: number;
600
- }>) => void;
601
- customKeypad?: boolean;
602
- isMobile?: boolean;
603
- isMobileApp?: boolean;
604
- hintProgressColor?: string;
605
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
606
- }>["readOnly"]>;
607
- showAlignmentOptions: NonNullable<Readonly<{
608
- isArticle?: boolean;
609
- onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
610
- showAlignmentOptions?: boolean;
611
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
612
- readOnly?: boolean;
613
- editingDisabled?: boolean;
614
- answerableCallback?: (arg1: boolean) => unknown;
615
- getAnotherHint?: () => unknown;
616
- interactionCallback?: (widgetData: {
617
- [widgetId: string]: any;
618
- }) => void;
619
- imagePlaceholder?: React.ReactNode;
620
- widgetPlaceholder?: React.ReactNode;
621
- baseElements?: {
622
- Link: React.ComponentType<any>;
623
- };
624
- trackInteraction?: (args: {
625
- type: string;
626
- id: string;
627
- correct?: boolean;
628
- } & Partial<import("../../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<{
629
- visible: number;
630
- }>) => void;
631
- customKeypad?: boolean;
632
- isMobile?: boolean;
633
- isMobileApp?: boolean;
634
- hintProgressColor?: string;
635
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
636
- }>["showAlignmentOptions"]>;
637
- }>;
638
- keypadElement?: any;
639
- onFocus: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
640
- onBlur: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
641
- findWidgets: import("../../../../perseus/src/types").FindWidgetsFunction;
642
- reviewMode: boolean;
643
- showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
644
- handleUserInput: (newUserInput: PerseusGraphType, cb
645
- /**
646
- * Whether to show tooltips on the graph.
647
- * (Currently not used, but will be in the future.)
648
- */
649
- ? /**
650
- * Whether to show tooltips on the graph.
651
- * (Currently not used, but will be in the future.)
652
- */: () => void, silent?: boolean) => void;
653
- linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
654
- containerSizeClass: import("../../../../perseus/src/util/sizing-utils").SizeClass;
655
- step: [number, number];
656
- gridStep?: [x: number, y: number];
657
- snapStep?: [x: number, y: number];
658
- backgroundImage: import("@khanacademy/perseus-core").PerseusImageBackground;
659
- markings: import("@khanacademy/perseus-core").MarkingsType;
660
- labels: string[];
661
- labelLocation: import("@khanacademy/perseus-core").AxisLabelLocation;
662
- showAxisArrows: import("@khanacademy/perseus-core").ShowAxisArrows;
663
- showAxisTicks: import("@khanacademy/perseus-core").ShowAxisTicks;
664
- showProtractor: boolean;
665
- showRuler?: boolean;
666
- showTooltips: boolean;
667
- rulerLabel?: string;
668
- rulerTicks?: number;
669
- range: import("@khanacademy/perseus-core").GraphRange;
670
- correct: PerseusGraphType;
671
- lockedFigures: import("@khanacademy/perseus-core").LockedFigure[];
672
- fullGraphAriaLabel?: string;
673
- fullGraphAriaDescription?: string;
674
- };
675
- render(): React.JSX.Element;
676
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
677
- forceUpdate(callback?: (() => void) | undefined): void;
678
- readonly props: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>;
679
- state: Readonly<{}>;
680
- refs: {
681
- [key: string]: React.ReactInstance;
682
- };
683
- componentDidMount?(): void;
684
- shouldComponentUpdate?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextState: Readonly<{}>, nextContext: any): boolean;
685
- componentWillUnmount?(): void;
686
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
687
- getSnapshotBeforeUpdate?(prevProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, prevState: Readonly<{}>): any;
688
- componentDidUpdate?(prevProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, prevState: Readonly<{}>, snapshot?: any): void;
689
- componentWillMount?(): void;
690
- UNSAFE_componentWillMount?(): void;
691
- componentWillReceiveProps?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextContext: any): void;
692
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextContext: any): void;
693
- componentWillUpdate?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextState: Readonly<{}>, nextContext: any): void;
694
- UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props>, nextState: Readonly<{}>, nextContext: any): void;
695
- };
696
- contextType: React.Context<import("../../../../perseus/src/components/i18n-context").I18nContextType>;
697
- getEquationString(props: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props): string;
698
- };
699
- type InteractiveGraphProps = PropsFor<typeof InteractiveGraph>;
3
+ import type { PerseusInteractiveGraphUserInput, LockedFigure, PerseusImageBackground, PerseusInteractiveGraphWidgetOptions, PerseusGraphType, MarkingsType, AxisLabelLocation, ShowAxisArrows, ShowAxisTicks } from "@khanacademy/perseus-core";
700
4
  type Range = [min: number, max: number];
701
5
  export type Props = {
702
6
  apiOptions: APIOptionsWithDefaults;
@@ -786,7 +90,7 @@ export type Props = {
786
90
  /**
787
91
  * The graph to display in the graph area.
788
92
  */
789
- graph: InteractiveGraphProps["userInput"];
93
+ graph: PerseusInteractiveGraphUserInput;
790
94
  onChange: (props: Partial<Props>) => void;
791
95
  static?: boolean;
792
96
  /**