-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Upgrade to Emoji-Mart v5 #128
base: main
Are you sure you want to change the base?
Conversation
src/popup/module/EmojiPicker.js
Outdated
@@ -5,6 +5,8 @@ | |||
*/ | |||
|
|||
import * as EmojiSelect from "./EmojiSelect.js"; | |||
import data from "/node_modules/@emoji-mart/data"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem in the official guide was that this is not an ECMAstandard apparently. This here should load a combined JSON, but dpoes not work in Firefox like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why I now tried using the unpkg version, but it did not work in my testing before, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, one cannot yet import JSON files as a module (see here). I believe the solution would be to remove this line and then use a hack like this below:
const emojiPicker = new EmojiMart.Picker({ ...initProperties, data: async () => {
const response = await fetch(browser.runtime.getURL("/node_modules/@emoji-mart/data/sets/14/native.json"));
return response.json();
}});
"homepage": "https://github.com/rugk/awesome-emoji-picker#readme", | ||
"dependencies": { | ||
"@emoji-mart/data": "^1.0.1", | ||
"emoji-mart": "^5.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Update to emoji-mart v5.1.0
} | ||
|
||
console.log(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: rmeove when finished ebugging :O
Attention: This is a draft and does not work yet.
Fixes #116
FYI @tdulcet sorry and thanks for making me aware of the priority here (keep doing that), I already had a branch in progress, so I just created this draft PR. It does not wokr and I got stuck though, see below.