@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.
Files changed (37) hide show
  1. package/LICENSE +18 -0
  2. package/dist/components/number-input.d.ts +9 -10
  3. package/dist/components/range-input.d.ts +5 -6
  4. package/dist/components/simple-keypad-input.d.ts +5 -0
  5. package/dist/components/stub-tag-editor.d.ts +3 -4
  6. package/dist/components/text-list-editor.d.ts +3 -4
  7. package/dist/es/index.css +16 -6
  8. package/dist/es/index.js +901 -985
  9. package/dist/es/index.js.map +1 -1
  10. package/dist/es/strings.js +40 -10
  11. package/dist/es/strings.js.map +1 -1
  12. package/dist/index.css +16 -6
  13. package/dist/index.js +1035 -1086
  14. package/dist/index.js.map +1 -1
  15. package/dist/mixins/changeable.d.ts +1 -2
  16. package/dist/perseus-api.d.ts +1 -56
  17. package/dist/shared-utils/add-library-version-to-perseus-debug.d.ts +9 -0
  18. package/dist/strings.d.ts +34 -4
  19. package/dist/strings.js +142 -97
  20. package/dist/strings.js.map +1 -1
  21. package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +1 -1
  22. package/dist/widgets/dropdown/dropdown.d.ts +5 -4
  23. package/dist/widgets/interactive-graph.d.ts +4 -2
  24. package/dist/widgets/interactive-graphs/graphs/circle.d.ts +7 -0
  25. package/dist/widgets/interactive-graphs/graphs/components/movable-line.d.ts +6 -0
  26. package/dist/widgets/interactive-graphs/graphs/quadratic.d.ts +8 -0
  27. package/dist/widgets/interactive-graphs/graphs/sinusoid.d.ts +7 -0
  28. package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +1 -1
  29. package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +6 -1
  30. package/dist/widgets/numeric-input/index.d.ts +1 -1
  31. package/dist/widgets/numeric-input/input-with-examples.d.ts +8 -0
  32. package/dist/widgets/numeric-input/numeric-input.class.d.ts +66 -0
  33. package/dist/widgets/numeric-input/numeric-input.d.ts +123 -77
  34. package/dist/widgets/numeric-input/utils.d.ts +25 -0
  35. package/package.json +120 -124
  36. package/dist/components/input-with-examples.d.ts +0 -51
  37. 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
