Skip to content

Commit 2d4346c

Browse files
committed
Use updated regex from joypixels/emojione#507
1 parent 58a3d01 commit 2d4346c

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

draft-js-emoji-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "draft-js-emoji-bump",
3-
"version": "2.2.0",
3+
"version": "2.2.16",
44
"description": "Emoji Plugin for DraftJS",
55
"author": {
66
"name": "Nik Graf",

draft-js-emoji-plugin/src/components/Emoji/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Emoji = ({ theme = {}, cacheBustParam, imagePath, imageType, className, de
1616
);
1717
} else {
1818
// short name to image url code steal from emojione source code
19-
const codepointsForImage = emojione.emojioneList[shortName].fname;
19+
const codepointsForImage = emojione.emojioneList[shortName].uc_base;
2020
const backgroundImage = `url(${imagePath}${codepointsForImage}.${imageType}${cacheBustParam})`;
2121
const combinedClassName = unionClassNames(theme.emoji, className);
2222

draft-js-emoji-plugin/src/components/EmojiSelect/Popover/Entry/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class Entry extends Component {
6666
emojiDisplay = convertShortNameToUnicode(unicode);
6767
} else {
6868
// short name to image url code steal from emojione source code
69-
const codePointsForImage = emojione.emojioneList[emoji].fname;
69+
const codePointsForImage = emojione.emojioneList[emoji].uc_base;
7070
const fullImagePath = `${imagePath}${codePointsForImage}.${imageType}${cacheBustParam}`;
7171
emojiDisplay = (
7272
<img

draft-js-emoji-plugin/src/components/EmojiSuggestions/Entry/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class Entry extends Component {
4545
emojiDisplay = convertShortNameToUnicode(unicode);
4646
} else {
4747
// short name to image url code steal from emojione source code
48-
const codePointsForImage = emojione.emojioneList[this.props.emoji].fname;
48+
const codePointsForImage = emojione.emojioneList[this.props.emoji].uc_base;
4949
const fullImagePath = `${imagePath}${codePointsForImage}.${imageType}${cacheBustParam}`;
5050
emojiDisplay = (
5151
<img

draft-js-emoji-plugin/src/emojiStrategy.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import findWithRegex from 'find-with-regex';
2-
import emojione from 'emojione';
3-
4-
const unicodeRegex = emojione.regUnicode;
2+
import unicodeRegex from './utils/emojiUnicodeRegex';
53

64
export default (contentBlock: Object, callback: Function) => {
75
findWithRegex(unicodeRegex, contentBlock, callback);

draft-js-emoji-plugin/src/modifiers/attachImmutableEntitiesToEmojis.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { EditorState, Modifier, SelectionState } from 'draft-js';
22
import findWithRegex from 'find-with-regex';
3-
import emojione from 'emojione';
4-
5-
const unicodeRegex = emojione.regUnicode;
3+
import unicodeRegex from '../utils/emojiUnicodeRegex';
64

75
/*
86
* Attaches Immutable DraftJS Entities to the Emoji text.

draft-js-emoji-plugin/src/utils/emojiList.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import emojione from 'emojione';
22

3+
emojione.greedyMatch = true;
4+
35
const newEmojiListWithOutPriorityList = (priorityList) => {
46
const list = {};
57
for (const key in emojione.emojioneList) { // eslint-disable-line no-restricted-syntax
68
if (priorityList.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins
79
continue; // eslint-disable-line no-continue
810
}
9-
list[key] = emojione.emojioneList[key].uc;
11+
list[key] = emojione.emojioneList[key].uc_output;
1012
}
1113

1214
return { ...priorityList, ...list };

draft-js-emoji-plugin/src/utils/emojiUnicodeRegex.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)