@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.
- package/dist/components/text-list-editor.d.ts +15 -11
- package/dist/components/widget-editor.d.ts +2 -2
- package/dist/es/index.js +12 -12
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +40 -40
- package/dist/widgets/matcher-editor/matcher-editor.d.ts +8 -13
- package/dist/widgets/orderer-editor/orderer-editor.d.ts +14 -19
- package/dist/widgets/plotter-editor/plotter-editor.d.ts +1 -2
- package/dist/widgets/sorter-editor/sorter-editor.d.ts +7 -10
- package/package.json +7 -7
|
@@ -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:
|
|
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:
|
|
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
|
|
1
|
+
import { type PerseusMatcherWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
type Props =
|
|
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:
|
|
17
|
-
onLabelChange: (
|
|
18
|
-
getSaveWarnings: () =>
|
|
19
|
-
serialize:
|
|
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
|
|
1
|
+
import { type PerseusOrdererWidgetOptions, type PerseusRenderer } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
type Props =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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:
|
|
19
|
-
onOptionsChange: (
|
|
20
|
-
onLayoutChange: (
|
|
21
|
-
onHeightChange: (
|
|
22
|
-
serialize: () =>
|
|
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:
|
|
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
|
|
1
|
+
import { type PerseusSorterWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
type Props =
|
|
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:
|
|
15
|
-
onLayoutChange: (
|
|
16
|
-
serialize: (
|
|
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.
|
|
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/
|
|
40
|
-
"@khanacademy/
|
|
41
|
-
"@khanacademy/
|
|
42
|
-
"@khanacademy/
|
|
43
|
-
"@khanacademy/perseus-core": "
|
|
44
|
-
"@khanacademy/perseus-linter": "5.1.
|
|
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": {
|