Giter Club home page Giter Club logo

emoji-mart-embed's Introduction

Archived: The maintainance of this stopped. Emoji-mart itself now has/is a pure JS/CSS solution that can be embedded, so this is no longer needed.

emoji-mart-embed

Node CI

Provides emoji-mart, so it can be used in plain JavaScript. This uses remount and preact.

In the end, you just have a custom element:

<emoji-picker></emoji-picker>

Building

npm install
npm run build

For your convenience, the finished files are written into the dist dir. All Emoji JSON data is included in the JS, and there is also the CSS file.

To generate a file of all used licenses of the dependencies, do run:

npm install npm-license-text
npx npm-license-text . THIRD_PARTY_LICENSES.md

Usage

Include the JS and CSS.

EmojiPicker

Then, you can define the emoji-mart EmojiPicker like this:

window.emojiMart.definePicker("emoji-picker", {
     native: true,
     emojiTooltip: true,
});

You can pass in a JSON, which is directly passed to the picker of emoji-mart (only some little defaults are provided).

Afterwards, you can create the HTML custom element:

const picker = document.createElement("emoji-picker");
document.body.appendChild(picker);

Headless search

As with upstream you can use the emoji-index. Just use window.emojiMart.emojiIndex instead.

Get emoji data from Native

Basically the same as the upstream project, just use window.emojiMart.getEmojiDataFromNative instead.

TODO: Needs testing!

Storage

It also exposes the storage of emoji-mart, so you can use it in the same way as the original docs:

window.emojiMart.setDataStore("emoji-picker", {
    getter: (key) => {
        // Get from your own storage (sync)
    },

    setter: (key, value) => {
        // Persist in your own storage (can be async)
    }
});

Credits

Loosely based on https://github.com/nolanlawson/emoji-mart-outside-react, so thanks to @nolanlawson.

emoji-mart-embed's People

Contributors

dependabot[bot] avatar rugk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gaplo917 ilkkah

emoji-mart-embed's Issues

Some license stuff executed at npm install

v1.1 of Awesome Emoji Picker shipped with this source code of this module:

awesome-emoji-picker-1.1-src.zip

Problem

On a clean clone

npm install resulted in this log:

 npm install 
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/remount-e22ca2ce/dist/remount.es5.js'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/remount-e22ca2ce/dist/remount.es5.min.js'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/npm-license-text-f14457a0/tsconfig.json'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/remount-e22ca2ce/dist/remount.es6.js'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/npm-license-text-f14457a0/tslint.json'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/bluebird-a16a1a3d/js/browser/bluebird.min.js'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/remount-e22ca2ce/dist/remount.es6.min.js'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/remount-e22ca2ce/dist/remount.esm.min.mjs'
npm WARN tar ENOENT: no such file or directory, open '/home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/node_modules/.staging/remount-e22ca2ce/dist/remount.esm.mjs'
npm WARN [email protected] No repository field.

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://github.com/mwittig/license-checker.git
npm ERR! 
npm ERR! fatal: Kein Git-Repository: /home/dev/Downloads/awesome-emoji-picker-1.1-src/emoji-mart-embed/../../../../.git/modules/src/popup/lib/awesome-emoji-emoji-mart-embed
npm ERR! 
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dev/.npm/_logs/2019-09-07T15_50_53_991Z-debug.log

Cause

Some license-checker npm module seems to do crazy stuff when being installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.