From 008b3347cd97c1fd84923f82478ad04c188b4c31 Mon Sep 17 00:00:00 2001 From: Rob Petti Date: Wed, 7 Dec 2022 18:33:02 -0700 Subject: [PATCH] replace emojione with emoji-toolkit --- package-lock.json | 10 +++++----- package.json | 2 +- src/app/tools/emoji.tools.ts | 16 +++++++++------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index b5949e25..da982201 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sengi", - "version": "1.0.3", + "version": "1.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -4182,10 +4182,10 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "emojione": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/emojione/-/emojione-4.5.0.tgz", - "integrity": "sha512-Tq55Y3UgPOnayFDN+Qd6QMP0rpoH10a1nhSFN27s8gXW3qymgFIHiXys2ECYYAI134BafmI3qP9ni2rZOe9BjA==" + "emoji-toolkit": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/emoji-toolkit/-/emoji-toolkit-7.0.0.tgz", + "integrity": "sha512-swoVbGlR/cyJ2ysrw1+axjRkEHAlH0myhbK1ybkv8zR6r9KpL4vzb96m3Y2j0hixUKj1Nb8YBQbk3ihB+XkpBw==" }, "emojis-list": { "version": "2.1.0", diff --git a/package.json b/package.json index 3956d025..a98be126 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "angular2-hotkeys": "^2.1.5", "bootstrap": "^4.1.3", "core-js": "^2.5.4", - "emojione": "~4.5.0", + "emoji-toolkit": "^7.0.0", "howler": "^2.1.2", "ng-pick-datetime": "^7.0.0", "ngx-contextmenu": "^5.2.0", diff --git a/src/app/tools/emoji.tools.ts b/src/app/tools/emoji.tools.ts index 41071014..d83647e7 100644 --- a/src/app/tools/emoji.tools.ts +++ b/src/app/tools/emoji.tools.ts @@ -1,6 +1,6 @@ import { Emoji } from "../services/models/mastodon.interfaces"; // import { EmojiOne } from "./emoji-one"; -import * as EmojiOne from 'emojione'; +import * as EmojiToolkit from 'emoji-toolkit'; export class EmojiConverter { // private emojiOne = new EmojiOne(); @@ -31,21 +31,23 @@ export class EmojiConverter { } private applyEmojiOne(className: string, text: string): string{ - text = EmojiOne.toImage(text); + text = EmojiToolkit.toImage(text); - while (text.includes('class="emojione"')) { - text = text.replace('class="emojione"', `class="emojione ${className}"`); + while (text.includes('class="joypixels"')) { + text = text.replace('class="joypixels"', `class="joypixels ${className}"`); } - + + /* Static asset copy of emojis need to be updated to joypixels 7.0, use CDN for now while ( - text.includes("https://cdn.jsdelivr.net/emojione/assets/4.5/png/32/") + text.includes("https://cdn.jsdelivr.net/joypixels/assets/7.0/png/") ) { text = text.replace( - "https://cdn.jsdelivr.net/emojione/assets/4.5/png/32/", + "https://cdn.jsdelivr.net/joypixels/assets/7.0/png/", "assets/emoji/72x72/" ); // text = text.replace('.png', '.svg'); } + */ return text; }