@khanacademy/perseus 52.0.1 → 53.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.
- package/dist/components/number-input.d.ts +2 -0
- package/dist/components/range-input.d.ts +1 -0
- package/dist/components/svg-image.d.ts +2 -2
- package/dist/es/index.css +0 -30
- package/dist/es/index.js +385 -865
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +0 -30
- package/dist/index.d.ts +1 -2
- package/dist/index.js +383 -868
- package/dist/index.js.map +1 -1
- package/dist/perseus-api.d.ts +0 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/styles/constants.d.ts +0 -2
- package/dist/types.d.ts +3 -20
- package/dist/util/math-utils.d.ts +1 -0
- package/dist/util/scoring.d.ts +0 -15
- package/dist/util/test-utils.d.ts +1 -1
- package/dist/widget-ai-utils/mock-widget/prompt-utils.d.ts +1 -1
- package/dist/widget-container.d.ts +1 -1
- package/dist/widgets/categorizer/categorizer.d.ts +0 -3
- package/dist/widgets/cs-program/cs-program.d.ts +2 -3
- package/dist/widgets/definition/definition.d.ts +0 -2
- package/dist/widgets/deprecated-standin/deprecated-standin.d.ts +0 -1
- package/dist/widgets/dropdown/dropdown.d.ts +2 -4
- package/dist/widgets/explanation/explanation.d.ts +0 -2
- package/dist/widgets/expression/expression.d.ts +1 -5
- package/dist/widgets/grapher/grapher.d.ts +0 -2
- package/dist/widgets/group/group.d.ts +0 -4
- package/dist/widgets/iframe/iframe.d.ts +0 -2
- package/dist/widgets/image/image.d.ts +0 -3
- package/dist/widgets/input-number/input-number.d.ts +0 -3
- package/dist/widgets/interaction/interaction.d.ts +0 -1
- package/dist/widgets/interactive-graph.d.ts +0 -2
- package/dist/widgets/interactive-graphs/backgrounds/axis-ticks.d.ts +1 -0
- package/dist/widgets/label-image/label-image.d.ts +2 -2
- package/dist/widgets/matcher/matcher.d.ts +0 -2
- package/dist/widgets/matrix/matrix.d.ts +0 -3
- package/dist/widgets/measurer/measurer.d.ts +0 -1
- package/dist/widgets/mock-widgets/mock-widget-types.d.ts +0 -6
- package/dist/widgets/mock-widgets/mock-widget.d.ts +2 -5
- package/dist/widgets/molecule/molecule.d.ts +0 -1
- package/dist/widgets/number-line/number-line.d.ts +2 -3
- package/dist/widgets/numeric-input/numeric-input.d.ts +2 -3
- package/dist/widgets/orderer/orderer.d.ts +0 -3
- package/dist/widgets/passage/passage.d.ts +0 -1
- package/dist/widgets/passage-ref/passage-ref.d.ts +0 -2
- package/dist/widgets/passage-ref-target/passage-ref-target.d.ts +0 -2
- package/dist/widgets/plotter/plotter.d.ts +0 -3
- package/dist/widgets/radio/radio.d.ts +0 -3
- package/dist/widgets/sorter/sorter.d.ts +2 -4
- package/dist/widgets/table/table.d.ts +0 -3
- package/dist/widgets/video/video.d.ts +0 -3
- package/dist/widgets.d.ts +1 -32
- package/package.json +10 -10
- package/dist/renderer-util.d.ts +0 -14
- package/dist/widgets/__shared__/score-noop.d.ts +0 -11
- package/dist/widgets/group/score-group.d.ts +0 -4
- package/dist/widgets/group/validate-group.d.ts +0 -4
- package/dist/widgets/mock-widgets/score-mock-widget.d.ts +0 -5
- package/dist/widgets/mock-widgets/validate-mock-widget.d.ts +0 -4
package/dist/perseus-api.d.ts
CHANGED
|
@@ -69,7 +69,6 @@ export declare const ClassNames: {
|
|
|
69
69
|
readonly SELECTED: "perseus-radio-selected";
|
|
70
70
|
readonly OPTION_CONTENT: "perseus-radio-option-content";
|
|
71
71
|
};
|
|
72
|
-
readonly INTERACTIVE: "perseus-interactive";
|
|
73
72
|
readonly CORRECT: "perseus-correct";
|
|
74
73
|
readonly INCORRECT: "perseus-incorrect";
|
|
75
74
|
readonly UNANSWERED: "perseus-unanswered";
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PerseusScore, type UserInputArray, type UserInputMap } from "@khanacademy/perseus-score";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { PerseusI18nContext } from "./components/i18n-context";
|
|
3
4
|
import InteractionTracker from "./interaction-tracker";
|
|
@@ -10,7 +11,6 @@ import type { GetPromptJSONInterface, RendererPromptJSON } from "./widget-ai-uti
|
|
|
10
11
|
import type { KeypadAPI } from "@khanacademy/math-input";
|
|
11
12
|
import type { PerseusRenderer, PerseusWidget, PerseusWidgetOptions, PerseusWidgetsMap, ShowSolutions } from "@khanacademy/perseus-core";
|
|
12
13
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
13
|
-
import type { PerseusScore, UserInputArray, UserInputMap } from "@khanacademy/perseus-score";
|
|
14
14
|
import "./styles/perseus-renderer.less";
|
|
15
15
|
type WidgetState = {
|
|
16
16
|
isMobile?: boolean;
|
|
@@ -16,8 +16,6 @@ export declare const pureSmMax = "767px";
|
|
|
16
16
|
export declare const pureMdMax = "1023px";
|
|
17
17
|
export declare const pureLgMax = "1279px";
|
|
18
18
|
export declare const tableBackgroundAccent = "#F9F9F9";
|
|
19
|
-
export declare const zIndexAboveScratchpad = 2;
|
|
20
|
-
export declare const zIndexInteractiveComponent = 3;
|
|
21
19
|
export declare const phoneMargin = 16;
|
|
22
20
|
export declare const negativePhoneMargin = -16;
|
|
23
21
|
export declare const hintBorderWidth = 4;
|
package/dist/types.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import type { PerseusStrings } from "./strings";
|
|
|
3
3
|
import type { SizeClass } from "./util/sizing-utils";
|
|
4
4
|
import type { WidgetPromptJSON } from "./widget-ai-utils/prompt-types";
|
|
5
5
|
import type { KeypadAPI } from "@khanacademy/math-input";
|
|
6
|
-
import type { Hint, PerseusAnswerArea, PerseusGraphType, PerseusWidget, PerseusWidgetsMap, AnalyticsEventHandlerFn, Version, WidgetOptionsUpgradeMap, getOrdererPublicWidgetOptions, getCategorizerPublicWidgetOptions, getExpressionPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
+
import type { getLabelImagePublicWidgetOptions, Hint, PerseusAnswerArea, PerseusGraphType, PerseusWidget, PerseusWidgetsMap, AnalyticsEventHandlerFn, Version, WidgetOptionsUpgradeMap, getOrdererPublicWidgetOptions, getCategorizerPublicWidgetOptions, getCSProgramPublicWidgetOptions, getExpressionPublicWidgetOptions, getSorterPublicWidgetOptions, getDropdownPublicWidgetOptions, getNumericInputPublicWidgetOptions, getNumberLinePublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
7
7
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
8
|
-
import type {
|
|
8
|
+
import type { Rubric, UserInput, UserInputArray, UserInputMap } from "@khanacademy/perseus-score";
|
|
9
9
|
import type { Result } from "@khanacademy/wonder-blocks-data";
|
|
10
10
|
import type * as React from "react";
|
|
11
11
|
export type FocusPath = ReadonlyArray<string> | null | undefined;
|
|
@@ -347,7 +347,6 @@ export type TrackingGradedGroupExtraArguments = {
|
|
|
347
347
|
type TrackingSequenceExtraArguments = {
|
|
348
348
|
visible: number;
|
|
349
349
|
};
|
|
350
|
-
export type Alignment = "default" | "block" | "inline-block" | "inline" | "float-left" | "float-right" | "full-width";
|
|
351
350
|
type WidgetOptions = any;
|
|
352
351
|
/**
|
|
353
352
|
* A transform that maps the WidgetOptions (sometimes referred to as
|
|
@@ -355,12 +354,10 @@ type WidgetOptions = any;
|
|
|
355
354
|
* identity transform.
|
|
356
355
|
*/
|
|
357
356
|
export type WidgetTransform = (arg1: WidgetOptions, strings: PerseusStrings, problemNumber?: number) => any;
|
|
358
|
-
export type WidgetValidatorFunction = (userInput: UserInput, validationData: ValidationData, strings: PerseusStrings, locale: string) => ValidationResult;
|
|
359
|
-
export type WidgetScorerFunction = (userInput: UserInput, rubric: Rubric, string?: PerseusStrings, locale?: string) => PerseusScore;
|
|
360
357
|
/**
|
|
361
358
|
* A union type of all the functions that provide public widget options.
|
|
362
359
|
*/
|
|
363
|
-
export type PublicWidgetOptionsFunction = typeof getCategorizerPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getExpressionPublicWidgetOptions;
|
|
360
|
+
export type PublicWidgetOptionsFunction = typeof getNumericInputPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getCategorizerPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getLabelImagePublicWidgetOptions | typeof getSorterPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getNumberLinePublicWidgetOptions;
|
|
364
361
|
export type WidgetExports<T extends React.ComponentType<any> & Widget = React.ComponentType<any>> = Readonly<{
|
|
365
362
|
name: string;
|
|
366
363
|
displayName: string;
|
|
@@ -378,9 +375,6 @@ export type WidgetExports<T extends React.ComponentType<any> & Widget = React.Co
|
|
|
378
375
|
* This key defaults to `{major: 0, minor: 0}` if not provided.
|
|
379
376
|
*/
|
|
380
377
|
version?: Version;
|
|
381
|
-
supportedAlignments?: ReadonlyArray<Alignment>;
|
|
382
|
-
defaultAlignment?: Alignment;
|
|
383
|
-
getDefaultAlignment?: () => Alignment;
|
|
384
378
|
isLintable?: boolean;
|
|
385
379
|
tracking?: Tracking;
|
|
386
380
|
traverseChildWidgets?: any;
|
|
@@ -393,17 +387,6 @@ export type WidgetExports<T extends React.ComponentType<any> & Widget = React.Co
|
|
|
393
387
|
* static renders.
|
|
394
388
|
*/
|
|
395
389
|
staticTransform?: WidgetTransform;
|
|
396
|
-
/**
|
|
397
|
-
* Validates the learner's guess to check if it's sufficient for scoring.
|
|
398
|
-
* Typically, this is basically an "emptiness" check, but for some widgets
|
|
399
|
-
* such as `interactive-graph` it is a check that the learner has made any
|
|
400
|
-
* edits (ie. the widget is not in it's origin state).
|
|
401
|
-
*/
|
|
402
|
-
validator?: WidgetValidatorFunction;
|
|
403
|
-
/**
|
|
404
|
-
* A function that scores user input (the guess) for the widget.
|
|
405
|
-
*/
|
|
406
|
-
scorer?: WidgetScorerFunction;
|
|
407
390
|
/**
|
|
408
391
|
* A function that provides a public version of the widget options that can
|
|
409
392
|
* be shared with the client.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isPiMultiple(value: number): boolean;
|
package/dist/util/scoring.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
import type { KEScore } from "@khanacademy/perseus-core";
|
|
2
2
|
import type { PerseusScore, UserInputArray } from "@khanacademy/perseus-score";
|
|
3
|
-
/**
|
|
4
|
-
* If a widget says that it is empty once it is graded.
|
|
5
|
-
* Trying to encapsulate references to the score format.
|
|
6
|
-
*/
|
|
7
|
-
export declare function scoreIsEmpty(score: PerseusScore): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Combine two score objects.
|
|
10
|
-
*
|
|
11
|
-
* Given two score objects for two different widgets, combine them so that
|
|
12
|
-
* if one is wrong, the total score is wrong, etc.
|
|
13
|
-
*/
|
|
14
|
-
export declare function combineScores(scoreA: PerseusScore, scoreB: PerseusScore): PerseusScore;
|
|
15
|
-
export declare function flattenScores(widgetScoreMap: {
|
|
16
|
-
[widgetId: string]: PerseusScore;
|
|
17
|
-
}): PerseusScore;
|
|
18
3
|
export declare function isCorrect(score: PerseusScore): boolean;
|
|
19
4
|
export declare function keScoreFromPerseusScore(score: PerseusScore, guess: UserInputArray | [UserInputArray, []], state: any): KEScore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type PerseusScore, type UserInputMap } from "@khanacademy/perseus-score";
|
|
1
2
|
import type { CategorizerWidget, ExpressionWidget, InteractiveGraphWidget, NumericInputWidget, PerseusItem, PerseusRenderer, RadioWidget } from "@khanacademy/perseus-core";
|
|
2
|
-
import type { PerseusScore, UserInputMap } from "@khanacademy/perseus-score";
|
|
3
3
|
export declare const genericPerseusItemData: PerseusItem;
|
|
4
4
|
/**
|
|
5
5
|
* Thin wrapper around scorePerseusItem for internal testing
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type mockWidget from "../../widgets/mock-widgets/mock-widget";
|
|
2
|
-
import type { PerseusMockWidgetUserInput } from "
|
|
2
|
+
import type { PerseusMockWidgetUserInput } from "@khanacademy/perseus-score";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
export type MockWidgetPromptJSON = {
|
|
5
5
|
type: "mock-widget";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type PerseusWidgetOptions } from "@khanacademy/perseus-core";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import type { WidgetProps } from "./types";
|
|
3
|
-
import type { PerseusWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
4
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
5
5
|
type Props = {
|
|
6
6
|
shouldHighlight: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type PerseusCategorizerWidgetOptions, getCategorizerPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
|
-
import { scoreCategorizer, validateCategorizer } from "@khanacademy/perseus-score";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
5
4
|
import type { Widget, WidgetProps } from "../../types";
|
|
@@ -43,8 +42,6 @@ declare const _default: {
|
|
|
43
42
|
transform: (widgetOptions: PerseusCategorizerWidgetOptions) => RenderProps;
|
|
44
43
|
staticTransform: (editorProps: PerseusCategorizerWidgetOptions) => RenderProps;
|
|
45
44
|
isLintable: true;
|
|
46
|
-
scorer: typeof scoreCategorizer;
|
|
47
|
-
validator: typeof validateCategorizer;
|
|
48
45
|
getPublicWidgetOptions: typeof getCategorizerPublicWidgetOptions;
|
|
49
46
|
};
|
|
50
47
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This widget is for embedding Khan Academy CS programs.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { getCSProgramPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import type { Widget, WidgetProps } from "../../types";
|
|
7
7
|
import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
|
|
@@ -28,9 +28,8 @@ declare class CSProgram extends React.Component<Props> implements Widget {
|
|
|
28
28
|
declare const _default: {
|
|
29
29
|
name: string;
|
|
30
30
|
displayName: string;
|
|
31
|
-
supportedAlignments: ("block" | "full-width")[];
|
|
32
31
|
widget: typeof CSProgram;
|
|
33
32
|
hidden: true;
|
|
34
|
-
|
|
33
|
+
getPublicWidgetOptions: typeof getCSProgramPublicWidgetOptions;
|
|
35
34
|
};
|
|
36
35
|
export default _default;
|
|
@@ -23,9 +23,7 @@ declare const _default: {
|
|
|
23
23
|
name: string;
|
|
24
24
|
displayName: string;
|
|
25
25
|
accessible: true;
|
|
26
|
-
defaultAlignment: "inline";
|
|
27
26
|
widget: typeof Definition;
|
|
28
27
|
transform: (x: any) => any;
|
|
29
|
-
scorer: () => import("@khanacademy/perseus-score").PerseusScore;
|
|
30
28
|
};
|
|
31
29
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getDropdownPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
4
|
import type { Widget, WidgetProps } from "../../types";
|
|
@@ -34,11 +34,9 @@ type RenderProps = {
|
|
|
34
34
|
declare const _default: {
|
|
35
35
|
name: string;
|
|
36
36
|
displayName: string;
|
|
37
|
-
defaultAlignment: "inline-block";
|
|
38
37
|
accessible: true;
|
|
39
38
|
widget: typeof Dropdown;
|
|
40
39
|
transform: (arg1: PerseusDropdownWidgetOptions) => RenderProps;
|
|
41
|
-
|
|
42
|
-
validator: typeof validateDropdown;
|
|
40
|
+
getPublicWidgetOptions: typeof getDropdownPublicWidgetOptions;
|
|
43
41
|
};
|
|
44
42
|
export default _default;
|
|
@@ -33,10 +33,8 @@ declare const _default: {
|
|
|
33
33
|
name: string;
|
|
34
34
|
displayName: string;
|
|
35
35
|
accessible: true;
|
|
36
|
-
defaultAlignment: "inline";
|
|
37
36
|
widget: typeof Explanation;
|
|
38
37
|
transform: <T>(value: T) => T;
|
|
39
38
|
isLintable: true;
|
|
40
|
-
scorer: () => import("@khanacademy/perseus-score").PerseusScore;
|
|
41
39
|
};
|
|
42
40
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type PerseusExpressionWidgetOptions, getExpressionPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
|
-
import { scoreExpression, validateExpression } from "@khanacademy/perseus-score";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
5
4
|
import type { DependenciesContext } from "../../dependencies";
|
|
@@ -89,7 +88,6 @@ declare const _default: {
|
|
|
89
88
|
name: string;
|
|
90
89
|
displayName: string;
|
|
91
90
|
accessible: true;
|
|
92
|
-
defaultAlignment: "inline-block";
|
|
93
91
|
widget: React.ForwardRefExoticComponent<Omit<Pick<RenderProps & {
|
|
94
92
|
widgetId: string;
|
|
95
93
|
alignment: string | null | undefined;
|
|
@@ -169,7 +167,7 @@ declare const _default: {
|
|
|
169
167
|
visibleLabel: PerseusExpressionWidgetOptions["visibleLabel"];
|
|
170
168
|
ariaLabel: PerseusExpressionWidgetOptions["ariaLabel"];
|
|
171
169
|
value: string;
|
|
172
|
-
}, "static" | "containerSizeClass" | "widgetId" | "onChange" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "keypadElement" | "ariaLabel" | "
|
|
170
|
+
}, "static" | "containerSizeClass" | "widgetId" | "onChange" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "keypadElement" | "ariaLabel" | "reviewMode" | keyof import("../..").PerseusDependenciesV2 | "alignment" | "reviewModeRubric" | "isLastUsedWidget" | "visibleLabel" | "buttonsVisible" | "keypadConfiguration"> & {
|
|
173
171
|
value?: string | undefined;
|
|
174
172
|
apiOptions?: Readonly<Readonly<{
|
|
175
173
|
isArticle?: boolean;
|
|
@@ -233,8 +231,6 @@ declare const _default: {
|
|
|
233
231
|
version: import("@khanacademy/perseus-core").Version | undefined;
|
|
234
232
|
propUpgrades: import("@khanacademy/perseus-core").WidgetOptionsUpgradeMap | undefined;
|
|
235
233
|
isLintable: true;
|
|
236
|
-
scorer: typeof scoreExpression;
|
|
237
|
-
validator: typeof validateExpression;
|
|
238
234
|
getPublicWidgetOptions: typeof getExpressionPublicWidgetOptions;
|
|
239
235
|
getOneCorrectAnswerFromRubric(rubric: PerseusExpressionRubric): string | null | undefined;
|
|
240
236
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scoreGrapher } from "@khanacademy/perseus-score";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import Graphie from "../../components/graphie";
|
|
4
3
|
import type { Coord } from "../../interactive2/types";
|
|
@@ -47,6 +46,5 @@ declare const _default: {
|
|
|
47
46
|
widget: typeof Grapher;
|
|
48
47
|
transform: (arg1: PerseusGrapherWidgetOptions) => RenderProps;
|
|
49
48
|
staticTransform: (arg1: PerseusGrapherWidgetOptions) => RenderProps;
|
|
50
|
-
scorer: typeof scoreGrapher;
|
|
51
49
|
};
|
|
52
50
|
export default _default;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
3
|
import Renderer from "../../renderer";
|
|
4
|
-
import scoreGroup from "./score-group";
|
|
5
|
-
import validateGroup from "./validate-group";
|
|
6
4
|
import type { ChangeFn, FocusPath, Widget, WidgetProps } from "../../types";
|
|
7
5
|
import type { GroupPromptJSON } from "../../widget-ai-utils/group/group-ai-utils";
|
|
8
6
|
import type { PerseusGroupWidgetOptions } from "@khanacademy/perseus-core";
|
|
@@ -43,8 +41,6 @@ declare const _default: {
|
|
|
43
41
|
displayName: string;
|
|
44
42
|
widget: typeof Group;
|
|
45
43
|
traverseChildWidgets: (props: any, traverseRenderer: any) => any;
|
|
46
|
-
scorer: typeof scoreGroup;
|
|
47
|
-
validator: typeof validateGroup;
|
|
48
44
|
hidden: true;
|
|
49
45
|
isLintable: true;
|
|
50
46
|
};
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* It's particularly well suited for embedding our ProcessingJS programs,
|
|
7
7
|
* but could also be used for embedding viz's hosted elsewhere.
|
|
8
8
|
*/
|
|
9
|
-
import { scoreIframe } from "@khanacademy/perseus-score";
|
|
10
9
|
import * as React from "react";
|
|
11
10
|
import type { WidgetProps, Widget } from "../../types";
|
|
12
11
|
import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
|
|
@@ -40,6 +39,5 @@ declare const _default: {
|
|
|
40
39
|
displayName: string;
|
|
41
40
|
widget: typeof Iframe;
|
|
42
41
|
hidden: true;
|
|
43
|
-
scorer: typeof scoreIframe;
|
|
44
42
|
};
|
|
45
43
|
export default _default;
|
|
@@ -39,11 +39,8 @@ declare class ImageWidget extends React.Component<Props> implements Widget {
|
|
|
39
39
|
declare const _default: {
|
|
40
40
|
name: string;
|
|
41
41
|
accessible: (widgetOptions: PerseusImageWidgetOptions) => boolean;
|
|
42
|
-
defaultAlignment: "block";
|
|
43
|
-
supportedAlignments: readonly ["block", "full-width"];
|
|
44
42
|
displayName: string;
|
|
45
43
|
widget: typeof ImageWidget;
|
|
46
44
|
isLintable: true;
|
|
47
|
-
scorer: () => import("@khanacademy/perseus-score").PerseusScore;
|
|
48
45
|
};
|
|
49
46
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scoreInputNumber } from "@khanacademy/perseus-score";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
3
|
import type { Path, Widget, WidgetProps } from "../../types";
|
|
@@ -52,12 +51,10 @@ declare class InputNumber extends React.Component<Props> implements Widget {
|
|
|
52
51
|
declare const _default: {
|
|
53
52
|
name: string;
|
|
54
53
|
displayName: string;
|
|
55
|
-
defaultAlignment: "inline-block";
|
|
56
54
|
hidden: true;
|
|
57
55
|
widget: typeof InputNumber;
|
|
58
56
|
transform: (widgetOptions: PerseusInputNumberWidgetOptions) => RenderProps;
|
|
59
57
|
isLintable: true;
|
|
60
|
-
scorer: typeof scoreInputNumber;
|
|
61
58
|
getOneCorrectAnswerFromRubric(rubric: any): string | null | undefined;
|
|
62
59
|
};
|
|
63
60
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scoreInteractiveGraph } from "@khanacademy/perseus-score";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { PerseusI18nContext } from "../components/i18n-context";
|
|
4
3
|
import type { StatefulMafsGraphType } from "./interactive-graphs/stateful-mafs-graph";
|
|
@@ -261,6 +260,5 @@ declare const _default: {
|
|
|
261
260
|
displayName: string;
|
|
262
261
|
widget: typeof InteractiveGraph;
|
|
263
262
|
staticTransform: <T>(value: T) => T;
|
|
264
|
-
scorer: typeof scoreInteractiveGraph;
|
|
265
263
|
};
|
|
266
264
|
export default _default;
|
|
@@ -3,4 +3,5 @@ import type { Interval } from "mafs";
|
|
|
3
3
|
export declare const shouldShowLabel: (currentTick: number, range: [Interval, Interval], tickStep: number) => boolean;
|
|
4
4
|
export declare function generateTickLocations(tickStep: number, min: number, max: number): number[];
|
|
5
5
|
export declare const countSignificantDecimals: (number: number) => number;
|
|
6
|
+
export declare function divideByAndShowPi(value: number): string;
|
|
6
7
|
export declare const AxisTicks: () => React.JSX.Element;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* that involve the use of images, and enable learners to demonstrate their
|
|
6
6
|
* knowledge by directly interacting with the image.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { getLabelImagePublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
11
11
|
import Marker from "./marker";
|
|
@@ -92,6 +92,6 @@ declare const _default: {
|
|
|
92
92
|
}, keyof import("../..").PerseusDependenciesV2> & React.RefAttributes<LabelImage>>;
|
|
93
93
|
accessible: true;
|
|
94
94
|
isLintable: true;
|
|
95
|
-
|
|
95
|
+
getPublicWidgetOptions: typeof getLabelImagePublicWidgetOptions;
|
|
96
96
|
};
|
|
97
97
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scoreMatcher } from "@khanacademy/perseus-score";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
3
|
import type { SortableOption } from "../../components/sortable";
|
|
@@ -42,6 +41,5 @@ declare const _default: {
|
|
|
42
41
|
displayName: string;
|
|
43
42
|
widget: typeof Matcher;
|
|
44
43
|
isLintable: true;
|
|
45
|
-
scorer: typeof scoreMatcher;
|
|
46
44
|
};
|
|
47
45
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type PerseusMatrixWidgetAnswers } from "@khanacademy/perseus-core";
|
|
2
|
-
import { scoreMatrix, validateMatrix } from "@khanacademy/perseus-score";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
5
4
|
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
@@ -61,7 +60,5 @@ declare const _default: {
|
|
|
61
60
|
transform: (arg1: any) => any;
|
|
62
61
|
staticTransform: (arg1: any) => any;
|
|
63
62
|
isLintable: true;
|
|
64
|
-
scorer: typeof scoreMatrix;
|
|
65
|
-
validator: typeof validateMatrix;
|
|
66
63
|
};
|
|
67
64
|
export default _default;
|
|
@@ -37,6 +37,5 @@ declare const _default: {
|
|
|
37
37
|
widget: typeof Measurer;
|
|
38
38
|
version: import("@khanacademy/perseus-core").Version | undefined;
|
|
39
39
|
propUpgrades: import("@khanacademy/perseus-core").WidgetOptionsUpgradeMap | undefined;
|
|
40
|
-
scorer: () => import("@khanacademy/perseus-score").PerseusScore;
|
|
41
40
|
};
|
|
42
41
|
export default _default;
|
|
@@ -4,12 +4,6 @@ export type MockWidgetOptions = {
|
|
|
4
4
|
static?: boolean;
|
|
5
5
|
value: string;
|
|
6
6
|
};
|
|
7
|
-
export type PerseusMockWidgetRubric = {
|
|
8
|
-
value: string;
|
|
9
|
-
};
|
|
10
|
-
export type PerseusMockWidgetUserInput = {
|
|
11
|
-
currentValue: string;
|
|
12
|
-
};
|
|
13
7
|
declare module "@khanacademy/perseus-core" {
|
|
14
8
|
interface PerseusWidgetTypes {
|
|
15
9
|
"mock-widget": MockWidget;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
3
|
-
import validateMockWidget from "./validate-mock-widget";
|
|
4
|
-
import type { MockWidgetOptions, PerseusMockWidgetRubric, PerseusMockWidgetUserInput } from "./mock-widget-types";
|
|
2
|
+
import type { MockWidgetOptions } from "./mock-widget-types";
|
|
5
3
|
import type { WidgetProps, Widget, FocusPath } from "../../types";
|
|
6
4
|
import type { MockWidgetPromptJSON } from "../../widget-ai-utils/mock-widget/prompt-utils";
|
|
5
|
+
import type { PerseusMockWidgetRubric, PerseusMockWidgetUserInput } from "@khanacademy/perseus-score";
|
|
7
6
|
type ExternalProps = WidgetProps<MockWidgetOptions, PerseusMockWidgetRubric>;
|
|
8
7
|
type DefaultProps = {
|
|
9
8
|
currentValue: Props["currentValue"];
|
|
@@ -42,7 +41,5 @@ declare const _default: {
|
|
|
42
41
|
displayName: string;
|
|
43
42
|
widget: typeof MockWidgetComponent;
|
|
44
43
|
isLintable: true;
|
|
45
|
-
scorer: typeof scoreMockWidget;
|
|
46
|
-
validator: typeof validateMockWidget;
|
|
47
44
|
};
|
|
48
45
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getNumberLinePublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
4
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
@@ -79,7 +79,6 @@ declare const _default: {
|
|
|
79
79
|
widget: typeof NumberLine;
|
|
80
80
|
transform: (arg1: any) => any;
|
|
81
81
|
staticTransform: (arg1: any) => any;
|
|
82
|
-
|
|
83
|
-
validator: typeof validateNumberLine;
|
|
82
|
+
getPublicWidgetOptions: typeof getNumberLinePublicWidgetOptions;
|
|
84
83
|
};
|
|
85
84
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getNumericInputPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
4
|
import InputWithExamples from "../../components/input-with-examples";
|
|
@@ -72,12 +72,11 @@ type RenderProps = {
|
|
|
72
72
|
declare const _default: {
|
|
73
73
|
name: string;
|
|
74
74
|
displayName: string;
|
|
75
|
-
defaultAlignment: "inline-block";
|
|
76
75
|
accessible: true;
|
|
77
76
|
widget: typeof NumericInput;
|
|
78
77
|
transform: (widgetOptions: PerseusNumericInputWidgetOptions) => RenderProps;
|
|
79
78
|
isLintable: true;
|
|
80
|
-
|
|
79
|
+
getPublicWidgetOptions: typeof getNumericInputPublicWidgetOptions;
|
|
81
80
|
getOneCorrectAnswerFromRubric(rubric: PerseusNumericInputRubric): string | null | undefined;
|
|
82
81
|
};
|
|
83
82
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getOrdererPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
|
-
import { scoreOrderer, validateOrderer } from "@khanacademy/perseus-score";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import type { Widget, WidgetProps } from "../../types";
|
|
5
4
|
import type { OrdererPromptJSON } from "../../widget-ai-utils/orderer/orderer-ai-utils";
|
|
@@ -56,8 +55,6 @@ declare const _default: {
|
|
|
56
55
|
hidden: true;
|
|
57
56
|
widget: typeof Orderer;
|
|
58
57
|
isLintable: true;
|
|
59
|
-
scorer: typeof scoreOrderer;
|
|
60
|
-
validator: typeof validateOrderer;
|
|
61
58
|
getPublicWidgetOptions: typeof getOrdererPublicWidgetOptions;
|
|
62
59
|
};
|
|
63
60
|
export default _default;
|
|
@@ -41,7 +41,6 @@ declare const _default: {
|
|
|
41
41
|
name: string;
|
|
42
42
|
displayName: string;
|
|
43
43
|
hidden: true;
|
|
44
|
-
defaultAlignment: "inline";
|
|
45
44
|
widget: typeof PassageRef;
|
|
46
45
|
transform: (widgetOptions: PerseusPassageRefWidgetOptions) => {
|
|
47
46
|
passageNumber: number;
|
|
@@ -49,6 +48,5 @@ declare const _default: {
|
|
|
49
48
|
summaryText: string | undefined;
|
|
50
49
|
};
|
|
51
50
|
version: import("@khanacademy/perseus-core").Version | undefined;
|
|
52
|
-
scorer: () => import("@khanacademy/perseus-score").PerseusScore;
|
|
53
51
|
};
|
|
54
52
|
export default _default;
|
|
@@ -24,11 +24,9 @@ declare class PassageRefTarget extends React.Component<Props> implements Widget
|
|
|
24
24
|
declare const _default: {
|
|
25
25
|
name: string;
|
|
26
26
|
displayName: string;
|
|
27
|
-
defaultAlignment: "inline";
|
|
28
27
|
widget: typeof PassageRefTarget;
|
|
29
28
|
hidden: true;
|
|
30
29
|
transform: (editorProps: any) => any;
|
|
31
30
|
isLintable: true;
|
|
32
|
-
scorer: () => import("@khanacademy/perseus-score").PerseusScore;
|
|
33
31
|
};
|
|
34
32
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scorePlotter, validatePlotter } from "@khanacademy/perseus-score";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
3
|
import type { Widget, WidgetProps } from "../../types";
|
|
@@ -76,7 +75,5 @@ declare const _default: {
|
|
|
76
75
|
hidden: true;
|
|
77
76
|
widget: typeof Plotter;
|
|
78
77
|
staticTransform: <T>(value: T) => T;
|
|
79
|
-
scorer: typeof scorePlotter;
|
|
80
|
-
validator: typeof validatePlotter;
|
|
81
78
|
};
|
|
82
79
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
|
-
import { scoreRadio, validateRadio } from "@khanacademy/perseus-score";
|
|
3
2
|
import Radio from "./radio-component";
|
|
4
3
|
import type { RenderProps } from "./radio-component";
|
|
5
4
|
import type { PerseusStrings } from "../../strings";
|
|
@@ -13,7 +12,5 @@ declare const _default: {
|
|
|
13
12
|
version: import("@khanacademy/perseus-core").Version | undefined;
|
|
14
13
|
propUpgrades: import("@khanacademy/perseus-core").WidgetOptionsUpgradeMap | undefined;
|
|
15
14
|
isLintable: true;
|
|
16
|
-
scorer: typeof scoreRadio;
|
|
17
|
-
validator: typeof validateRadio;
|
|
18
15
|
};
|
|
19
16
|
export default _default;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type PerseusSorterWidgetOptions, getSorterPublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { SortableOption } from "../../components/sortable";
|
|
4
4
|
import type { Widget, WidgetProps } from "../../types";
|
|
5
5
|
import type { SorterPromptJSON } from "../../widget-ai-utils/sorter/sorter-ai-utils";
|
|
6
|
-
import type { PerseusSorterWidgetOptions } from "@khanacademy/perseus-core";
|
|
7
6
|
import type { PerseusSorterRubric, PerseusSorterUserInput } from "@khanacademy/perseus-score";
|
|
8
7
|
type RenderProps = PerseusSorterWidgetOptions;
|
|
9
8
|
type Props = WidgetProps<RenderProps, PerseusSorterRubric>;
|
|
@@ -35,7 +34,6 @@ declare const _default: {
|
|
|
35
34
|
displayName: string;
|
|
36
35
|
widget: typeof Sorter;
|
|
37
36
|
isLintable: true;
|
|
38
|
-
|
|
39
|
-
validator: typeof validateSorter;
|
|
37
|
+
getPublicWidgetOptions: typeof getSorterPublicWidgetOptions;
|
|
40
38
|
};
|
|
41
39
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scoreTable, validateTable } from "@khanacademy/perseus-score";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
3
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
@@ -46,7 +45,5 @@ declare const _default: {
|
|
|
46
45
|
transform: (arg1: any) => any;
|
|
47
46
|
hidden: true;
|
|
48
47
|
isLintable: true;
|
|
49
|
-
scorer: typeof scoreTable;
|
|
50
|
-
validator: typeof validateTable;
|
|
51
48
|
};
|
|
52
49
|
export default _default;
|
|
@@ -24,9 +24,6 @@ declare class Video extends React.Component<Props> implements Widget {
|
|
|
24
24
|
declare const _default: {
|
|
25
25
|
name: string;
|
|
26
26
|
displayName: string;
|
|
27
|
-
defaultAlignment: "block";
|
|
28
|
-
supportedAlignments: ("block" | "full-width" | "float-left" | "float-right")[];
|
|
29
27
|
widget: typeof Video;
|
|
30
|
-
scorer: () => import("@khanacademy/perseus-score").PerseusScore;
|
|
31
28
|
};
|
|
32
29
|
export default _default;
|