- import { PerseusI18nContext } from "../../components/i18n-context";
3
- import InputWithExamples from "../../components/input-with-examples";
4
- import SimpleKeypadInput from "../../components/simple-keypad-input";
5
- import type { FocusPath, Widget, WidgetProps } from "../../types";
6
- import type { NumericInputPromptJSON } from "../../widget-ai-utils/numeric-input/prompt-utils";
7
- import type { PerseusNumericInputWidgetOptions, PerseusNumericInputAnswerForm } from "@khanacademy/perseus-core";
8
- import type { PerseusNumericInputRubric, PerseusNumericInputUserInput } from "@khanacademy/perseus-score";
9
- type ExternalProps = WidgetProps<PerseusNumericInputWidgetOptions, PerseusNumericInputRubric>;
10
- type Props = ExternalProps & {
11
- size: NonNullable<ExternalProps["size"]>;
12
- rightAlign: NonNullable<ExternalProps["rightAlign"]>;
13
- apiOptions: NonNullable<ExternalProps["apiOptions"]>;
14
- coefficient: NonNullable<ExternalProps["coefficient"]>;
15
- answerForms: NonNullable<ExternalProps["answerForms"]>;
16
- labelText: string;
17
- linterContext: NonNullable<ExternalProps["linterContext"]>;
18
- currentValue: string;
19
- };
20
- type DefaultProps = {
21
- currentValue: Props["currentValue"];
22
- size: Props["size"];
23
- rightAlign: Props["rightAlign"];
24
- apiOptions: Props["apiOptions"];
25
- coefficient: Props["coefficient"];
26
- answerForms: Props["answerForms"];
27
- labelText: Props["labelText"];
28
- linterContext: Props["linterContext"];
29
- };
30
- type State = {
31
- previousValues: ReadonlyArray<string>;
32
- isFocused: boolean;
33
- };
34
- export declare class NumericInput extends React.Component<Props, State> implements Widget {
35
- static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
36
- context: React.ContextType<typeof PerseusI18nContext>;
37
- inputRef: SimpleKeypadInput | InputWithExamples | null | undefined;
38
- static defaultProps: DefaultProps;
39
- static getUserInputFromProps(props: Props): PerseusNumericInputUserInput;
40
- state: State;
41
- /**
42
- * Generates a string that demonstrates how to input the various supported
43
- * answer forms.
44
- */
45
- examples(): ReadonlyArray<string>;
46
- shouldShowExamples: () => boolean;
47
- focus: () => boolean;
48
- focusInputPath: () => void;
49
- blurInputPath: () => void;
50
- getInputPaths: () => ReadonlyArray<ReadonlyArray<string>>;
51
- setInputValue: (arg1: FocusPath, arg2: string, arg3?: () => unknown | null | undefined) => void;
52
- getUserInput(): PerseusNumericInputUserInput;
53
- getPromptJSON(): NumericInputPromptJSON;
54
- handleChange: (arg1: string, arg2?: () => unknown | null | undefined) => void;
55
- _handleFocus: () => void;
56
- _handleBlur: () => void;
57
- render(): React.ReactNode;
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
- size: "normal" | "small";
67
- coefficient: boolean;
68
- rightAlign?: boolean;
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
- "name": "@khanacademy/perseus",
3
- "description": "Core Perseus API (includes renderers and widgets)",
4
- "author": "Khan Academy",
5
- "license": "MIT",
6
- "version": "54.1.0",
7
- "publishConfig": {
8
- "access": "public"
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
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/Khan/perseus.git",
13
- "directory": "packages/perseus"
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
- "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"
27
- },
28
- "./strings": {
29
- "import": "./dist/es/strings.js",
30
- "require": "./dist/strings.js",
31
- "types": "./dist/strings.d.ts",
32
- "source": "./src/strings.ts"
33
- },
34
- "./styles.css": "./dist/index.css"
35
- },
36
- "files": [
37
- "dist"
38
- ],
39
- "scripts": {
40
- "prepublishOnly": "../../utils/package-pre-publish-check.sh",
41
- "test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
42
- },
43
- "dependencies": {
44
- "@khanacademy/kas": "^0.4.16",
45
- "@khanacademy/keypad-context": "^1.0.19",
46
- "@khanacademy/kmath": "^0.3.5",
47
- "@khanacademy/math-input": "^22.2.6",
48
- "@khanacademy/perseus-core": "3.7.0",
49
- "@khanacademy/perseus-linter": "^1.2.18",
50
- "@khanacademy/perseus-score": "^2.2.2",
51
- "@khanacademy/pure-markdown": "^0.3.27",
52
- "@khanacademy/simple-markdown": "^0.13.20",
53
- "@types/classnames": "2.2.0",
54
- "@use-gesture/react": "^10.2.27",
55
- "mafs": "0.19.0",
56
- "uuid": "^10.0.0"
57
- },
58
- "devDependencies": {
59
- "@khanacademy/wonder-blocks-banner": "4.1.1",
60
- "@khanacademy/wonder-blocks-button": "7.1.1",
61
- "@khanacademy/wonder-blocks-clickable": "6.1.1",
62
- "@khanacademy/wonder-blocks-core": "12.1.1",
63
- "@khanacademy/wonder-blocks-data": "14.1.1",
64
- "@khanacademy/wonder-blocks-dropdown": "9.1.1",
65
- "@khanacademy/wonder-blocks-form": "7.1.1",
66
- "@khanacademy/wonder-blocks-icon": "5.1.1",
67
- "@khanacademy/wonder-blocks-icon-button": "6.1.1",
68
- "@khanacademy/wonder-blocks-layout": "3.1.1",
69
- "@khanacademy/wonder-blocks-link": "7.1.1",
70
- "@khanacademy/wonder-blocks-pill": "3.1.1",
71
- "@khanacademy/wonder-blocks-popover": "5.1.1",
72
- "@khanacademy/wonder-blocks-progress-spinner": "3.1.1",
73
- "@khanacademy/wonder-blocks-switch": "3.1.1",
74
- "@khanacademy/wonder-blocks-tokens": "4.2.1",
75
- "@khanacademy/wonder-blocks-tooltip": "4.1.1",
76
- "@khanacademy/wonder-blocks-typography": "3.1.1",
77
- "@khanacademy/wonder-stuff-core": "1.5.4",
78
- "@phosphor-icons/core": "^2.0.2",
79
- "@popperjs/core": "^2.10.2",
80
- "aphrodite": "^1.2.5",
81
- "classnames": "1.1.4",
82
- "csstype": "^3.1.3",
83
- "intersection-observer": "^0.12.0",
84
- "jquery": "^2.1.1",
85
- "lodash.debounce": "^4.0.8",
86
- "perseus-build-settings": "^0.4.3",
87
- "prop-types": "15.6.1",
88
- "react": "^18.2.0",
89
- "react-dom": "^18.2.0",
90
- "react-popper": "^2.2.5",
91
- "underscore": "^1.4.4"
92
- },
93
- "peerDependencies": {
94
- "@khanacademy/wonder-blocks-banner": "4.1.1",
95
- "@khanacademy/wonder-blocks-button": "7.1.1",
96
- "@khanacademy/wonder-blocks-clickable": "6.1.1",
97
- "@khanacademy/wonder-blocks-core": "12.1.1",
98
- "@khanacademy/wonder-blocks-data": "14.1.1",
99
- "@khanacademy/wonder-blocks-dropdown": "9.1.1",
100
- "@khanacademy/wonder-blocks-form": "7.1.1",
101
- "@khanacademy/wonder-blocks-icon": "5.1.1",
102
- "@khanacademy/wonder-blocks-icon-button": "6.1.1",
103
- "@khanacademy/wonder-blocks-layout": "3.1.1",
104
- "@khanacademy/wonder-blocks-link": "7.1.1",
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;