@khanacademy/perseus 0.2.6 → 0.3.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 +31 -0
- package/README.md +5 -0
- package/dist/es/index.css +1 -436
- package/dist/es/index.js +13785 -16058
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1 -436
- package/dist/index.js +3200 -5480
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- package/src/__tests__/jipt-paragraphs_test.js +34 -0
- 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/item-renderer.jsx +4 -5
- package/src/jipt-paragraphs.js +16 -8
- 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/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
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)
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`pure markdown parser should parse titled table with unescaped dollars 1`] = `
|
|
4
|
-
Array [
|
|
5
|
-
Object {
|
|
6
|
-
"table": Object {
|
|
7
|
-
"align": Array [
|
|
8
|
-
null,
|
|
9
|
-
null,
|
|
10
|
-
null,
|
|
11
|
-
],
|
|
12
|
-
"cells": Array [
|
|
13
|
-
Array [
|
|
14
|
-
Array [
|
|
15
|
-
Object {
|
|
16
|
-
"content": "data 1",
|
|
17
|
-
"type": "text",
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
Array [
|
|
21
|
-
Object {
|
|
22
|
-
"content": "data 2",
|
|
23
|
-
"type": "text",
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
Array [
|
|
27
|
-
Object {
|
|
28
|
-
"content": "data 3",
|
|
29
|
-
"type": "text",
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
],
|
|
33
|
-
Array [
|
|
34
|
-
Array [
|
|
35
|
-
Object {
|
|
36
|
-
"content": "data 4",
|
|
37
|
-
"type": "text",
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
Array [
|
|
41
|
-
Object {
|
|
42
|
-
"type": "unescapedDollar",
|
|
43
|
-
},
|
|
44
|
-
Object {
|
|
45
|
-
"content": "data 5",
|
|
46
|
-
"type": "text",
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
Array [
|
|
50
|
-
Object {
|
|
51
|
-
"content": "data 6",
|
|
52
|
-
"type": "text",
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
],
|
|
56
|
-
Array [
|
|
57
|
-
Array [
|
|
58
|
-
Object {
|
|
59
|
-
"content": "data 7",
|
|
60
|
-
"type": "text",
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
Array [
|
|
64
|
-
Object {
|
|
65
|
-
"content": "data 8",
|
|
66
|
-
"type": "text",
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
Array [
|
|
70
|
-
Object {
|
|
71
|
-
"content": "data 9",
|
|
72
|
-
"type": "text",
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
],
|
|
76
|
-
],
|
|
77
|
-
"header": Array [
|
|
78
|
-
Array [
|
|
79
|
-
Object {
|
|
80
|
-
"content": "header 1",
|
|
81
|
-
"type": "text",
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
Array [
|
|
85
|
-
Object {
|
|
86
|
-
"content": "header 2",
|
|
87
|
-
"type": "text",
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
Array [
|
|
91
|
-
Object {
|
|
92
|
-
"content": "header 3",
|
|
93
|
-
"type": "text",
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
],
|
|
97
|
-
"type": "table",
|
|
98
|
-
},
|
|
99
|
-
"title": Array [
|
|
100
|
-
Object {
|
|
101
|
-
"content": Array [
|
|
102
|
-
Object {
|
|
103
|
-
"content": "Table title",
|
|
104
|
-
"type": "text",
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
"type": "strong",
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
"type": "titledTable",
|
|
111
|
-
},
|
|
112
|
-
]
|
|
113
|
-
`;
|