@khanacademy/perseus 54.1.0 → 55.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/LICENSE +18 -0
- package/dist/components/number-input.d.ts +9 -10
- package/dist/components/range-input.d.ts +5 -6
- package/dist/components/simple-keypad-input.d.ts +5 -0
- package/dist/components/stub-tag-editor.d.ts +3 -4
- package/dist/components/text-list-editor.d.ts +3 -4
- package/dist/es/index.css +16 -6
- package/dist/es/index.js +901 -985
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +40 -10
- package/dist/es/strings.js.map +1 -1
- package/dist/index.css +16 -6
- package/dist/index.js +1035 -1086
- package/dist/index.js.map +1 -1
- package/dist/mixins/changeable.d.ts +1 -2
- package/dist/perseus-api.d.ts +1 -56
- package/dist/shared-utils/add-library-version-to-perseus-debug.d.ts +9 -0
- package/dist/strings.d.ts +34 -4
- package/dist/strings.js +142 -97
- package/dist/strings.js.map +1 -1
- package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +1 -1
- package/dist/widgets/dropdown/dropdown.d.ts +5 -4
- package/dist/widgets/interactive-graph.d.ts +4 -2
- package/dist/widgets/interactive-graphs/graphs/circle.d.ts +7 -0
- package/dist/widgets/interactive-graphs/graphs/components/movable-line.d.ts +6 -0
- package/dist/widgets/interactive-graphs/graphs/quadratic.d.ts +8 -0
- package/dist/widgets/interactive-graphs/graphs/sinusoid.d.ts +7 -0
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +1 -1
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +6 -1
- package/dist/widgets/numeric-input/index.d.ts +1 -1
- package/dist/widgets/numeric-input/input-with-examples.d.ts +8 -0
- package/dist/widgets/numeric-input/numeric-input.class.d.ts +66 -0
- package/dist/widgets/numeric-input/numeric-input.d.ts +123 -77
- package/dist/widgets/numeric-input/utils.d.ts +25 -0
- package/package.json +120 -124
- package/dist/components/input-with-examples.d.ts +0 -51
- package/dist/components/tooltip.d.ts +0 -85
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
3
|
+
import type { NumericInputPromptJSON } from "../../widget-ai-utils/numeric-input/prompt-utils";
|
|
4
|
+
import type { PerseusNumericInputWidgetOptions, PerseusNumericInputAnswerForm } from "@khanacademy/perseus-core";
|
|
5
|
+
import type { PerseusNumericInputRubric, PerseusNumericInputUserInput } from "@khanacademy/perseus-score";
|
|
6
|
+
type ExternalProps = WidgetProps<PerseusNumericInputWidgetOptions, PerseusNumericInputRubric>;
|
|
7
|
+
export type NumericInputProps = ExternalProps & {
|
|
8
|
+
size: NonNullable<ExternalProps["size"]>;
|
|
9
|
+
rightAlign: NonNullable<ExternalProps["rightAlign"]>;
|
|
10
|
+
apiOptions: NonNullable<ExternalProps["apiOptions"]>;
|
|
11
|
+
coefficient: NonNullable<ExternalProps["coefficient"]>;
|
|
12
|
+
answerForms: ReadonlyArray<PerseusNumericInputAnswerForm>;
|
|
13
|
+
labelText: string;
|
|
14
|
+
linterContext: NonNullable<ExternalProps["linterContext"]>;
|
|
15
|
+
currentValue: string;
|
|
16
|
+
};
|
|
17
|
+
type DefaultProps = Pick<NumericInputProps, "currentValue" | "size" | "rightAlign" | "apiOptions" | "coefficient" | "answerForms" | "labelText" | "linterContext">;
|
|
18
|
+
type RenderProps = {
|
|
19
|
+
answerForms: ReadonlyArray<PerseusNumericInputAnswerForm>;
|
|
20
|
+
labelText?: string;
|
|
21
|
+
size: string;
|
|
22
|
+
coefficient: boolean;
|
|
23
|
+
rightAlign?: boolean;
|
|
24
|
+
static: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The NumericInput widget is a numeric input field that supports a variety of
|
|
28
|
+
* answer forms, including integers, decimals, fractions, and mixed numbers.
|
|
29
|
+
*
|
|
30
|
+
* [Jan 2025] We're currenly migrating from class-based components to functional
|
|
31
|
+
* components. While we cannot fully migrate this component yet, we can start
|
|
32
|
+
* by using the functional component for the rendering the UI of the widget.
|
|
33
|
+
*/
|
|
34
|
+
export declare class NumericInput extends React.Component<NumericInputProps> implements Widget {
|
|
35
|
+
inputRef: React.RefObject<any>;
|
|
36
|
+
static defaultProps: DefaultProps;
|
|
37
|
+
static getUserInputFromProps(props: NumericInputProps): PerseusNumericInputUserInput;
|
|
38
|
+
focus: () => boolean;
|
|
39
|
+
focusInputPath: () => void;
|
|
40
|
+
blurInputPath: () => void;
|
|
41
|
+
getInputPaths: () => ReadonlyArray<ReadonlyArray<string>>;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the value of the input at the given path.
|
|
44
|
+
*/
|
|
45
|
+
setInputValue: (path: FocusPath, newValue: string, cb?: () => unknown | null | undefined) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the value the user has currently input for this widget.
|
|
48
|
+
*/
|
|
49
|
+
getUserInput(): PerseusNumericInputUserInput;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the JSON representation of the prompt for this widget.
|
|
52
|
+
* This is used by the AI to determine the prompt for the widget.
|
|
53
|
+
*/
|
|
54
|
+
getPromptJSON(): NumericInputPromptJSON;
|
|
55
|
+
render(): React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
declare const _default: {
|
|
58
|
+
name: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
accessible: true;
|
|
61
|
+
widget: typeof NumericInput;
|
|
62
|
+
transform: (widgetOptions: PerseusNumericInputWidgetOptions) => RenderProps;
|
|
63
|
+
isLintable: true;
|
|
64
|
+
getOneCorrectAnswerFromRubric(rubric: PerseusNumericInputRubric): string | null | undefined;
|
|
65
|
+
};
|
|
66
|
+
export default _default;
|
|
@@ -1,80 +1,126 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
export declare const unionAnswerForms: (arg1: ReadonlyArray<ReadonlyArray<PerseusNumericInputAnswerForm>>) => ReadonlyArray<PerseusNumericInputAnswerForm>;
|
|
60
|
-
type RenderProps = {
|
|
61
|
-
answerForms: ReadonlyArray<{
|
|
62
|
-
simplify: "required" | "correct" | "enforced" | null | undefined;
|
|
63
|
-
name: "integer" | "decimal" | "proper" | "improper" | "mixed" | "pi";
|
|
2
|
+
/**
|
|
3
|
+
* The NumericInputComponent is a child component of the NumericInput class
|
|
4
|
+
* component. It is responsible for rendering the UI elements of the Numeric
|
|
5
|
+
* Input widget.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NumericInputComponent: React.ForwardRefExoticComponent<import("@khanacademy/perseus-core").PerseusNumericInputWidgetOptions & {
|
|
8
|
+
widgetId: string;
|
|
9
|
+
alignment: string | null | undefined;
|
|
10
|
+
static: boolean | null | undefined;
|
|
11
|
+
problemNum: number | null | undefined;
|
|
12
|
+
apiOptions: Readonly<Readonly<{
|
|
13
|
+
isArticle?: boolean;
|
|
14
|
+
onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
15
|
+
GroupMetadataEditor?: React.ComponentType<any>;
|
|
16
|
+
showAlignmentOptions?: boolean;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
answerableCallback?: (arg1: boolean) => unknown;
|
|
19
|
+
getAnotherHint?: () => unknown;
|
|
20
|
+
interactionCallback?: (widgetData: {
|
|
21
|
+
[widgetId: string]: any;
|
|
22
|
+
}) => void;
|
|
23
|
+
groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
24
|
+
imagePlaceholder?: React.ReactNode;
|
|
25
|
+
widgetPlaceholder?: React.ReactNode;
|
|
26
|
+
baseElements?: {
|
|
27
|
+
Link: React.ComponentType<any>;
|
|
28
|
+
};
|
|
29
|
+
imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
|
|
30
|
+
trackInteraction?: (args: {
|
|
31
|
+
type: string;
|
|
32
|
+
id: string;
|
|
33
|
+
correct?: boolean;
|
|
34
|
+
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
35
|
+
visible: number;
|
|
36
|
+
}>) => void;
|
|
37
|
+
customKeypad?: boolean;
|
|
38
|
+
nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
|
|
39
|
+
isMobile?: boolean;
|
|
40
|
+
setDrawingAreaAvailable?: (arg1: boolean) => unknown;
|
|
41
|
+
hintProgressColor?: string;
|
|
42
|
+
canScrollPage?: boolean;
|
|
43
|
+
crossOutEnabled?: boolean;
|
|
44
|
+
editorChangeDelay?: number;
|
|
45
|
+
onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
|
|
46
|
+
}> & {
|
|
47
|
+
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
48
|
+
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
49
|
+
crossOutEnabled: NonNullable<import("../..").APIOptions["crossOutEnabled"]>;
|
|
50
|
+
editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
|
|
51
|
+
groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
|
|
52
|
+
isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
|
|
53
|
+
isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
|
|
54
|
+
onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
|
|
55
|
+
readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
|
|
56
|
+
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
57
|
+
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
64
58
|
}>;
|
|
59
|
+
keypadElement?: any;
|
|
60
|
+
questionCompleted?: boolean;
|
|
61
|
+
onFocus: (blurPath: import("../..").FocusPath) => void;
|
|
62
|
+
onBlur: (blurPath: import("../..").FocusPath) => void;
|
|
63
|
+
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<import("../../types").Widget>;
|
|
64
|
+
reviewModeRubric?: import("@khanacademy/perseus-score").PerseusNumericInputRubric | null | undefined;
|
|
65
|
+
reviewMode: boolean;
|
|
66
|
+
onChange: import("../..").ChangeHandler;
|
|
67
|
+
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
68
|
+
isLastUsedWidget: boolean;
|
|
69
|
+
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
70
|
+
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
71
|
+
} & {
|
|
72
|
+
size: NonNullable<string>;
|
|
73
|
+
rightAlign: NonNullable<boolean | undefined>;
|
|
74
|
+
apiOptions: NonNullable<Readonly<Readonly<{
|
|
75
|
+
isArticle?: boolean;
|
|
76
|
+
onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
77
|
+
GroupMetadataEditor?: React.ComponentType<any>;
|
|
78
|
+
showAlignmentOptions?: boolean;
|
|
79
|
+
readOnly?: boolean;
|
|
80
|
+
answerableCallback?: (arg1: boolean) => unknown;
|
|
81
|
+
getAnotherHint?: () => unknown;
|
|
82
|
+
interactionCallback?: (widgetData: {
|
|
83
|
+
[widgetId: string]: any;
|
|
84
|
+
}) => void;
|
|
85
|
+
groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
86
|
+
imagePlaceholder?: React.ReactNode;
|
|
87
|
+
widgetPlaceholder?: React.ReactNode;
|
|
88
|
+
baseElements?: {
|
|
89
|
+
Link: React.ComponentType<any>;
|
|
90
|
+
};
|
|
91
|
+
imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
|
|
92
|
+
trackInteraction?: (args: {
|
|
93
|
+
type: string;
|
|
94
|
+
id: string;
|
|
95
|
+
correct?: boolean;
|
|
96
|
+
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
97
|
+
visible: number;
|
|
98
|
+
}>) => void;
|
|
99
|
+
customKeypad?: boolean;
|
|
100
|
+
nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
|
|
101
|
+
isMobile?: boolean;
|
|
102
|
+
setDrawingAreaAvailable?: (arg1: boolean) => unknown;
|
|
103
|
+
hintProgressColor?: string;
|
|
104
|
+
canScrollPage?: boolean;
|
|
105
|
+
crossOutEnabled?: boolean;
|
|
106
|
+
editorChangeDelay?: number;
|
|
107
|
+
onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
|
|
108
|
+
}> & {
|
|
109
|
+
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
110
|
+
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
111
|
+
crossOutEnabled: NonNullable<import("../..").APIOptions["crossOutEnabled"]>;
|
|
112
|
+
editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
|
|
113
|
+
groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
|
|
114
|
+
isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
|
|
115
|
+
isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
|
|
116
|
+
onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
|
|
117
|
+
readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
|
|
118
|
+
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
119
|
+
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
120
|
+
}>>;
|
|
121
|
+
coefficient: NonNullable<boolean>;
|
|
122
|
+
answerForms: ReadonlyArray<import("@khanacademy/perseus-core").PerseusNumericInputAnswerForm>;
|
|
65
123
|
labelText: string;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
static: boolean;
|
|
70
|
-
};
|
|
71
|
-
declare const _default: {
|
|
72
|
-
name: string;
|
|
73
|
-
displayName: string;
|
|
74
|
-
accessible: true;
|
|
75
|
-
widget: typeof NumericInput;
|
|
76
|
-
transform: (widgetOptions: PerseusNumericInputWidgetOptions) => RenderProps;
|
|
77
|
-
isLintable: true;
|
|
78
|
-
getOneCorrectAnswerFromRubric(rubric: PerseusNumericInputRubric): string | null | undefined;
|
|
79
|
-
};
|
|
80
|
-
export default _default;
|
|
124
|
+
linterContext: NonNullable<import("@khanacademy/perseus-linter").LinterContextProps>;
|
|
125
|
+
currentValue: string;
|
|
126
|
+
} & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PerseusStrings } from "../../strings";
|
|
2
|
+
import type { PerseusNumericInputAnswerForm } from "@khanacademy/perseus-core";
|
|
3
|
+
/**
|
|
4
|
+
* The full list of available strings for the numeric input widget,
|
|
5
|
+
* based on whether the Content Creator has specified that the answer must be simplified.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NumericExampleStrings: {
|
|
8
|
+
[key: string]: (form: PerseusNumericInputAnswerForm, strings: PerseusStrings) => string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Generates the specific set of examples for the current question.
|
|
12
|
+
* This string is shown as examples to the user in a tooltip.
|
|
13
|
+
*/
|
|
14
|
+
export declare const generateExamples: (answerForms: readonly PerseusNumericInputAnswerForm[], strings: PerseusStrings) => ReadonlyArray<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Determines whether to show examples of how to input the various supported answer forms.
|
|
17
|
+
* We do not show examples if all forms are accepted or if no forms are accepted.
|
|
18
|
+
*/
|
|
19
|
+
export declare const shouldShowExamples: (answerForms: readonly PerseusNumericInputAnswerForm[]) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Takes a list of lists of answer forms, and returns a list of the forms
|
|
22
|
+
* in each of these lists in the same order that they're listed in the
|
|
23
|
+
* `formExamples` forms from above.
|
|
24
|
+
*/
|
|
25
|
+
export declare const unionAnswerForms: (answerFormsList: ReadonlyArray<ReadonlyArray<PerseusNumericInputAnswerForm>>) => ReadonlyArray<PerseusNumericInputAnswerForm>;
|
package/package.json
CHANGED
|
@@ -1,127 +1,123 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"name": "@khanacademy/perseus",
|
|
3
|
+
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
|
+
"author": "Khan Academy",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"version": "55.0.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/Khan/perseus.git",
|
|
13
|
+
"directory": "packages/perseus"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/Khan/perseus/issues"
|
|
17
|
+
},
|
|
18
|
+
"module": "dist/es/index.js",
|
|
19
|
+
"main": "dist/index.js",
|
|
20
|
+
"source": "src/index.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/es/index.js",
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"source": "./src/index.ts"
|
|
9
27
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
28
|
+
"./strings": {
|
|
29
|
+
"import": "./dist/es/strings.js",
|
|
30
|
+
"require": "./dist/strings.js",
|
|
31
|
+
"types": "./dist/strings.d.ts",
|
|
32
|
+
"source": "./src/strings.ts"
|
|
14
33
|
},
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"@khanacademy/wonder-blocks-pill": "3.1.1",
|
|
106
|
-
"@khanacademy/wonder-blocks-popover": "5.1.1",
|
|
107
|
-
"@khanacademy/wonder-blocks-progress-spinner": "3.1.1",
|
|
108
|
-
"@khanacademy/wonder-blocks-switch": "3.1.1",
|
|
109
|
-
"@khanacademy/wonder-blocks-tokens": "4.2.1",
|
|
110
|
-
"@khanacademy/wonder-blocks-tooltip": "4.1.1",
|
|
111
|
-
"@khanacademy/wonder-blocks-typography": "3.1.1",
|
|
112
|
-
"@khanacademy/wonder-stuff-core": "1.5.4",
|
|
113
|
-
"@phosphor-icons/core": "^2.0.2",
|
|
114
|
-
"@popperjs/core": "^2.10.2",
|
|
115
|
-
"aphrodite": "^1.2.5",
|
|
116
|
-
"classnames": "1.1.4",
|
|
117
|
-
"intersection-observer": "^0.12.0",
|
|
118
|
-
"jquery": "^2.1.1",
|
|
119
|
-
"lodash.debounce": "^4.0.8",
|
|
120
|
-
"prop-types": "15.6.1",
|
|
121
|
-
"react": "^18.2.0",
|
|
122
|
-
"react-dom": "^18.2.0",
|
|
123
|
-
"react-popper": "^2.2.5",
|
|
124
|
-
"underscore": "^1.4.4"
|
|
125
|
-
},
|
|
126
|
-
"keywords": []
|
|
127
|
-
}
|
|
34
|
+
"./styles.css": "./dist/index.css"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@use-gesture/react": "^10.2.27",
|
|
41
|
+
"mafs": "0.19.0",
|
|
42
|
+
"uuid": "^10.0.0",
|
|
43
|
+
"@khanacademy/kas": "0.5.0",
|
|
44
|
+
"@khanacademy/keypad-context": "1.1.0",
|
|
45
|
+
"@khanacademy/kmath": "0.4.0",
|
|
46
|
+
"@khanacademy/math-input": "22.3.0",
|
|
47
|
+
"@khanacademy/perseus-core": "4.0.0",
|
|
48
|
+
"@khanacademy/perseus-linter": "1.3.0",
|
|
49
|
+
"@khanacademy/perseus-score": "2.3.0",
|
|
50
|
+
"@khanacademy/pure-markdown": "0.4.0",
|
|
51
|
+
"@khanacademy/simple-markdown": "0.14.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@khanacademy/wonder-blocks-banner": "4.1.1",
|
|
55
|
+
"@khanacademy/wonder-blocks-button": "7.1.1",
|
|
56
|
+
"@khanacademy/wonder-blocks-clickable": "6.1.1",
|
|
57
|
+
"@khanacademy/wonder-blocks-core": "12.1.1",
|
|
58
|
+
"@khanacademy/wonder-blocks-data": "14.1.1",
|
|
59
|
+
"@khanacademy/wonder-blocks-dropdown": "9.1.1",
|
|
60
|
+
"@khanacademy/wonder-blocks-form": "7.1.1",
|
|
61
|
+
"@khanacademy/wonder-blocks-icon-button": "6.1.1",
|
|
62
|
+
"@khanacademy/wonder-blocks-icon": "5.1.1",
|
|
63
|
+
"@khanacademy/wonder-blocks-layout": "3.1.1",
|
|
64
|
+
"@khanacademy/wonder-blocks-link": "7.1.1",
|
|
65
|
+
"@khanacademy/wonder-blocks-pill": "3.1.1",
|
|
66
|
+
"@khanacademy/wonder-blocks-popover": "5.1.1",
|
|
67
|
+
"@khanacademy/wonder-blocks-progress-spinner": "3.1.1",
|
|
68
|
+
"@khanacademy/wonder-blocks-switch": "3.1.1",
|
|
69
|
+
"@khanacademy/wonder-blocks-tokens": "4.2.1",
|
|
70
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.1",
|
|
71
|
+
"@khanacademy/wonder-blocks-typography": "3.1.1",
|
|
72
|
+
"@khanacademy/wonder-stuff-core": "1.5.4",
|
|
73
|
+
"@phosphor-icons/core": "^2.0.2",
|
|
74
|
+
"@popperjs/core": "^2.10.2",
|
|
75
|
+
"aphrodite": "^1.2.5",
|
|
76
|
+
"classnames": "1.1.4",
|
|
77
|
+
"csstype": "^3.1.3",
|
|
78
|
+
"intersection-observer": "^0.12.0",
|
|
79
|
+
"jquery": "^2.1.1",
|
|
80
|
+
"lodash.debounce": "^4.0.8",
|
|
81
|
+
"prop-types": "15.6.1",
|
|
82
|
+
"react": "^18.2.0",
|
|
83
|
+
"react-dom": "^18.2.0",
|
|
84
|
+
"react-popper": "^2.2.5",
|
|
85
|
+
"underscore": "^1.4.4",
|
|
86
|
+
"perseus-build-settings": "0.5.0"
|
|
87
|
+
},
|
|
88
|
+
"peerDependencies": {
|
|
89
|
+
"@khanacademy/wonder-blocks-banner": "4.1.1",
|
|
90
|
+
"@khanacademy/wonder-blocks-button": "7.1.1",
|
|
91
|
+
"@khanacademy/wonder-blocks-clickable": "6.1.1",
|
|
92
|
+
"@khanacademy/wonder-blocks-core": "12.1.1",
|
|
93
|
+
"@khanacademy/wonder-blocks-data": "14.1.1",
|
|
94
|
+
"@khanacademy/wonder-blocks-dropdown": "9.1.1",
|
|
95
|
+
"@khanacademy/wonder-blocks-form": "7.1.1",
|
|
96
|
+
"@khanacademy/wonder-blocks-icon": "5.1.1",
|
|
97
|
+
"@khanacademy/wonder-blocks-icon-button": "6.1.1",
|
|
98
|
+
"@khanacademy/wonder-blocks-layout": "3.1.1",
|
|
99
|
+
"@khanacademy/wonder-blocks-link": "7.1.1",
|
|
100
|
+
"@khanacademy/wonder-blocks-pill": "3.1.1",
|
|
101
|
+
"@khanacademy/wonder-blocks-popover": "5.1.1",
|
|
102
|
+
"@khanacademy/wonder-blocks-progress-spinner": "3.1.1",
|
|
103
|
+
"@khanacademy/wonder-blocks-switch": "3.1.1",
|
|
104
|
+
"@khanacademy/wonder-blocks-tokens": "4.2.1",
|
|
105
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.1",
|
|
106
|
+
"@khanacademy/wonder-blocks-typography": "3.1.1",
|
|
107
|
+
"@khanacademy/wonder-stuff-core": "1.5.4",
|
|
108
|
+
"@phosphor-icons/core": "^2.0.2",
|
|
109
|
+
"@popperjs/core": "^2.10.2",
|
|
110
|
+
"aphrodite": "^1.2.5",
|
|
111
|
+
"classnames": "1.1.4",
|
|
112
|
+
"intersection-observer": "^0.12.0",
|
|
113
|
+
"jquery": "^2.1.1",
|
|
114
|
+
"lodash.debounce": "^4.0.8",
|
|
115
|
+
"prop-types": "15.6.1",
|
|
116
|
+
"react": "^18.2.0",
|
|
117
|
+
"react-dom": "^18.2.0",
|
|
118
|
+
"react-popper": "^2.2.5",
|
|
119
|
+
"underscore": "^1.4.4"
|
|
120
|
+
},
|
|
121
|
+
"keywords": [],
|
|
122
|
+
"scripts": {}
|
|
123
|
+
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "./i18n-context";
|
|
3
|
-
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
4
|
-
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
5
|
-
type Props = {
|
|
6
|
-
value: string;
|
|
7
|
-
onChange: any;
|
|
8
|
-
className: string;
|
|
9
|
-
examples: ReadonlyArray<string>;
|
|
10
|
-
shouldShowExamples: boolean;
|
|
11
|
-
convertDotToTimes?: boolean;
|
|
12
|
-
buttonSet?: string;
|
|
13
|
-
buttonsVisible?: "always" | "never" | "focused";
|
|
14
|
-
labelText?: string;
|
|
15
|
-
onFocus: () => void;
|
|
16
|
-
onBlur: () => void;
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
style?: StyleType;
|
|
19
|
-
id: string;
|
|
20
|
-
linterContext: LinterContextProps;
|
|
21
|
-
};
|
|
22
|
-
type DefaultProps = {
|
|
23
|
-
shouldShowExamples: Props["shouldShowExamples"];
|
|
24
|
-
onFocus: Props["onFocus"];
|
|
25
|
-
onBlur: Props["onBlur"];
|
|
26
|
-
disabled: Props["disabled"];
|
|
27
|
-
linterContext: Props["linterContext"];
|
|
28
|
-
className: Props["className"];
|
|
29
|
-
};
|
|
30
|
-
type State = {
|
|
31
|
-
focused: boolean;
|
|
32
|
-
showExamples: boolean;
|
|
33
|
-
};
|
|
34
|
-
declare class InputWithExamples extends React.Component<Props, State> {
|
|
35
|
-
static contextType: React.Context<import("./i18n-context").I18nContextType>;
|
|
36
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
37
|
-
static defaultProps: DefaultProps;
|
|
38
|
-
state: State;
|
|
39
|
-
_getUniqueId: () => string;
|
|
40
|
-
_getInputClassName: () => string;
|
|
41
|
-
_renderInput: () => any;
|
|
42
|
-
_handleFocus: () => void;
|
|
43
|
-
show: () => void;
|
|
44
|
-
hide: () => void;
|
|
45
|
-
_handleBlur: () => void;
|
|
46
|
-
focus: () => void;
|
|
47
|
-
blur: () => void;
|
|
48
|
-
handleChange: (arg1: any) => void;
|
|
49
|
-
render(): React.ReactNode;
|
|
50
|
-
}
|
|
51
|
-
export default InputWithExamples;
|