@khanacademy/perseus-editor 37.0.0 → 37.0.2

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.
@@ -10,29 +10,10 @@ declare const InteractiveGraph: {
10
10
  getPromptJSON(): import("@khanacademy/perseus").InteractiveGraphPromptJSON | import("@khanacademy/perseus").UnsupportedWidgetPromptJSON;
11
11
  getSerializedState(): {
12
12
  graph: PerseusGraphType;
13
- step: [number, number];
14
- gridStep?: [x: number, y: number];
15
- snapStep?: [x: number, y: number];
16
- backgroundImage: import("@khanacademy/perseus-core").PerseusImageBackground;
17
- markings: import("@khanacademy/perseus-core").MarkingsType;
18
- labels: string[];
19
- labelLocation: import("@khanacademy/perseus-core").AxisLabelLocation;
20
- showAxisArrows: import("@khanacademy/perseus-core").ShowAxisArrows;
21
- showAxisTicks: import("@khanacademy/perseus-core").ShowAxisTicks;
22
- showProtractor: boolean;
23
- showRuler?: boolean;
24
- showTooltips: boolean;
25
- rulerLabel?: string;
26
- rulerTicks?: number;
27
- range: import("@khanacademy/perseus-core").GraphRange;
28
- correct: PerseusGraphType;
29
- lockedFigures: import("@khanacademy/perseus-core").LockedFigure[];
30
- fullGraphAriaLabel?: string;
31
- fullGraphAriaDescription?: string;
32
13
  trackInteraction: (extraData?: Empty | undefined) => void;
33
14
  widgetId: string;
34
15
  widgetIndex: number;
35
- alignment: string | null | undefined;
16
+ alignment: import("@khanacademy/perseus-core").Alignment | null | undefined;
36
17
  static: boolean | null | undefined;
37
18
  graded?: boolean | null;
38
19
  problemNum: number | null | undefined;
@@ -307,6 +288,25 @@ declare const InteractiveGraph: {
307
288
  handleUserInput: (newUserInput: PerseusGraphType, cb?: () => void, silent?: boolean) => void;
308
289
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
309
290
  containerSizeClass: import("../../../../perseus/src/util/sizing-utils").SizeClass;
291
+ step: [number, number];
292
+ gridStep?: [x: number, y: number];
293
+ snapStep?: [x: number, y: number];
294
+ backgroundImage: import("@khanacademy/perseus-core").PerseusImageBackground;
295
+ markings: import("@khanacademy/perseus-core").MarkingsType;
296
+ labels: string[];
297
+ labelLocation: import("@khanacademy/perseus-core").AxisLabelLocation;
298
+ showAxisArrows: import("@khanacademy/perseus-core").ShowAxisArrows;
299
+ showAxisTicks: import("@khanacademy/perseus-core").ShowAxisTicks;
300
+ showProtractor: boolean;
301
+ showRuler?: boolean;
302
+ showTooltips: boolean;
303
+ rulerLabel?: string;
304
+ rulerTicks?: number;
305
+ range: import("@khanacademy/perseus-core").GraphRange;
306
+ correct: PerseusGraphType;
307
+ lockedFigures: import("@khanacademy/perseus-core").LockedFigure[];
308
+ fullGraphAriaLabel?: string;
309
+ fullGraphAriaDescription?: string;
310
310
  };
311
311
  render(): React.JSX.Element;
312
312
  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;
@@ -336,29 +336,10 @@ declare const InteractiveGraph: {
336
336
  getPromptJSON(): import("@khanacademy/perseus").InteractiveGraphPromptJSON | import("@khanacademy/perseus").UnsupportedWidgetPromptJSON;
337
337
  getSerializedState(): {
338
338
  graph: PerseusGraphType;
339
- step: [number, number];
340
- gridStep?: [x: number, y: number];
341
- snapStep?: [x: number, y: number];
342
- backgroundImage: import("@khanacademy/perseus-core").PerseusImageBackground;
343
- markings: import("@khanacademy/perseus-core").MarkingsType;
344
- labels: string[];
345
- labelLocation: import("@khanacademy/perseus-core").AxisLabelLocation;
346
- showAxisArrows: import("@khanacademy/perseus-core").ShowAxisArrows;
347
- showAxisTicks: import("@khanacademy/perseus-core").ShowAxisTicks;
348
- showProtractor: boolean;
349
- showRuler?: boolean;
350
- showTooltips: boolean;
351
- rulerLabel?: string;
352
- rulerTicks?: number;
353
- range: import("@khanacademy/perseus-core").GraphRange;
354
- correct: PerseusGraphType;
355
- lockedFigures: import("@khanacademy/perseus-core").LockedFigure[];
356
- fullGraphAriaLabel?: string;
357
- fullGraphAriaDescription?: string;
358
339
  trackInteraction: (extraData?: Empty | undefined) => void;
359
340
  widgetId: string;
360
341
  widgetIndex: number;
361
- alignment: string | null | undefined;
342
+ alignment: import("@khanacademy/perseus-core").Alignment | null | undefined;
362
343
  static: boolean | null | undefined;
363
344
  graded?: boolean | null;
364
345
  problemNum: number | null | undefined;
@@ -633,6 +614,25 @@ declare const InteractiveGraph: {
633
614
  handleUserInput: (newUserInput: PerseusGraphType, cb?: () => void, silent?: boolean) => void;
634
615
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
635
616
  containerSizeClass: import("../../../../perseus/src/util/sizing-utils").SizeClass;
617
+ step: [number, number];
618
+ gridStep?: [x: number, y: number];
619
+ snapStep?: [x: number, y: number];
620
+ backgroundImage: import("@khanacademy/perseus-core").PerseusImageBackground;
621
+ markings: import("@khanacademy/perseus-core").MarkingsType;
622
+ labels: string[];
623
+ labelLocation: import("@khanacademy/perseus-core").AxisLabelLocation;
624
+ showAxisArrows: import("@khanacademy/perseus-core").ShowAxisArrows;
625
+ showAxisTicks: import("@khanacademy/perseus-core").ShowAxisTicks;
626
+ showProtractor: boolean;
627
+ showRuler?: boolean;
628
+ showTooltips: boolean;
629
+ rulerLabel?: string;
630
+ rulerTicks?: number;
631
+ range: import("@khanacademy/perseus-core").GraphRange;
632
+ correct: PerseusGraphType;
633
+ lockedFigures: import("@khanacademy/perseus-core").LockedFigure[];
634
+ fullGraphAriaLabel?: string;
635
+ fullGraphAriaDescription?: string;
636
636
  };
637
637
  render(): React.JSX.Element;
638
638
  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;
@@ -1,22 +1,17 @@
1
- import { type MatcherDefaultWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusMatcherWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
- type Props = any;
3
+ type Props = PerseusMatcherWidgetOptions & {
4
+ onChange: (newOptions: Partial<PerseusMatcherWidgetOptions>, callback?: () => void) => void;
5
+ };
4
6
  /**
5
7
  * An editor for adding a matcher widget that allows users to match items from two different sets.
6
8
  */
7
9
  declare class MatcherEditor extends React.Component<Props> {
8
- static propTypes: {
9
- left: any;
10
- right: any;
11
- labels: any;
12
- orderMatters: any;
13
- padding: any;
14
- };
15
10
  static widgetName: "matcher";
16
- static defaultProps: MatcherDefaultWidgetOptions;
17
- onLabelChange: (arg1: number, arg2: React.ChangeEvent<HTMLInputElement>) => void;
18
- getSaveWarnings: () => ReadonlyArray<string>;
19
- serialize: any;
11
+ static defaultProps: PerseusMatcherWidgetOptions;
12
+ onLabelChange: (index: number, e: React.ChangeEvent<HTMLInputElement>) => void;
13
+ getSaveWarnings: () => string[];
14
+ serialize: () => PerseusMatcherWidgetOptions;
20
15
  render(): React.ReactNode;
21
16
  }
22
17
  export default MatcherEditor;
@@ -1,25 +1,20 @@
1
- import { type OrdererDefaultWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusOrdererWidgetOptions, type PerseusRenderer } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
- type Props = any;
4
- export declare const getUpdatedOptions: (correctOptions: Array<{
5
- content: string;
6
- }>, otherOptions: Array<{
7
- content: string;
8
- }>, whichOptions?: string, options?: string[]) => Record<string, any>;
3
+ type Props = PerseusOrdererWidgetOptions & {
4
+ onChange: (newOptions: Partial<PerseusOrdererWidgetOptions>, callback?: () => void) => void;
5
+ };
6
+ /**
7
+ * The cards the student picks from: the correct answer and the distractors,
8
+ * with duplicates and empty cards removed.
9
+ */
10
+ export declare const mergeCards: (correctOptions: PerseusRenderer[], otherOptions: PerseusRenderer[]) => PerseusRenderer[];
9
11
  declare class OrdererEditor extends React.Component<Props> {
10
- static propTypes: {
11
- correctOptions: any;
12
- otherOptions: any;
13
- height: any;
14
- layout: any;
15
- onChange: any;
16
- };
17
12
  static widgetName: "orderer";
18
- static defaultProps: OrdererDefaultWidgetOptions;
19
- onOptionsChange: (arg1: "correctOptions" | "otherOptions", arg2: any, arg3: any) => any;
20
- onLayoutChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
21
- onHeightChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
22
- serialize: () => any;
13
+ static defaultProps: PerseusOrdererWidgetOptions;
14
+ onOptionsChange: (whichOptions: "correctOptions" | "otherOptions", options: string[]) => void;
15
+ onLayoutChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
16
+ onHeightChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
17
+ serialize: () => PerseusOrdererWidgetOptions;
23
18
  render(): React.ReactNode;
24
19
  }
25
20
  export default OrdererEditor;
@@ -7,7 +7,7 @@ type Props = {
7
7
  apiOptions: APIOptions;
8
8
  type: PerseusPlotterWidgetOptions["type"];
9
9
  labels: Array<string>;
10
- categories: ReadonlyArray<string | number>;
10
+ categories: PerseusPlotterWidgetOptions["categories"];
11
11
  scaleY: number;
12
12
  maxY: number;
13
13
  snapsPerLine: number;
@@ -42,7 +42,6 @@ declare class PlotterEditor extends React.Component<Props, State> {
42
42
  handleChangeTickStep: (arg1: number) => void;
43
43
  handleChangeRange: (arg1: [number, number]) => void;
44
44
  changeLabelInterval: (arg1: number) => void;
45
- handlePlotterChange: (arg1: any) => void;
46
45
  changeType: (arg1: any) => void;
47
46
  changeLabel: (arg1: number, arg2: any) => void;
48
47
  changePicUrl: (arg1: string) => void;
@@ -1,19 +1,16 @@
1
- import { type SorterDefaultWidgetOptions } from "@khanacademy/perseus-core";
1
+ import { type PerseusSorterWidgetOptions } from "@khanacademy/perseus-core";
2
2
  import * as React from "react";
3
- type Props = any;
3
+ type Props = PerseusSorterWidgetOptions & {
4
+ onChange: (newOptions: Partial<PerseusSorterWidgetOptions>, callback?: () => void) => void;
5
+ };
4
6
  /**
5
7
  * An editor for adding a sorter widget that allows users to arrange items in a specific order.
6
8
  */
7
9
  declare class SorterEditor extends React.Component<Props> {
8
- static propTypes: {
9
- correct: any;
10
- layout: any;
11
- padding: any;
12
- };
13
10
  static widgetName: "sorter";
14
- static defaultProps: SorterDefaultWidgetOptions;
15
- onLayoutChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
16
- serialize: (arg1: any) => void;
11
+ static defaultProps: PerseusSorterWidgetOptions;
12
+ onLayoutChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
13
+ serialize: () => PerseusSorterWidgetOptions;
17
14
  render(): React.ReactNode;
18
15
  }
19
16
  export default SorterEditor;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Perseus editors",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "37.0.0",
6
+ "version": "37.0.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -36,12 +36,12 @@
36
36
  "mafs": "^0.19.0",
37
37
  "tiny-invariant": "1.3.1",
38
38
  "@khanacademy/kas": "2.2.6",
39
- "@khanacademy/kmath": "2.4.41",
40
- "@khanacademy/math-input": "27.0.2",
41
- "@khanacademy/perseus": "84.0.2",
42
- "@khanacademy/keypad-context": "3.2.82",
43
- "@khanacademy/perseus-core": "35.0.0",
44
- "@khanacademy/perseus-linter": "5.1.22",
39
+ "@khanacademy/keypad-context": "3.2.84",
40
+ "@khanacademy/kmath": "2.4.43",
41
+ "@khanacademy/math-input": "27.0.4",
42
+ "@khanacademy/perseus": "84.1.1",
43
+ "@khanacademy/perseus-core": "36.1.0",
44
+ "@khanacademy/perseus-linter": "5.1.24",
45
45
  "@khanacademy/perseus-utils": "2.1.5"
46
46
  },
47
47
  "devDependencies": {