Comments (6)
There isn’t a direct way to get it, since it’s always dynamic and depends on a few props (emoji.js#L126), but tenically one could:
Emoji.defaultProps.backgroundImageFn(
Emoji.defaultProps.set, // apple
Emoji.defaultProps.sheetSize // 64
)
That function returns the sheet URL used. EmojiMart uses spritesheets provided by https://github.com/iamcal/emoji-data, so all emojis have the same URL. Is that what you wanted, or were you looking for a distinct URL per emoji to use in a <img>
element?
from emoji-mart.
Hi @EtienneLem,
Thanks for the super fast response!
I'm specifically looking for the unique URL's/filenames for the Twemoji set, as the backend I'm integrating with requires the direct URL to the emoji.
Looking at emoji-data
's example in https://github.com/iamcal/emoji-data/blob/master/README.md, the image
value is what I'm looking for (since that appears to reference https://github.com/twitter/twemoji/blob/gh-pages/36x36/261d.png)
I suppose I could find the right image via emoji-data
, but it would be helpful to avoid another direct dependency.
Thanks again for your time, and hard work!
from emoji-mart.
I see. What EmojiMart could do is at least return the unified
value in the click callback, so you could then easily construct a URL that you could store on your backend.
I would suggest using https://rawgit.com (unless you’re hosting all emoji images yourself?). For example: https://cdn.rawgit.com/iamcal/emoji-data/v2.4.4/img-twitter-64/261d.png or https://cdn.rawgit.com/twitter/twemoji/gh-pages/36x36/261d.png
261d
would be the new value added in the onClick
callback and it would be up to you to “figure out” an absolute URL that points to that emoji (cdn, self-hosted, etc.)
Would that work for you?
from emoji-mart.
261d
would be the new value added in theonClick
callback and it would be up to you to “figure out” an absolute URL that points to that emoji (cdn, self-hosted, etc.)
Yes, that would be perfect! 😍
from emoji-mart.
There you go! Available in v0.4.4
.
As a FYI:
Some emojis (i.e. the :point-up:
), will have -fe0f
at the end of the unified
value, but the images in both emoji-data
and Twemoji
don’t. That’s because these emojis sort of exist under 2 different forms:
EmojiMart will return 261d-fe0f
because that’s the codePoint needed to reconstruct the native emoji. However in your case, I think it’d be safe to always unified.replace(/-fe0f$/, '')
before storing in your backend.
from emoji-mart.
Thank you very much, @EtienneLem :)
from emoji-mart.
Related Issues (20)
- Question: Using twitter SVG
- Supporting multi skin tone handshakes
- What font is used? HOT 1
- Emoji Rendering issue
- Set twitter is not working in any lib version HOT 1
- Svelte Integration
- How does onEmojiSelect work with the custom emojis?
- Ability to specify the initial category
- Skin tone button does not work (React)? HOT 3
- allow escape listeners
- A11Y: various issues HOT 2
- Previous version Emoji picker are breaking due to new data.json HOT 1
- Error using emoji-mart Picker in Chrome Extension HOT 1
- There is an expression that displays abnormally
- onClickOutside is called even when user clicks inside Picker
- Feature Request: quick reactions picker HOT 1
- How to use .update method ?
- do you have a tool to create the dataset out of the official annonations?
- Optional chaining in distributed code breaks webpack 4
- A form field element has neither an id nor a name attribute
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emoji-mart.