@khanacademy/perseus 0.2.7 → 0.3.1
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 +29 -0
- package/README.md +5 -0
- package/dist/es/index.css +1 -436
- package/dist/es/index.js +3172 -5450
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1 -436
- package/dist/index.js +13520 -15805
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/__tests__/perseus-markdown_test.jsx +6 -6
- package/src/__tests__/renderer_test.jsx +9 -9
- package/src/article-renderer.jsx +4 -5
- package/src/components/input-with-examples.jsx +4 -5
- package/src/components/lint.jsx +2 -1
- package/src/components/sortable.jsx +6 -7
- package/src/hint-renderer.jsx +3 -4
- package/src/hints-renderer.jsx +3 -4
- package/src/index.js +1 -0
- package/src/item-renderer.jsx +4 -5
- package/src/jquery.mobile.vmouse.js +2 -1
- package/src/perseus-markdown.jsx +3 -3
- package/src/renderer.jsx +31 -33
- package/src/styles/perseus-renderer.less +1 -1
- package/src/{not-gorgon.js → translation-linter.js} +10 -14
- package/src/types.js +3 -1
- package/src/widget-container.jsx +1 -1
- package/src/widgets/__tests__/__snapshots__/definition_test.js.snap +30 -12
- package/src/widgets/__tests__/definition_test.js +18 -33
- package/src/widgets/__tests__/grapher.cypress.jsx +2 -2
- package/src/widgets/__tests__/interactive-graph.cypress.jsx +2 -2
- package/src/widgets/categorizer.jsx +1 -1
- package/src/widgets/definition.jsx +36 -71
- package/src/widgets/explanation.jsx +1 -1
- package/src/widgets/expression.jsx +1 -1
- package/src/widgets/graded-group-set.jsx +1 -1
- package/src/widgets/graded-group.jsx +1 -1
- package/src/widgets/group.jsx +1 -1
- package/src/widgets/image.jsx +1 -1
- package/src/widgets/input-number.jsx +1 -1
- package/src/widgets/matcher.jsx +4 -1
- package/src/widgets/matrix.jsx +1 -1
- package/src/widgets/numeric-input.jsx +1 -1
- package/src/widgets/orderer.jsx +4 -1
- package/src/widgets/passage-ref-target.jsx +4 -1
- package/src/widgets/passage.jsx +1 -1
- package/src/widgets/radio/widget.jsx +1 -1
- package/src/widgets/sequence.jsx +4 -1
- package/src/widgets/sorter.jsx +4 -1
- package/src/widgets/table.jsx +4 -1
- package/src/README.md +0 -35
- package/src/__tests__/__snapshots__/pure-markdown_test.js.snap +0 -113
- package/src/__tests__/pure-markdown_test.js +0 -552
- package/src/gorgon/README +0 -40
- package/src/gorgon/__tests__/matcher_test.js +0 -497
- package/src/gorgon/__tests__/rule_test.js +0 -101
- package/src/gorgon/__tests__/rules_test.js +0 -487
- package/src/gorgon/__tests__/selector-parser_test.js +0 -52
- package/src/gorgon/__tests__/tree-transformer_test.js +0 -446
- package/src/gorgon/gorgon.js +0 -290
- package/src/gorgon/proptypes.js +0 -29
- package/src/gorgon/rule.js +0 -413
- package/src/gorgon/rules/absolute-url.js +0 -24
- package/src/gorgon/rules/all-rules.js +0 -72
- package/src/gorgon/rules/blockquoted-math.js +0 -10
- package/src/gorgon/rules/blockquoted-widget.js +0 -10
- package/src/gorgon/rules/double-spacing-after-terminal.js +0 -12
- package/src/gorgon/rules/extra-content-spacing.js +0 -12
- package/src/gorgon/rules/heading-level-1.js +0 -14
- package/src/gorgon/rules/heading-level-skip.js +0 -20
- package/src/gorgon/rules/heading-sentence-case.js +0 -11
- package/src/gorgon/rules/heading-title-case.js +0 -63
- package/src/gorgon/rules/image-alt-text.js +0 -21
- package/src/gorgon/rules/image-in-table.js +0 -10
- package/src/gorgon/rules/image-spaces-around-urls.js +0 -35
- package/src/gorgon/rules/image-widget.js +0 -50
- package/src/gorgon/rules/link-click-here.js +0 -11
- package/src/gorgon/rules/lint-utils.js +0 -48
- package/src/gorgon/rules/long-paragraph.js +0 -14
- package/src/gorgon/rules/math-adjacent.js +0 -10
- package/src/gorgon/rules/math-align-extra-break.js +0 -11
- package/src/gorgon/rules/math-align-linebreaks.js +0 -43
- package/src/gorgon/rules/math-empty.js +0 -10
- package/src/gorgon/rules/math-font-size.js +0 -12
- package/src/gorgon/rules/math-frac.js +0 -10
- package/src/gorgon/rules/math-nested.js +0 -11
- package/src/gorgon/rules/math-starts-with-space.js +0 -12
- package/src/gorgon/rules/math-text-empty.js +0 -10
- package/src/gorgon/rules/math-without-dollars.js +0 -14
- package/src/gorgon/rules/nested-lists.js +0 -11
- package/src/gorgon/rules/profanity.js +0 -10
- package/src/gorgon/rules/table-missing-cells.js +0 -20
- package/src/gorgon/rules/unbalanced-code-delimiters.js +0 -14
- package/src/gorgon/rules/unescaped-dollar.js +0 -10
- package/src/gorgon/rules/widget-in-table.js +0 -10
- package/src/gorgon/selector.js +0 -506
- package/src/gorgon/tree-transformer.js +0 -588
- package/src/pure-markdown.js +0 -347
|
@@ -30,15 +30,24 @@ exports[`Definition widget should have a default snapshot: first render 1`] = `
|
|
|
30
30
|
class="perseus-widget-container widget-nohighlight widget-inline"
|
|
31
31
|
>
|
|
32
32
|
<span
|
|
33
|
-
aria-
|
|
33
|
+
aria-controls="uid-popover-0-wb-id"
|
|
34
|
+
aria-expanded="false"
|
|
34
35
|
class="perseus-widget-definition"
|
|
35
|
-
|
|
36
|
+
id="uid-popover-0-wb-id-anchor"
|
|
36
37
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
38
|
+
<button
|
|
39
|
+
aria-disabled="false"
|
|
40
|
+
class="button_vr44p2-o_O-shared_lwskrm-o_O-default_1hl5pu8-o_O-small_xwkmkn"
|
|
41
|
+
role="button"
|
|
42
|
+
tabindex="0"
|
|
43
|
+
type="button"
|
|
39
44
|
>
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
<span
|
|
46
|
+
class="text_f1191h-o_O-LabelSmall_hl4zs1-o_O-text_m8a8ki-o_O-textWithFocus_e296pg"
|
|
47
|
+
>
|
|
48
|
+
the Pequots
|
|
49
|
+
</span>
|
|
50
|
+
</button>
|
|
42
51
|
</span>
|
|
43
52
|
</div>
|
|
44
53
|
, upon these conditions.
|
|
@@ -79,15 +88,24 @@ exports[`Definition widget should have an open state snapshot: open state 1`] =
|
|
|
79
88
|
class="perseus-widget-container widget-nohighlight widget-inline"
|
|
80
89
|
>
|
|
81
90
|
<span
|
|
82
|
-
aria-
|
|
91
|
+
aria-controls="uid-popover-1-wb-id"
|
|
92
|
+
aria-expanded="true"
|
|
83
93
|
class="perseus-widget-definition"
|
|
84
|
-
|
|
94
|
+
id="uid-popover-1-wb-id-anchor"
|
|
85
95
|
>
|
|
86
|
-
<
|
|
87
|
-
|
|
96
|
+
<button
|
|
97
|
+
aria-disabled="false"
|
|
98
|
+
class="button_vr44p2-o_O-shared_lwskrm-o_O-default_1hl5pu8-o_O-small_xwkmkn"
|
|
99
|
+
role="button"
|
|
100
|
+
tabindex="0"
|
|
101
|
+
type="button"
|
|
88
102
|
>
|
|
89
|
-
|
|
90
|
-
|
|
103
|
+
<span
|
|
104
|
+
class="text_f1191h-o_O-LabelSmall_hl4zs1-o_O-text_m8a8ki-o_O-textWithFocus_e296pg-o_O-focus_15mc0l2"
|
|
105
|
+
>
|
|
106
|
+
the Pequots
|
|
107
|
+
</span>
|
|
108
|
+
</button>
|
|
91
109
|
</span>
|
|
92
110
|
</div>
|
|
93
111
|
, upon these conditions.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {screen
|
|
2
|
+
import {screen} from "@testing-library/react";
|
|
3
3
|
import userEvent from "@testing-library/user-event";
|
|
4
4
|
|
|
5
5
|
import "@testing-library/jest-dom"; // Imports custom matchers
|
|
@@ -49,28 +49,30 @@ describe("Definition widget", () => {
|
|
|
49
49
|
expect(container).toMatchSnapshot("first render");
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
it("should have an open state snapshot", () => {
|
|
52
|
+
it("should have an open state snapshot", async () => {
|
|
53
53
|
// Arrange
|
|
54
54
|
const {container} = renderQuestion(question);
|
|
55
55
|
|
|
56
56
|
// Act
|
|
57
57
|
const definitionAnchor = screen.getByText("the Pequots");
|
|
58
|
-
userEvent.
|
|
58
|
+
userEvent.click(definitionAnchor);
|
|
59
59
|
|
|
60
60
|
// Assert
|
|
61
|
+
const tooltip = await screen.findByRole("dialog");
|
|
62
|
+
expect(tooltip).toBeVisible();
|
|
61
63
|
expect(container).toMatchSnapshot("open state");
|
|
62
64
|
});
|
|
63
65
|
|
|
64
|
-
it("should display the definition on
|
|
66
|
+
it("should display the definition on click", async () => {
|
|
65
67
|
// Arrange
|
|
66
68
|
renderQuestion(question);
|
|
67
69
|
|
|
68
70
|
// Act
|
|
69
71
|
const definitionAnchor = screen.getByText("the Pequots");
|
|
70
|
-
userEvent.
|
|
72
|
+
userEvent.click(definitionAnchor);
|
|
71
73
|
|
|
72
74
|
// Assert
|
|
73
|
-
const tooltip = await screen.findByRole("
|
|
75
|
+
const tooltip = await screen.findByRole("dialog");
|
|
74
76
|
expect(tooltip).toBeVisible();
|
|
75
77
|
expect(tooltip).toHaveTextContent("Definition text");
|
|
76
78
|
});
|
|
@@ -82,41 +84,28 @@ describe("Definition widget", () => {
|
|
|
82
84
|
// Act
|
|
83
85
|
const definitionAnchor = screen.getByText("the Pequots");
|
|
84
86
|
userEvent.click(definitionAnchor);
|
|
85
|
-
const tooltip = await screen.findByRole("
|
|
87
|
+
const tooltip = await screen.findByRole("dialog");
|
|
86
88
|
|
|
87
89
|
// Assert
|
|
88
90
|
expect(tooltip).toBeVisible();
|
|
89
91
|
expect(tooltip).toHaveTextContent("Definition text");
|
|
90
92
|
});
|
|
91
93
|
|
|
92
|
-
it("should show via focus
|
|
94
|
+
it("should show via focus on space key", async () => {
|
|
93
95
|
// Arrange
|
|
94
96
|
renderQuestion(question);
|
|
95
97
|
|
|
96
98
|
// Act - Tab in to set focus
|
|
97
|
-
|
|
99
|
+
const definitionAnchor = screen.getByText("the Pequots");
|
|
100
|
+
userEvent.type(definitionAnchor, "{space}");
|
|
98
101
|
|
|
99
102
|
// Assert
|
|
100
|
-
const tooltip = await screen.findByRole("
|
|
103
|
+
const tooltip = await screen.findByRole("dialog");
|
|
101
104
|
expect(tooltip).toBeVisible();
|
|
102
105
|
expect(tooltip).toHaveTextContent("Definition text");
|
|
103
106
|
});
|
|
104
107
|
|
|
105
|
-
it("should
|
|
106
|
-
// Arrange
|
|
107
|
-
renderQuestion(question);
|
|
108
|
-
|
|
109
|
-
// Act - Tab in to set focus, tab out to blur
|
|
110
|
-
userEvent.tab();
|
|
111
|
-
await screen.findByRole("tooltip");
|
|
112
|
-
userEvent.tab();
|
|
113
|
-
await waitForElementToBeRemoved(() => screen.queryByRole("tooltip"));
|
|
114
|
-
|
|
115
|
-
// Assert
|
|
116
|
-
expect(screen.queryByRole("tooltip")).toBeNull();
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it("should dimiss by a click when showing", async () => {
|
|
108
|
+
it("should dimiss by a click on the x when showing", async () => {
|
|
120
109
|
renderQuestion(question);
|
|
121
110
|
|
|
122
111
|
// Act
|
|
@@ -124,16 +113,12 @@ describe("Definition widget", () => {
|
|
|
124
113
|
const definitionAnchor = screen.getByText("the Pequots");
|
|
125
114
|
userEvent.click(definitionAnchor);
|
|
126
115
|
|
|
127
|
-
//
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
// Click to elsewhere, tooltip is hidden
|
|
132
|
-
userEvent.click((document.body: any));
|
|
133
|
-
await waitForElementToBeRemoved(() => screen.queryByRole("tooltip"));
|
|
116
|
+
// Click close, tooltip is hidden
|
|
117
|
+
const close = screen.getByTestId("popover-close-btn");
|
|
118
|
+
userEvent.click(close);
|
|
134
119
|
|
|
135
120
|
// Assert
|
|
136
|
-
expect(screen.queryByRole("
|
|
121
|
+
expect(screen.queryByRole("dialog")).toBeNull();
|
|
137
122
|
});
|
|
138
123
|
|
|
139
124
|
it("should not affect answerable", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import renderQuestionWithCypress from "../../../../../testing/render-question-with-cypress.jsx";
|
|
4
|
-
import {
|
|
4
|
+
import {cypressTestDependencies} from "../../../../../testing/test-dependencies.js";
|
|
5
5
|
import * as Perseus from "../../index.js";
|
|
6
6
|
import {
|
|
7
7
|
absoluteValueQuestion,
|
|
@@ -27,7 +27,7 @@ const LINES = "[data-interactive-kind-for-testing=movable-line] > svg > path";
|
|
|
27
27
|
describe("Grapher widget", () => {
|
|
28
28
|
beforeEach(() => {
|
|
29
29
|
Perseus.init({skipMathJax: true});
|
|
30
|
-
Perseus.Dependencies.setDependencies(
|
|
30
|
+
Perseus.Dependencies.setDependencies(cypressTestDependencies);
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
describe("absolute value graph", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import renderQuestion from "../../../../../testing/render-question-with-cypress.jsx";
|
|
4
|
-
import {
|
|
4
|
+
import {cypressTestDependencies} from "../../../../../testing/test-dependencies.js";
|
|
5
5
|
import * as Dependencies from "../../dependencies.js";
|
|
6
6
|
import * as Perseus from "../../index.js";
|
|
7
7
|
import {
|
|
@@ -29,7 +29,7 @@ const CIRCLES = "svg > circle";
|
|
|
29
29
|
|
|
30
30
|
describe("Interactive graph", () => {
|
|
31
31
|
beforeEach(() => {
|
|
32
|
-
Dependencies.setDependencies(
|
|
32
|
+
Dependencies.setDependencies(cypressTestDependencies);
|
|
33
33
|
Perseus.init({skipMathJax: true});
|
|
34
34
|
});
|
|
35
35
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
3
4
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
4
5
|
import {StyleSheet, css} from "aphrodite";
|
|
5
6
|
import classNames from "classnames";
|
|
@@ -7,7 +8,6 @@ import * as React from "react";
|
|
|
7
8
|
import _ from "underscore";
|
|
8
9
|
|
|
9
10
|
import InlineIcon from "../components/inline-icon.jsx";
|
|
10
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
11
11
|
import {iconCircle, iconCircleThin} from "../icon-paths.js";
|
|
12
12
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
13
13
|
import WidgetJsonifyDeprecated from "../mixins/widget-jsonify-deprecated.jsx";
|
|
@@ -1,60 +1,20 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
+
import Button from "@khanacademy/wonder-blocks-button";
|
|
3
4
|
import Color from "@khanacademy/wonder-blocks-color";
|
|
4
|
-
import {
|
|
5
|
+
import {Popover, PopoverContentCore} from "@khanacademy/wonder-blocks-popover";
|
|
5
6
|
import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
6
|
-
import Tooltip from "@khanacademy/wonder-blocks-tooltip";
|
|
7
|
-
import PropTypes from "prop-types";
|
|
8
7
|
import * as React from "react";
|
|
9
|
-
import _ from "underscore";
|
|
10
8
|
|
|
11
|
-
import {ApiOptions} from "../perseus-api.jsx";
|
|
12
9
|
import Renderer from "../renderer.jsx";
|
|
13
10
|
|
|
14
11
|
import type {
|
|
15
12
|
PerseusRenderer,
|
|
16
13
|
PerseusDefinitionWidgetOptions,
|
|
17
14
|
} from "../perseus-types.js";
|
|
18
|
-
import type {
|
|
19
|
-
APIOptionsWithDefaults,
|
|
20
|
-
PerseusScore,
|
|
21
|
-
WidgetExports,
|
|
22
|
-
WidgetProps,
|
|
23
|
-
} from "../types.js";
|
|
24
|
-
|
|
25
|
-
type DefinitionContentProps = {|
|
|
26
|
-
apiOptions: APIOptionsWithDefaults,
|
|
27
|
-
content: string,
|
|
28
|
-
trackInteraction: () => mixed,
|
|
29
|
-
widgets: PerseusRenderer["widgets"],
|
|
30
|
-
|};
|
|
31
|
-
|
|
32
|
-
class DefinitionContent extends React.Component<DefinitionContentProps> {
|
|
33
|
-
static propTypes = {
|
|
34
|
-
apiOptions: ApiOptions.propTypes,
|
|
35
|
-
content: PropTypes.string,
|
|
36
|
-
trackInteraction: PropTypes.func.isRequired,
|
|
37
|
-
widgets: PropTypes.objectOf(PropTypes.any),
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
componentDidMount() {
|
|
41
|
-
this.props.trackInteraction();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
render(): React.Node {
|
|
45
|
-
return (
|
|
46
|
-
<View style={styles.tooltipBody}>
|
|
47
|
-
<Renderer
|
|
48
|
-
apiOptions={this.props.apiOptions}
|
|
49
|
-
content={this.props.content}
|
|
50
|
-
widgets={this.props.widgets}
|
|
51
|
-
/>
|
|
52
|
-
</View>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
15
|
+
import type {PerseusScore, WidgetExports, WidgetProps} from "../types.js";
|
|
56
16
|
|
|
57
|
-
type RenderProps = PerseusDefinitionWidgetOptions;
|
|
17
|
+
type RenderProps = PerseusDefinitionWidgetOptions;
|
|
58
18
|
|
|
59
19
|
type Rubric = PerseusDefinitionWidgetOptions;
|
|
60
20
|
|
|
@@ -89,25 +49,38 @@ class Definition extends React.Component<DefinitionProps> {
|
|
|
89
49
|
};
|
|
90
50
|
|
|
91
51
|
render(): React.Node {
|
|
92
|
-
const content = (
|
|
93
|
-
<DefinitionContent
|
|
94
|
-
apiOptions={this.props.apiOptions}
|
|
95
|
-
content={this.props.definition}
|
|
96
|
-
key={this.props.definition}
|
|
97
|
-
trackInteraction={this.props.trackInteraction}
|
|
98
|
-
widgets={this.props.widgets}
|
|
99
|
-
/>
|
|
100
|
-
);
|
|
101
|
-
|
|
102
52
|
return (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
53
|
+
<Popover
|
|
54
|
+
content={
|
|
55
|
+
<PopoverContentCore
|
|
56
|
+
color="white"
|
|
57
|
+
style={styles.tooltipBody}
|
|
58
|
+
closeButtonVisible={true}
|
|
59
|
+
>
|
|
60
|
+
<Renderer
|
|
61
|
+
apiOptions={this.props.apiOptions}
|
|
62
|
+
content={this.props.definition}
|
|
63
|
+
widgets={this.props.widgets}
|
|
64
|
+
/>
|
|
65
|
+
</PopoverContentCore>
|
|
66
|
+
}
|
|
67
|
+
placement="top"
|
|
68
|
+
>
|
|
69
|
+
{({open}) => (
|
|
70
|
+
<span className="perseus-widget-definition">
|
|
71
|
+
<Button
|
|
72
|
+
size="small"
|
|
73
|
+
kind="tertiary"
|
|
74
|
+
onClick={() => {
|
|
75
|
+
this.props.trackInteraction();
|
|
76
|
+
open();
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{this.props.togglePrompt}
|
|
80
|
+
</Button>
|
|
81
|
+
</span>
|
|
82
|
+
)}
|
|
83
|
+
</Popover>
|
|
111
84
|
);
|
|
112
85
|
}
|
|
113
86
|
}
|
|
@@ -121,14 +94,6 @@ const styles = {
|
|
|
121
94
|
lineHeight: "30px",
|
|
122
95
|
margin: Spacing.xSmall_8,
|
|
123
96
|
},
|
|
124
|
-
|
|
125
|
-
definitionLink: {
|
|
126
|
-
borderBottom: `dashed 1px ${Color.blue}`,
|
|
127
|
-
color: Color.blue,
|
|
128
|
-
cursor: "pointer",
|
|
129
|
-
display: "inline-block",
|
|
130
|
-
textDecoration: "none",
|
|
131
|
-
},
|
|
132
97
|
};
|
|
133
98
|
|
|
134
99
|
export default ({
|
|
@@ -137,5 +102,5 @@ export default ({
|
|
|
137
102
|
accessible: true,
|
|
138
103
|
defaultAlignment: "inline",
|
|
139
104
|
widget: Definition,
|
|
140
|
-
transform:
|
|
105
|
+
transform: (x: any) => x,
|
|
141
106
|
}: WidgetExports<typeof Definition>);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
3
4
|
import {StyleSheet, css} from "aphrodite";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import _ from "underscore";
|
|
6
7
|
|
|
7
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
8
8
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
9
9
|
import Renderer from "../renderer.jsx";
|
|
10
10
|
import * as styleConstants from "../styles/constants.js";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// @flow
|
|
3
3
|
import * as KAS from "@khanacademy/kas";
|
|
4
4
|
import {KeypadInput, KeypadTypes} from "@khanacademy/math-input";
|
|
5
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
5
6
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
6
7
|
import classNames from "classnames";
|
|
7
8
|
import * as React from "react";
|
|
@@ -11,7 +12,6 @@ import InlineIcon from "../components/inline-icon.jsx";
|
|
|
11
12
|
import InputWithExamples from "../components/input-with-examples.jsx";
|
|
12
13
|
import MathInput from "../components/math-input.jsx";
|
|
13
14
|
import Tooltip from "../components/tooltip.jsx";
|
|
14
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
15
15
|
import {iconExclamationSign} from "../icon-paths.js";
|
|
16
16
|
import {Errors as PerseusErrors, Log} from "../logging/log.js";
|
|
17
17
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
2
3
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
3
4
|
import {StyleSheet, css} from "aphrodite";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
|
|
6
7
|
import {getDependencies} from "../dependencies.js";
|
|
7
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
8
8
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
9
9
|
import {
|
|
10
10
|
grayLight,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
2
3
|
import Button from "@khanacademy/wonder-blocks-button";
|
|
3
4
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
4
5
|
import {StyleSheet, css} from "aphrodite";
|
|
@@ -7,7 +8,6 @@ import * as React from "react";
|
|
|
7
8
|
import _ from "underscore";
|
|
8
9
|
|
|
9
10
|
import InlineIcon from "../components/inline-icon.jsx";
|
|
10
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
11
11
|
import {iconOk, iconRemove} from "../icon-paths.js";
|
|
12
12
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
13
13
|
import {ApiOptions} from "../perseus-api.jsx";
|
package/src/widgets/group.jsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
3
4
|
import classNames from "classnames";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import _ from "underscore";
|
|
6
7
|
|
|
7
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
8
8
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
9
9
|
import {ApiOptions} from "../perseus-api.jsx";
|
|
10
10
|
import Renderer from "../renderer.jsx";
|
package/src/widgets/image.jsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
/* eslint-disable react/sort-comp */
|
|
3
3
|
// @flow
|
|
4
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
4
5
|
import {StyleSheet, css} from "aphrodite";
|
|
5
6
|
import classNames from "classnames";
|
|
6
7
|
import * as React from "react";
|
|
7
8
|
import _ from "underscore";
|
|
8
9
|
|
|
9
10
|
import SvgImage from "../components/svg-image.jsx";
|
|
10
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
11
11
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
12
12
|
import Renderer from "../renderer.jsx";
|
|
13
13
|
import {baseUnitPx} from "../styles/constants.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
/* eslint-disable react/sort-comp */
|
|
3
3
|
// @flow
|
|
4
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
4
5
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
5
6
|
import classNames from "classnames";
|
|
6
7
|
import * as React from "react";
|
|
@@ -9,7 +10,6 @@ import _ from "underscore";
|
|
|
9
10
|
import InputWithExamples from "../components/input-with-examples.jsx";
|
|
10
11
|
import PossibleAnswers from "../components/possible-answers.jsx";
|
|
11
12
|
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
|
|
12
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
13
13
|
import {ClassNames as ApiClassNames, ApiOptions} from "../perseus-api.jsx";
|
|
14
14
|
import TexWrangler from "../tex-wrangler.js";
|
|
15
15
|
import KhanAnswerTypes from "../util/answer-types.js";
|
package/src/widgets/matcher.jsx
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* eslint-disable react/forbid-prop-types, react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {
|
|
4
|
+
linterContextProps,
|
|
5
|
+
linterContextDefault,
|
|
6
|
+
} from "@khanacademy/perseus-linter";
|
|
3
7
|
import {CircularSpinner} from "@khanacademy/wonder-blocks-progress-spinner";
|
|
4
8
|
import {StyleSheet, css} from "aphrodite";
|
|
5
9
|
import PropTypes from "prop-types";
|
|
@@ -8,7 +12,6 @@ import _ from "underscore";
|
|
|
8
12
|
|
|
9
13
|
import Sortable from "../components/sortable.jsx";
|
|
10
14
|
import {getDependencies} from "../dependencies.js";
|
|
11
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
12
15
|
import {ApiOptions} from "../perseus-api.jsx";
|
|
13
16
|
import Renderer from "../renderer.jsx";
|
|
14
17
|
import Util from "../util.js";
|
package/src/widgets/matrix.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
/* eslint-disable react/sort-comp */
|
|
3
3
|
// @flow
|
|
4
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
4
5
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
5
6
|
import classNames from "classnames";
|
|
6
7
|
import * as React from "react";
|
|
@@ -11,7 +12,6 @@ import MathOutput from "../components/math-output.jsx";
|
|
|
11
12
|
import NumberInput from "../components/number-input.jsx";
|
|
12
13
|
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
|
|
13
14
|
import TextInput from "../components/text-input.jsx";
|
|
14
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
15
15
|
import InteractiveUtil from "../interactive2/interactive-util.js";
|
|
16
16
|
import {ApiOptions} from "../perseus-api.jsx";
|
|
17
17
|
import Renderer from "../renderer.jsx";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
// @flow
|
|
3
3
|
|
|
4
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
4
5
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
5
6
|
import classNames from "classnames";
|
|
6
7
|
import * as React from "react";
|
|
@@ -9,7 +10,6 @@ import _ from "underscore";
|
|
|
9
10
|
import InputWithExamples from "../components/input-with-examples.jsx";
|
|
10
11
|
import PossibleAnswers from "../components/possible-answers.jsx";
|
|
11
12
|
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
|
|
12
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
13
13
|
import {ApiOptions, ClassNames as ApiClassNames} from "../perseus-api.jsx";
|
|
14
14
|
import TexWrangler from "../tex-wrangler.js";
|
|
15
15
|
import KhanAnswerTypes from "../util/answer-types.js";
|
package/src/widgets/orderer.jsx
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* eslint-disable @babel/no-invalid-this, no-unused-vars, one-var, react/no-unsafe, react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {
|
|
4
|
+
linterContextProps,
|
|
5
|
+
linterContextDefault,
|
|
6
|
+
} from "@khanacademy/perseus-linter";
|
|
3
7
|
import $ from "jquery";
|
|
4
8
|
import PropTypes, {bool} from "prop-types";
|
|
5
9
|
import * as React from "react";
|
|
@@ -7,7 +11,6 @@ import ReactDOM from "react-dom";
|
|
|
7
11
|
import _ from "underscore";
|
|
8
12
|
|
|
9
13
|
import {getDependencies} from "../dependencies.js";
|
|
10
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
11
14
|
import {Errors, Log} from "../logging/log.js";
|
|
12
15
|
import {ClassNames as ApiClassNames} from "../perseus-api.jsx";
|
|
13
16
|
import Renderer from "../renderer.jsx";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import {
|
|
3
|
+
linterContextProps,
|
|
4
|
+
linterContextDefault,
|
|
5
|
+
} from "@khanacademy/perseus-linter";
|
|
2
6
|
import PropTypes from "prop-types";
|
|
3
7
|
import * as React from "react";
|
|
4
8
|
import _ from "underscore";
|
|
5
9
|
|
|
6
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
7
10
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
8
11
|
import WidgetJsonifyDeprecated from "../mixins/widget-jsonify-deprecated.jsx";
|
|
9
12
|
import Renderer from "../renderer.jsx";
|
package/src/widgets/passage.jsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
3
4
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
4
5
|
import {StyleSheet, css} from "aphrodite";
|
|
5
6
|
import $ from "jquery";
|
|
@@ -9,7 +10,6 @@ import _ from "underscore";
|
|
|
9
10
|
|
|
10
11
|
import HighlightableContent from "../components/highlighting/highlightable-content.jsx";
|
|
11
12
|
import {getDependencies} from "../dependencies.js";
|
|
12
|
-
import {linterContextDefault} from "../gorgon/proptypes.js";
|
|
13
13
|
import Renderer from "../renderer.jsx";
|
|
14
14
|
|
|
15
15
|
import {getLineHeightForNode} from "./passage/get-line-height-for-node.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {linterContextDefault} from "@khanacademy/perseus-linter";
|
|
3
4
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import _ from "underscore";
|
|
6
7
|
|
|
7
|
-
import {linterContextDefault} from "../../gorgon/proptypes.js";
|
|
8
8
|
import Renderer from "../../renderer.jsx";
|
|
9
9
|
import Util from "../../util.js";
|
|
10
10
|
import PassageRef from "../passage-ref.jsx";
|
package/src/widgets/sequence.jsx
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import {
|
|
3
|
+
linterContextProps,
|
|
4
|
+
linterContextDefault,
|
|
5
|
+
} from "@khanacademy/perseus-linter";
|
|
2
6
|
import PropTypes from "prop-types";
|
|
3
7
|
import * as React from "react";
|
|
4
8
|
import _ from "underscore";
|
|
5
9
|
|
|
6
10
|
import InlineIcon from "../components/inline-icon.jsx";
|
|
7
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
8
11
|
import {iconOk} from "../icon-paths.js";
|
|
9
12
|
import * as Changeable from "../mixins/changeable.jsx";
|
|
10
13
|
import {ApiOptions} from "../perseus-api.jsx";
|
package/src/widgets/sorter.jsx
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import {
|
|
3
|
+
linterContextProps,
|
|
4
|
+
linterContextDefault,
|
|
5
|
+
} from "@khanacademy/perseus-linter";
|
|
2
6
|
import PropTypes from "prop-types";
|
|
3
7
|
import * as React from "react";
|
|
4
8
|
import _ from "underscore";
|
|
5
9
|
|
|
6
10
|
import Sortable from "../components/sortable.jsx";
|
|
7
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
8
11
|
import {ApiOptions} from "../perseus-api.jsx";
|
|
9
12
|
import Util from "../util.js";
|
|
10
13
|
|
package/src/widgets/table.jsx
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
3
|
import {keypadElementPropType} from "@khanacademy/math-input";
|
|
4
|
+
import {
|
|
5
|
+
linterContextProps,
|
|
6
|
+
linterContextDefault,
|
|
7
|
+
} from "@khanacademy/perseus-linter";
|
|
4
8
|
import PropTypes from "prop-types";
|
|
5
9
|
import * as React from "react";
|
|
6
10
|
import ReactDOM from "react-dom";
|
|
@@ -8,7 +12,6 @@ import _ from "underscore";
|
|
|
8
12
|
|
|
9
13
|
import MathOutput from "../components/math-output.jsx";
|
|
10
14
|
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
|
|
11
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
12
15
|
import InteractiveUtil from "../interactive2/interactive-util.js";
|
|
13
16
|
import {ApiOptions} from "../perseus-api.jsx";
|
|
14
17
|
import Renderer from "../renderer.jsx";
|