diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b429316 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*] +indent_size = 2 diff --git a/.gitignore b/.gitignore index a45ab12..5483f76 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist-es/ dist-modern/ stats.json report.html +package-lock.json diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cda0efc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: +- 10 +sudo: false +script: yarn test +before_script: +- yarn prettier:check +branches: + only: + - master diff --git a/README.md b/README.md index 5c0c963..4e16bdf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@

Emoji Mart is a Slack-like customizable
emoji picker component for React
DemoChangelog +
Build Status

picker

Missive | Team email, team chat, team tasks, one app
Brought to you by the Missive team @@ -405,6 +406,13 @@ Apple / Google / Twitter / EmojiOne / Messenger / Facebook ## Not opinionated **Emoji Mart** doesn’t automatically insert anything into a text input, nor does it show or hide itself. It simply returns an `emoji` object. It’s up to the developer to mount/unmount (it’s fast!) and position the picker. You can use the returned object as props for the `EmojiMart.Emoji` component. You could also use `emoji.colons` to insert text into a textarea or `emoji.native` to use the emoji. +## Usage outside React + +**Emoji Mart** can be used with React alternatives such as [Preact](https://preactjs.com/), [Inferno](https://www.infernojs.org/), and [react-lite](https://github.com/Lucifier129/react-lite). + +Furthermore, you can use it as a [custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) using [remount](https://github.com/rstacruz/remount), meaning that you can use it within any JavaScript framework (or vanilla JS). + +For an end-to-end example of how to do this, see [emoji-mart-outside-react](https://github.com/nolanlawson/emoji-mart-outside-react). ## Optimizing for production diff --git a/package.json b/package.json index 54c6c57..da04a31 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "inflection": "1.10.0", "jest": "^23.0.0", "mkdirp": "0.5.1", - "prettier": "1.11.1", + "prettier": "^1.16.4", "react": "^16.0.0", "react-dom": "^16.0.0", "react-test-renderer": "^16.8.4", @@ -76,6 +76,7 @@ "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook", "prettier": "prettier --write \"{src,scripts}/**/*.js\"", + "prettier:check": "prettier --check \"{src,scripts}/**/*.js\"", "prepare": "npm run build:dist" }, "size-limit": [ diff --git a/src/components/category.js b/src/components/category.js index 31beaa3..26e08b8 100644 --- a/src/components/category.js +++ b/src/components/category.js @@ -210,16 +210,15 @@ export default class Category extends React.Component { ))} - {emojis && - !emojis.length && ( - - )} + {emojis && !emojis.length && ( + + )} ) } diff --git a/src/components/search.js b/src/components/search.js index b8cbfc8..6aec93f 100644 --- a/src/components/search.js +++ b/src/components/search.js @@ -94,9 +94,9 @@ export default class Search extends React.PureComponent { autoFocus={autoFocus} /> {/* - * Use a