File tree Expand file tree Collapse file tree 7 files changed +19
-26
lines changed
Expand file tree Collapse file tree 7 files changed +19
-26
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ import {EditorWatchdog} from 'ckeditor5';
6363import { TodoList } from 'ckeditor5' ;
6464
6565import ExtendedMarkdown from "./plugins/extendedMarkdown.js" ;
66- import SpecialCharactersEmoji from "./plugins/special_characters_emoji" ;
66+ import SpecialCharactersGreek from "./plugins/special_characters_emoji" ;
67+ import { Mention , Emoji } from "ckeditor5" ;
6768
6869class Editor extends ClassicEditor { }
6970
@@ -117,9 +118,11 @@ Editor.builtinPlugins = [
117118 Underline ,
118119 TodoList ,
119120
121+ Mention , Emoji ,
122+
120123 //Our own extensions
121124 ExtendedMarkdown ,
122- SpecialCharactersEmoji
125+ SpecialCharactersGreek
123126] ;
124127
125128// Editor configuration.
@@ -148,6 +151,7 @@ Editor.defaultConfig = {
148151 'indent' ,
149152 '|' ,
150153 'specialCharacters' ,
154+ "emoji" ,
151155 'horizontalLine' ,
152156 '|' ,
153157 'imageUpload' ,
Original file line number Diff line number Diff line change @@ -27,10 +27,11 @@ import {Subscript} from 'ckeditor5';
2727import { Superscript } from 'ckeditor5' ;
2828import { Underline } from 'ckeditor5' ;
2929import { EditorWatchdog } from 'ckeditor5' ;
30+ import { Mention , Emoji } from "ckeditor5" ;
3031
3132import ExtendedMarkdownInline from "./plugins/extendedMarkdownInline" ;
3233import SingleLinePlugin from "./plugins/singleLine" ;
33- import SpecialCharactersEmoji from "./plugins/special_characters_emoji" ;
34+ import SpecialCharactersGreek from "./plugins/special_characters_emoji" ;
3435
3536class Editor extends ClassicEditor { }
3637
@@ -62,7 +63,8 @@ Editor.builtinPlugins = [
6263
6364 ExtendedMarkdownInline ,
6465 SingleLinePlugin ,
65- SpecialCharactersEmoji
66+ SpecialCharactersGreek ,
67+ Mention , Emoji
6668] ;
6769
6870// Editor configuration.
@@ -81,6 +83,7 @@ Editor.defaultConfig = {
8183 'link' ,
8284 'code' ,
8385 'specialCharacters' ,
86+ 'emoji' ,
8487 '|' ,
8588 'undo' ,
8689 'redo' ,
Original file line number Diff line number Diff line change @@ -22,19 +22,14 @@ import SpecialCharactersEssentials from 'ckeditor5';
2222
2323import { Plugin } from 'ckeditor5' ;
2424
25- const emoji = require ( 'emoji.json' ) ;
26-
27- export default class SpecialCharactersEmoji extends Plugin {
25+ export default class SpecialCharactersGreek extends Plugin {
2826
2927 init ( ) {
3028 const editor = this . editor ;
3129 const specialCharsPlugin = editor . plugins . get ( 'SpecialCharacters' ) ;
3230
3331 //Add greek characters to special characters
3432 specialCharsPlugin . addItems ( 'Greek' , this . getGreek ( ) ) ;
35-
36- //Add Emojis to special characters
37- specialCharsPlugin . addItems ( 'Emoji' , this . getEmojis ( ) ) ;
3833 }
3934
4035 getGreek ( ) {
@@ -96,14 +91,4 @@ export default class SpecialCharactersEmoji extends Plugin {
9691 { title : 'san' , character : 'Ϻ' } ,
9792 ] ;
9893 }
99-
100- getEmojis ( ) {
101- //Map our emoji data to the format the plugin expects
102- return emoji . map ( emoji => {
103- return {
104- title : emoji . name ,
105- character : emoji . char
106- } ;
107- } ) ;
108- }
10994}
Original file line number Diff line number Diff line change @@ -52,9 +52,15 @@ export default class extends Controller {
5252
5353 const language = document . body . dataset . locale ?? "en" ;
5454
55+ const emojiURL = new URL ( '../../ckeditor/emojis.json' , import . meta. url ) . href ;
56+
5557 const config = {
5658 language : language ,
5759 licenseKey : "GPL" ,
60+
61+ emoji : {
62+ definitionsUrl : emojiURL
63+ }
5864 }
5965
6066 const watchdog = new EditorWatchdog ( ) ;
Original file line number Diff line number Diff line change 5858 "datatables.net-responsive-bs5" : " ^3.0.0" ,
5959 "datatables.net-select-bs5" : " ^2.0.0" ,
6060 "dompurify" : " ^3.0.3" ,
61- "emoji.json" : " ^15.0.0" ,
6261 "exports-loader" : " ^5.0.0" ,
6362 "json-formatter-js" : " ^2.3.4" ,
6463 "jszip" : " ^3.2.0" ,
Original file line number Diff line number Diff line change @@ -3682,11 +3682,6 @@ emoji-regex@^8.0.0:
36823682 resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
36833683 integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
36843684
3685- emoji.json@^15.0.0 :
3686- version "15.1.0"
3687- resolved "https://registry.yarnpkg.com/emoji.json/-/emoji.json-15.1.0.tgz#1a1bac02f95983c808601a74b0b367677e52db3b"
3688- integrity sha512-GqE6SCE8rSc5Gyd+oh6s/pkoNSW/pULdgJTB6jd/sM87FWA/a1nmvFMdWBjvSA5vdomzDvZgy584KNgzdYJwDA==
3689-
36903685emojis-list@^3.0.0 :
36913686 version "3.0.0"
36923687 resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
You can’t perform that action at this time.
0 commit comments