@khanacademy/perseus 54.0.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 +919 -1066
- 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 +1055 -1170
- 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/types.d.ts +3 -1
- package/dist/util.d.ts +0 -5
- package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +1 -1
- package/dist/widgets/categorizer/categorizer.d.ts +1 -1
- package/dist/widgets/dropdown/dropdown.d.ts +5 -4
- package/dist/widgets/expression/expression.d.ts +0 -2
- 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/dist/widgets/radio/radio.d.ts +1 -1
- package/dist/widgets/sorter/sorter.d.ts +1 -1
- package/package.json +120 -124
- package/dist/components/input-with-examples.d.ts +0 -51
- package/dist/components/tooltip.d.ts +0 -85
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;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export declare enum HorizontalDirection {
|
|
3
|
-
Left = "left",
|
|
4
|
-
Right = "right"
|
|
5
|
-
}
|
|
6
|
-
export declare enum VerticalDirection {
|
|
7
|
-
Top = "top",
|
|
8
|
-
Bottom = "bottom"
|
|
9
|
-
}
|
|
10
|
-
type Props = {
|
|
11
|
-
show: boolean;
|
|
12
|
-
className: string;
|
|
13
|
-
arrowSize: number;
|
|
14
|
-
borderColor: string;
|
|
15
|
-
verticalPosition: VerticalDirection;
|
|
16
|
-
horizontalPosition: HorizontalDirection;
|
|
17
|
-
horizontalAlign: HorizontalDirection.Left;
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
targetContainerStyle: any;
|
|
20
|
-
};
|
|
21
|
-
type DefaultProps = {
|
|
22
|
-
className: Props["className"];
|
|
23
|
-
arrowSize: Props["arrowSize"];
|
|
24
|
-
borderColor: Props["borderColor"];
|
|
25
|
-
verticalPosition: Props["verticalPosition"];
|
|
26
|
-
horizontalPosition: Props["horizontalPosition"];
|
|
27
|
-
horizontalAlign: Props["horizontalAlign"];
|
|
28
|
-
targetContainerStyle: Props["targetContainerStyle"];
|
|
29
|
-
};
|
|
30
|
-
type State = {
|
|
31
|
-
height: number | null;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* DEPRECATED! Use Wonder Blocks tooltip instead.
|
|
35
|
-
*
|
|
36
|
-
* A generic tooltip library for React.js
|
|
37
|
-
*
|
|
38
|
-
* ```
|
|
39
|
-
* import Tooltip from "./tooltip";
|
|
40
|
-
* <Tooltip
|
|
41
|
-
* className="class-for-tooltip-contents"
|
|
42
|
-
* horizontalPosition={HoriziontalDirection.Left}
|
|
43
|
-
* horizontalAlign={HoriziontalDirection.Left}
|
|
44
|
-
* verticalPosition={VerticalDirection.Top}
|
|
45
|
-
* arrowSize={10} // arrow size in pixels
|
|
46
|
-
* borderColor="#ccc" // color of the border for the tooltip
|
|
47
|
-
* show={true} // whether the tooltip should currently be visible
|
|
48
|
-
* targetContainerStyle={targetContainerStyle}
|
|
49
|
-
* >
|
|
50
|
-
* <TargetElementOfTheTooltip />
|
|
51
|
-
* <TooltipContents1 />
|
|
52
|
-
* <TooltipContents2 />
|
|
53
|
-
* </Tooltip>
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* To show/hide the tooltip, the parent component should call the
|
|
57
|
-
* `.show()` and `.hide()` methods of the tooltip when appropriate.
|
|
58
|
-
* (These are usually set up as handlers of events on the target element.)
|
|
59
|
-
*
|
|
60
|
-
* Notes:
|
|
61
|
-
* `className` should not specify a border; that is handled by `borderColor`
|
|
62
|
-
* so that the arrow and tooltip match
|
|
63
|
-
*
|
|
64
|
-
* ```
|
|
65
|
-
* __,,--``\\
|
|
66
|
-
* _,,-''`` \\ ,
|
|
67
|
-
* '----------_.------'-.___|\__
|
|
68
|
-
* _.--''`` `)__ )__ @\__
|
|
69
|
-
* ( .. ''---/___,,E/__,E'------`
|
|
70
|
-
* `-''`''
|
|
71
|
-
* Here be dragons.
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
declare class Tooltip extends React.Component<Props, State> {
|
|
75
|
-
tooltipContainerRef: React.RefObject<HTMLDivElement>;
|
|
76
|
-
static defaultProps: DefaultProps;
|
|
77
|
-
state: State;
|
|
78
|
-
componentDidMount(): void;
|
|
79
|
-
UNSAFE_componentWillReceiveProps(): void;
|
|
80
|
-
componentDidUpdate(): void;
|
|
81
|
-
_renderToolTipDiv(isTooltipAbove?: boolean): React.JSX.Element;
|
|
82
|
-
_updateHeight(): void;
|
|
83
|
-
render(): React.JSX.Element;
|
|
84
|
-
}
|
|
85
|
-
export default Tooltip;
|