From c25b928ae99e44edead8bd1f0217b64d6d1dbc29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Heimb=C3=BCrger?= Date: Thu, 15 Aug 2019 10:48:19 +0100 Subject: [PATCH 1/4] Deprecate superfluous convenience parameters --- src/MathFieldComponent.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MathFieldComponent.tsx b/src/MathFieldComponent.tsx index 96d0b96..1b0cb0e 100644 --- a/src/MathFieldComponent.tsx +++ b/src/MathFieldComponent.tsx @@ -6,7 +6,13 @@ import { makeMathField } from 'mathlive'; export interface Props { latex: string; onChange?: (latex: string) => void; + /** + * @deprecated Use native configuration instead. + */ onBlur?: () => void; + /** + * @deprecated Use native configuration instead. + */ onKeystroke?: (ev: KeyboardEvent) => void; /** From fd7bb6e24c06c34e69923857f94d3b80853461c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Heimb=C3=BCrger?= Date: Thu, 8 Aug 2019 23:34:16 +0100 Subject: [PATCH 2/4] Update readme --- CONTRIBUTING.md | 23 +++++++++++++++++++++++ README.md | 33 +++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4830e5b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing + +## Before contributing + +This library is a thin wrapper (the "react wrapper") around Mathlive (the "base library"). It's likely that errors encountered when using the wrapper originate in the base library. Likewise, feature-requests and feature-PRs should probably go directly into the base library as well. + +## What to contribute + +Contributions to the react-wrapper can be issues, feature-requests or pull-requests (code), that should + +* improve the interaction of react and mathlive, +* make sure best practices in react are used +* simplify using of the wrapper +* improve the general code style +* add test-cases +* adjust for new react / mathlive versions or +* fix existing bugs in the implementation. + +This wrapper does not aim to add too much functionality or additional wrapping around the base library. This minimizes the necessary maintenance to keep the wrapper compatible with future versions. + +## How to contribute + +Feel free to create an issue if you have any problem that you think originates in this wrapper. If you want to contribute code, fork the repository on github and create a pull request for master. diff --git a/README.md b/README.md index e317d34..72024e6 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ # react-mathlive - -[![Build Status](https://semaphoreci.com/api/v1/concludio/react-mathlive/branches/master/badge.svg)](https://semaphoreci.com/concludio/react-mathlive) - +[![Build Status](https://semaphoreci.com/api/v1/concludio/react-mathlive/branches/master/shields_badge.svg)](https://semaphoreci.com/concludio/react-mathlive) [![Coverage Status](https://coveralls.io/repos/github/concludio/react-mathlive/badge.svg?branch=master)](https://coveralls.io/github/concludio/react-mathlive?branch=master) -A react-component for using [mathlive.js](https://mathlive.io)'s mathfield (interactive math editor). +A react-component using [mathlive.js](https://mathlive.io)'s mathfield (interactive math editor). ## How to install @@ -28,7 +26,7 @@ render() { return + />; } onMathChange(mathText) { @@ -38,7 +36,7 @@ onMathChange(mathText) { There is an [example](/examples/example1/) using Typescript available. -## Interacting with the native library +### Interacting with the native library The `MathfieldComponent` also allows retrieving the native [`Mathfield`-object](http://docs.mathlive.io/MathField.html) from the Mathlive-library via the `mathFieldRef`-parameter: @@ -46,8 +44,27 @@ The `MathfieldComponent` also allows retrieving the native [`Mathfield`-object]( render() { return (this.internalMathField = mf)} - /> + />; } ``` -Via the `mathFieldOptions`-parameter it's possible to provide the native `Mathfield` with [`MathFieldOptions`](http://docs.mathlive.io/tutorial-CONFIG.html). +Via the optional `mathFieldConfig`-parameter it's possible to provide the native `Mathfield` with a [`MathFieldConfig`](http://docs.mathlive.io/tutorial-CONFIG.html) on its creation: + + +```JavaScript +render() { + return ; +} +``` + +## Contribute + +This is an open source library and issues and pull requests are very welcome. + +See [Contributing](CONTRIBUTING.md). + From 8d38f3765ec75e2f5a83cf8cb9e750498c660a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Heimb=C3=BCrger?= Date: Sat, 10 Aug 2019 07:51:53 +0100 Subject: [PATCH 3/4] Fix spelling --- CONTRIBUTING.md | 8 ++++---- README.md | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4830e5b..49c9fcc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,17 +2,17 @@ ## Before contributing -This library is a thin wrapper (the "react wrapper") around Mathlive (the "base library"). It's likely that errors encountered when using the wrapper originate in the base library. Likewise, feature-requests and feature-PRs should probably go directly into the base library as well. +This library is a thin wrapper (the "react wrapper") around Mathlive (the "base library"). It's likely that errors encountered when using the wrapper originate in the base library. Likewise, feature requests and feature PRs should probably go directly into the base library as well. ## What to contribute -Contributions to the react-wrapper can be issues, feature-requests or pull-requests (code), that should +Contributions to the react wrapper can be issues, feature requests or pull requests (code), that should * improve the interaction of react and mathlive, * make sure best practices in react are used -* simplify using of the wrapper +* simplify using the wrapper * improve the general code style -* add test-cases +* add test cases * adjust for new react / mathlive versions or * fix existing bugs in the implementation. diff --git a/README.md b/README.md index 72024e6..66d63b5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status](https://semaphoreci.com/api/v1/concludio/react-mathlive/branches/master/shields_badge.svg)](https://semaphoreci.com/concludio/react-mathlive) [![Coverage Status](https://coveralls.io/repos/github/concludio/react-mathlive/badge.svg?branch=master)](https://coveralls.io/github/concludio/react-mathlive?branch=master) -A react-component using [mathlive.js](https://mathlive.io)'s mathfield (interactive math editor). +A react component using [mathlive.js](https://mathlive.io)'s mathfield (interactive math editor). ## How to install @@ -13,13 +13,13 @@ You can install *react-mathlive* like any other Javascript or Typescript library npm i react-mathlive ``` -For Typescript users: As *react-mathlive* is written in Typescript, it comes with it's own typings. +For Typescript users: As *react-mathlive* is written in Typescript, it comes with its own typings. ## How to use -This text assumes you know [how to build simple react-components](https://reactjs.org/tutorial/tutorial.html). +This text assumes you know [how to build simple react components](https://reactjs.org/tutorial/tutorial.html). -You can use the `MathfieldComponent` in your web-application as follows: +You can use the `MathFieldComponent` in your web application as follows: ```JSX render() { @@ -34,11 +34,11 @@ onMathChange(mathText) { } ``` -There is an [example](/examples/example1/) using Typescript available. +There is also an [example Typescript react application](/examples/example1/) using this library. ### Interacting with the native library -The `MathfieldComponent` also allows retrieving the native [`Mathfield`-object](http://docs.mathlive.io/MathField.html) from the Mathlive-library via the `mathFieldRef`-parameter: +The `MathFieldComponent` also allows retrieving the native [`MathField` object](http://docs.mathlive.io/MathField.html) from the Mathlive library via the `mathFieldRef` parameter: ```JavaScript render() { @@ -48,10 +48,10 @@ render() { } ``` -Via the optional `mathFieldConfig`-parameter it's possible to provide the native `Mathfield` with a [`MathFieldConfig`](http://docs.mathlive.io/tutorial-CONFIG.html) on its creation: +Via the optional `mathFieldConfig` parameter it is possible to provide the native `MathField` with a [`MathFieldConfig`](http://docs.mathlive.io/tutorial-CONFIG.html) on its creation: -```JavaScript +```JSX render() { return Date: Tue, 3 Sep 2019 07:55:14 +0000 Subject: [PATCH 4/4] Bump eslint-utils from 1.4.0 to 1.4.2 in /examples/example1 Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.2) Signed-off-by: dependabot[bot] --- examples/example1/package-lock.json | 76 +++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/examples/example1/package-lock.json b/examples/example1/package-lock.json index 6cbd823..dbd4985 100644 --- a/examples/example1/package-lock.json +++ b/examples/example1/package-lock.json @@ -4841,9 +4841,9 @@ } }, "eslint-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.0.tgz", - "integrity": "sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz", + "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==", "requires": { "eslint-visitor-keys": "^1.0.0" } @@ -10121,6 +10121,76 @@ "mathlive": ">= 0.32.1 < 1", "react": "^16.7.0", "react-dom": "^16.7.0" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "mathlive": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/mathlive/-/mathlive-0.32.1.tgz", + "integrity": "sha512-iKVTL89SCgKsqd1oaIr/is1HVlEE2myGSVTv7g9pTcxGt8QaSb2z17HmLqfPYBvNNCUGzDvoJyXz8adXoJEadQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "react": { + "version": "16.9.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.9.0.tgz", + "integrity": "sha512-+7LQnFBwkiw+BobzOF6N//BdoNw0ouwmSJTEm9cglOOmsg/TMiFHZLe2sEoN5M7LgJTj9oHH0gxklfnQe66S1w==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2" + } + }, + "react-dom": { + "version": "16.9.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.9.0.tgz", + "integrity": "sha512-YFT2rxO9hM70ewk9jq0y6sQk8cL02xm4+IzYBz75CQGlClQQ1Bxq0nhHF6OtSbit+AIahujJgb/CPRibFkMNJQ==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.15.0" + } + }, + "react-is": { + "version": "16.9.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", + "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==" + }, + "scheduler": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.15.0.tgz", + "integrity": "sha512-xAefmSfN6jqAa7Kuq7LIJY0bwAPG3xlCj0HMEBQk1lxYiDKZscY2xJ5U/61ZTrYbmNQbXa+gc7czPkVo11tnCg==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + } } }, "react-scripts": {