@khanacademy/perseus 0.2.7 → 0.2.8
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 +9 -0
- package/README.md +5 -0
- package/dist/es/index.js +3094 -5325
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +13597 -15834
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/__tests__/perseus-markdown_test.jsx +4 -4
- package/src/article-renderer.jsx +3 -4
- package/src/components/input-with-examples.jsx +3 -4
- package/src/components/sortable.jsx +4 -5
- package/src/hint-renderer.jsx +2 -3
- package/src/hints-renderer.jsx +2 -3
- package/src/item-renderer.jsx +2 -3
- package/src/not-gorgon.js +1 -2
- package/src/perseus-markdown.jsx +1 -2
- package/src/renderer.jsx +2 -3
- package/src/widget-container.jsx +1 -1
- package/src/widgets/categorizer.jsx +1 -1
- 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
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.8",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -22,8 +22,10 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@khanacademy/kmath": "^0.0.5",
|
|
25
|
-
"@khanacademy/math-input": "^0.5.2",
|
|
26
25
|
"@khanacademy/kas": "^0.2.4",
|
|
26
|
+
"@khanacademy/math-input": "^0.5.2",
|
|
27
|
+
"@khanacademy/perseus-linter": "^0.1.0",
|
|
28
|
+
"@khanacademy/pure-markdown": "^0.1.0",
|
|
27
29
|
"@khanacademy/simple-markdown": "^0.8.3",
|
|
28
30
|
"mathquill": "git+https://git@github.com/Khan/mathquill.git#a9ae54e057c5c1acc8244a5627acbff29901d992"
|
|
29
31
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import Gorgon from "
|
|
3
|
-
|
|
2
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
3
|
+
|
|
4
4
|
import PerseusMarkdown from "../perseus-markdown.jsx";
|
|
5
5
|
|
|
6
6
|
const {parse, basicOutput, characterCount} = PerseusMarkdown;
|
|
@@ -565,7 +565,7 @@ describe("perseus markdown", () => {
|
|
|
565
565
|
"data 4 | $data 5 | data 6\n" +
|
|
566
566
|
"data 7 | data 8 | data 9";
|
|
567
567
|
const context = {
|
|
568
|
-
...linterContextDefault,
|
|
568
|
+
...Gorgon.linterContextDefault,
|
|
569
569
|
content,
|
|
570
570
|
widgets: {},
|
|
571
571
|
};
|
|
@@ -650,7 +650,7 @@ describe("perseus markdown", () => {
|
|
|
650
650
|
"data 4 | $data 5 | data 6\n" +
|
|
651
651
|
"data 7 | data 8 | data 9";
|
|
652
652
|
const context = {
|
|
653
|
-
...linterContextDefault,
|
|
653
|
+
...Gorgon.linterContextDefault,
|
|
654
654
|
content,
|
|
655
655
|
widgets: {},
|
|
656
656
|
};
|
package/src/article-renderer.jsx
CHANGED
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
* composed of multiple (Renderer) sections concatenated together.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
8
9
|
import classNames from "classnames";
|
|
9
10
|
import PropTypes from "prop-types";
|
|
10
11
|
import * as React from "react";
|
|
11
12
|
|
|
12
|
-
import Gorgon from "./gorgon/gorgon.js";
|
|
13
|
-
import {linterContextProps, linterContextDefault} from "./gorgon/proptypes.js";
|
|
14
13
|
import ProvideKeypad from "./mixins/provide-keypad.jsx";
|
|
15
14
|
import {ClassNames as ApiClassNames, ApiOptions} from "./perseus-api.jsx";
|
|
16
15
|
import Renderer from "./renderer.jsx";
|
|
@@ -38,14 +37,14 @@ class ArticleRenderer extends React.Component<$FlowFixMe, $FlowFixMe> {
|
|
|
38
37
|
|
|
39
38
|
// Whether to use the new Bibliotron styles for articles
|
|
40
39
|
useNewStyles: PropTypes.bool,
|
|
41
|
-
linterContext: linterContextProps,
|
|
40
|
+
linterContext: Gorgon.linterContextProps,
|
|
42
41
|
legacyPerseusLint: PropTypes.arrayOf(PropTypes.string),
|
|
43
42
|
};
|
|
44
43
|
|
|
45
44
|
static defaultProps: $FlowFixMe = {
|
|
46
45
|
apiOptions: {},
|
|
47
46
|
useNewStyles: false,
|
|
48
|
-
linterContext: linterContextDefault,
|
|
47
|
+
linterContext: Gorgon.linterContextDefault,
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
constructor(props: $FlowFixMe) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
3
4
|
import PropTypes from "prop-types";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import _ from "underscore";
|
|
6
7
|
|
|
7
|
-
import Gorgon from "../gorgon/gorgon.js";
|
|
8
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
9
8
|
import {ClassNames as ApiClassNames} from "../perseus-api.jsx";
|
|
10
9
|
import Renderer from "../renderer.jsx";
|
|
11
10
|
import Util from "../util.js";
|
|
@@ -38,7 +37,7 @@ class InputWithExamples extends React.Component<$FlowFixMe, $FlowFixMe> {
|
|
|
38
37
|
|
|
39
38
|
// A unique string identifying this InputWithExamples
|
|
40
39
|
id: PropTypes.string.isRequired,
|
|
41
|
-
linterContext: linterContextProps,
|
|
40
|
+
linterContext: Gorgon.linterContextProps,
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
static defaultProps: $FlowFixMe = {
|
|
@@ -47,7 +46,7 @@ class InputWithExamples extends React.Component<$FlowFixMe, $FlowFixMe> {
|
|
|
47
46
|
onFocus: function () {},
|
|
48
47
|
onBlur: function () {},
|
|
49
48
|
disabled: false,
|
|
50
|
-
linterContext: linterContextDefault,
|
|
49
|
+
linterContext: Gorgon.linterContextDefault,
|
|
51
50
|
};
|
|
52
51
|
|
|
53
52
|
state: $FlowFixMe = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @babel/no-invalid-this, react/forbid-prop-types, react/no-unsafe, react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
3
4
|
import {CircularSpinner} from "@khanacademy/wonder-blocks-progress-spinner";
|
|
4
5
|
import {StyleSheet, css} from "aphrodite";
|
|
5
6
|
import $ from "jquery";
|
|
@@ -9,8 +10,6 @@ import ReactDOM from "react-dom";
|
|
|
9
10
|
import _ from "underscore";
|
|
10
11
|
|
|
11
12
|
import {getDependencies} from "../dependencies.js";
|
|
12
|
-
import Gorgon from "../gorgon/gorgon.js";
|
|
13
|
-
import {linterContextProps, linterContextDefault} from "../gorgon/proptypes.js";
|
|
14
13
|
import {ClassNames as ApiClassNames} from "../perseus-api.jsx";
|
|
15
14
|
import Renderer from "../renderer.jsx";
|
|
16
15
|
import Util from "../util.js";
|
|
@@ -96,13 +95,13 @@ class Draggable extends React.Component<DraggableProps, DraggableState> {
|
|
|
96
95
|
onMouseUp: PropTypes.func.isRequired,
|
|
97
96
|
onRender: PropTypes.func.isRequired,
|
|
98
97
|
type: PropTypes.oneOf([STATIC, DRAGGING, ANIMATING, DISABLED]),
|
|
99
|
-
linterContext: linterContextProps,
|
|
98
|
+
linterContext: Gorgon.linterContextProps,
|
|
100
99
|
};
|
|
101
100
|
|
|
102
101
|
static defaultProps = {
|
|
103
102
|
includePadding: true,
|
|
104
103
|
type: STATIC,
|
|
105
|
-
linterContext: linterContextDefault,
|
|
104
|
+
linterContext: Gorgon.linterContextDefault,
|
|
106
105
|
};
|
|
107
106
|
|
|
108
107
|
state: DraggableState = {
|
|
@@ -423,7 +422,7 @@ class Sortable extends React.Component<SortableProps, SortableState> {
|
|
|
423
422
|
onMeasure: function () {},
|
|
424
423
|
margin: 5,
|
|
425
424
|
onChange: function () {},
|
|
426
|
-
linterContext: linterContextDefault,
|
|
425
|
+
linterContext: Gorgon.linterContextDefault,
|
|
427
426
|
waitForKatexLoad: true,
|
|
428
427
|
};
|
|
429
428
|
|
package/src/hint-renderer.jsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
2
3
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
3
4
|
import {StyleSheet, css} from "aphrodite";
|
|
4
5
|
import classnames from "classnames";
|
|
5
6
|
import * as React from "react";
|
|
6
7
|
|
|
7
|
-
import Gorgon from "./gorgon/gorgon.js";
|
|
8
|
-
import {linterContextDefault} from "./gorgon/proptypes.js";
|
|
9
8
|
import Renderer from "./renderer.jsx";
|
|
10
9
|
import {
|
|
11
10
|
baseUnitPx,
|
|
@@ -36,7 +35,7 @@ type DefaultProps = {|
|
|
|
36
35
|
/* Renders just a hint preview */
|
|
37
36
|
class HintRenderer extends React.Component<Props> {
|
|
38
37
|
static defaultProps: DefaultProps = {
|
|
39
|
-
linterContext: linterContextDefault,
|
|
38
|
+
linterContext: Gorgon.linterContextDefault,
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
getSerializedState: () => void = () => {
|
package/src/hints-renderer.jsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
2
3
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
3
4
|
import {StyleSheet, css} from "aphrodite";
|
|
4
5
|
import classnames from "classnames";
|
|
@@ -6,8 +7,6 @@ import * as React from "react";
|
|
|
6
7
|
import ReactDOM from "react-dom";
|
|
7
8
|
import _ from "underscore";
|
|
8
9
|
|
|
9
|
-
import Gorgon from "./gorgon/gorgon.js";
|
|
10
|
-
import {linterContextDefault} from "./gorgon/proptypes.js";
|
|
11
10
|
import HintRenderer from "./hint-renderer.jsx";
|
|
12
11
|
import {ApiOptions} from "./perseus-api.jsx";
|
|
13
12
|
import typeof Renderer from "./renderer.jsx";
|
|
@@ -43,7 +42,7 @@ type State = {|
|
|
|
43
42
|
// eslint-disable-next-line react/no-unsafe
|
|
44
43
|
class HintsRenderer extends React.Component<Props, State> {
|
|
45
44
|
static defaultProps: DefaultProps = {
|
|
46
|
-
linterContext: linterContextDefault,
|
|
45
|
+
linterContext: Gorgon.linterContextDefault,
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
// The isFinalHelpPage property determines if the user has requested help
|
package/src/item-renderer.jsx
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* eslint-disable react/no-unsafe */
|
|
2
2
|
// @flow
|
|
3
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
3
4
|
import $ from "jquery";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import * as ReactDOM from "react-dom";
|
|
6
7
|
import _ from "underscore";
|
|
7
8
|
|
|
8
|
-
import Gorgon from "./gorgon/gorgon.js";
|
|
9
|
-
import {linterContextDefault} from "./gorgon/proptypes.js";
|
|
10
9
|
import HintsRenderer from "./hints-renderer.jsx";
|
|
11
10
|
import Objective from "./interactive2/objective_.js";
|
|
12
11
|
import ProvideKeypad from "./mixins/provide-keypad.jsx";
|
|
@@ -88,7 +87,7 @@ class ItemRenderer extends React.Component<Props, State> {
|
|
|
88
87
|
initialHintsVisible: 0,
|
|
89
88
|
workAreaSelector: "#workarea",
|
|
90
89
|
reviewMode: false,
|
|
91
|
-
linterContext: linterContextDefault,
|
|
90
|
+
linterContext: Gorgon.linterContextDefault,
|
|
92
91
|
};
|
|
93
92
|
|
|
94
93
|
constructor(props: Props) {
|
package/src/not-gorgon.js
CHANGED
package/src/perseus-markdown.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-useless-escape, no-prototype-builtins */
|
|
2
2
|
// @flow
|
|
3
|
-
|
|
3
|
+
import {pureMarkdownRules} from "@khanacademy/pure-markdown";
|
|
4
4
|
import SimpleMarkdown from "@khanacademy/simple-markdown";
|
|
5
5
|
import * as i18n from "@khanacademy/wonder-blocks-i18n";
|
|
6
6
|
import * as React from "react";
|
|
@@ -8,7 +8,6 @@ import _ from "underscore";
|
|
|
8
8
|
|
|
9
9
|
import Lint from "./components/lint.jsx";
|
|
10
10
|
import {getDependencies} from "./dependencies.js";
|
|
11
|
-
import {pureMarkdownRules} from "./pure-markdown.js";
|
|
12
11
|
|
|
13
12
|
const rules = {
|
|
14
13
|
...pureMarkdownRules,
|
package/src/renderer.jsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/no-unsafe */
|
|
2
2
|
// @flow
|
|
3
|
+
import * as Gorgon from "@khanacademy/perseus-linter";
|
|
3
4
|
import classNames from "classnames";
|
|
4
5
|
import $ from "jquery";
|
|
5
6
|
import * as React from "react";
|
|
@@ -13,8 +14,6 @@ import ZoomableTeX from "./components/zoomable-tex.jsx";
|
|
|
13
14
|
import Zoomable from "./components/zoomable.jsx";
|
|
14
15
|
import {getDependencies} from "./dependencies.js";
|
|
15
16
|
import ErrorBoundary from "./error-boundary.jsx";
|
|
16
|
-
import Gorgon from "./gorgon/gorgon.js"; // The linter engine
|
|
17
|
-
import {linterContextDefault} from "./gorgon/proptypes.js";
|
|
18
17
|
import InteractionTracker from "./interaction-tracker.js";
|
|
19
18
|
import Objective from "./interactive2/objective_.js";
|
|
20
19
|
import JiptParagraphs from "./jipt-paragraphs.js";
|
|
@@ -234,7 +233,7 @@ class Renderer extends React.Component<Props, State> {
|
|
|
234
233
|
reviewMode: false,
|
|
235
234
|
serializedState: null,
|
|
236
235
|
onSerializedStateUpdated: () => {},
|
|
237
|
-
linterContext: linterContextDefault,
|
|
236
|
+
linterContext: Gorgon.linterContextDefault,
|
|
238
237
|
};
|
|
239
238
|
|
|
240
239
|
constructor(props: Props, context: Context) {
|
package/src/widget-container.jsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/no-unsafe, 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 ReactDOM from "react-dom";
|
|
6
7
|
|
|
7
|
-
import {linterContextDefault} from "./gorgon/proptypes.js";
|
|
8
8
|
import {zIndexInteractiveComponent} from "./styles/constants.js";
|
|
9
9
|
import {containerSizeClass, getClassFromWidth} from "./util/sizing-utils.js";
|
|
10
10
|
import * as Widgets from "./widgets.js";
|
|
@@ -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,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";
|
package/src/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Perseus
|
|
2
|
-
|
|
3
|
-
<p align="center"><img src="logo.png" alt="perseus logo" width="150px"/></p>
|
|
4
|
-
|
|
5
|
-
<p align="center">Perseus Exercise Renderer</p>
|
|
6
|
-
|
|
7
|
-
Perseus is Khan Academy's exercise system. This repo contains the code needed to take a problem in the perseus format and present it, allow interaction, and grade the result of a learner's work.
|
|
8
|
-
|
|
9
|
-
<p align="center"><img src="sample.png" alt="sample of perseus in use" height="150px"/></p>
|
|
10
|
-
|
|
11
|
-
This repo is a constellation of sub-repos for showing exercise content. Please see individual projects in in the `packages/` folder for more information about each sub-project.
|
|
12
|
-
|
|
13
|
-
## Getting started
|
|
14
|
-
|
|
15
|
-
### Prerequisites
|
|
16
|
-
|
|
17
|
-
- [Node.JS v12](https://nodejs.org/download/release/v10.18.1/)
|
|
18
|
-
- [Yarn](https://yarnpkg.com/lang/en/docs/install/)
|
|
19
|
-
|
|
20
|
-
### Installation
|
|
21
|
-
|
|
22
|
-
To install perseus, you need to run the following commands:
|
|
23
|
-
|
|
24
|
-
#### `yarn install`
|
|
25
|
-
|
|
26
|
-
Installs project dependencies
|
|
27
|
-
|
|
28
|
-
## Contributing
|
|
29
|
-
|
|
30
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for a walkthrough of how some
|
|
31
|
-
of the Perseus code works and how to extend it.
|
|
32
|
-
|
|
33
|
-
## License
|
|
34
|
-
|
|
35
|
-
[MIT License](http://opensource.org/licenses/MIT)
|