Skip to content

Commit

Permalink
Convert emoji-emojione to main module structure (#12605)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored and rodrigok committed Nov 16, 2018
1 parent aea5d62 commit 12103a2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 2 additions & 0 deletions packages/rocketchat-emoji-emojione/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './sprites.css';
import '../lib/rocketchat';
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* globals emojisByCategory:true, emojiCategories:true, toneList:true */

/*
* Mapping category hashes into human readable and translated names
*/
emojiCategories = {
export const emojiCategories = {
people: 'Smileys_and_People',
nature: 'Animals_and_Nature',
food: 'Food_and_Drink',
Expand All @@ -14,7 +12,7 @@ emojiCategories = {
flags: 'Flags',
};

toneList = {
export const toneList = {
raised_hands: 1,
clap: 1,
wave: 1,
Expand Down Expand Up @@ -101,7 +99,7 @@ toneList = {
juggling: 1,
};

emojisByCategory = {
export const emojisByCategory = {
people: [
'grinning',
'grimacing',
Expand Down Expand Up @@ -1525,5 +1523,3 @@ emojisByCategory = {
'flag_mf',
],
};

/* exported emojisByCategory, emojiCategories, toneList */
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
// emoji.json from [email protected]
import fs from 'fs';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* globals emojione, emojisByCategory, emojiCategories, toneList */
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { RocketChat } from 'meteor/rocketchat:lib';
import { emojione } from 'meteor/emojione:emojione';
import { emojisByCategory, emojiCategories, toneList } from './emojiPicker';

RocketChat.emoji.packages.emojione = emojione;
RocketChat.emoji.packages.emojione.imageType = 'png';
Expand Down
8 changes: 2 additions & 6 deletions packages/rocketchat-emoji-emojione/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ Package.onUse(function(api) {
'rocketchat:lib',
]);

api.addFiles('emojiPicker.js');

api.addFiles('rocketchat.js');

api.addFiles('client/sprites.css', 'client');
api.addFiles('server/callbacks.js', 'server');
api.mainModule('client/index.js', 'client');
api.mainModule('server/index.js', 'server');
});
3 changes: 2 additions & 1 deletion packages/rocketchat-emoji-emojione/server/callbacks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* globals emojione */
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { emojione } from 'meteor/emojione:emojione';

Meteor.startup(function() {
RocketChat.callbacks.add('beforeSendMessageNotifications', (message) => emojione.shortnameToUnicode(message));
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-emoji-emojione/server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '../lib/rocketchat';
import './callbacks';

0 comments on commit 12103a2

Please sign in to comment.