@khanacademy/perseus 5.0.0 → 6.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/CHANGELOG.md +42 -0
- package/dist/components/fixed-to-responsive.d.ts +27 -1
- package/dist/components/fixed-to-responsive.js.flow +27 -1
- package/dist/components/graph.d.ts +42 -26
- package/dist/components/graph.js.flow +42 -28
- package/dist/components/graphie.d.ts +34 -22
- package/dist/components/graphie.js.flow +37 -24
- package/dist/components/hud.d.ts +8 -14
- package/dist/components/hud.js.flow +7 -14
- package/dist/components/inline-icon.d.ts +9 -19
- package/dist/components/inline-icon.js.flow +26 -13
- package/dist/components/lint.d.ts +41 -13
- package/dist/components/lint.js.flow +42 -13
- package/dist/components/math-output.d.ts +15 -11
- package/dist/components/math-output.js.flow +15 -11
- package/dist/components/sortable.d.ts +17 -9
- package/dist/components/sortable.js.flow +22 -9
- package/dist/components/svg-image.d.ts +5 -3
- package/dist/components/svg-image.js.flow +5 -3
- package/dist/components/tooltip.d.ts +45 -4
- package/dist/components/tooltip.js.flow +44 -31
- package/dist/es/index.css +0 -3
- package/dist/es/index.js +477 -648
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +0 -3
- package/dist/index.js +481 -645
- package/dist/index.js.map +1 -1
- package/dist/perseus-types.d.ts +11 -9
- package/dist/perseus-types.js.flow +11 -9
- package/dist/renderer.d.ts +2 -2
- package/dist/renderer.js.flow +1 -3
- package/dist/styles/shared.d.ts +0 -1
- package/dist/styles/shared.js.flow +0 -1
- package/dist/types.d.ts +0 -10
- package/dist/types.js.flow +0 -13
- package/dist/util/a11y.d.ts +0 -1
- package/dist/util/a11y.js.flow +0 -1
- package/dist/util/interactive.d.ts +2 -0
- package/dist/util/interactive.js.flow +2 -0
- package/dist/util.d.ts +3 -3
- package/dist/util.js.flow +4 -3
- package/dist/widgets/grapher.d.ts +1 -1
- package/dist/widgets/grapher.js.flow +12 -3
- package/dist/widgets/matcher.d.ts +7 -3
- package/dist/widgets/matcher.js.flow +7 -3
- package/dist/widgets/number-line.d.ts +1 -1
- package/dist/widgets/number-line.js.flow +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/item-renderer.test.tsx.snap +151 -159
- package/src/__tests__/__snapshots__/renderer.test.tsx.snap +358 -394
- package/src/__tests__/__snapshots__/server-item-renderer.test.tsx.snap +169 -189
- package/src/components/__stories__/lint.stories.tsx +56 -21
- package/src/components/__stories__/sortable.stories.tsx +5 -5
- package/src/components/__stories__/tooltip.stories.tsx +52 -0
- package/src/components/__tests__/__snapshots__/sortable.test.tsx.snap +114 -30
- package/src/components/__tests__/__snapshots__/sorter.test.tsx.snap +172 -204
- package/src/components/__tests__/sortable.test.tsx +54 -16
- package/src/components/__tests__/sorter.test.tsx +12 -9
- package/src/components/fixed-to-responsive.tsx +43 -38
- package/src/components/graph.tsx +95 -81
- package/src/components/graphie.tsx +62 -32
- package/src/components/hud.tsx +104 -115
- package/src/components/inline-icon.tsx +15 -32
- package/src/components/input-with-examples.tsx +4 -4
- package/src/components/lint.tsx +47 -41
- package/src/components/math-output.tsx +17 -11
- package/src/components/simple-keypad-input.tsx +2 -2
- package/src/components/sortable.tsx +134 -94
- package/src/components/svg-image.tsx +10 -11
- package/src/components/tooltip.tsx +189 -171
- package/src/interactive2/types.ts +2 -2
- package/src/multi-items/__tests__/__snapshots__/multi-renderer.test.tsx.snap +708 -764
- package/src/perseus-types.ts +13 -9
- package/src/renderer.tsx +11 -22
- package/src/types.ts +0 -18
- package/src/util/interactive.ts +18 -5
- package/src/util/tex.ts +13 -77
- package/src/util.ts +3 -4
- package/src/widgets/__tests__/__snapshots__/categorizer.test.ts.snap +717 -773
- package/src/widgets/__tests__/__snapshots__/cs-program.test.ts.snap +28 -36
- package/src/widgets/__tests__/__snapshots__/definition.test.ts.snap +52 -60
- package/src/widgets/__tests__/__snapshots__/dropdown.test.ts.snap +100 -108
- package/src/widgets/__tests__/__snapshots__/explanation.test.ts.snap +212 -260
- package/src/widgets/__tests__/__snapshots__/graded-group-set-jipt.test.ts.snap +613 -641
- package/src/widgets/__tests__/__snapshots__/graded-group-set.test.ts.snap +249 -261
- package/src/widgets/__tests__/__snapshots__/graded-group.test.ts.snap +671 -735
- package/src/widgets/__tests__/__snapshots__/grapher.test.ts.snap +2676 -2684
- package/src/widgets/__tests__/__snapshots__/group.test.tsx.snap +938 -1002
- package/src/widgets/__tests__/__snapshots__/iframe.test.ts.snap +28 -36
- package/src/widgets/__tests__/__snapshots__/image.test.ts.snap +227 -255
- package/src/widgets/__tests__/__snapshots__/input-number.test.ts.snap +353 -357
- package/src/widgets/__tests__/__snapshots__/interaction.test.ts.snap +255 -259
- package/src/widgets/__tests__/__snapshots__/interactive-graph.test.ts.snap +2401 -2433
- package/src/widgets/__tests__/__snapshots__/matcher.test.tsx.snap +600 -756
- package/src/widgets/__tests__/__snapshots__/matrix.test.ts.snap +420 -428
- package/src/widgets/__tests__/__snapshots__/number-line.test.ts.snap +762 -770
- package/src/widgets/__tests__/__snapshots__/numeric-input.test.ts.snap +373 -393
- package/src/widgets/__tests__/__snapshots__/orderer.test.ts.snap +116 -148
- package/src/widgets/__tests__/__snapshots__/passage-ref.test.ts.snap +289 -301
- package/src/widgets/__tests__/__snapshots__/passage.test.tsx.snap +1679 -1711
- package/src/widgets/__tests__/__snapshots__/radio.test.ts.snap +2692 -2960
- package/src/widgets/__tests__/__snapshots__/video.test.ts.snap +90 -98
- package/src/widgets/__tests__/matcher.test.tsx +33 -9
- package/src/widgets/expression.tsx +9 -6
- package/src/widgets/grapher.tsx +3 -3
- package/src/widgets/image.tsx +2 -2
- package/src/widgets/interactive-graph.tsx +5 -5
- package/src/widgets/matcher.tsx +43 -24
- package/src/widgets/number-line.tsx +1 -1
- package/src/widgets/simulator.tsx +4 -6
- package/{tsconfig.json → tsconfig-build.json} +6 -6
- package/tsconfig-build.tsbuildinfo +1 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -4,21 +4,50 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
7
|
import * as React from "react";
|
|
9
|
-
|
|
10
|
-
declare
|
|
8
|
+
|
|
9
|
+
declare var Severity: {|
|
|
10
|
+
+Error: 1, // 1
|
|
11
|
+
+Warning: 2, // 2
|
|
12
|
+
+Recommendation: 3, // 3
|
|
13
|
+
+OfflineReportingOnly: 4, // 4
|
|
14
|
+
|};
|
|
15
|
+
declare type Props = {|
|
|
16
|
+
children: React.Node,
|
|
17
|
+
inline?: boolean,
|
|
18
|
+
message: string,
|
|
19
|
+
ruleName: string,
|
|
20
|
+
insideTable: boolean,
|
|
21
|
+
blockHighlight?: boolean,
|
|
22
|
+
severity?: $Values<typeof Severity>,
|
|
23
|
+
|};
|
|
24
|
+
declare type State = {|
|
|
25
|
+
tooltipAbove: boolean,
|
|
26
|
+
|};
|
|
27
|
+
/**
|
|
28
|
+
* This component renders "lint" nodes in a markdown parse tree. Lint nodes
|
|
29
|
+
* are inserted into the tree by the Perseus linter (see
|
|
30
|
+
* perseus-linter/src/index).
|
|
31
|
+
*
|
|
32
|
+
* This component serves multiple purposes
|
|
33
|
+
*
|
|
34
|
+
* 1) It renders a small circle in the right margin to indicate that there
|
|
35
|
+
* is lint on (or near) that line.
|
|
36
|
+
*
|
|
37
|
+
* 2) The area around the circle is hoverable: when the mouse moves over it
|
|
38
|
+
* the linty content is highlighted and a tooltip is displayed that explains
|
|
39
|
+
* what the problem is.
|
|
40
|
+
*
|
|
41
|
+
* 3) The hoverable area is also an HTML <a> tag. Clicking on it opens
|
|
42
|
+
* a new tab and links to additional details about the specific lint rule.
|
|
43
|
+
*
|
|
44
|
+
* The CSS required to position the circles in the right margin is tricky
|
|
45
|
+
* and it does not always work perfectly. When lint occurs on a block element
|
|
46
|
+
* that has a right margin (like anything blockquoted) the circle will appear
|
|
47
|
+
* to the left of where it belongs. And if there is more
|
|
48
|
+
*/
|
|
11
49
|
declare class Lint extends React.Component<Props, State> {
|
|
12
|
-
_positionTimeout: number |
|
|
13
|
-
static propTypes: {|
|
|
14
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>,
|
|
15
|
-
inline: PropTypes.Requireable<boolean>,
|
|
16
|
-
message: PropTypes.Validator<string>,
|
|
17
|
-
ruleName: PropTypes.Validator<string>,
|
|
18
|
-
insideTable: PropTypes.Validator<boolean>,
|
|
19
|
-
blockHighlight: PropTypes.Requireable<boolean>,
|
|
20
|
-
severity: PropTypes.Requireable<number>,
|
|
21
|
-
|};
|
|
50
|
+
_positionTimeout: number | void;
|
|
22
51
|
state: State;
|
|
23
52
|
componentDidMount(): void;
|
|
24
53
|
componentWillUnmount(): void;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import PropTypes from "prop-types";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
type Props = {
|
|
3
|
+
value: string | number;
|
|
4
|
+
className?: string;
|
|
5
|
+
labelText?: string;
|
|
6
|
+
onFocus: () => void;
|
|
7
|
+
onBlur: () => void;
|
|
8
|
+
};
|
|
9
|
+
type DefaultProps = Pick<Props, "value" | "onFocus" | "onBlur">;
|
|
10
|
+
type State = {
|
|
11
|
+
focused: boolean;
|
|
12
|
+
selectorNamespace: string;
|
|
13
|
+
};
|
|
14
|
+
declare class MathOutput extends React.Component<Props, State> {
|
|
15
|
+
static defaultProps: DefaultProps;
|
|
16
|
+
state: State;
|
|
13
17
|
_getInputClassName: () => string;
|
|
14
18
|
_getDisplayValue: (arg1: string | number) => string;
|
|
15
19
|
render(): React.ReactNode;
|
|
@@ -4,18 +4,22 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
7
|
import * as React from "react";
|
|
9
|
-
declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
declare type Props = {|
|
|
9
|
+
value: string | number,
|
|
10
|
+
className?: string,
|
|
11
|
+
labelText?: string,
|
|
12
|
+
onFocus: () => void,
|
|
13
|
+
onBlur: () => void,
|
|
14
|
+
|};
|
|
15
|
+
declare type DefaultProps = Pick<Props, "value" | "onFocus" | "onBlur">;
|
|
16
|
+
declare type State = {|
|
|
17
|
+
focused: boolean,
|
|
18
|
+
selectorNamespace: string,
|
|
19
|
+
|};
|
|
20
|
+
declare class MathOutput extends React.Component<Props, State> {
|
|
21
|
+
static defaultProps: DefaultProps;
|
|
22
|
+
state: State;
|
|
19
23
|
_getInputClassName: () => string;
|
|
20
24
|
_getDisplayValue: (arg1: string | number) => string;
|
|
21
25
|
render(): React.Node;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { Position } from "../util";
|
|
2
3
|
import type { LinterContextProps } from "../types";
|
|
3
|
-
|
|
4
|
+
export declare enum Layout {
|
|
5
|
+
HORIZONTAL = "horizontal",
|
|
6
|
+
VERTICAL = "vertical"
|
|
7
|
+
}
|
|
8
|
+
declare enum ItemState {
|
|
9
|
+
STATIC = "static",
|
|
10
|
+
DRAGGING = "dragging",
|
|
11
|
+
ANIMATING = "animating",
|
|
12
|
+
DISABLED = "disabled"
|
|
13
|
+
}
|
|
4
14
|
export type SortableOption = string;
|
|
5
15
|
type SortableProps = {
|
|
6
16
|
constraints: {
|
|
@@ -8,7 +18,7 @@ type SortableProps = {
|
|
|
8
18
|
height: number;
|
|
9
19
|
} | Record<any, any>;
|
|
10
20
|
disabled: boolean;
|
|
11
|
-
layout:
|
|
21
|
+
layout: Layout;
|
|
12
22
|
margin: number;
|
|
13
23
|
onChange: (arg1: any) => void;
|
|
14
24
|
onMeasure: (arg1: {
|
|
@@ -17,8 +27,8 @@ type SortableProps = {
|
|
|
17
27
|
}) => void;
|
|
18
28
|
padding: boolean;
|
|
19
29
|
linterContext: LinterContextProps;
|
|
20
|
-
waitForKatexLoad: boolean;
|
|
21
30
|
options: ReadonlyArray<SortableOption>;
|
|
31
|
+
waitForTexRendererToLoad: boolean;
|
|
22
32
|
};
|
|
23
33
|
type DefaultProps = {
|
|
24
34
|
constraints: SortableProps["constraints"];
|
|
@@ -29,27 +39,25 @@ type DefaultProps = {
|
|
|
29
39
|
onMeasure: SortableProps["onMeasure"];
|
|
30
40
|
padding: SortableProps["padding"];
|
|
31
41
|
linterContext: SortableProps["linterContext"];
|
|
32
|
-
|
|
42
|
+
waitForTexRendererToLoad: SortableProps["waitForTexRendererToLoad"];
|
|
33
43
|
};
|
|
34
|
-
type ItemState = "disabled" | "static" | "dragging" | "animating";
|
|
35
44
|
type SortableItem = {
|
|
36
45
|
option: SortableOption;
|
|
37
46
|
key: number;
|
|
38
|
-
|
|
39
|
-
endPosition:
|
|
47
|
+
state: ItemState;
|
|
48
|
+
endPosition: Position | Record<string, never>;
|
|
40
49
|
width: number;
|
|
41
50
|
height: number;
|
|
42
51
|
};
|
|
43
52
|
type SortableState = {
|
|
44
53
|
items: ReadonlyArray<SortableItem>;
|
|
45
|
-
|
|
54
|
+
texRendererLoaded: boolean;
|
|
46
55
|
};
|
|
47
56
|
declare class Sortable extends React.Component<SortableProps, SortableState> {
|
|
48
57
|
static defaultProps: DefaultProps;
|
|
49
58
|
constructor(props: SortableProps);
|
|
50
59
|
UNSAFE_componentWillReceiveProps(nextProps: SortableProps): void;
|
|
51
60
|
componentDidUpdate(): void;
|
|
52
|
-
componentDidMount(): void;
|
|
53
61
|
static itemsFromProps(props: {
|
|
54
62
|
disabled: boolean;
|
|
55
63
|
options: ReadonlyArray<SortableOption>;
|
|
@@ -5,8 +5,20 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { Position } from "../util";
|
|
8
9
|
import type { LinterContextProps } from "../types";
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
declare export var Layout: {|
|
|
12
|
+
+HORIZONTAL: "horizontal", // "horizontal"
|
|
13
|
+
+VERTICAL: "vertical", // "vertical"
|
|
14
|
+
|};
|
|
15
|
+
|
|
16
|
+
declare var ItemState: {|
|
|
17
|
+
+STATIC: "static", // "static"
|
|
18
|
+
+DRAGGING: "dragging", // "dragging"
|
|
19
|
+
+ANIMATING: "animating", // "animating"
|
|
20
|
+
+DISABLED: "disabled", // "disabled"
|
|
21
|
+
|};
|
|
10
22
|
export type SortableOption = string;
|
|
11
23
|
declare type SortableProps = {|
|
|
12
24
|
constraints:
|
|
@@ -16,7 +28,7 @@ declare type SortableProps = {|
|
|
|
16
28
|
|}
|
|
17
29
|
| { [key: any]: any },
|
|
18
30
|
disabled: boolean,
|
|
19
|
-
layout:
|
|
31
|
+
layout: $Values<typeof Layout>,
|
|
20
32
|
margin: number,
|
|
21
33
|
onChange: (arg1: any) => void,
|
|
22
34
|
onMeasure: (arg1: {|
|
|
@@ -25,8 +37,8 @@ declare type SortableProps = {|
|
|
|
25
37
|
|}) => void,
|
|
26
38
|
padding: boolean,
|
|
27
39
|
linterContext: LinterContextProps,
|
|
28
|
-
waitForKatexLoad: boolean,
|
|
29
40
|
options: $ReadOnlyArray<SortableOption>,
|
|
41
|
+
waitForTexRendererToLoad: boolean,
|
|
30
42
|
|};
|
|
31
43
|
declare type DefaultProps = {|
|
|
32
44
|
constraints: $PropertyType<SortableProps, "constraints">,
|
|
@@ -37,27 +49,28 @@ declare type DefaultProps = {|
|
|
|
37
49
|
onMeasure: $PropertyType<SortableProps, "onMeasure">,
|
|
38
50
|
padding: $PropertyType<SortableProps, "padding">,
|
|
39
51
|
linterContext: $PropertyType<SortableProps, "linterContext">,
|
|
40
|
-
|
|
52
|
+
waitForTexRendererToLoad: $PropertyType<
|
|
53
|
+
SortableProps,
|
|
54
|
+
"waitForTexRendererToLoad"
|
|
55
|
+
>,
|
|
41
56
|
|};
|
|
42
|
-
declare type ItemState = "disabled" | "static" | "dragging" | "animating";
|
|
43
57
|
declare type SortableItem = {|
|
|
44
58
|
option: SortableOption,
|
|
45
59
|
key: number,
|
|
46
|
-
|
|
47
|
-
endPosition:
|
|
60
|
+
state: $Values<typeof ItemState>,
|
|
61
|
+
endPosition: Position | { [key: string]: empty },
|
|
48
62
|
width: number,
|
|
49
63
|
height: number,
|
|
50
64
|
|};
|
|
51
65
|
declare type SortableState = {|
|
|
52
66
|
items: $ReadOnlyArray<SortableItem>,
|
|
53
|
-
|
|
67
|
+
texRendererLoaded: boolean,
|
|
54
68
|
|};
|
|
55
69
|
declare class Sortable extends React.Component<SortableProps, SortableState> {
|
|
56
70
|
static defaultProps: DefaultProps;
|
|
57
71
|
constructor(props: SortableProps): this;
|
|
58
72
|
UNSAFE_componentWillReceiveProps(nextProps: SortableProps): void;
|
|
59
73
|
componentDidUpdate(): void;
|
|
60
|
-
componentDidMount(): void;
|
|
61
74
|
static itemsFromProps(props: {|
|
|
62
75
|
disabled: boolean,
|
|
63
76
|
options: $ReadOnlyArray<SortableOption>,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { Coord } from "../interactive2/types";
|
|
3
|
+
import type { Size } from "../perseus-types";
|
|
2
4
|
import type { Alignment, Dimensions } from "../types";
|
|
3
5
|
type Props = {
|
|
4
6
|
allowFullBleed?: boolean;
|
|
5
7
|
alt: string;
|
|
6
8
|
constrainHeight?: boolean;
|
|
7
9
|
extraGraphie?: {
|
|
8
|
-
box:
|
|
9
|
-
range:
|
|
10
|
+
box: Size;
|
|
11
|
+
range: [Coord, Coord];
|
|
10
12
|
labels: ReadonlyArray<any>;
|
|
11
13
|
};
|
|
12
14
|
height?: number;
|
|
@@ -38,7 +40,7 @@ type State = {
|
|
|
38
40
|
labelsRendered: LabelsRenderedMap;
|
|
39
41
|
labelDataIsLocalized: boolean;
|
|
40
42
|
labels: ReadonlyArray<Label>;
|
|
41
|
-
range:
|
|
43
|
+
range: [Coord, Coord];
|
|
42
44
|
};
|
|
43
45
|
declare class SvgImage extends React.Component<Props, State> {
|
|
44
46
|
_isMounted: boolean;
|
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { Coord } from "../interactive2/types";
|
|
9
|
+
import type { Size } from "../perseus-types";
|
|
8
10
|
import type { Alignment, Dimensions } from "../types";
|
|
9
11
|
declare type Props = {|
|
|
10
12
|
allowFullBleed?: boolean,
|
|
11
13
|
alt: string,
|
|
12
14
|
constrainHeight?: boolean,
|
|
13
15
|
extraGraphie?: {|
|
|
14
|
-
box:
|
|
15
|
-
range:
|
|
16
|
+
box: Size,
|
|
17
|
+
range: [Coord, Coord],
|
|
16
18
|
labels: $ReadOnlyArray<any>,
|
|
17
19
|
|},
|
|
18
20
|
height?: number,
|
|
@@ -44,7 +46,7 @@ declare type State = {|
|
|
|
44
46
|
labelsRendered: LabelsRenderedMap,
|
|
45
47
|
labelDataIsLocalized: boolean,
|
|
46
48
|
labels: $ReadOnlyArray<Label>,
|
|
47
|
-
range:
|
|
49
|
+
range: [Coord, Coord],
|
|
48
50
|
|};
|
|
49
51
|
declare class SvgImage extends React.Component<Props, State> {
|
|
50
52
|
_isMounted: boolean;
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* import Tooltip from "./tooltip";
|
|
8
8
|
* <Tooltip
|
|
9
9
|
* className="class-for-tooltip-contents"
|
|
10
|
-
* horizontalPosition=
|
|
11
|
-
* horizontalAlign=
|
|
12
|
-
* verticalPosition=
|
|
10
|
+
* horizontalPosition={HoriziontalDirection.Left}
|
|
11
|
+
* horizontalAlign={HoriziontalDirection.Left}
|
|
12
|
+
* verticalPosition={VerticalDirection.Top}
|
|
13
13
|
* arrowSize={10} // arrow size in pixels
|
|
14
14
|
* borderColor="#ccc" // color of the border for the tooltip
|
|
15
15
|
* show={true} // whether the tooltip should currently be visible
|
|
@@ -28,5 +28,46 @@
|
|
|
28
28
|
* className should not specify a border; that is handled by borderColor
|
|
29
29
|
* so that the arrow and tooltip match
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
import * as React from "react";
|
|
32
|
+
export declare enum HorizontalDirection {
|
|
33
|
+
Left = "left",
|
|
34
|
+
Right = "right"
|
|
35
|
+
}
|
|
36
|
+
export declare enum VerticalDirection {
|
|
37
|
+
Top = "top",
|
|
38
|
+
Bottom = "bottom"
|
|
39
|
+
}
|
|
40
|
+
type Props = {
|
|
41
|
+
show: boolean;
|
|
42
|
+
className: string;
|
|
43
|
+
arrowSize: number;
|
|
44
|
+
borderColor: string;
|
|
45
|
+
verticalPosition: VerticalDirection;
|
|
46
|
+
horizontalPosition: HorizontalDirection;
|
|
47
|
+
horizontalAlign: HorizontalDirection.Left;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
targetContainerStyle: any;
|
|
50
|
+
};
|
|
51
|
+
type DefaultProps = {
|
|
52
|
+
className: Props["className"];
|
|
53
|
+
arrowSize: Props["arrowSize"];
|
|
54
|
+
borderColor: Props["borderColor"];
|
|
55
|
+
verticalPosition: Props["verticalPosition"];
|
|
56
|
+
horizontalPosition: Props["horizontalPosition"];
|
|
57
|
+
horizontalAlign: Props["horizontalAlign"];
|
|
58
|
+
targetContainerStyle: Props["targetContainerStyle"];
|
|
59
|
+
};
|
|
60
|
+
type State = {
|
|
61
|
+
height: number | null;
|
|
62
|
+
};
|
|
63
|
+
declare class Tooltip extends React.Component<Props, State> {
|
|
64
|
+
static defaultProps: DefaultProps;
|
|
65
|
+
state: State;
|
|
66
|
+
componentDidMount(): void;
|
|
67
|
+
UNSAFE_componentWillReceiveProps(): void;
|
|
68
|
+
componentDidUpdate(): void;
|
|
69
|
+
_renderToolTipDiv(isTooltipAbove?: boolean): JSX.Element;
|
|
70
|
+
_updateHeight(): void;
|
|
71
|
+
render(): JSX.Element;
|
|
72
|
+
}
|
|
32
73
|
export default Tooltip;
|
|
@@ -4,35 +4,48 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
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
|
-
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
|
|
9
|
+
declare export var HorizontalDirection: {|
|
|
10
|
+
+Left: "left", // "left"
|
|
11
|
+
+Right: "right", // "right"
|
|
12
|
+
|};
|
|
13
|
+
|
|
14
|
+
declare export var VerticalDirection: {|
|
|
15
|
+
+Top: "top", // "top"
|
|
16
|
+
+Bottom: "bottom", // "bottom"
|
|
17
|
+
|};
|
|
18
|
+
declare type Props = {|
|
|
19
|
+
show: boolean,
|
|
20
|
+
className: string,
|
|
21
|
+
arrowSize: number,
|
|
22
|
+
borderColor: string,
|
|
23
|
+
verticalPosition: $Values<typeof VerticalDirection>,
|
|
24
|
+
horizontalPosition: $Values<typeof HorizontalDirection>,
|
|
25
|
+
horizontalAlign: typeof HorizontalDirection.Left,
|
|
26
|
+
children: React.Node,
|
|
27
|
+
targetContainerStyle: any,
|
|
28
|
+
|};
|
|
29
|
+
declare type DefaultProps = {|
|
|
30
|
+
className: $PropertyType<Props, "className">,
|
|
31
|
+
arrowSize: $PropertyType<Props, "arrowSize">,
|
|
32
|
+
borderColor: $PropertyType<Props, "borderColor">,
|
|
33
|
+
verticalPosition: $PropertyType<Props, "verticalPosition">,
|
|
34
|
+
horizontalPosition: $PropertyType<Props, "horizontalPosition">,
|
|
35
|
+
horizontalAlign: $PropertyType<Props, "horizontalAlign">,
|
|
36
|
+
targetContainerStyle: $PropertyType<Props, "targetContainerStyle">,
|
|
37
|
+
|};
|
|
38
|
+
declare type State = {|
|
|
39
|
+
height: number | null,
|
|
40
|
+
|};
|
|
41
|
+
declare class Tooltip extends React.Component<Props, State> {
|
|
42
|
+
static defaultProps: DefaultProps;
|
|
43
|
+
state: State;
|
|
44
|
+
componentDidMount(): void;
|
|
45
|
+
UNSAFE_componentWillReceiveProps(): void;
|
|
46
|
+
componentDidUpdate(): void;
|
|
47
|
+
_renderToolTipDiv(isTooltipAbove?: boolean): React$Node;
|
|
48
|
+
_updateHeight(): void;
|
|
49
|
+
render(): React$Node;
|
|
50
|
+
}
|
|
38
51
|
declare export default typeof Tooltip;
|
package/dist/es/index.css
CHANGED
|
@@ -3606,9 +3606,6 @@ body.mobile .framework-perseus table.perseus-widget-table-of-values.non-markdown
|
|
|
3606
3606
|
color: white !important;
|
|
3607
3607
|
display: inline-block !important;
|
|
3608
3608
|
}
|
|
3609
|
-
.keypad-container .katex {
|
|
3610
|
-
color: inherit !important;
|
|
3611
|
-
}
|
|
3612
3609
|
/**
|
|
3613
3610
|
* Styles for managing the popover animations.
|
|
3614
3611
|
*
|