Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zfletch committed Nov 15, 2019
1 parent cb23b8f commit 0f2a183
Show file tree
Hide file tree
Showing 10 changed files with 2,319 additions and 2,183 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"homepage": "https://perseids-project.github.io/greek-latin-demixer/",
"dependencies": {
"bootstrap": "^4.3.1",
"eslint-config-airbnb": "^17.1.1",
"eslint-plugin-jest": "^22.7.2",
"gh-pages": "^2.0.1",
"perseids-react-components": "^0.1.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-jest": "^23.0.4",
"gh-pages": "^2.1.1",
"perseids-react-components": "^0.2.0",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-clipboard.js": "^2.0.13",
"react-dom": "^16.8.6",
"react-scripts": "^3.0.1",
"react-tippy": "^1.2.3"
"react": "^16.12.0",
"react-clipboard.js": "^2.0.16",
"react-dom": "^16.12.0",
"react-scripts": "^3.2.0",
"react-tippy": "^1.3.1"
},
"scripts": {
"deploy": "yarn deploy-github && yarn deploy-perseids",
Expand Down
4 changes: 2 additions & 2 deletions src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class App extends Component {
const { text } = this.state;

return (
<React.Fragment>
<>
<PerseidsHeader>
Greek Latin Demixer
<ul className="navbar-nav ml-auto">
Expand All @@ -47,7 +47,7 @@ class App extends Component {
github="https://github.com/perseids-project/greek-latin-demixer"
report="https://github.com/perseids-project/greek-latin-demixer/issues"
/>
</React.Fragment>
</>
);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/components/ContentLine/ContentLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import ContentWord from '../ContentWord';
import Delimit from '../../lib/delimit';

class ContentLine extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
selectActiveWord: PropTypes.func.isRequired,
focusCustomInput: PropTypes.func.isRequired,
}

constructor(props) {
super(props);

Expand Down Expand Up @@ -50,4 +44,10 @@ class ContentLine extends Component {
}
}

ContentLine.propTypes = {
children: PropTypes.node.isRequired,
selectActiveWord: PropTypes.func.isRequired,
focusCustomInput: PropTypes.func.isRequired,
};

export default ContentLine;
15 changes: 8 additions & 7 deletions src/components/ContentWord/ContentWord.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ const convertChar = (char, key) => {
return char;
};

const convertWord = word => word.split('').map((a, i) => convertChar(a, i));
const convertWord = (word) => word.split('').map((a, i) => convertChar(a, i));

class ContentWord extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
selectActiveWord: PropTypes.func.isRequired,
focusCustomInput: PropTypes.func.isRequired,
}

constructor(props) {
super(props);

Expand Down Expand Up @@ -104,4 +98,11 @@ class ContentWord extends Component {
}
}

ContentWord.propTypes = {
children: PropTypes.node.isRequired,
selectActiveWord: PropTypes.func.isRequired,
focusCustomInput: PropTypes.func.isRequired,
};


export default ContentWord;
9 changes: 5 additions & 4 deletions src/components/EditXml/EditXml.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import Word from '../../lib/Word';
import styles from './EditXml.module.css';

class EditXml extends Component {
static propTypes = {
text: PropTypes.string.isRequired,
}

constructor(props) {
super(props);

Expand Down Expand Up @@ -82,4 +78,9 @@ class EditXml extends Component {
}
}

EditXml.propTypes = {
text: PropTypes.string.isRequired,
};


export default EditXml;
8 changes: 4 additions & 4 deletions src/components/InputXml/InputXml.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import PropTypes from 'prop-types';
import styles from './InputXml.module.css';

class InputXml extends Component {
static propTypes = {
onSubmit: PropTypes.func.isRequired,
}

constructor(props) {
super(props);

Expand Down Expand Up @@ -62,4 +58,8 @@ class InputXml extends Component {
}
}

InputXml.propTypes = {
onSubmit: PropTypes.func.isRequired,
};

export default InputXml;
28 changes: 17 additions & 11 deletions src/components/WordPanel/WordPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@ import { RefType } from '../../lib/types';

import styles from './WordPanel.module.css';

const handleClipboardSuccess = event => event.clearSelection();
const handleClipboardSuccess = (event) => event.clearSelection();

class WordPanel extends Component {
static propTypes = {
word: PropTypes.instanceOf(Word).isRequired,
customInputFocusRef: RefType.isRequired,
static getDerivedStateFromProps(props, state) {
const { word: { text } } = props;
const { previousText } = state;

if (text !== previousText) {
return { customText: text, previousText: text };
}

return null;
}

constructor(props) {
super(props);

this.state = {
customText: '',
customText: null,
previousText: null,
};

this.handleCustomChange = this.handleCustomChange.bind(this);
Expand All @@ -37,12 +44,6 @@ class WordPanel extends Component {
this.renderCustomTooltip = this.renderCustomTooltip.bind(this);
}

componentWillReceiveProps(props) {
const { word: { text } } = props;

this.setState({ customText: text });
}

handleCustomChange(event) {
this.setState({ customText: event.target.value });
}
Expand Down Expand Up @@ -222,4 +223,9 @@ class WordPanel extends Component {
}
}

WordPanel.propTypes = {
word: PropTypes.instanceOf(Word).isRequired,
customInputFocusRef: RefType.isRequired,
};

export default WordPanel;
2 changes: 1 addition & 1 deletion src/lib/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const latinRegExp = new RegExp(`[${charRange.latin}]`);
const mixtureRegExp = new RegExp(`([${charRange.greek}][${charRange.latin}])|([${charRange.latin}][${charRange.greek}])`);

const ltgFactory = (dict, regExp) => (
string => string.split('').map(a => (regExp.test(a) ? a : (dict[a] || '?'))).join('')
(string) => string.split('').map((a) => (regExp.test(a) ? a : (dict[a] || '?'))).join('')
);

const Convert = {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/delimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// eslint-disable-next-line no-useless-escape
const splitRegExp = /([\s\/\\\(\)"'\:\,\.;<>~\!@#\$%\^&\*\|\+\=\[\]\{\}`\?\-…]+)/;

const split = line => (
line.split(splitRegExp).map(string => (
const split = (line) => (
line.split(splitRegExp).map((string) => (
splitRegExp.test(string) ? { type: 'delimiter', string } : { type: 'word', string }
)).filter(({ string }) => string !== '')
);
Expand Down
Loading

0 comments on commit 0f2a183

Please sign in to comment.