├── .gitignore ├── .npmignore ├── .travis.yml ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── LICENSE ├── README.md ├── example ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── Entypo.ttf │ │ │ │ ├── EvilIcons.ttf │ │ │ │ ├── Feather.ttf │ │ │ │ ├── FontAwesome.ttf │ │ │ │ ├── Foundation.ttf │ │ │ │ ├── Ionicons.ttf │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ ├── Octicons.ttf │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ └── Zocial.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── example-tvOS │ │ └── Info.plist │ ├── example-tvOSTests │ │ └── Info.plist │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── example-tvOS.xcscheme │ │ │ └── example.xcscheme │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m ├── metro.config.js ├── package-lock.json ├── package.json ├── src │ ├── Emoji.js │ ├── EmojiInput.js │ ├── EmojiSearch.js │ └── emoji-data │ │ ├── compiled.js │ │ ├── duplicates.json │ │ ├── emoji-data.json │ │ ├── emojiSynonyms.json │ │ ├── index.js │ │ └── userInputtedSynonyms.json └── yarn.lock ├── index.js ├── package-lock.json ├── package.json ├── scripts └── compile.js ├── src ├── Emoji.js ├── EmojiInput.js ├── EmojiSearch.js └── emoji-data │ ├── compiled.js │ ├── duplicates.json │ ├── emoji-data.json │ ├── emojiSynonyms.json │ ├── index.js │ └── userInputtedSynonyms.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | .DS_Store 61 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | example/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | #Contibuting to react-native-emoji-input 2 | 3 | ## Welcome contributors to the project: 4 | 5 | ## How to submit changes: Pull Request protocol etc. 6 | 7 | _What people might expect in a response from the core devs_ 8 | 9 | ## How to report a bug: 10 | 11 | * Template: 12 | _ *Platform (iOS or Android)* 13 | _ _Description_ \* _Reproduction Steps_ 14 | 15 | ## New Feature Requirements 16 | 17 | * Template 18 | \_ _Description_ 19 | \_ _Explanation of implementation_ 20 | 21 | ## Style Guide / Coding conventions 22 | 23 | * 4 Spaces 24 | * Braces on the Right 25 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | Sujay Khandekar (sskhandek), 2 | Rijn Bian (rijn) 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sujay Khandekar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Emoji Input 2 | 3 | [![npm version](https://badge.fury.io/js/react-native-emoji-input.svg)](https://badge.fury.io/js/react-native-emoji-input) 4 | 5 | A performant, customizable keyboard input for React Native. Built for and used in [Opico](http://onelink.to/opico). 6 | 7 | ![Emoji Input Example](https://media.giphy.com/media/7OWdR4BGCEtKJai6nu/giphy.gif) 8 | 9 | ## Installation 10 | 11 | `npm install --save react-native-emoji-input` 12 | 13 | or 14 | 15 | `yarn add react-native-emoji-input` 16 | 17 | If you make changes to the emoji synonyms files, you need to recompile the data sources. To compile the emoji dataset, run: 18 | 19 | ``` 20 | npx babel-node scripts/compile.js 21 | ``` 22 | 23 | ## Default Props 24 | 25 | | Prop | Description | type | 26 | | ----------------- | -------------------------------- | -------- | 27 | | `onEmojiSelected` | A handler for the selected emoji | function | 28 | 29 | ## Optional Props 30 | 31 | | Prop | Description | type | default value | 32 | | ---------------------------------- | ----------------------------------------------------------------------------------- | ------------- | -------------- | 33 | | `keyboardBackgroundColor` | Set the background color of the main keyboard pane | string | '#E3E1EC' | 34 | | `categoryUnhighlightedColor` | Set the default color of the category icons | string | 'lightgray' | 35 | | `categoryHighlightColor` | Set the color of a higlighted category icon | string | 'black' | 36 | | `width` | Width of the keyboard, number in px | number | window width | 37 | | `numColumns` | Number of emoji columns to display | number | 6 | 38 | | `categoryLabelHeight` | The height of category title | number | 40 | 39 | | `categoryLabelTextStyle` | The text size of the category title | object | {fontSize: 25} | 40 | | `emojiFontSize` | The default size of the emojis | number | 40 | 41 | | `categoryFontSize` | The default size of the category icons | number | 40 | 42 | | `numFrequentlyUsedEmoji` | Max number of frequently used emojis in the section | number | 18 | 43 | | `showCategoryTab` | Whether the categories should be shown or not | boolean | true | 44 | | `enableSearch` | Whether the search bar should be shown or not | boolean | true | 45 | | `showCategoryTitleInSearchResults` | Whether the search title should be shown or not in search results | boolean | false | 46 | | `enableFrequentlyUsedEmoji` | Whether the frequently used category should be shown or not | boolean | true | 47 | | `defaultFrequentlyUsedEmoji` | An array of keys for emojis that will always render in the frequently used category | Array(string) | [] | 48 | | `resetSearch` | Pass this in if you want to clear the the search | boolean | false | 49 | | `loggingFunction` | Logging function to be called when applicable.\* | function | none | 50 | | `verboseLoggingFunction` | Same as loggingFunction but also provides strategy used to determine failed search | boolean | false | 51 | | `filterFunctions` | Array of functions that are used to limit which emojis should be rendered. Each of this function will be invoked with single parameter being `emoji` data and if every function returns `true` for `emoji` then this emoji will be included and displayed.| Array(function) | [] | 52 | | `renderAheadOffset` | Specify how many pixels in advance you want views to be rendered. Increasing this value can help reduce blanks (if any). However, making this low can improve performance if you're having issues with it (see [#36](https://github.com/sskhandek/react-native-emoji-input/issues/36)). Higher values also increase re-render compute | number | 1500 | 53 | > \* When the search function yields this function is called. Additionally when the user clears the query box this function is called with the previous longest query since the last time the query box was empty. By default the function is called with one parameter, a string representing the query. If the verbose logging function parameter is set to true the function is called with a second parameter that is a string specifying why the function was called (either 'emptySearchResult' or 'longestPreviousQuery'). 54 | 55 | ## Usage 56 | 57 | ``` 58 | {console.log(emoji)}} 60 | /> 61 | ``` 62 | 63 | ## Compile emoji-data from source 64 | 65 | The project is using [iamcal/emoji-data](https://github.com/iamcal/emoji-data). We only use the `emoji.json` that contains all the Unicode characters, short names, keywords, and categories. To embrace the latest version of Emoji, we suggest to compile the json file from source. 66 | 67 | ```shell 68 | # You need first check out the `emoji-data` repo. We will use the compile tool provided in the repo. 69 | git clone https://github.com/iamcal/emoji-data.git 70 | cd emoji-data/build 71 | 72 | # Pull data from Unicode standard 73 | sh download_spec_files.sh 74 | 75 | # Add new shortnames. Here're some examples in current dir, check out data_emoji_names.txt, data_emoji_names_v4.txt 76 | vim data_emoji_names_vxx.txt # xx should be version of emoji, e.g. 11 77 | 78 | # Compile from spec files into json 79 | php build_map.php 80 | ``` 81 | 82 | Then copy the `emoji-data/emoji.json` to `src/emoji-data/emoji-data.json` and make sure the entry point is point to this json file. 83 | ```javascript 84 | // src/emoji-data/index.js 85 | import emoji from './emoji-data.json'; 86 | ``` 87 | 88 | Finally compile the data file that used in the keyboard. 89 | ```shell 90 | node-babel ./scripts/compile.js 91 | ``` 92 | 93 | ## Missing Emojis on some devices 94 | 95 | So why Emojis are displayed as `X` / other characters insetad of actual Emojis for some of your users? 96 | That is because this library renders Emojis based on Font and Font need to support Emoji character in order to render it. And those fonts are updated with every system release, but because there is a lot of Android device manufacturers who are actually using Android as a base to come up with their own UI layer then it is harder for them to keep up with system updates. 97 | You can read more about it here [Emojipedia article link](https://blog.emojipedia.org/androids-emoji-problem/) 98 | 99 | So what can you do? 100 | Apps such as `Slack` / `WhatsApp` are actually providing Emojis as little images so that they can be render regardless of operating system on mobile phone. The problem in `React-Native` is that there is no support for placing images in `Input` element at time of writing this. 101 | Other solution is to limit number of possible emojis to most basic ones which are supported on most devices. Choosing emojis from `Unicode 6.0` seems like solid solution: [Unicode 6.0 Emojis List](https://emojipedia.org/unicode-6.0/) - you get tons of Emojis that are most likely to be correctly rendered across most of the devices. 102 | 103 | In `React-Native-Emoji-Input` you can limit emojis displayed by using `filterFunctions` prop and passing array of functions. Each of this function takes `emoji` as an single parameter and if every function passed in `filterFunctions` prop returns `true` then emoji will be included in final list. 104 | We can use that to show only emojis which are part of `Unicode 6.0` or `Unicode 6.1` like so: 105 | ``` 106 | filterFunctionByUnicode = emoji => { 107 | return emoji.lib.added_in === "6.0" || emoji.lib.added_in === "6.1" 108 | } 109 | 110 | this._emojiInput = emojiInput} 113 | resetSearch={this.state.reset} 114 | loggingFunction={this.verboseLoggingFunction.bind(this)} 115 | verboseLoggingFunction={true} 116 | filterFunctions={[this.filterFunctionByUnicode]} 117 | /> 118 | ``` 119 | This will render only emojis from Unicode 6.0 and Unicode 6.1 in input. -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | 28 | [options] 29 | emoji=true 30 | 31 | esproposal.optional_chaining=enable 32 | esproposal.nullish_coalescing=enable 33 | 34 | module.system=haste 35 | module.system.haste.use_name_reducers=true 36 | # get basename 37 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' 38 | # strip .js or .js.flow suffix 39 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' 40 | # strip .ios suffix 41 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' 42 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' 43 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' 44 | module.system.haste.paths.blacklist=.*/__tests__/.* 45 | module.system.haste.paths.blacklist=.*/__mocks__/.* 46 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* 47 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* 48 | 49 | munge_underscores=true 50 | 51 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 52 | 53 | module.file_ext=.js 54 | module.file_ext=.jsx 55 | module.file_ext=.json 56 | module.file_ext=.native.js 57 | 58 | suppress_type=$FlowIssue 59 | suppress_type=$FlowFixMe 60 | suppress_type=$FlowFixMeProps 61 | suppress_type=$FlowFixMeState 62 | 63 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 64 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 65 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 66 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 67 | 68 | [version] 69 | ^0.92.0 70 | -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { Platform, StyleSheet, Text, View } from 'react-native'; 9 | import EmojiInput from './src/EmojiInput'; 10 | 11 | type Props = {}; 12 | export default class App extends Component { 13 | constructor() { 14 | super(); 15 | 16 | this.state = { 17 | currentEmoji: 'X', 18 | reset: false, 19 | } 20 | } 21 | 22 | handleEmojiSelected = (emoji) => { 23 | this.setState({ currentEmoji: emoji.char }); 24 | } 25 | render() { 26 | return ( 27 | 28 | 34 | {this.state.currentEmoji} 35 | 36 | { this._emojiInput.clearFrequentlyUsedEmoji(); }}> 37 | Remove Frequently Used Emoji 38 | 39 | { 40 | if (this.state.reset) { 41 | this.setState({ reset: false }) 42 | } else { 43 | this.setState({ reset: true }) 44 | } 45 | }}> 46 | Clear 47 | 48 | this._emojiInput = emojiInput} 51 | resetSearch={this.state.reset} 52 | loggingFunction={this.verboseLoggingFunction.bind(this)} 53 | verboseLoggingFunction={true} 54 | /> 55 | 56 | ); 57 | } 58 | 59 | loggingFunction(text) { 60 | console.log(text) 61 | } 62 | verboseLoggingFunction(text,type) { 63 | console.log(text,type) 64 | } 65 | } 66 | 67 | const styles = StyleSheet.create({ 68 | container: { 69 | flex: 1, 70 | justifyContent: 'flex-start', 71 | alignItems: 'center', 72 | } 73 | }); 74 | -------------------------------------------------------------------------------- /example/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion rootProject.ext.compileSdkVersion 98 | 99 | compileOptions { 100 | sourceCompatibility JavaVersion.VERSION_1_8 101 | targetCompatibility JavaVersion.VERSION_1_8 102 | } 103 | 104 | defaultConfig { 105 | applicationId "com.example" 106 | minSdkVersion rootProject.ext.minSdkVersion 107 | targetSdkVersion rootProject.ext.targetSdkVersion 108 | versionCode 1 109 | versionName "1.0" 110 | } 111 | splits { 112 | abi { 113 | reset() 114 | enable enableSeparateBuildPerCPUArchitecture 115 | universalApk false // If true, also generate a universal APK 116 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 117 | } 118 | } 119 | buildTypes { 120 | release { 121 | minifyEnabled enableProguardInReleaseBuilds 122 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 123 | } 124 | } 125 | // applicationVariants are e.g. debug, release 126 | applicationVariants.all { variant -> 127 | variant.outputs.each { output -> 128 | // For each separate APK per architecture, set a unique version code as described here: 129 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 130 | def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4] 131 | def abi = output.getFilter(OutputFile.ABI) 132 | if (abi != null) { // null for the universal-debug, universal-release variants 133 | output.versionCodeOverride = 134 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 135 | } 136 | } 137 | } 138 | } 139 | 140 | dependencies { 141 | implementation project(':react-native-vector-icons') 142 | implementation fileTree(dir: "libs", include: ["*.jar"]) 143 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" 144 | implementation "com.facebook.react:react-native:+" // From node_modules 145 | } 146 | 147 | // Run this once to be able to run the application with BUCK 148 | // puts all compile dependencies into folder libs for BUCK to use 149 | task copyDownloadableDepsToLibs(type: Copy) { 150 | from configurations.compile 151 | into 'libs' 152 | } 153 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "example"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.oblador.vectoricons.VectorIconsPackage; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.shell.MainReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage(), 27 | new VectorIconsPackage() 28 | ); 29 | } 30 | 31 | @Override 32 | protected String getJSMainModuleName() { 33 | return "index"; 34 | } 35 | }; 36 | 37 | @Override 38 | public ReactNativeHost getReactNativeHost() { 39 | return mReactNativeHost; 40 | } 41 | 42 | @Override 43 | public void onCreate() { 44 | super.onCreate(); 45 | SoLoader.init(this, /* native exopackage */ false); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | supportLibVersion = "28.0.0" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.3.1' 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | mavenLocal() 26 | google() 27 | jcenter() 28 | maven { 29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 30 | url "$rootDir/../node_modules/react-native/android" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sskhandek/react-native-emoji-input/18e46501af8affce0cddfa2e80b5783a3a54e044/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | include ':react-native-vector-icons' 3 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 4 | 5 | include ':app' 6 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /example/ios/example-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/example-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 19 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 20 | moduleName:@"example" 21 | initialProperties:nil]; 22 | 23 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 24 | 25 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 26 | UIViewController *rootViewController = [UIViewController new]; 27 | rootViewController.view = rootView; 28 | self.window.rootViewController = rootViewController; 29 | [self.window makeKeyAndVisible]; 30 | return YES; 31 | } 32 | 33 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 34 | { 35 | #if DEBUG 36 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 37 | #else 38 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 39 | #endif 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /example/ios/example/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSLocationWhenInUseUsageDescription 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | NSAppTransportSecurity 44 | 45 | NSAllowsArbitraryLoads 46 | 47 | NSExceptionDomains 48 | 49 | localhost 50 | 51 | NSExceptionAllowsInsecureHTTPLoads 52 | 53 | 54 | 55 | 56 | UIAppFonts 57 | 58 | Entypo.ttf 59 | EvilIcons.ttf 60 | Feather.ttf 61 | FontAwesome.ttf 62 | Foundation.ttf 63 | Ionicons.ttf 64 | MaterialCommunityIcons.ttf 65 | MaterialIcons.ttf 66 | Octicons.ttf 67 | SimpleLineIcons.ttf 68 | Zocial.ttf 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/exampleTests/exampleTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 16 | 17 | @interface exampleTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation exampleTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 44 | if (level >= RCTLogLevelError) { 45 | redboxError = message; 46 | } 47 | }); 48 | 49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 52 | 53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 55 | return YES; 56 | } 57 | return NO; 58 | }]; 59 | } 60 | 61 | RCTSetLogFunction(RCTDefaultLogFunction); 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "16.8.3", 11 | "react-native": "0.59.8", 12 | "emoji-datasource": "^4.0.4", 13 | "emoji-datasource-apple": "^4.0.4", 14 | "eslint-plugin-react": "^7.8.2", 15 | "fuse.js": "^3.2.1", 16 | "lodash": "^4.17.5", 17 | "react-native-animatable": "^1.3.0", 18 | "react-native-elements": "^0.19.0", 19 | "react-native-responsive-dimensions": "^1.0.2", 20 | "react-native-triangle": "^0.0.9", 21 | "react-native-vector-icons": "^4.5.0", 22 | "recyclerlistview": "^1.3.4" 23 | }, 24 | "devDependencies": { 25 | "@babel/core": "^7.4.4", 26 | "@babel/runtime": "^7.4.4", 27 | "babel-jest": "^24.8.0", 28 | "jest": "^24.8.0", 29 | "metro-react-native-babel-preset": "^0.54.1", 30 | "react-test-renderer": "16.8.3" 31 | }, 32 | "jest": { 33 | "preset": "react-native" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /example/src/Emoji.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { View, Text, TouchableOpacity, StyleSheet, Image } from 'react-native'; 4 | import _ from 'lodash'; 5 | 6 | const EMOJI_DATASOURCE_VERSION = '4.0.4'; 7 | 8 | class Emoji extends React.PureComponent { 9 | static propTypes = { 10 | data: PropTypes.shape({ 11 | char: PropTypes.char, 12 | unified: PropTypes.char 13 | }), 14 | onPress: PropTypes.func, 15 | onLongPress: PropTypes.func, 16 | native: PropTypes.bool, 17 | size: PropTypes.number, 18 | style: PropTypes.object, 19 | labelStyle: PropTypes.object 20 | }; 21 | 22 | static defaultProps = { 23 | native: true 24 | }; 25 | 26 | _getImage = data => { 27 | let localImage = _.get(data, 'localImage'); 28 | if (localImage) return localImage; 29 | 30 | let image = _.get(data, 'lib.image'); 31 | let imageSource = localImage || { 32 | uri: `https://unpkg.com/emoji-datasource-apple@${EMOJI_DATASOURCE_VERSION}/img/apple/64/${image}` 33 | }; 34 | return imageSource; 35 | }; 36 | 37 | render() { 38 | let imageComponent = null; 39 | 40 | const { 41 | native, 42 | style, 43 | labelStyle, 44 | data, 45 | onPress, 46 | onLongPress 47 | } = this.props; 48 | 49 | if (!native) { 50 | const emojiImageFile = this._getImage(data); 51 | 52 | const imageStyle = { 53 | width: this.props.size, 54 | height: this.props.size 55 | }; 56 | 57 | imageComponent = ( 58 | 59 | ); 60 | } else { 61 | if (!data.char) { 62 | data.char = data.unified.replace(/(^|-)([a-z0-9]+)/gi, (s, b, cp) => 63 | String.fromCodePoint(parseInt(cp, 16)) 64 | ); 65 | } 66 | } 67 | 68 | const emojiComponent = ( 69 | 70 | {native ? ( 71 | 80 | {data.char} 81 | 82 | ) : ( 83 | imageComponent 84 | )} 85 | 86 | ); 87 | 88 | return onPress || onLongPress ? ( 89 | { 92 | onPress && onPress(data, evt); 93 | }} 94 | onLongPress={evt => { 95 | onLongPress && onLongPress(data, evt); 96 | }} 97 | > 98 | {emojiComponent} 99 | 100 | ) : ( 101 | emojiComponent 102 | ); 103 | } 104 | } 105 | 106 | const styles = StyleSheet.create({ 107 | emojiWrapper: { 108 | justifyContent: 'space-around', 109 | alignItems: 'center', 110 | flex: 1 111 | }, 112 | labelStyle: { 113 | color: 'black', 114 | fontWeight: 'bold' 115 | } 116 | }); 117 | 118 | export default Emoji; 119 | -------------------------------------------------------------------------------- /example/src/EmojiInput.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { 4 | View, 5 | Text, 6 | TextInput, 7 | Dimensions, 8 | TouchableOpacity, 9 | TouchableWithoutFeedback, 10 | AsyncStorage 11 | } from 'react-native'; 12 | import { 13 | RecyclerListView, 14 | DataProvider, 15 | LayoutProvider 16 | } from 'recyclerlistview'; 17 | import Triangle from 'react-native-triangle'; 18 | import _ from 'lodash'; 19 | import { 20 | responsiveFontSize 21 | } from 'react-native-responsive-dimensions'; 22 | import { Icon } from 'react-native-elements'; 23 | import * as Animatable from 'react-native-animatable'; 24 | import EmojiSearchSpace from "./EmojiSearch"; 25 | 26 | import Emoji from './Emoji'; 27 | 28 | const { 29 | category, 30 | categoryIndexMap, 31 | emojiLib, 32 | emojiArray 33 | } = require('./emoji-data/compiled'); 34 | 35 | const categoryIcon = { 36 | fue: props => , 37 | people: props => , 38 | animals_and_nature: props => ( 39 | 40 | ), 41 | food_and_drink: props => ( 42 | 43 | ), 44 | activity: props => ( 45 | 46 | ), 47 | travel_and_places: props => ( 48 | 49 | ), 50 | objects: props => ( 51 | 52 | ), 53 | symbols: props => , 54 | flags: props => 55 | }; 56 | 57 | const { width: WINDOW_WIDTH } = Dimensions.get('window'); 58 | 59 | const ViewTypes = { 60 | EMOJI: 0, 61 | CATEGORY: 1 62 | }; 63 | 64 | // fromCodePoint polyfill 65 | if (!String.fromCodePoint) { 66 | (function() { 67 | var defineProperty = (function() { 68 | // IE 8 only supports `Object.defineProperty` on DOM elements 69 | try { 70 | var object = {}; 71 | var $defineProperty = Object.defineProperty; 72 | var result = 73 | $defineProperty(object, object, object) && $defineProperty; 74 | } catch (error) {} 75 | return result; 76 | })(); 77 | var stringFromCharCode = String.fromCharCode; 78 | var floor = Math.floor; 79 | var fromCodePoint = function() { 80 | var MAX_SIZE = 0x4000; 81 | var codeUnits = []; 82 | var highSurrogate; 83 | var lowSurrogate; 84 | var index = -1; 85 | var length = arguments.length; 86 | if (!length) { 87 | return ''; 88 | } 89 | var result = ''; 90 | while (++index < length) { 91 | var codePoint = Number(arguments[index]); 92 | if ( 93 | !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` 94 | codePoint < 0 || // not a valid Unicode code point 95 | codePoint > 0x10ffff || // not a valid Unicode code point 96 | floor(codePoint) != codePoint // not an integer 97 | ) { 98 | throw RangeError('Invalid code point: ' + codePoint); 99 | } 100 | if (codePoint <= 0xffff) { 101 | // BMP code point 102 | codeUnits.push(codePoint); 103 | } else { 104 | // Astral code point; split in surrogate halves 105 | // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 106 | codePoint -= 0x10000; 107 | highSurrogate = (codePoint >> 10) + 0xd800; 108 | lowSurrogate = (codePoint % 0x400) + 0xdc00; 109 | codeUnits.push(highSurrogate, lowSurrogate); 110 | } 111 | if (index + 1 == length || codeUnits.length > MAX_SIZE) { 112 | result += stringFromCharCode.apply(null, codeUnits); 113 | codeUnits.length = 0; 114 | } 115 | } 116 | return result; 117 | }; 118 | if (defineProperty) { 119 | defineProperty(String, 'fromCodePoint', { 120 | value: fromCodePoint, 121 | configurable: true, 122 | writable: true 123 | }); 124 | } else { 125 | String.fromCodePoint = fromCodePoint; 126 | } 127 | })(); 128 | } 129 | 130 | class EmojiInput extends React.PureComponent { 131 | constructor(props) { 132 | super(props); 133 | 134 | if (this.props.enableFrequentlyUsedEmoji) this.getFrequentlyUsedEmoji(); 135 | 136 | this.emojiSize = _.floor(props.width / this.props.numColumns); 137 | 138 | this.emoji = []; 139 | 140 | this.loggingFunction = this.props.loggingFunction 141 | ? this.props.loggingFunction 142 | : null; 143 | 144 | this.verboseLoggingFunction = this.props.verboseLoggingFunction 145 | ? this.props.verboseLoggingFunction 146 | : false; 147 | 148 | let dataProvider = new DataProvider((e1, e2) => { 149 | return e1.char !== e2.char; 150 | }); 151 | 152 | this._layoutProvider = new LayoutProvider( 153 | index => 154 | _.has(this.emoji[index], 'categoryMarker') 155 | ? ViewTypes.CATEGORY 156 | : ViewTypes.EMOJI, 157 | (type, dim) => { 158 | switch (type) { 159 | case ViewTypes.CATEGORY: 160 | dim.height = this.props.categoryLabelHeight; 161 | dim.width = props.width; 162 | break; 163 | case ViewTypes.EMOJI: 164 | dim.height = dim.width = this.emojiSize; 165 | break; 166 | } 167 | } 168 | ); 169 | 170 | this._rowRenderer = this._rowRenderer.bind(this); 171 | this._isMounted = false; 172 | 173 | this.state = { 174 | dataProvider: dataProvider.cloneWithRows(this.emoji), 175 | currentCategoryKey: this.props.enableFrequentlyUsedEmoji 176 | ? category[0].key 177 | : category[1].key, 178 | searchQuery: '', 179 | emptySearchResult: false, 180 | frequentlyUsedEmoji: {}, 181 | previousLongestQuery: '', 182 | selectedEmoji: null, 183 | offsetY: 0 184 | }; 185 | } 186 | 187 | componentDidMount() { 188 | this._isMounted = true; 189 | this.search(); 190 | } 191 | 192 | componentDidUpdate(prevProps, prevStates) { 193 | if (this.props.resetSearch) { 194 | this.textInput.clear(); 195 | this.setState({ 196 | searchQuery: '' 197 | }); 198 | } 199 | if ( 200 | prevStates.searchQuery !== this.state.searchQuery || 201 | prevStates.frequentlyUsedEmoji !== this.state.frequentlyUsedEmoji 202 | ) { 203 | this.search(); 204 | } 205 | } 206 | 207 | componentWillUnmount() { 208 | this._isMounted = false; 209 | } 210 | 211 | getFrequentlyUsedEmoji = () => { 212 | AsyncStorage.getItem('@EmojiInput:frequentlyUsedEmoji').then( 213 | frequentlyUsedEmoji => { 214 | if (frequentlyUsedEmoji !== null) { 215 | frequentlyUsedEmoji = JSON.parse(frequentlyUsedEmoji); 216 | this.setState({ frequentlyUsedEmoji }); 217 | } 218 | } 219 | ); 220 | }; 221 | 222 | addFrequentlyUsedEmoji = data => { 223 | let emoji = data.key; 224 | let { frequentlyUsedEmoji } = this.state; 225 | if (_(frequentlyUsedEmoji).has(emoji)) { 226 | frequentlyUsedEmoji[emoji]++; 227 | } else { 228 | frequentlyUsedEmoji[emoji] = 1; 229 | } 230 | this.setState({ frequentlyUsedEmoji }); 231 | AsyncStorage.setItem( 232 | '@EmojiInput:frequentlyUsedEmoji', 233 | JSON.stringify(frequentlyUsedEmoji) 234 | ); 235 | }; 236 | 237 | clearFrequentlyUsedEmoji = () => { 238 | AsyncStorage.removeItem('@EmojiInput:frequentlyUsedEmoji'); 239 | }; 240 | 241 | search = () => { 242 | let query = this.state.searchQuery; 243 | this.setState({ emptySearchResult: false }); 244 | 245 | if (query) { 246 | let result = _(EmojiSearchSpace.search(query).slice(0,50)) // Only show top 50 relevant results 247 | .map(({ emoji_key }) => emojiLib[emoji_key]) // speeds up response time 248 | .value(); 249 | 250 | if (!result.length) { 251 | this.setState({ emptySearchResult: true }); 252 | if (this.loggingFunction) { 253 | if (this.verboseLoggingFunction) { 254 | this.loggingFunction(query, 'emptySearchResult'); 255 | } else { 256 | this.loggingFunction(query); 257 | } 258 | } 259 | } 260 | this.emojiRenderer(result); 261 | setTimeout(() => { 262 | if (this._isMounted) { 263 | this._recyclerListView._pendingScrollToOffset = null; 264 | this._recyclerListView.scrollToTop(false); 265 | } 266 | }, 15); 267 | } else { 268 | let fue = _(this.state.frequentlyUsedEmoji) 269 | .toPairs() 270 | .sortBy([1]) 271 | .reverse() 272 | .map(([key]) => key) 273 | .value(); 274 | fue = _(this.props.defaultFrequentlyUsedEmoji) 275 | .concat(fue) 276 | .take(this.props.numFrequentlyUsedEmoji) 277 | .value(); 278 | let _emoji = _(emojiLib) 279 | .pick(fue) 280 | .mapKeys((v, k) => `FUE_${k}`) 281 | .mapValues(v => ({ ...v, category: 'fue' })) 282 | .extend(emojiLib) 283 | .value(); 284 | this.emojiRenderer(_emoji); 285 | } 286 | }; 287 | 288 | emojiRenderer = emojis => { 289 | let dataProvider = new DataProvider((e1, e2) => { 290 | return e1.char !== e2.char; 291 | }); 292 | 293 | this.emoji = []; 294 | let categoryIndexMap = _(category) 295 | .map((v, idx) => ({ ...v, idx })) 296 | .keyBy('key') 297 | .value(); 298 | 299 | let tempEmoji = _ 300 | .range(_.size(category)) 301 | .map((v, k) => [ 302 | { char: category[k].key, categoryMarker: true, ...category[k] } 303 | ]); 304 | _(emojis) 305 | .values() 306 | .filter(emoji => _.every(this.props.filterFunctions, fn => fn(emoji))) 307 | .each(e => { 308 | if (_.has(categoryIndexMap, e.category)) { 309 | tempEmoji[categoryIndexMap[e.category].idx].push(e); 310 | } 311 | }); 312 | let accurateY = 0; 313 | let lastCount = 0; 314 | let s = 0; 315 | _(tempEmoji).each(v => { 316 | let idx = categoryIndexMap[v[0].key].idx; 317 | let c = category[idx]; 318 | 319 | c.idx = s; 320 | s = s + lastCount; 321 | 322 | c.y = 323 | _.ceil(lastCount / this.props.numColumns) * this.emojiSize + 324 | accurateY; 325 | accurateY = 326 | c.y + (_.size(v) === 1 ? 0 : this.props.categoryLabelHeight); 327 | 328 | lastCount = _.size(v) - 1; 329 | }); 330 | this.emoji = _(tempEmoji) 331 | .filter(c => c.length > 1) 332 | .flatten(tempEmoji) 333 | .value(); 334 | if ( 335 | !this.props.showCategoryTitleInSearchResults && 336 | this.state.searchQuery 337 | ) { 338 | this.emoji = _.filter(this.emoji, c => !c.categoryMarker); 339 | } 340 | 341 | _.reduce( 342 | this.emoji, 343 | ({ x, y, i, previousDimension }, emoji) => { 344 | const layoutType = this._layoutProvider.getLayoutTypeForIndex( 345 | i 346 | ); 347 | const dimension = { width: 0, height: 0 }; 348 | this._layoutProvider._setLayoutForType( 349 | layoutType, 350 | dimension, 351 | i 352 | ); 353 | 354 | x = x + dimension.width; 355 | if (x > this.props.width) { 356 | x = dimension.width; 357 | y = y + previousDimension.height; 358 | } 359 | 360 | emoji.y = y; 361 | emoji.x = x - dimension.width; 362 | 363 | return { x, y, i: i + 1, previousDimension: dimension }; 364 | }, 365 | { x: 0, y: 0, i: 0, previousDimension: null } 366 | ); 367 | this.setState({ 368 | dataProvider: dataProvider.cloneWithRows(this.emoji) 369 | }); 370 | }; 371 | 372 | _rowRenderer(type, data) { 373 | switch (type) { 374 | case ViewTypes.CATEGORY: 375 | return ( 376 | 382 | {data.title} 383 | 384 | ); 385 | case ViewTypes.EMOJI: 386 | return ( 387 | 393 | ); 394 | } 395 | } 396 | 397 | handleCategoryPress = key => { 398 | this._recyclerListView.scrollToOffset( 399 | 0, 400 | category[categoryIndexMap[key].idx].y + 1, 401 | false 402 | ); 403 | }; 404 | 405 | handleScroll = (rawEvent, offsetX, offsetY) => { 406 | let idx = _(category).findLastIndex(c => c.y < offsetY); 407 | if (idx < 0) idx = 0; 408 | this.setState({ 409 | currentCategoryKey: category[idx].key, 410 | selectedEmoji: null, 411 | offsetY 412 | }); 413 | }; 414 | 415 | handleEmojiPress = data => { 416 | this.props.onEmojiSelected(data); 417 | if (_.has(data, 'derivedFrom')) { 418 | data = data.derivedFrom; 419 | } 420 | if (this.props.enableFrequentlyUsedEmoji) 421 | this.addFrequentlyUsedEmoji(data); 422 | this.hideSkinSelector(); 423 | }; 424 | 425 | handleEmojiLongPress = data => { 426 | if (!_.has(data, ['lib', 'skin_variations'])) return; 427 | this.setState({ selectedEmoji: data }); 428 | }; 429 | 430 | hideSkinSelector = () => { 431 | this.setState({ selectedEmoji: null }); 432 | }; 433 | 434 | render() { 435 | const { selectedEmoji, offsetY } = this.state; 436 | const { enableSearch, width, renderAheadOffset } = this.props; 437 | return ( 438 | 446 | {enableSearch && ( 447 | { 449 | this.textInput = input; 450 | }} 451 | placeholderTextColor={'#A0A0A2'} 452 | style={{ 453 | backgroundColor: 'white', 454 | borderColor: '#A0A0A2', 455 | borderWidth: 0.5, 456 | color: 'black', 457 | fontSize: responsiveFontSize(2), 458 | padding: 10, 459 | paddingLeft: 15, 460 | borderRadius: 15, 461 | margin: 10, 462 | }} 463 | returnKeyType={'search'} 464 | clearButtonMode={'always'} 465 | placeholder={'Search emoji'} 466 | autoCorrect={false} 467 | onChangeText={text => { 468 | this.setState({ 469 | searchQuery: text 470 | }); 471 | if (text.length) { 472 | if ( 473 | text.length > 474 | this.state.previousLongestQuery.length 475 | ) { 476 | this.setState({ 477 | previousLongestQuery: text 478 | }); 479 | } 480 | } else { 481 | if (this.loggingFunction) { 482 | if (this.verboseLoggingFunction) { 483 | this.loggingFunction( 484 | this.state.previousLongestQuery, 485 | 'previousLongestQuery' 486 | ); 487 | } else { 488 | this.loggingFunction( 489 | this.state.previousLongestQuery 490 | ); 491 | } 492 | } 493 | this.setState({ 494 | previousLongestQuery: '' 495 | }); 496 | } 497 | }} 498 | /> 499 | )} 500 | {this.state.emptySearchResult && ( 501 | 502 | No search results. 503 | 504 | )} 505 | (this._recyclerListView = component)} 512 | onScroll={this.handleScroll} 513 | /> 514 | {!this.state.searchQuery && 515 | this.props.showCategoryTab && ( 516 | 517 | 518 | {_ 519 | .drop( 520 | category, 521 | this.props.enableFrequentlyUsedEmoji 522 | ? 0 523 | : 1 524 | ) 525 | .map(({ key }) => ( 526 | 529 | this.handleCategoryPress(key) 530 | } 531 | style={styles.categoryIconContainer} 532 | > 533 | 534 | {categoryIcon[key]({ 535 | color: 536 | key === 537 | this.state 538 | .currentCategoryKey 539 | ? this.props 540 | .categoryHighlightColor 541 | : this.props 542 | .categoryUnhighlightedColor, 543 | size: this.props 544 | .categoryFontSize 545 | })} 546 | 547 | 548 | ))} 549 | 550 | 551 | )} 552 | {selectedEmoji && ( 553 | 566 | 574 | {_(_.get(selectedEmoji, ['lib', 'skin_variations'])) 575 | .map(data => { 576 | return ( 577 | 581 | 589 | 590 | ); 591 | }) 592 | .value()} 593 | 594 | 605 | 611 | 612 | 613 | )} 614 | 615 | ); 616 | } 617 | } 618 | 619 | EmojiInput.defaultProps = { 620 | keyboardBackgroundColor: '#E3E1EC', 621 | width: WINDOW_WIDTH, 622 | numColumns: 6, 623 | 624 | showCategoryTab: true, 625 | showCategoryTitleInSearchResults: false, 626 | categoryUnhighlightedColor: 'lightgray', 627 | categoryHighlightColor: 'black', 628 | enableSearch: true, 629 | 630 | enableFrequentlyUsedEmoji: true, 631 | numFrequentlyUsedEmoji: 18, 632 | defaultFrequentlyUsedEmoji: [], 633 | 634 | categoryLabelHeight: 45, 635 | categoryLabelTextStyle: { 636 | fontSize: 25 637 | }, 638 | emojiFontSize: 40, 639 | categoryFontSize: 20, 640 | resetSearch: false, 641 | filterFunctions: [], 642 | renderAheadOffset: 1500 643 | }; 644 | 645 | EmojiInput.propTypes = { 646 | keyboardBackgroundColor: PropTypes.string, 647 | width: PropTypes.number, 648 | numColumns: PropTypes.number, 649 | emojiFontSize: PropTypes.number, 650 | 651 | onEmojiSelected: PropTypes.func.isRequired, 652 | 653 | showCategoryTab: PropTypes.bool, 654 | showCategoryTitleInSearchResults: PropTypes.bool, 655 | categoryFontSize: PropTypes.number, 656 | categoryUnhighlightedColor: PropTypes.string, 657 | categoryHighlightColor: PropTypes.string, 658 | categorySize: PropTypes.number, 659 | categoryLabelHeight: PropTypes.number, 660 | enableSearch: PropTypes.bool, 661 | categoryLabelTextStyle: PropTypes.object, 662 | 663 | enableFrequentlyUsedEmoji: PropTypes.bool, 664 | numFrequentlyUsedEmoji: PropTypes.number, 665 | defaultFrequentlyUsedEmoji: PropTypes.arrayOf(PropTypes.string), 666 | resetSearch: PropTypes.bool, 667 | filterFunctions: PropTypes.arrayOf(PropTypes.func), 668 | renderAheadOffset: PropTypes.number 669 | }; 670 | 671 | const styles = { 672 | cellContainer: { 673 | justifyContent: 'space-around', 674 | alignItems: 'center', 675 | flex: 1 676 | }, 677 | footerContainer: { 678 | width: '100%', 679 | paddingVertical: 15, 680 | backgroundColor: '#fff', 681 | flexDirection: 'row' 682 | }, 683 | emptySearchResultContainer: { 684 | flex: 1, 685 | alignItems: 'center', 686 | padding: 20 687 | }, 688 | emojiText: { 689 | color: 'black', 690 | fontWeight: 'bold' 691 | }, 692 | categoryText: { 693 | color: 'black', 694 | fontWeight: 'bold', 695 | paddingVertical: 15, 696 | paddingLeft: 10 697 | }, 698 | categoryIconContainer: { 699 | flex: 1, 700 | alignItems: 'center', 701 | justifyContent: 'space-around' 702 | }, 703 | skinSelectorContainer: { 704 | width: '100%', 705 | flex: 1, 706 | flexDirection: 'column', 707 | justifyContent: 'flex-start', 708 | position: 'absolute' 709 | }, 710 | skinSelector: { 711 | width: '100%', 712 | justifyContent: 'space-around', 713 | alignItems: 'center', 714 | flexDirection: 'row', 715 | backgroundColor: '#fff' 716 | }, 717 | skinSelectorTriangleContainer: { 718 | height: 20 719 | }, 720 | skinEmoji: { 721 | flex: 1 722 | } 723 | }; 724 | 725 | export default EmojiInput; 726 | -------------------------------------------------------------------------------- /example/src/EmojiSearch.js: -------------------------------------------------------------------------------- 1 | import Fuse from "fuse.js"; 2 | 3 | const { emojiArray } = require("./emoji-data/compiled"); 4 | 5 | const emojiSynonyms = require("./emoji-data/emojiSynonyms"); 6 | 7 | // Extend keywords using synonym JSON file 8 | for (let i = 0; i < emojiArray.length; i++) { 9 | emojiArray[i]["keywords"] = emojiArray[i]["keywords"].concat( 10 | emojiSynonyms[i]["keywords"] 11 | ); 12 | } 13 | 14 | const fuseOptions = { 15 | shouldSort: true, 16 | threshold: 0.0, // threshold of 0.0 is perfect match and 1.0 is any match 17 | keys: ["keywords"] 18 | }; 19 | 20 | const EmojiSearchSpace = new Fuse(emojiArray, fuseOptions); 21 | 22 | export default EmojiSearchSpace; 23 | -------------------------------------------------------------------------------- /example/src/emoji-data/duplicates.json: -------------------------------------------------------------------------------- 1 | [ 2 | "1F926", "1F937", "1F93C" 3 | ] -------------------------------------------------------------------------------- /example/src/emoji-data/index.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | import emoji from './emoji-data.json'; 3 | import emojiSynonyms from './emojiSynonyms.json'; 4 | import userInputEmojiSynonyms from './userInputtedSynonyms.json'; 5 | import duplicates from './duplicates.json'; 6 | 7 | const filteredEmoji = _.filter(emoji, e => !_.includes(duplicates, e.unified)); 8 | 9 | const categoryTitleToKey = { 10 | 'Frequently Used': 'fue', 11 | 'Smileys & People': 'people', 12 | 'Animals & Nature': 'animals_and_nature', 13 | 'Food & Drink': 'food_and_drink', 14 | Activities: 'activity', 15 | 'Travel & Places': 'travel_and_places', 16 | Objects: 'objects', 17 | Symbols: 'symbols', 18 | Flags: 'flags' 19 | }; 20 | 21 | let obsoletes = _(filteredEmoji) 22 | .filter('obsoletes') 23 | .map(v => v.obsoletes) 24 | .value(); 25 | 26 | // Adding in extra duplicates not marked in datasource 27 | obsoletes.push.apply(obsoletes, ['1F93D', '1F93E', '1F939', '1F938', '1F939']); 28 | 29 | let emojiLib = _(filteredEmoji) 30 | .filter(e => !obsoletes.includes(e.unified)) 31 | .sortBy('sort_order') 32 | .mapKeys(({ short_name }) => short_name) 33 | .mapValues((v, k) => ({ 34 | char: String.fromCodePoint.apply( 35 | null, 36 | v.unified.split('-').map(v => `0x${v}`) 37 | ), 38 | key: v.short_name, 39 | keywords: [v.short_name, v.name ? v.name : ''], 40 | category: categoryTitleToKey[v.category], 41 | lib: v 42 | })) 43 | .value(); 44 | 45 | const category = [ 46 | { 47 | key: 'fue', 48 | title: 'Frequently Used' 49 | }, 50 | { 51 | key: 'people', 52 | title: 'Smileys & People' 53 | }, 54 | { 55 | key: 'animals_and_nature', 56 | title: 'Animals & Nature' 57 | }, 58 | { 59 | key: 'food_and_drink', 60 | title: 'Food & Drink' 61 | }, 62 | { 63 | key: 'activity', 64 | title: 'Activities' 65 | }, 66 | { 67 | key: 'travel_and_places', 68 | title: 'Travel & Places' 69 | }, 70 | { 71 | key: 'objects', 72 | title: 'Objects' 73 | }, 74 | { 75 | key: 'symbols', 76 | title: 'Symbols' 77 | }, 78 | { 79 | key: 'flags', 80 | title: 'Flags' 81 | } 82 | ]; 83 | 84 | const categoryIndexMap = _(category) 85 | .map((v, idx) => ({ ...v, idx })) 86 | .keyBy('key') 87 | .value(); 88 | 89 | _.each(emojiSynonyms, (v, k) => { 90 | emojiSynonyms[k] = _.uniq( 91 | emojiSynonyms[k].concat(userInputEmojiSynonyms[k]) 92 | ); 93 | }); 94 | 95 | const emojiMap = _(emojiLib) 96 | .mapValues( 97 | (v, k) => 98 | k + 99 | ' ' + 100 | v.keywords.map(v => v.replace(/_/g, ' ')).join(' ') + 101 | (emojiSynonyms[k] || []).map(v => v.replace(/_/g, ' ')).join(' ') 102 | ) 103 | .invert() 104 | .value(); 105 | 106 | const emojiArray = _.keys(emojiMap); 107 | 108 | export { category, categoryIndexMap, emojiLib, emojiMap, emojiArray }; 109 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import EmojiInput from './src/EmojiInput'; 2 | export default EmojiInput; 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-emoji-input", 3 | "version": "1.1.10", 4 | "description": "A React Native emoji keyboard component", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/sskhandek/react-native-emoji-input.git" 12 | }, 13 | "keywords": [ 14 | "react", 15 | "native", 16 | "emoji", 17 | "input", 18 | "component", 19 | "keyboard" 20 | ], 21 | "author": "sskhandek", 22 | "contributors": [ 23 | { 24 | "name": "Rijn Bian", 25 | "email": "bxbian951122@gmail.com" 26 | } 27 | ], 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/sskhandek/react-native-emoji-input/issues" 31 | }, 32 | "homepage": "https://github.com/sskhandek/react-native-emoji-input#readme", 33 | "dependencies": { 34 | "emoji-datasource": "^4.0.4", 35 | "emoji-datasource-apple": "^4.0.4", 36 | "eslint-plugin-react": "^7.8.2", 37 | "fuse.js": "^3.4.4", 38 | "lodash": "^4.17.5", 39 | "react-native-animatable": "^1.3.0", 40 | "react-native-elements": "^0.19.0", 41 | "react-native-responsive-dimensions": "^1.0.2", 42 | "react-native-triangle": "^0.0.9", 43 | "react-native-vector-icons": "^4.5.0", 44 | "recyclerlistview": "^1.3.4" 45 | }, 46 | "jest": { 47 | "preset": "react-native" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /scripts/compile.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | import fs from 'fs'; 3 | 4 | import { 5 | category, 6 | categoryIndexMap, 7 | emojiLib, 8 | emojiMap, 9 | emojiArray 10 | } from '../src/emoji-data'; 11 | 12 | let data = { 13 | category, 14 | categoryIndexMap, 15 | emojiLib, 16 | emojiMap, 17 | emojiArray 18 | }; 19 | 20 | var stingified = JSON.stringify(data).replace( 21 | /(["'])require(?:(?=(\\?))\2.)*?\1/g, 22 | value => value.replace(/"/g, '') 23 | ); 24 | 25 | fs.writeFile( 26 | 'src/emoji-data/compiled.js', 27 | `module.exports = ${stingified}`, 28 | err => { 29 | if (err) throw err; 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /src/Emoji.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { View, Text, TouchableOpacity, StyleSheet, Image } from 'react-native'; 4 | import _ from 'lodash'; 5 | 6 | const EMOJI_DATASOURCE_VERSION = '4.0.4'; 7 | 8 | class Emoji extends React.PureComponent { 9 | static propTypes = { 10 | data: PropTypes.shape({ 11 | char: PropTypes.char, 12 | unified: PropTypes.char 13 | }), 14 | onPress: PropTypes.func, 15 | onLongPress: PropTypes.func, 16 | native: PropTypes.bool, 17 | size: PropTypes.number, 18 | style: PropTypes.object, 19 | labelStyle: PropTypes.object 20 | }; 21 | 22 | static defaultProps = { 23 | native: true 24 | }; 25 | 26 | _getImage = data => { 27 | let localImage = _.get(data, 'localImage'); 28 | if (localImage) return localImage; 29 | 30 | let image = _.get(data, 'lib.image'); 31 | let imageSource = localImage || { 32 | uri: `https://unpkg.com/emoji-datasource-apple@${EMOJI_DATASOURCE_VERSION}/img/apple/64/${image}` 33 | }; 34 | return imageSource; 35 | }; 36 | 37 | render() { 38 | let imageComponent = null; 39 | 40 | const { 41 | native, 42 | style, 43 | labelStyle, 44 | data, 45 | onPress, 46 | onLongPress 47 | } = this.props; 48 | 49 | if (!native) { 50 | const emojiImageFile = this._getImage(data); 51 | 52 | const imageStyle = { 53 | width: this.props.size, 54 | height: this.props.size 55 | }; 56 | 57 | imageComponent = ( 58 | 59 | ); 60 | } else { 61 | if (!data.char) { 62 | data.char = data.unified.replace(/(^|-)([a-z0-9]+)/gi, (s, b, cp) => 63 | String.fromCodePoint(parseInt(cp, 16)) 64 | ); 65 | } 66 | } 67 | 68 | const emojiComponent = ( 69 | 70 | {native ? ( 71 | 80 | {data.char} 81 | 82 | ) : ( 83 | imageComponent 84 | )} 85 | 86 | ); 87 | 88 | return onPress || onLongPress ? ( 89 | { 92 | onPress && onPress(data, evt); 93 | }} 94 | onLongPress={evt => { 95 | onLongPress && onLongPress(data, evt); 96 | }} 97 | > 98 | {emojiComponent} 99 | 100 | ) : ( 101 | emojiComponent 102 | ); 103 | } 104 | } 105 | 106 | const styles = StyleSheet.create({ 107 | emojiWrapper: { 108 | justifyContent: 'space-around', 109 | alignItems: 'center', 110 | flex: 1 111 | }, 112 | labelStyle: { 113 | color: 'black', 114 | fontWeight: 'bold' 115 | } 116 | }); 117 | 118 | export default Emoji; 119 | -------------------------------------------------------------------------------- /src/EmojiInput.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { 4 | View, 5 | Text, 6 | TextInput, 7 | Dimensions, 8 | TouchableOpacity, 9 | TouchableWithoutFeedback, 10 | AsyncStorage 11 | } from 'react-native'; 12 | import { 13 | RecyclerListView, 14 | DataProvider, 15 | LayoutProvider 16 | } from 'recyclerlistview'; 17 | import Triangle from 'react-native-triangle'; 18 | import _ from 'lodash'; 19 | import { 20 | responsiveFontSize 21 | } from 'react-native-responsive-dimensions'; 22 | import { Icon } from 'react-native-elements'; 23 | import * as Animatable from 'react-native-animatable'; 24 | import EmojiSearchSpace from "./EmojiSearch"; 25 | 26 | import Emoji from './Emoji'; 27 | 28 | const { 29 | category, 30 | categoryIndexMap, 31 | emojiLib, 32 | emojiArray 33 | } = require('./emoji-data/compiled'); 34 | 35 | const categoryIcon = { 36 | fue: props => , 37 | people: props => , 38 | animals_and_nature: props => ( 39 | 40 | ), 41 | food_and_drink: props => ( 42 | 43 | ), 44 | activity: props => ( 45 | 46 | ), 47 | travel_and_places: props => ( 48 | 49 | ), 50 | objects: props => ( 51 | 52 | ), 53 | symbols: props => , 54 | flags: props => 55 | }; 56 | 57 | const { width: WINDOW_WIDTH } = Dimensions.get('window'); 58 | 59 | const ViewTypes = { 60 | EMOJI: 0, 61 | CATEGORY: 1 62 | }; 63 | 64 | // fromCodePoint polyfill 65 | if (!String.fromCodePoint) { 66 | (function() { 67 | var defineProperty = (function() { 68 | // IE 8 only supports `Object.defineProperty` on DOM elements 69 | try { 70 | var object = {}; 71 | var $defineProperty = Object.defineProperty; 72 | var result = 73 | $defineProperty(object, object, object) && $defineProperty; 74 | } catch (error) {} 75 | return result; 76 | })(); 77 | var stringFromCharCode = String.fromCharCode; 78 | var floor = Math.floor; 79 | var fromCodePoint = function() { 80 | var MAX_SIZE = 0x4000; 81 | var codeUnits = []; 82 | var highSurrogate; 83 | var lowSurrogate; 84 | var index = -1; 85 | var length = arguments.length; 86 | if (!length) { 87 | return ''; 88 | } 89 | var result = ''; 90 | while (++index < length) { 91 | var codePoint = Number(arguments[index]); 92 | if ( 93 | !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` 94 | codePoint < 0 || // not a valid Unicode code point 95 | codePoint > 0x10ffff || // not a valid Unicode code point 96 | floor(codePoint) != codePoint // not an integer 97 | ) { 98 | throw RangeError('Invalid code point: ' + codePoint); 99 | } 100 | if (codePoint <= 0xffff) { 101 | // BMP code point 102 | codeUnits.push(codePoint); 103 | } else { 104 | // Astral code point; split in surrogate halves 105 | // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 106 | codePoint -= 0x10000; 107 | highSurrogate = (codePoint >> 10) + 0xd800; 108 | lowSurrogate = (codePoint % 0x400) + 0xdc00; 109 | codeUnits.push(highSurrogate, lowSurrogate); 110 | } 111 | if (index + 1 == length || codeUnits.length > MAX_SIZE) { 112 | result += stringFromCharCode.apply(null, codeUnits); 113 | codeUnits.length = 0; 114 | } 115 | } 116 | return result; 117 | }; 118 | if (defineProperty) { 119 | defineProperty(String, 'fromCodePoint', { 120 | value: fromCodePoint, 121 | configurable: true, 122 | writable: true 123 | }); 124 | } else { 125 | String.fromCodePoint = fromCodePoint; 126 | } 127 | })(); 128 | } 129 | 130 | class EmojiInput extends React.PureComponent { 131 | constructor(props) { 132 | super(props); 133 | 134 | if (this.props.enableFrequentlyUsedEmoji) this.getFrequentlyUsedEmoji(); 135 | 136 | this.emojiSize = _.floor(props.width / this.props.numColumns); 137 | 138 | this.emoji = []; 139 | 140 | this.loggingFunction = this.props.loggingFunction 141 | ? this.props.loggingFunction 142 | : null; 143 | 144 | this.verboseLoggingFunction = this.props.verboseLoggingFunction 145 | ? this.props.verboseLoggingFunction 146 | : false; 147 | 148 | let dataProvider = new DataProvider((e1, e2) => { 149 | return e1.char !== e2.char; 150 | }); 151 | 152 | this._layoutProvider = new LayoutProvider( 153 | index => 154 | _.has(this.emoji[index], 'categoryMarker') 155 | ? ViewTypes.CATEGORY 156 | : ViewTypes.EMOJI, 157 | (type, dim) => { 158 | switch (type) { 159 | case ViewTypes.CATEGORY: 160 | dim.height = this.props.categoryLabelHeight; 161 | dim.width = props.width; 162 | break; 163 | case ViewTypes.EMOJI: 164 | dim.height = dim.width = this.emojiSize; 165 | break; 166 | } 167 | } 168 | ); 169 | 170 | this._rowRenderer = this._rowRenderer.bind(this); 171 | this._isMounted = false; 172 | 173 | this.state = { 174 | dataProvider: dataProvider.cloneWithRows(this.emoji), 175 | currentCategoryKey: this.props.enableFrequentlyUsedEmoji 176 | ? category[0].key 177 | : category[1].key, 178 | searchQuery: '', 179 | emptySearchResult: false, 180 | frequentlyUsedEmoji: {}, 181 | previousLongestQuery: '', 182 | selectedEmoji: null, 183 | offsetY: 0 184 | }; 185 | } 186 | 187 | componentDidMount() { 188 | this._isMounted = true; 189 | this.search(); 190 | } 191 | 192 | componentDidUpdate(prevProps, prevStates) { 193 | if (this.props.resetSearch) { 194 | this.textInput.clear(); 195 | this.setState({ 196 | searchQuery: '' 197 | }); 198 | } 199 | if ( 200 | prevStates.searchQuery !== this.state.searchQuery || 201 | prevStates.frequentlyUsedEmoji !== this.state.frequentlyUsedEmoji 202 | ) { 203 | this.search(); 204 | } 205 | } 206 | 207 | componentWillUnmount() { 208 | this._isMounted = false; 209 | } 210 | 211 | getFrequentlyUsedEmoji = () => { 212 | AsyncStorage.getItem('@EmojiInput:frequentlyUsedEmoji').then( 213 | frequentlyUsedEmoji => { 214 | if (frequentlyUsedEmoji !== null) { 215 | frequentlyUsedEmoji = JSON.parse(frequentlyUsedEmoji); 216 | this.setState({ frequentlyUsedEmoji }); 217 | } 218 | } 219 | ); 220 | }; 221 | 222 | addFrequentlyUsedEmoji = data => { 223 | let emoji = data.key; 224 | let { frequentlyUsedEmoji } = this.state; 225 | if (_(frequentlyUsedEmoji).has(emoji)) { 226 | frequentlyUsedEmoji[emoji]++; 227 | } else { 228 | frequentlyUsedEmoji[emoji] = 1; 229 | } 230 | this.setState({ frequentlyUsedEmoji }); 231 | AsyncStorage.setItem( 232 | '@EmojiInput:frequentlyUsedEmoji', 233 | JSON.stringify(frequentlyUsedEmoji) 234 | ); 235 | }; 236 | 237 | clearFrequentlyUsedEmoji = () => { 238 | AsyncStorage.removeItem('@EmojiInput:frequentlyUsedEmoji'); 239 | }; 240 | 241 | search = () => { 242 | let query = this.state.searchQuery; 243 | this.setState({ emptySearchResult: false }); 244 | 245 | if (query) { 246 | let result = _(EmojiSearchSpace.search(query).slice(0,50)) // Only show top 50 relevant results 247 | .map(({ emoji_key }) => emojiLib[emoji_key]) // speeds up response time 248 | .value(); 249 | 250 | if (!result.length) { 251 | this.setState({ emptySearchResult: true }); 252 | if (this.loggingFunction) { 253 | if (this.verboseLoggingFunction) { 254 | this.loggingFunction(query, 'emptySearchResult'); 255 | } else { 256 | this.loggingFunction(query); 257 | } 258 | } 259 | } 260 | this.emojiRenderer(result); 261 | setTimeout(() => { 262 | if (this._isMounted) { 263 | this._recyclerListView._pendingScrollToOffset = null; 264 | this._recyclerListView.scrollToTop(false); 265 | } 266 | }, 15); 267 | } else { 268 | let fue = _(this.state.frequentlyUsedEmoji) 269 | .toPairs() 270 | .sortBy([1]) 271 | .reverse() 272 | .map(([key]) => key) 273 | .value(); 274 | fue = _(this.props.defaultFrequentlyUsedEmoji) 275 | .concat(fue) 276 | .take(this.props.numFrequentlyUsedEmoji) 277 | .value(); 278 | let _emoji = _(emojiLib) 279 | .pick(fue) 280 | .mapKeys((v, k) => `FUE_${k}`) 281 | .mapValues(v => ({ ...v, category: 'fue' })) 282 | .extend(emojiLib) 283 | .value(); 284 | this.emojiRenderer(_emoji); 285 | } 286 | }; 287 | 288 | emojiRenderer = emojis => { 289 | let dataProvider = new DataProvider((e1, e2) => { 290 | return e1.char !== e2.char; 291 | }); 292 | 293 | this.emoji = []; 294 | let categoryIndexMap = _(category) 295 | .map((v, idx) => ({ ...v, idx })) 296 | .keyBy('key') 297 | .value(); 298 | 299 | let tempEmoji = _ 300 | .range(_.size(category)) 301 | .map((v, k) => [ 302 | { char: category[k].key, categoryMarker: true, ...category[k] } 303 | ]); 304 | _(emojis) 305 | .values() 306 | .filter(emoji => _.every(this.props.filterFunctions, fn => fn(emoji))) 307 | .each(e => { 308 | if (_.has(categoryIndexMap, e.category)) { 309 | tempEmoji[categoryIndexMap[e.category].idx].push(e); 310 | } 311 | }); 312 | let accurateY = 0; 313 | let lastCount = 0; 314 | let s = 0; 315 | _(tempEmoji).each(v => { 316 | let idx = categoryIndexMap[v[0].key].idx; 317 | let c = category[idx]; 318 | 319 | c.idx = s; 320 | s = s + lastCount; 321 | 322 | c.y = 323 | _.ceil(lastCount / this.props.numColumns) * this.emojiSize + 324 | accurateY; 325 | accurateY = 326 | c.y + (_.size(v) === 1 ? 0 : this.props.categoryLabelHeight); 327 | 328 | lastCount = _.size(v) - 1; 329 | }); 330 | this.emoji = _(tempEmoji) 331 | .filter(c => c.length > 1) 332 | .flatten(tempEmoji) 333 | .value(); 334 | if ( 335 | !this.props.showCategoryTitleInSearchResults && 336 | this.state.searchQuery 337 | ) { 338 | this.emoji = _.filter(this.emoji, c => !c.categoryMarker); 339 | } 340 | 341 | _.reduce( 342 | this.emoji, 343 | ({ x, y, i, previousDimension }, emoji) => { 344 | const layoutType = this._layoutProvider.getLayoutTypeForIndex( 345 | i 346 | ); 347 | const dimension = { width: 0, height: 0 }; 348 | this._layoutProvider._setLayoutForType( 349 | layoutType, 350 | dimension, 351 | i 352 | ); 353 | 354 | x = x + dimension.width; 355 | if (x > this.props.width) { 356 | x = dimension.width; 357 | y = y + previousDimension.height; 358 | } 359 | 360 | emoji.y = y; 361 | emoji.x = x - dimension.width; 362 | 363 | return { x, y, i: i + 1, previousDimension: dimension }; 364 | }, 365 | { x: 0, y: 0, i: 0, previousDimension: null } 366 | ); 367 | this.setState({ 368 | dataProvider: dataProvider.cloneWithRows(this.emoji) 369 | }); 370 | }; 371 | 372 | _rowRenderer(type, data) { 373 | switch (type) { 374 | case ViewTypes.CATEGORY: 375 | return ( 376 | 382 | {data.title} 383 | 384 | ); 385 | case ViewTypes.EMOJI: 386 | return ( 387 | 393 | ); 394 | } 395 | } 396 | 397 | handleCategoryPress = key => { 398 | this._recyclerListView.scrollToOffset( 399 | 0, 400 | category[categoryIndexMap[key].idx].y + 1, 401 | false 402 | ); 403 | }; 404 | 405 | handleScroll = (rawEvent, offsetX, offsetY) => { 406 | let idx = _(category).findLastIndex(c => c.y < offsetY); 407 | if (idx < 0) idx = 0; 408 | this.setState({ 409 | currentCategoryKey: category[idx].key, 410 | selectedEmoji: null, 411 | offsetY 412 | }); 413 | }; 414 | 415 | handleEmojiPress = data => { 416 | this.props.onEmojiSelected(data); 417 | if (_.has(data, 'derivedFrom')) { 418 | data = data.derivedFrom; 419 | } 420 | if (this.props.enableFrequentlyUsedEmoji) 421 | this.addFrequentlyUsedEmoji(data); 422 | this.hideSkinSelector(); 423 | }; 424 | 425 | handleEmojiLongPress = data => { 426 | if (!_.has(data, ['lib', 'skin_variations'])) return; 427 | this.setState({ selectedEmoji: data }); 428 | }; 429 | 430 | hideSkinSelector = () => { 431 | this.setState({ selectedEmoji: null }); 432 | }; 433 | 434 | render() { 435 | const { selectedEmoji, offsetY } = this.state; 436 | const { enableSearch, width, renderAheadOffset } = this.props; 437 | return ( 438 | 446 | {enableSearch && ( 447 | { 449 | this.textInput = input; 450 | }} 451 | placeholderTextColor={'#A0A0A2'} 452 | style={{ 453 | backgroundColor: 'white', 454 | borderColor: '#A0A0A2', 455 | borderWidth: 0.5, 456 | color: 'black', 457 | fontSize: responsiveFontSize(2), 458 | padding: 10, 459 | paddingLeft: 15, 460 | borderRadius: 15, 461 | margin: 10, 462 | }} 463 | returnKeyType={'search'} 464 | clearButtonMode={'always'} 465 | placeholder={'Search emoji'} 466 | autoCorrect={false} 467 | onChangeText={text => { 468 | this.setState({ 469 | searchQuery: text 470 | }); 471 | if (text.length) { 472 | if ( 473 | text.length > 474 | this.state.previousLongestQuery.length 475 | ) { 476 | this.setState({ 477 | previousLongestQuery: text 478 | }); 479 | } 480 | } else { 481 | if (this.loggingFunction) { 482 | if (this.verboseLoggingFunction) { 483 | this.loggingFunction( 484 | this.state.previousLongestQuery, 485 | 'previousLongestQuery' 486 | ); 487 | } else { 488 | this.loggingFunction( 489 | this.state.previousLongestQuery 490 | ); 491 | } 492 | } 493 | this.setState({ 494 | previousLongestQuery: '' 495 | }); 496 | } 497 | }} 498 | /> 499 | )} 500 | {this.state.emptySearchResult && ( 501 | 502 | No search results. 503 | 504 | )} 505 | (this._recyclerListView = component)} 512 | onScroll={this.handleScroll} 513 | /> 514 | {!this.state.searchQuery && 515 | this.props.showCategoryTab && ( 516 | 517 | 518 | {_ 519 | .drop( 520 | category, 521 | this.props.enableFrequentlyUsedEmoji 522 | ? 0 523 | : 1 524 | ) 525 | .map(({ key }) => ( 526 | 529 | this.handleCategoryPress(key) 530 | } 531 | style={styles.categoryIconContainer} 532 | > 533 | 534 | {categoryIcon[key]({ 535 | color: 536 | key === 537 | this.state 538 | .currentCategoryKey 539 | ? this.props 540 | .categoryHighlightColor 541 | : this.props 542 | .categoryUnhighlightedColor, 543 | size: this.props 544 | .categoryFontSize 545 | })} 546 | 547 | 548 | ))} 549 | 550 | 551 | )} 552 | {selectedEmoji && ( 553 | 566 | 574 | {_(_.get(selectedEmoji, ['lib', 'skin_variations'])) 575 | .map(data => { 576 | return ( 577 | 581 | 589 | 590 | ); 591 | }) 592 | .value()} 593 | 594 | 605 | 611 | 612 | 613 | )} 614 | 615 | ); 616 | } 617 | } 618 | 619 | EmojiInput.defaultProps = { 620 | keyboardBackgroundColor: '#E3E1EC', 621 | width: WINDOW_WIDTH, 622 | numColumns: 6, 623 | 624 | showCategoryTab: true, 625 | showCategoryTitleInSearchResults: false, 626 | categoryUnhighlightedColor: 'lightgray', 627 | categoryHighlightColor: 'black', 628 | enableSearch: true, 629 | 630 | enableFrequentlyUsedEmoji: true, 631 | numFrequentlyUsedEmoji: 18, 632 | defaultFrequentlyUsedEmoji: [], 633 | 634 | categoryLabelHeight: 45, 635 | categoryLabelTextStyle: { 636 | fontSize: 25 637 | }, 638 | emojiFontSize: 40, 639 | categoryFontSize: 20, 640 | resetSearch: false, 641 | filterFunctions: [], 642 | renderAheadOffset: 1500 643 | }; 644 | 645 | EmojiInput.propTypes = { 646 | keyboardBackgroundColor: PropTypes.string, 647 | width: PropTypes.number, 648 | numColumns: PropTypes.number, 649 | emojiFontSize: PropTypes.number, 650 | 651 | onEmojiSelected: PropTypes.func.isRequired, 652 | 653 | showCategoryTab: PropTypes.bool, 654 | showCategoryTitleInSearchResults: PropTypes.bool, 655 | categoryFontSize: PropTypes.number, 656 | categoryUnhighlightedColor: PropTypes.string, 657 | categoryHighlightColor: PropTypes.string, 658 | categorySize: PropTypes.number, 659 | categoryLabelHeight: PropTypes.number, 660 | enableSearch: PropTypes.bool, 661 | categoryLabelTextStyle: PropTypes.object, 662 | 663 | enableFrequentlyUsedEmoji: PropTypes.bool, 664 | numFrequentlyUsedEmoji: PropTypes.number, 665 | defaultFrequentlyUsedEmoji: PropTypes.arrayOf(PropTypes.string), 666 | resetSearch: PropTypes.bool, 667 | filterFunctions: PropTypes.arrayOf(PropTypes.func), 668 | renderAheadOffset: PropTypes.number 669 | }; 670 | 671 | const styles = { 672 | cellContainer: { 673 | justifyContent: 'space-around', 674 | alignItems: 'center', 675 | flex: 1 676 | }, 677 | footerContainer: { 678 | width: '100%', 679 | paddingVertical: 15, 680 | backgroundColor: '#fff', 681 | flexDirection: 'row' 682 | }, 683 | emptySearchResultContainer: { 684 | flex: 1, 685 | alignItems: 'center', 686 | padding: 20 687 | }, 688 | emojiText: { 689 | color: 'black', 690 | fontWeight: 'bold' 691 | }, 692 | categoryText: { 693 | color: 'black', 694 | fontWeight: 'bold', 695 | paddingVertical: 15, 696 | paddingLeft: 10 697 | }, 698 | categoryIconContainer: { 699 | flex: 1, 700 | alignItems: 'center', 701 | justifyContent: 'space-around' 702 | }, 703 | skinSelectorContainer: { 704 | width: '100%', 705 | flex: 1, 706 | flexDirection: 'column', 707 | justifyContent: 'flex-start', 708 | position: 'absolute' 709 | }, 710 | skinSelector: { 711 | width: '100%', 712 | justifyContent: 'space-around', 713 | alignItems: 'center', 714 | flexDirection: 'row', 715 | backgroundColor: '#fff' 716 | }, 717 | skinSelectorTriangleContainer: { 718 | height: 20 719 | }, 720 | skinEmoji: { 721 | flex: 1 722 | } 723 | }; 724 | 725 | export default EmojiInput; 726 | -------------------------------------------------------------------------------- /src/EmojiSearch.js: -------------------------------------------------------------------------------- 1 | import Fuse from "fuse.js"; 2 | 3 | const { emojiArray } = require("./emoji-data/compiled"); 4 | 5 | const emojiSynonyms = require("./emoji-data/emojiSynonyms"); 6 | 7 | // Extend keywords using synonym JSON file 8 | for (let i = 0; i < emojiArray.length; i++) { 9 | emojiArray[i]["keywords"] = emojiArray[i]["keywords"].concat( 10 | emojiSynonyms[i]["keywords"] 11 | ); 12 | } 13 | 14 | const fuseOptions = { 15 | shouldSort: true, 16 | threshold: 0.0, // threshold of 0.0 is perfect match and 1.0 is any match 17 | keys: ["keywords"] 18 | }; 19 | 20 | const EmojiSearchSpace = new Fuse(emojiArray, fuseOptions); 21 | 22 | export default EmojiSearchSpace; 23 | -------------------------------------------------------------------------------- /src/emoji-data/duplicates.json: -------------------------------------------------------------------------------- 1 | [ 2 | "1F926", "1F937", "1F93C" 3 | ] -------------------------------------------------------------------------------- /src/emoji-data/index.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | import emoji from './emoji-data.json'; 3 | import emojiSynonyms from './emojiSynonyms.json'; 4 | import userInputEmojiSynonyms from './userInputtedSynonyms.json'; 5 | import duplicates from './duplicates.json'; 6 | 7 | const filteredEmoji = _.filter(emoji, e => !_.includes(duplicates, e.unified)); 8 | 9 | const categoryTitleToKey = { 10 | 'Frequently Used': 'fue', 11 | 'Smileys & People': 'people', 12 | 'Animals & Nature': 'animals_and_nature', 13 | 'Food & Drink': 'food_and_drink', 14 | Activities: 'activity', 15 | 'Travel & Places': 'travel_and_places', 16 | Objects: 'objects', 17 | Symbols: 'symbols', 18 | Flags: 'flags' 19 | }; 20 | 21 | let obsoletes = _(filteredEmoji) 22 | .filter('obsoletes') 23 | .map(v => v.obsoletes) 24 | .value(); 25 | 26 | // Adding in extra duplicates not marked in datasource 27 | obsoletes.push.apply(obsoletes, ['1F93D', '1F93E', '1F939', '1F938', '1F939']); 28 | 29 | let emojiLib = _(filteredEmoji) 30 | .filter(e => !obsoletes.includes(e.unified)) 31 | .sortBy('sort_order') 32 | .mapKeys(({ short_name }) => short_name) 33 | .mapValues((v, k) => ({ 34 | char: String.fromCodePoint.apply( 35 | null, 36 | v.unified.split('-').map(v => `0x${v}`) 37 | ), 38 | key: v.short_name, 39 | keywords: [v.short_name, v.name ? v.name : ''], 40 | category: categoryTitleToKey[v.category], 41 | lib: v 42 | })) 43 | .value(); 44 | 45 | const category = [ 46 | { 47 | key: 'fue', 48 | title: 'Frequently Used' 49 | }, 50 | { 51 | key: 'people', 52 | title: 'Smileys & People' 53 | }, 54 | { 55 | key: 'animals_and_nature', 56 | title: 'Animals & Nature' 57 | }, 58 | { 59 | key: 'food_and_drink', 60 | title: 'Food & Drink' 61 | }, 62 | { 63 | key: 'activity', 64 | title: 'Activities' 65 | }, 66 | { 67 | key: 'travel_and_places', 68 | title: 'Travel & Places' 69 | }, 70 | { 71 | key: 'objects', 72 | title: 'Objects' 73 | }, 74 | { 75 | key: 'symbols', 76 | title: 'Symbols' 77 | }, 78 | { 79 | key: 'flags', 80 | title: 'Flags' 81 | } 82 | ]; 83 | 84 | const categoryIndexMap = _(category) 85 | .map((v, idx) => ({ ...v, idx })) 86 | .keyBy('key') 87 | .value(); 88 | 89 | _.each(emojiSynonyms, (v, k) => { 90 | emojiSynonyms[k] = _.uniq( 91 | emojiSynonyms[k].concat(userInputEmojiSynonyms[k]) 92 | ); 93 | }); 94 | 95 | const emojiMap = _(emojiLib) 96 | .mapValues( 97 | (v, k) => 98 | k + 99 | ' ' + 100 | v.keywords.map(v => v.replace(/_/g, ' ')).join(' ') + 101 | (emojiSynonyms[k] || []).map(v => v.replace(/_/g, ' ')).join(' ') 102 | ) 103 | .invert() 104 | .value(); 105 | 106 | const emojiArray = _.keys(emojiMap); 107 | 108 | export { category, categoryIndexMap, emojiLib, emojiMap, emojiArray }; 109 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | ansi-escapes@^1.1.0: 6 | version "1.4.0" 7 | resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" 8 | 9 | ansi-regex@^2.0.0: 10 | version "2.1.1" 11 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 12 | 13 | ansi-regex@^3.0.0: 14 | version "3.0.0" 15 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 16 | 17 | ansi-styles@^2.2.1: 18 | version "2.2.1" 19 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" 20 | 21 | array-includes@^3.0.3: 22 | version "3.0.3" 23 | resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" 24 | dependencies: 25 | define-properties "^1.1.2" 26 | es-abstract "^1.7.0" 27 | 28 | asap@~2.0.3: 29 | version "2.0.6" 30 | resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" 31 | 32 | babel-polyfill@6.23.0: 33 | version "6.23.0" 34 | resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" 35 | dependencies: 36 | babel-runtime "^6.22.0" 37 | core-js "^2.4.0" 38 | regenerator-runtime "^0.10.0" 39 | 40 | babel-runtime@^6.22.0: 41 | version "6.26.0" 42 | resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" 43 | dependencies: 44 | core-js "^2.4.0" 45 | regenerator-runtime "^0.11.0" 46 | 47 | builtin-modules@^1.0.0: 48 | version "1.1.1" 49 | resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" 50 | 51 | camelcase@^4.1.0: 52 | version "4.1.0" 53 | resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" 54 | 55 | chalk@1.1.3, chalk@^1.0.0: 56 | version "1.1.3" 57 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" 58 | dependencies: 59 | ansi-styles "^2.2.1" 60 | escape-string-regexp "^1.0.2" 61 | has-ansi "^2.0.0" 62 | strip-ansi "^3.0.0" 63 | supports-color "^2.0.0" 64 | 65 | chardet@^0.4.0: 66 | version "0.4.2" 67 | resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" 68 | 69 | cli-cursor@^2.1.0: 70 | version "2.1.0" 71 | resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" 72 | dependencies: 73 | restore-cursor "^2.0.0" 74 | 75 | cli-width@^2.0.0: 76 | version "2.2.0" 77 | resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" 78 | 79 | cliui@^3.2.0: 80 | version "3.2.0" 81 | resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" 82 | dependencies: 83 | string-width "^1.0.1" 84 | strip-ansi "^3.0.1" 85 | wrap-ansi "^2.0.0" 86 | 87 | code-point-at@^1.0.0: 88 | version "1.1.0" 89 | resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" 90 | 91 | core-js@^1.0.0: 92 | version "1.2.7" 93 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" 94 | 95 | core-js@^2.4.0: 96 | version "2.5.3" 97 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" 98 | 99 | create-react-class@^15.6.0: 100 | version "15.6.3" 101 | resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" 102 | dependencies: 103 | fbjs "^0.8.9" 104 | loose-envify "^1.3.1" 105 | object-assign "^4.1.1" 106 | 107 | cross-spawn@^5.0.1: 108 | version "5.1.0" 109 | resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" 110 | dependencies: 111 | lru-cache "^4.0.1" 112 | shebang-command "^1.2.0" 113 | which "^1.2.9" 114 | 115 | decamelize@^1.1.1: 116 | version "1.2.0" 117 | resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" 118 | 119 | define-properties@^1.1.2: 120 | version "1.1.2" 121 | resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" 122 | dependencies: 123 | foreach "^2.0.5" 124 | object-keys "^1.0.8" 125 | 126 | doctrine@^2.0.2: 127 | version "2.1.0" 128 | resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" 129 | dependencies: 130 | esutils "^2.0.2" 131 | 132 | emoji-datasource-apple@^4.0.4: 133 | version "4.0.4" 134 | resolved "https://registry.yarnpkg.com/emoji-datasource-apple/-/emoji-datasource-apple-4.0.4.tgz#586048cf338623c1d64f41c0642cfb3f19552503" 135 | 136 | emoji-datasource@^4.0.4: 137 | version "4.0.4" 138 | resolved "https://registry.yarnpkg.com/emoji-datasource/-/emoji-datasource-4.0.4.tgz#516b9ab2f34569e468e4e3753a34a47a0b2b5aa3" 139 | 140 | encoding@^0.1.11: 141 | version "0.1.12" 142 | resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" 143 | dependencies: 144 | iconv-lite "~0.4.13" 145 | 146 | error-ex@^1.2.0: 147 | version "1.3.1" 148 | resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" 149 | dependencies: 150 | is-arrayish "^0.2.1" 151 | 152 | es-abstract@^1.7.0: 153 | version "1.11.0" 154 | resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.11.0.tgz#cce87d518f0496893b1a30cd8461835535480681" 155 | dependencies: 156 | es-to-primitive "^1.1.1" 157 | function-bind "^1.1.1" 158 | has "^1.0.1" 159 | is-callable "^1.1.3" 160 | is-regex "^1.0.4" 161 | 162 | es-to-primitive@^1.1.1: 163 | version "1.1.1" 164 | resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" 165 | dependencies: 166 | is-callable "^1.1.1" 167 | is-date-object "^1.0.1" 168 | is-symbol "^1.0.1" 169 | 170 | escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: 171 | version "1.0.5" 172 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 173 | 174 | eslint-plugin-react@^7.8.2: 175 | version "7.8.2" 176 | resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.8.2.tgz#e95c9c47fece55d2303d1a67c9d01b930b88a51d" 177 | dependencies: 178 | doctrine "^2.0.2" 179 | has "^1.0.1" 180 | jsx-ast-utils "^2.0.1" 181 | prop-types "^15.6.0" 182 | 183 | esutils@^2.0.2: 184 | version "2.0.2" 185 | resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" 186 | 187 | execa@^0.7.0: 188 | version "0.7.0" 189 | resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" 190 | dependencies: 191 | cross-spawn "^5.0.1" 192 | get-stream "^3.0.0" 193 | is-stream "^1.1.0" 194 | npm-run-path "^2.0.0" 195 | p-finally "^1.0.0" 196 | signal-exit "^3.0.0" 197 | strip-eof "^1.0.0" 198 | 199 | external-editor@^2.0.1: 200 | version "2.2.0" 201 | resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" 202 | dependencies: 203 | chardet "^0.4.0" 204 | iconv-lite "^0.4.17" 205 | tmp "^0.0.33" 206 | 207 | fbjs@^0.8.16, fbjs@^0.8.9: 208 | version "0.8.16" 209 | resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" 210 | dependencies: 211 | core-js "^1.0.0" 212 | isomorphic-fetch "^2.1.1" 213 | loose-envify "^1.0.0" 214 | object-assign "^4.1.0" 215 | promise "^7.1.1" 216 | setimmediate "^1.0.5" 217 | ua-parser-js "^0.7.9" 218 | 219 | figures@^2.0.0: 220 | version "2.0.0" 221 | resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" 222 | dependencies: 223 | escape-string-regexp "^1.0.5" 224 | 225 | find-up@^2.0.0: 226 | version "2.1.0" 227 | resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" 228 | dependencies: 229 | locate-path "^2.0.0" 230 | 231 | foreach@^2.0.5: 232 | version "2.0.5" 233 | resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" 234 | 235 | function-bind@^1.0.2, function-bind@^1.1.1: 236 | version "1.1.1" 237 | resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" 238 | 239 | get-caller-file@^1.0.1: 240 | version "1.0.2" 241 | resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" 242 | 243 | get-stream@^3.0.0: 244 | version "3.0.0" 245 | resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" 246 | 247 | graceful-fs@^4.1.2: 248 | version "4.1.11" 249 | resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" 250 | 251 | has-ansi@^2.0.0: 252 | version "2.0.0" 253 | resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" 254 | dependencies: 255 | ansi-regex "^2.0.0" 256 | 257 | has@^1.0.1: 258 | version "1.0.1" 259 | resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" 260 | dependencies: 261 | function-bind "^1.0.2" 262 | 263 | hosted-git-info@^2.1.4: 264 | version "2.5.0" 265 | resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" 266 | 267 | iconv-lite@^0.4.17, iconv-lite@~0.4.13: 268 | version "0.4.19" 269 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" 270 | 271 | inquirer@3.0.6: 272 | version "3.0.6" 273 | resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.0.6.tgz#e04aaa9d05b7a3cb9b0f407d04375f0447190347" 274 | dependencies: 275 | ansi-escapes "^1.1.0" 276 | chalk "^1.0.0" 277 | cli-cursor "^2.1.0" 278 | cli-width "^2.0.0" 279 | external-editor "^2.0.1" 280 | figures "^2.0.0" 281 | lodash "^4.3.0" 282 | mute-stream "0.0.7" 283 | run-async "^2.2.0" 284 | rx "^4.1.0" 285 | string-width "^2.0.0" 286 | strip-ansi "^3.0.0" 287 | through "^2.3.6" 288 | 289 | invert-kv@^1.0.0: 290 | version "1.0.0" 291 | resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" 292 | 293 | is-arrayish@^0.2.1: 294 | version "0.2.1" 295 | resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" 296 | 297 | is-builtin-module@^1.0.0: 298 | version "1.0.0" 299 | resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" 300 | dependencies: 301 | builtin-modules "^1.0.0" 302 | 303 | is-callable@^1.1.1, is-callable@^1.1.3: 304 | version "1.1.3" 305 | resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" 306 | 307 | is-date-object@^1.0.1: 308 | version "1.0.1" 309 | resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" 310 | 311 | is-fullwidth-code-point@^1.0.0: 312 | version "1.0.0" 313 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" 314 | dependencies: 315 | number-is-nan "^1.0.0" 316 | 317 | is-fullwidth-code-point@^2.0.0: 318 | version "2.0.0" 319 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" 320 | 321 | is-promise@^2.1.0: 322 | version "2.1.0" 323 | resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" 324 | 325 | is-regex@^1.0.4: 326 | version "1.0.4" 327 | resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" 328 | dependencies: 329 | has "^1.0.1" 330 | 331 | is-stream@^1.0.1, is-stream@^1.1.0: 332 | version "1.1.0" 333 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 334 | 335 | is-symbol@^1.0.1: 336 | version "1.0.1" 337 | resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" 338 | 339 | isexe@^2.0.0: 340 | version "2.0.0" 341 | resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" 342 | 343 | isomorphic-fetch@^2.1.1: 344 | version "2.2.1" 345 | resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" 346 | dependencies: 347 | node-fetch "^1.0.1" 348 | whatwg-fetch ">=0.10.0" 349 | 350 | js-tokens@^3.0.0: 351 | version "3.0.2" 352 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" 353 | 354 | jsx-ast-utils@^2.0.1: 355 | version "2.0.1" 356 | resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" 357 | dependencies: 358 | array-includes "^3.0.3" 359 | 360 | lcid@^1.0.0: 361 | version "1.0.0" 362 | resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" 363 | dependencies: 364 | invert-kv "^1.0.0" 365 | 366 | load-json-file@^2.0.0: 367 | version "2.0.0" 368 | resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" 369 | dependencies: 370 | graceful-fs "^4.1.2" 371 | parse-json "^2.2.0" 372 | pify "^2.0.0" 373 | strip-bom "^3.0.0" 374 | 375 | locate-path@^2.0.0: 376 | version "2.0.0" 377 | resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" 378 | dependencies: 379 | p-locate "^2.0.0" 380 | path-exists "^3.0.0" 381 | 382 | lodash-es@4.17.4: 383 | version "4.17.4" 384 | resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7" 385 | 386 | lodash.isempty@^4.4.0: 387 | version "4.4.0" 388 | resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e" 389 | 390 | lodash.times@^4.3.2: 391 | version "4.3.2" 392 | resolved "https://registry.yarnpkg.com/lodash.times/-/lodash.times-4.3.2.tgz#3e1f2565c431754d54ab57f2ed1741939285ca1d" 393 | 394 | lodash@^4.0.0, lodash@^4.17.5: 395 | version "4.17.10" 396 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" 397 | 398 | lodash@^4.3.0: 399 | version "4.17.5" 400 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" 401 | 402 | loose-envify@^1.0.0, loose-envify@^1.3.1: 403 | version "1.3.1" 404 | resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" 405 | dependencies: 406 | js-tokens "^3.0.0" 407 | 408 | lru-cache@^4.0.1: 409 | version "4.1.1" 410 | resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" 411 | dependencies: 412 | pseudomap "^1.0.2" 413 | yallist "^2.1.2" 414 | 415 | mem@^1.1.0: 416 | version "1.1.0" 417 | resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" 418 | dependencies: 419 | mimic-fn "^1.0.0" 420 | 421 | mimic-fn@^1.0.0: 422 | version "1.2.0" 423 | resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" 424 | 425 | minimist@1.2.0: 426 | version "1.2.0" 427 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 428 | 429 | mute-stream@0.0.7: 430 | version "0.0.7" 431 | resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" 432 | 433 | node-fetch@1.6.3: 434 | version "1.6.3" 435 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" 436 | dependencies: 437 | encoding "^0.1.11" 438 | is-stream "^1.0.1" 439 | 440 | node-fetch@^1.0.1: 441 | version "1.7.3" 442 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" 443 | dependencies: 444 | encoding "^0.1.11" 445 | is-stream "^1.0.1" 446 | 447 | normalize-package-data@^2.3.2: 448 | version "2.4.0" 449 | resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" 450 | dependencies: 451 | hosted-git-info "^2.1.4" 452 | is-builtin-module "^1.0.0" 453 | semver "2 || 3 || 4 || 5" 454 | validate-npm-package-license "^3.0.1" 455 | 456 | npm-run-path@^2.0.0: 457 | version "2.0.2" 458 | resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" 459 | dependencies: 460 | path-key "^2.0.0" 461 | 462 | number-is-nan@^1.0.0: 463 | version "1.0.1" 464 | resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" 465 | 466 | object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: 467 | version "4.1.1" 468 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 469 | 470 | object-keys@^1.0.8: 471 | version "1.0.11" 472 | resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" 473 | 474 | onetime@^2.0.0: 475 | version "2.0.1" 476 | resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" 477 | dependencies: 478 | mimic-fn "^1.0.0" 479 | 480 | opencollective@^1.0.3: 481 | version "1.0.3" 482 | resolved "https://registry.yarnpkg.com/opencollective/-/opencollective-1.0.3.tgz#aee6372bc28144583690c3ca8daecfc120dd0ef1" 483 | dependencies: 484 | babel-polyfill "6.23.0" 485 | chalk "1.1.3" 486 | inquirer "3.0.6" 487 | minimist "1.2.0" 488 | node-fetch "1.6.3" 489 | opn "4.0.2" 490 | 491 | opn@4.0.2: 492 | version "4.0.2" 493 | resolved "https://registry.yarnpkg.com/opn/-/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95" 494 | dependencies: 495 | object-assign "^4.0.1" 496 | pinkie-promise "^2.0.0" 497 | 498 | os-locale@^2.0.0: 499 | version "2.1.0" 500 | resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" 501 | dependencies: 502 | execa "^0.7.0" 503 | lcid "^1.0.0" 504 | mem "^1.1.0" 505 | 506 | os-tmpdir@~1.0.2: 507 | version "1.0.2" 508 | resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" 509 | 510 | p-finally@^1.0.0: 511 | version "1.0.0" 512 | resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" 513 | 514 | p-limit@^1.1.0: 515 | version "1.2.0" 516 | resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" 517 | dependencies: 518 | p-try "^1.0.0" 519 | 520 | p-locate@^2.0.0: 521 | version "2.0.0" 522 | resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" 523 | dependencies: 524 | p-limit "^1.1.0" 525 | 526 | p-try@^1.0.0: 527 | version "1.0.0" 528 | resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" 529 | 530 | parse-json@^2.2.0: 531 | version "2.2.0" 532 | resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" 533 | dependencies: 534 | error-ex "^1.2.0" 535 | 536 | path-exists@^3.0.0: 537 | version "3.0.0" 538 | resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" 539 | 540 | path-key@^2.0.0: 541 | version "2.0.1" 542 | resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" 543 | 544 | path-type@^2.0.0: 545 | version "2.0.0" 546 | resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" 547 | dependencies: 548 | pify "^2.0.0" 549 | 550 | pify@^2.0.0: 551 | version "2.3.0" 552 | resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" 553 | 554 | pinkie-promise@^2.0.0: 555 | version "2.0.1" 556 | resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" 557 | dependencies: 558 | pinkie "^2.0.0" 559 | 560 | pinkie@^2.0.0: 561 | version "2.0.4" 562 | resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" 563 | 564 | promise@^7.1.1: 565 | version "7.3.1" 566 | resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" 567 | dependencies: 568 | asap "~2.0.3" 569 | 570 | prop-types@15.5.8: 571 | version "15.5.8" 572 | resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" 573 | dependencies: 574 | fbjs "^0.8.9" 575 | 576 | prop-types@^15.5.10: 577 | version "15.6.1" 578 | resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" 579 | dependencies: 580 | fbjs "^0.8.16" 581 | loose-envify "^1.3.1" 582 | object-assign "^4.1.1" 583 | 584 | prop-types@^15.5.8, prop-types@^15.6.0: 585 | version "15.6.0" 586 | resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" 587 | dependencies: 588 | fbjs "^0.8.16" 589 | loose-envify "^1.3.1" 590 | object-assign "^4.1.1" 591 | 592 | pseudomap@^1.0.2: 593 | version "1.0.2" 594 | resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" 595 | 596 | react-native-animatable@^1.3.0: 597 | version "1.3.0" 598 | resolved "https://registry.yarnpkg.com/react-native-animatable/-/react-native-animatable-1.3.0.tgz#b5c3940fc758cfd9b2fe54613a457c4b6962b46e" 599 | dependencies: 600 | prop-types "^15.5.10" 601 | 602 | react-native-elements@^0.19.0: 603 | version "0.19.1" 604 | resolved "https://registry.yarnpkg.com/react-native-elements/-/react-native-elements-0.19.1.tgz#f92b69d864a150215d01f81fe3c52a9cada83e45" 605 | dependencies: 606 | lodash.isempty "^4.4.0" 607 | lodash.times "^4.3.2" 608 | opencollective "^1.0.3" 609 | prop-types "^15.5.8" 610 | 611 | react-native-responsive-dimensions@^1.0.2: 612 | version "1.0.2" 613 | resolved "https://registry.yarnpkg.com/react-native-responsive-dimensions/-/react-native-responsive-dimensions-1.0.2.tgz#521551fa90548f888578eafd71101d19061727ac" 614 | 615 | react-native-triangle@^0.0.9: 616 | version "0.0.9" 617 | resolved "https://registry.yarnpkg.com/react-native-triangle/-/react-native-triangle-0.0.9.tgz#53e804019477f757208da6c5977fc8695f49d4c8" 618 | dependencies: 619 | create-react-class "^15.6.0" 620 | prop-types "^15.5.10" 621 | 622 | react-native-vector-icons@^4.5.0: 623 | version "4.6.0" 624 | resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-4.6.0.tgz#e4014311ffa6de397d914ffc31b7097a874cc8d5" 625 | dependencies: 626 | lodash "^4.0.0" 627 | prop-types "^15.5.10" 628 | yargs "^8.0.2" 629 | 630 | read-pkg-up@^2.0.0: 631 | version "2.0.0" 632 | resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" 633 | dependencies: 634 | find-up "^2.0.0" 635 | read-pkg "^2.0.0" 636 | 637 | read-pkg@^2.0.0: 638 | version "2.0.0" 639 | resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" 640 | dependencies: 641 | load-json-file "^2.0.0" 642 | normalize-package-data "^2.3.2" 643 | path-type "^2.0.0" 644 | 645 | recyclerlistview@^1.3.4: 646 | version "1.3.4" 647 | resolved "https://registry.yarnpkg.com/recyclerlistview/-/recyclerlistview-1.3.4.tgz#4c0e57d19d5480d3c4e7e5abc45b23ca7ce09a5f" 648 | dependencies: 649 | lodash-es "4.17.4" 650 | prop-types "15.5.8" 651 | ts-object-utils "0.0.5" 652 | 653 | regenerator-runtime@^0.10.0: 654 | version "0.10.5" 655 | resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" 656 | 657 | regenerator-runtime@^0.11.0: 658 | version "0.11.1" 659 | resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" 660 | 661 | require-directory@^2.1.1: 662 | version "2.1.1" 663 | resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" 664 | 665 | require-main-filename@^1.0.1: 666 | version "1.0.1" 667 | resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" 668 | 669 | restore-cursor@^2.0.0: 670 | version "2.0.0" 671 | resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" 672 | dependencies: 673 | onetime "^2.0.0" 674 | signal-exit "^3.0.2" 675 | 676 | run-async@^2.2.0: 677 | version "2.3.0" 678 | resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" 679 | dependencies: 680 | is-promise "^2.1.0" 681 | 682 | rx@^4.1.0: 683 | version "4.1.0" 684 | resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" 685 | 686 | "semver@2 || 3 || 4 || 5": 687 | version "5.5.0" 688 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" 689 | 690 | set-blocking@^2.0.0: 691 | version "2.0.0" 692 | resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" 693 | 694 | setimmediate@^1.0.5: 695 | version "1.0.5" 696 | resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" 697 | 698 | shebang-command@^1.2.0: 699 | version "1.2.0" 700 | resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" 701 | dependencies: 702 | shebang-regex "^1.0.0" 703 | 704 | shebang-regex@^1.0.0: 705 | version "1.0.0" 706 | resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" 707 | 708 | signal-exit@^3.0.0, signal-exit@^3.0.2: 709 | version "3.0.2" 710 | resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" 711 | 712 | spdx-correct@~1.0.0: 713 | version "1.0.2" 714 | resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" 715 | dependencies: 716 | spdx-license-ids "^1.0.2" 717 | 718 | spdx-expression-parse@~1.0.0: 719 | version "1.0.4" 720 | resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" 721 | 722 | spdx-license-ids@^1.0.2: 723 | version "1.2.2" 724 | resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" 725 | 726 | string-width@^1.0.1: 727 | version "1.0.2" 728 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" 729 | dependencies: 730 | code-point-at "^1.0.0" 731 | is-fullwidth-code-point "^1.0.0" 732 | strip-ansi "^3.0.0" 733 | 734 | string-width@^2.0.0: 735 | version "2.1.1" 736 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" 737 | dependencies: 738 | is-fullwidth-code-point "^2.0.0" 739 | strip-ansi "^4.0.0" 740 | 741 | strip-ansi@^3.0.0, strip-ansi@^3.0.1: 742 | version "3.0.1" 743 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 744 | dependencies: 745 | ansi-regex "^2.0.0" 746 | 747 | strip-ansi@^4.0.0: 748 | version "4.0.0" 749 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" 750 | dependencies: 751 | ansi-regex "^3.0.0" 752 | 753 | strip-bom@^3.0.0: 754 | version "3.0.0" 755 | resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" 756 | 757 | strip-eof@^1.0.0: 758 | version "1.0.0" 759 | resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" 760 | 761 | supports-color@^2.0.0: 762 | version "2.0.0" 763 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" 764 | 765 | through@^2.3.6: 766 | version "2.3.8" 767 | resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" 768 | 769 | tmp@^0.0.33: 770 | version "0.0.33" 771 | resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" 772 | dependencies: 773 | os-tmpdir "~1.0.2" 774 | 775 | ts-object-utils@0.0.5: 776 | version "0.0.5" 777 | resolved "https://registry.yarnpkg.com/ts-object-utils/-/ts-object-utils-0.0.5.tgz#95361cdecd7e52167cfc5e634c76345e90a26077" 778 | 779 | ua-parser-js@^0.7.9: 780 | version "0.7.17" 781 | resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" 782 | 783 | validate-npm-package-license@^3.0.1: 784 | version "3.0.1" 785 | resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" 786 | dependencies: 787 | spdx-correct "~1.0.0" 788 | spdx-expression-parse "~1.0.0" 789 | 790 | wade@^0.3.3: 791 | version "0.3.3" 792 | resolved "https://registry.yarnpkg.com/wade/-/wade-0.3.3.tgz#0b3099d67646336706224b4122dd286a4f4d2ce2" 793 | 794 | whatwg-fetch@>=0.10.0: 795 | version "2.0.3" 796 | resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" 797 | 798 | which-module@^2.0.0: 799 | version "2.0.0" 800 | resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" 801 | 802 | which@^1.2.9: 803 | version "1.3.0" 804 | resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" 805 | dependencies: 806 | isexe "^2.0.0" 807 | 808 | wrap-ansi@^2.0.0: 809 | version "2.1.0" 810 | resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" 811 | dependencies: 812 | string-width "^1.0.1" 813 | strip-ansi "^3.0.1" 814 | 815 | y18n@^3.2.1: 816 | version "3.2.1" 817 | resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" 818 | 819 | yallist@^2.1.2: 820 | version "2.1.2" 821 | resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" 822 | 823 | yargs-parser@^7.0.0: 824 | version "7.0.0" 825 | resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" 826 | dependencies: 827 | camelcase "^4.1.0" 828 | 829 | yargs@^8.0.2: 830 | version "8.0.2" 831 | resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" 832 | dependencies: 833 | camelcase "^4.1.0" 834 | cliui "^3.2.0" 835 | decamelize "^1.1.1" 836 | get-caller-file "^1.0.1" 837 | os-locale "^2.0.0" 838 | read-pkg-up "^2.0.0" 839 | require-directory "^2.1.1" 840 | require-main-filename "^1.0.1" 841 | set-blocking "^2.0.0" 842 | string-width "^2.0.0" 843 | which-module "^2.0.0" 844 | y18n "^3.2.1" 845 | yargs-parser "^7.0.0" 846 | --------------------------------------------------------------------------------