@khanacademy/perseus-editor 0.1.0 → 0.1.3
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 +22 -0
- package/dist/es/index.css +1020 -0
- package/dist/es/index.js +2 -3
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1020 -0
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/json-editor.jsx +4 -1
- package/src/components/link.jsx +4 -4
- package/src/diffs/string-array-diff.jsx +1 -0
- package/src/diffs/text-diff.jsx +1 -0
- package/src/multirenderer-editor.jsx +1 -0
- package/src/widgets/definition-editor.jsx +0 -1
- package/src/widgets/example-graphie-widget.jsx +1 -1
- package/src/widgets/expression-editor.jsx +2 -1
- package/src/widgets/interaction-editor.jsx +1 -0
- package/src/widgets/interactive-graph-editor.jsx +3 -1
- package/src/widgets/label-image-editor.jsx +1 -0
- package/src/widgets/number-line-editor.jsx +1 -1
- package/src/widgets/plotter-editor.jsx +1 -1
- package/src/widgets/radio/editor.jsx +0 -1
- package/src/widgets/reaction-diagram-editor.jsx +1 -0
- package/src/widgets/transformer-editor.jsx +7 -7
- package/src/widgets/unit-editor.jsx +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"access": "public"
|
|
4
4
|
},
|
|
5
5
|
"name": "@khanacademy/perseus-editor",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.3",
|
|
7
7
|
"description": "Perseus editors",
|
|
8
8
|
"module": "dist/es/index.js",
|
|
9
9
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@khanacademy/perseus": "^0.
|
|
15
|
+
"@khanacademy/perseus": "^0.2.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@khanacademy/wonder-blocks-i18n": "^1.2.3",
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* eslint-disable
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
/* eslint-disable @babel/no-invalid-this */
|
|
3
|
+
/* eslint-disable react/no-unsafe */
|
|
4
|
+
/* eslint-disable react/sort-comp */
|
|
2
5
|
// @flow
|
|
3
6
|
import createReactClass from "create-react-class";
|
|
4
7
|
import * as React from "react";
|
package/src/components/link.jsx
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
import {StyleSheet, css} from "aphrodite";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
|
|
11
|
+
import type {CSSProperties} from "aphrodite";
|
|
12
|
+
|
|
11
13
|
// TODO(diedra): This is terrible! If we don't have a href for a link, it should
|
|
12
14
|
// be a button instead. We just need to make sure we override the default browser
|
|
13
15
|
// button styling (backgroundColor, border, and padding).
|
|
14
16
|
const DEFAULT_HREF = "javascript:void(0)";
|
|
15
17
|
|
|
16
|
-
type AphroditeStyle = any;
|
|
17
|
-
|
|
18
18
|
type DefaultProps = {|
|
|
19
19
|
element: string | React.AbstractComponent<any>,
|
|
20
20
|
// Whether the link should appear in a 'highlighted' state. In
|
|
@@ -22,7 +22,7 @@ type DefaultProps = {|
|
|
|
22
22
|
highlighted: boolean,
|
|
23
23
|
href: string,
|
|
24
24
|
// Pass through styles but also add our own to normalize
|
|
25
|
-
style:
|
|
25
|
+
style: CSSProperties | Array<CSSProperties>,
|
|
26
26
|
|};
|
|
27
27
|
|
|
28
28
|
type LinkProps = {|
|
|
@@ -70,7 +70,7 @@ class Link extends React.Component<LinkProps> {
|
|
|
70
70
|
static defaultProps: DefaultProps = {
|
|
71
71
|
highlighted: false,
|
|
72
72
|
href: DEFAULT_HREF,
|
|
73
|
-
style: ([]: Array<
|
|
73
|
+
style: ([]: Array<CSSProperties>),
|
|
74
74
|
element: "a",
|
|
75
75
|
};
|
|
76
76
|
|
package/src/diffs/text-diff.jsx
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
MultiItems,
|
|
15
15
|
} from "@khanacademy/perseus";
|
|
16
16
|
import {StyleSheet, css} from "aphrodite";
|
|
17
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
17
18
|
import lens from "hubble";
|
|
18
19
|
import * as React from "react";
|
|
19
20
|
import ReactDOM from "react-dom";
|
|
@@ -37,7 +37,6 @@ class DefinitionEditor extends React.Component<Props> {
|
|
|
37
37
|
return (
|
|
38
38
|
<div className="perseus-widget-definition-editor">
|
|
39
39
|
<a
|
|
40
|
-
// eslint-disable-next-line static-service/require-safe-link-to
|
|
41
40
|
href="https://docs.google.com/document/d/1udaPef4imOfTMhmLDlWq4SM0mxL0r3YHFZE-5J1uGfo"
|
|
42
41
|
target="_blank"
|
|
43
42
|
>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* TODO(jack): Add more comments
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import {number as knumber, point as kpoint} from "@khanacademy/kmath";
|
|
9
10
|
import {
|
|
10
11
|
components,
|
|
11
12
|
ApiOptions,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
Util,
|
|
14
15
|
WidgetJsonifyDeprecated,
|
|
15
16
|
} from "@khanacademy/perseus";
|
|
16
|
-
import {number as knumber, point as kpoint} from "kmath";
|
|
17
17
|
import PropTypes from "prop-types";
|
|
18
18
|
import * as React from "react";
|
|
19
19
|
import _ from "underscore";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/* eslint-disable one-var, react/forbid-prop-types, react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import * as KAS from "@khanacademy/kas";
|
|
3
4
|
import {
|
|
4
5
|
components,
|
|
5
6
|
Changeable,
|
|
6
7
|
Dependencies,
|
|
7
8
|
Expression,
|
|
8
9
|
} from "@khanacademy/perseus";
|
|
10
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
9
11
|
import lens from "hubble";
|
|
10
|
-
import KAS from "kas";
|
|
11
12
|
import PropTypes from "prop-types";
|
|
12
13
|
import * as React from "react";
|
|
13
14
|
import _ from "underscore";
|
|
@@ -761,6 +761,7 @@ class InteractionEditor extends React.Component<
|
|
|
761
761
|
// TODO(eater): Make more better
|
|
762
762
|
static propTypes = {
|
|
763
763
|
...Changeable.propTypes,
|
|
764
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
764
765
|
elements: PropTypes.arrayOf(PropTypes.object),
|
|
765
766
|
graph: PropTypes.objectOf(PropTypes.any),
|
|
766
767
|
};
|
|
@@ -78,6 +78,7 @@ class LabelImageEditor extends React.Component<LabelImageEditorProps> {
|
|
|
78
78
|
// Find the newly added marker indices.
|
|
79
79
|
const newIndices = this.props.markers
|
|
80
80
|
.map((marker, index) =>
|
|
81
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
81
82
|
coordsToMarkers.hasOwnProperty(`${marker.x}.${marker.y}`)
|
|
82
83
|
? -1
|
|
83
84
|
: index,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import {number as knumber} from "@khanacademy/kmath";
|
|
2
3
|
import {components, EditorJsonify} from "@khanacademy/perseus";
|
|
3
|
-
import {number as knumber} from "kmath";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import _ from "underscore";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable @babel/no-invalid-this, one-var, react/no-unsafe, react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {number as knumber} from "@khanacademy/kmath";
|
|
3
4
|
import {
|
|
4
5
|
components,
|
|
5
6
|
Dependencies,
|
|
6
7
|
PlotterWidget,
|
|
7
8
|
Util,
|
|
8
9
|
} from "@khanacademy/perseus";
|
|
9
|
-
import {number as knumber} from "kmath";
|
|
10
10
|
import PropTypes from "prop-types";
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import ReactDOM from "react-dom";
|
|
@@ -143,7 +143,6 @@ class RadioEditor extends React.Component<$FlowFixMe> {
|
|
|
143
143
|
<a
|
|
144
144
|
href={
|
|
145
145
|
// This is an editor component, not user-facing.
|
|
146
|
-
// eslint-disable-next-line static-service/require-safe-link-to
|
|
147
146
|
"https://docs.google.com/document/d/1frZf7yrWVWb1n4tVjqlzqVUiv1pn4cZXbxgP62-JDBY/edit#heading=h.8ng1isya19nu"
|
|
148
147
|
}
|
|
149
148
|
target="_blank"
|
|
@@ -11,6 +11,7 @@ class ReactionDiagramWidgetEditor extends React.Component<Props> {
|
|
|
11
11
|
static propTypes = {
|
|
12
12
|
...Changeable.propTypes,
|
|
13
13
|
rotationAngle: PropTypes.arrayOf(PropTypes.number),
|
|
14
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
14
15
|
separators: PropTypes.arrayOf(PropTypes.object),
|
|
15
16
|
smiles: PropTypes.arrayOf(PropTypes.string),
|
|
16
17
|
};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/* eslint-disable camelcase, react/sort-comp */
|
|
2
2
|
// @flow
|
|
3
|
+
import {
|
|
4
|
+
line as kline,
|
|
5
|
+
number as knumber,
|
|
6
|
+
point as kpoint,
|
|
7
|
+
ray as kray,
|
|
8
|
+
vector as kvector,
|
|
9
|
+
} from "@khanacademy/kmath";
|
|
3
10
|
import {
|
|
4
11
|
components,
|
|
5
12
|
ApiOptions,
|
|
@@ -9,13 +16,6 @@ import {
|
|
|
9
16
|
TransformerWidget,
|
|
10
17
|
Util,
|
|
11
18
|
} from "@khanacademy/perseus";
|
|
12
|
-
import {
|
|
13
|
-
line as kline,
|
|
14
|
-
number as knumber,
|
|
15
|
-
point as kpoint,
|
|
16
|
-
ray as kray,
|
|
17
|
-
vector as kvector,
|
|
18
|
-
} from "kmath";
|
|
19
19
|
import * as React from "react";
|
|
20
20
|
import _ from "underscore";
|
|
21
21
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/no-unsafe */
|
|
2
2
|
// @flow
|
|
3
|
+
import * as KAS from "@khanacademy/kas";
|
|
3
4
|
import {
|
|
4
5
|
components,
|
|
5
6
|
displaySigFigs,
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
Changeable,
|
|
8
9
|
EditorJsonify,
|
|
9
10
|
} from "@khanacademy/perseus";
|
|
10
|
-
import KAS from "kas";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import _ from "underscore";
|