@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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "access": "public"
4
4
  },
5
5
  "name": "@khanacademy/perseus-editor",
6
- "version": "0.1.0",
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.1.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 @babel/no-invalid-this, react/no-unsafe, react/sort-comp */
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";
@@ -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: AphroditeStyle | Array<AphroditeStyle>,
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<AphroditeStyle>),
73
+ style: ([]: Array<CSSProperties>),
74
74
  element: "a",
75
75
  };
76
76
 
@@ -1,4 +1,5 @@
1
1
  // @flow
2
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
3
  import jsdiff from "jsdiff";
3
4
  import _ from "underscore";
4
5
 
@@ -2,6 +2,7 @@
2
2
  // @flow
3
3
  import {components} from "@khanacademy/perseus";
4
4
  import classNames from "classnames";
5
+ // eslint-disable-next-line import/no-extraneous-dependencies
5
6
  import jsdiff from "jsdiff";
6
7
  import PropTypes from "prop-types";
7
8
  import * as React from "react";
@@ -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
  };
@@ -1,4 +1,6 @@
1
- /* eslint-disable react/no-unsafe, react/sort-comp */
1
+ /* eslint-disable react/prop-types */
2
+ /* eslint-disable react/no-unsafe */
3
+ /* eslint-disable react/sort-comp */
2
4
  // @flow
3
5
  import {
4
6
  components,
@@ -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";