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';
63
63
import { TodoList } from 'ckeditor5' ;
64
64
65
65
import 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" ;
67
68
68
69
class Editor extends ClassicEditor { }
69
70
@@ -117,9 +118,11 @@ Editor.builtinPlugins = [
117
118
Underline ,
118
119
TodoList ,
119
120
121
+ Mention , Emoji ,
122
+
120
123
//Our own extensions
121
124
ExtendedMarkdown ,
122
- SpecialCharactersEmoji
125
+ SpecialCharactersGreek
123
126
] ;
124
127
125
128
// Editor configuration.
@@ -148,6 +151,7 @@ Editor.defaultConfig = {
148
151
'indent' ,
149
152
'|' ,
150
153
'specialCharacters' ,
154
+ "emoji" ,
151
155
'horizontalLine' ,
152
156
'|' ,
153
157
'imageUpload' ,
Original file line number Diff line number Diff line change @@ -27,10 +27,11 @@ import {Subscript} from 'ckeditor5';
27
27
import { Superscript } from 'ckeditor5' ;
28
28
import { Underline } from 'ckeditor5' ;
29
29
import { EditorWatchdog } from 'ckeditor5' ;
30
+ import { Mention , Emoji } from "ckeditor5" ;
30
31
31
32
import ExtendedMarkdownInline from "./plugins/extendedMarkdownInline" ;
32
33
import SingleLinePlugin from "./plugins/singleLine" ;
33
- import SpecialCharactersEmoji from "./plugins/special_characters_emoji" ;
34
+ import SpecialCharactersGreek from "./plugins/special_characters_emoji" ;
34
35
35
36
class Editor extends ClassicEditor { }
36
37
@@ -62,7 +63,8 @@ Editor.builtinPlugins = [
62
63
63
64
ExtendedMarkdownInline ,
64
65
SingleLinePlugin ,
65
- SpecialCharactersEmoji
66
+ SpecialCharactersGreek ,
67
+ Mention , Emoji
66
68
] ;
67
69
68
70
// Editor configuration.
@@ -81,6 +83,7 @@ Editor.defaultConfig = {
81
83
'link' ,
82
84
'code' ,
83
85
'specialCharacters' ,
86
+ 'emoji' ,
84
87
'|' ,
85
88
'undo' ,
86
89
'redo' ,
Original file line number Diff line number Diff line change @@ -22,19 +22,14 @@ import SpecialCharactersEssentials from 'ckeditor5';
22
22
23
23
import { Plugin } from 'ckeditor5' ;
24
24
25
- const emoji = require ( 'emoji.json' ) ;
26
-
27
- export default class SpecialCharactersEmoji extends Plugin {
25
+ export default class SpecialCharactersGreek extends Plugin {
28
26
29
27
init ( ) {
30
28
const editor = this . editor ;
31
29
const specialCharsPlugin = editor . plugins . get ( 'SpecialCharacters' ) ;
32
30
33
31
//Add greek characters to special characters
34
32
specialCharsPlugin . addItems ( 'Greek' , this . getGreek ( ) ) ;
35
-
36
- //Add Emojis to special characters
37
- specialCharsPlugin . addItems ( 'Emoji' , this . getEmojis ( ) ) ;
38
33
}
39
34
40
35
getGreek ( ) {
@@ -96,14 +91,4 @@ export default class SpecialCharactersEmoji extends Plugin {
96
91
{ title : 'san' , character : 'Ϻ' } ,
97
92
] ;
98
93
}
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
- }
109
94
}
Original file line number Diff line number Diff line change @@ -52,9 +52,15 @@ export default class extends Controller {
52
52
53
53
const language = document . body . dataset . locale ?? "en" ;
54
54
55
+ const emojiURL = new URL ( '../../ckeditor/emojis.json' , import . meta. url ) . href ;
56
+
55
57
const config = {
56
58
language : language ,
57
59
licenseKey : "GPL" ,
60
+
61
+ emoji : {
62
+ definitionsUrl : emojiURL
63
+ }
58
64
}
59
65
60
66
const watchdog = new EditorWatchdog ( ) ;
Original file line number Diff line number Diff line change 58
58
"datatables.net-responsive-bs5" : " ^3.0.0" ,
59
59
"datatables.net-select-bs5" : " ^2.0.0" ,
60
60
"dompurify" : " ^3.0.3" ,
61
- "emoji.json" : " ^15.0.0" ,
62
61
"exports-loader" : " ^5.0.0" ,
63
62
"json-formatter-js" : " ^2.3.4" ,
64
63
"jszip" : " ^3.2.0" ,
Original file line number Diff line number Diff line change @@ -3682,11 +3682,6 @@ emoji-regex@^8.0.0:
3682
3682
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
3683
3683
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
3684
3684
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
-
3690
3685
emojis-list@^3.0.0 :
3691
3686
version "3.0.0"
3692
3687
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