@ckeditor/ckeditor5-emoji 0.0.0-nightly-next-20250227.0 → 0.0.0-nightly-20250228.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/build/emoji.js +1 -1
- package/ckeditor5-metadata.json +2 -2
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
- package/src/emojimention.js +0 -10
- package/src/emojipicker.js +2 -3
- package/src/emojirepository.js +13 -23
- package/src/emojiutils.js +6 -6
- package/src/ui/emojicategoriesview.js +0 -16
- package/src/ui/emojigridview.js +0 -26
- package/src/ui/emojipickerview.js +0 -36
- package/src/ui/emojisearchview.js +1 -9
- package/src/ui/emojitoneview.js +0 -8
- package/src/utils/isemojisupported.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-emoji",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20250228.0",
|
|
4
4
|
"description": "Emoji feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,15 +13,14 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ckeditor/ckeditor5-core": "0.0.0-nightly-
|
|
17
|
-
"@ckeditor/ckeditor5-
|
|
18
|
-
"@ckeditor/ckeditor5-
|
|
19
|
-
"@ckeditor/ckeditor5-
|
|
20
|
-
"@ckeditor/ckeditor5-
|
|
21
|
-
"
|
|
22
|
-
"ckeditor5": "0.0.0-nightly-next-20250227.0",
|
|
16
|
+
"@ckeditor/ckeditor5-core": "0.0.0-nightly-20250228.0",
|
|
17
|
+
"@ckeditor/ckeditor5-mention": "0.0.0-nightly-20250228.0",
|
|
18
|
+
"@ckeditor/ckeditor5-typing": "0.0.0-nightly-20250228.0",
|
|
19
|
+
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-20250228.0",
|
|
20
|
+
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-20250228.0",
|
|
21
|
+
"ckeditor5": "0.0.0-nightly-20250228.0",
|
|
23
22
|
"fuzzysort": "3.1.0",
|
|
24
|
-
"es
|
|
23
|
+
"lodash-es": "4.17.21"
|
|
25
24
|
},
|
|
26
25
|
"author": "CKSource (http://cksource.com/)",
|
|
27
26
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/emojimention.js
CHANGED
|
@@ -18,16 +18,6 @@ const EMOJI_HINT_OPTION_ID = ':__EMOJI_HINT:';
|
|
|
18
18
|
* Introduces the autocomplete of emojis while typing.
|
|
19
19
|
*/
|
|
20
20
|
export default class EmojiMention extends Plugin {
|
|
21
|
-
/**
|
|
22
|
-
* Defines a number of displayed items in the auto complete dropdown.
|
|
23
|
-
*
|
|
24
|
-
* It includes the "Show all emoji..." option if the `EmojiPicker` plugin is loaded.
|
|
25
|
-
*/
|
|
26
|
-
_emojiDropdownLimit;
|
|
27
|
-
/**
|
|
28
|
-
* Defines a skin tone that is set in the emoji config.
|
|
29
|
-
*/
|
|
30
|
-
_skinTone;
|
|
31
21
|
/**
|
|
32
22
|
* @inheritDoc
|
|
33
23
|
*/
|
package/src/emojipicker.js
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* @module emoji/emojipicker
|
|
7
7
|
*/
|
|
8
8
|
import { ButtonView, clickOutsideHandler, ContextualBalloon, Dialog, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { icons, Plugin } from 'ckeditor5/src/core.js';
|
|
10
10
|
import { Typing } from 'ckeditor5/src/typing.js';
|
|
11
|
-
import { IconEmoji } from 'ckeditor5/src/icons.js';
|
|
12
11
|
import EmojiCommand from './emojicommand.js';
|
|
13
12
|
import EmojiRepository from './emojirepository.js';
|
|
14
13
|
import EmojiPickerView from './ui/emojipickerview.js';
|
|
@@ -117,7 +116,7 @@ export default class EmojiPicker extends Plugin {
|
|
|
117
116
|
buttonView.bind('isEnabled').to(command, 'isEnabled');
|
|
118
117
|
buttonView.set({
|
|
119
118
|
label: t('Emoji'),
|
|
120
|
-
icon:
|
|
119
|
+
icon: icons.emoji,
|
|
121
120
|
isToggleable: true
|
|
122
121
|
});
|
|
123
122
|
buttonView.on('execute', () => {
|
package/src/emojirepository.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module emoji/emojirepository
|
|
7
7
|
*/
|
|
8
8
|
import fuzzysort from 'fuzzysort';
|
|
9
|
-
import { groupBy } from 'es
|
|
9
|
+
import { groupBy } from 'lodash-es';
|
|
10
10
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
11
11
|
import { logWarning, version as editorVersion } from 'ckeditor5/src/utils.js';
|
|
12
12
|
import EmojiUtils from './emojiutils.js';
|
|
@@ -20,19 +20,6 @@ const DEFAULT_EMOJI_VERSION = 16;
|
|
|
20
20
|
* Loads the emoji repository from URL during plugin initialization and provides utility methods to search it.
|
|
21
21
|
*/
|
|
22
22
|
class EmojiRepository extends Plugin {
|
|
23
|
-
/**
|
|
24
|
-
* Emoji repository in a configured version.
|
|
25
|
-
*/
|
|
26
|
-
_items;
|
|
27
|
-
/**
|
|
28
|
-
* The resolved URL from which the emoji repository is downloaded.
|
|
29
|
-
*/
|
|
30
|
-
_url;
|
|
31
|
-
/**
|
|
32
|
-
* A promise resolved after downloading the emoji collection.
|
|
33
|
-
* The promise resolves with `true` when the repository is successfully downloaded or `false` otherwise.
|
|
34
|
-
*/
|
|
35
|
-
_repositoryPromise;
|
|
36
23
|
/**
|
|
37
24
|
* @inheritDoc
|
|
38
25
|
*/
|
|
@@ -107,7 +94,8 @@ class EmojiRepository extends Plugin {
|
|
|
107
94
|
// It enables searching in tags with the space character in names.
|
|
108
95
|
const searchQueryTokens = searchQuery.split(/\s/).filter(Boolean);
|
|
109
96
|
const matchedTags = searchQueryTokens.flatMap(tok => {
|
|
110
|
-
|
|
97
|
+
var _a;
|
|
98
|
+
return (_a = emojiEntry.tags) === null || _a === void 0 ? void 0 : _a.filter(t => t.startsWith(tok));
|
|
111
99
|
});
|
|
112
100
|
return matchedTags.join();
|
|
113
101
|
}
|
|
@@ -138,7 +126,7 @@ class EmojiRepository extends Plugin {
|
|
|
138
126
|
{ title: t('Symbols'), icon: '🟢', groupId: 8 },
|
|
139
127
|
{ title: t('Flags'), icon: '🏁', groupId: 9 }
|
|
140
128
|
];
|
|
141
|
-
const groups = groupBy(repository,
|
|
129
|
+
const groups = groupBy(repository, 'group');
|
|
142
130
|
return categories.map(category => {
|
|
143
131
|
return {
|
|
144
132
|
...category,
|
|
@@ -216,11 +204,13 @@ class EmojiRepository extends Plugin {
|
|
|
216
204
|
return;
|
|
217
205
|
}
|
|
218
206
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
207
|
+
* It was detected that your installation uses a commercial license key,
|
|
208
|
+
* and the default {@glink features/emoji#emoji-source CKEditor CDN for Emoji plugin data}.
|
|
209
|
+
*
|
|
210
|
+
* To avoid this, you can use the {@link module:emoji/emojiconfig~EmojiConfig#definitionsUrl `emoji.definitionsUrl`}
|
|
221
211
|
* configuration option to provide a URL to your own emoji repository.
|
|
222
212
|
*
|
|
223
|
-
* If you
|
|
213
|
+
* If you want to suppress this warning, while using the default CDN, set this configuration option to `cdn`.
|
|
224
214
|
*
|
|
225
215
|
* @error emoji-repository-cdn-use
|
|
226
216
|
*/
|
|
@@ -284,9 +274,9 @@ class EmojiRepository extends Plugin {
|
|
|
284
274
|
container.remove();
|
|
285
275
|
return results;
|
|
286
276
|
}
|
|
287
|
-
/**
|
|
288
|
-
* Versioned emoji repository.
|
|
289
|
-
*/
|
|
290
|
-
static _results = {};
|
|
291
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Versioned emoji repository.
|
|
280
|
+
*/
|
|
281
|
+
EmojiRepository._results = {};
|
|
292
282
|
export default EmojiRepository;
|
package/src/emojiutils.js
CHANGED
|
@@ -131,11 +131,11 @@ class EmojiUtils extends Plugin {
|
|
|
131
131
|
// Category group=2 contains skin tones only, which we do not want to render.
|
|
132
132
|
return item.group !== 2;
|
|
133
133
|
}
|
|
134
|
-
/**
|
|
135
|
-
* A function used to determine if emoji is supported by detecting pixels.
|
|
136
|
-
*
|
|
137
|
-
* Referenced for unit testing purposes. Kept in a separate file because of licensing.
|
|
138
|
-
*/
|
|
139
|
-
static _isEmojiSupported = isEmojiSupported;
|
|
140
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* A function used to determine if emoji is supported by detecting pixels.
|
|
137
|
+
*
|
|
138
|
+
* Referenced for unit testing purposes. Kept in a separate file because of licensing.
|
|
139
|
+
*/
|
|
140
|
+
EmojiUtils._isEmojiSupported = isEmojiSupported;
|
|
141
141
|
export default EmojiUtils;
|
|
@@ -13,22 +13,6 @@ import '../../theme/emojicategories.css';
|
|
|
13
13
|
* It is responsible allowing the user to select a particular emoji category.
|
|
14
14
|
*/
|
|
15
15
|
export default class EmojiCategoriesView extends View {
|
|
16
|
-
/**
|
|
17
|
-
* Tracks information about the DOM focus in the grid.
|
|
18
|
-
*/
|
|
19
|
-
focusTracker;
|
|
20
|
-
/**
|
|
21
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
22
|
-
*/
|
|
23
|
-
keystrokes;
|
|
24
|
-
/**
|
|
25
|
-
* Helps cycling over focusable children in the input view.
|
|
26
|
-
*/
|
|
27
|
-
focusCycler;
|
|
28
|
-
/**
|
|
29
|
-
* A collection of the categories buttons.
|
|
30
|
-
*/
|
|
31
|
-
buttonViews;
|
|
32
16
|
/**
|
|
33
17
|
* @inheritDoc
|
|
34
18
|
*/
|
package/src/ui/emojigridview.js
CHANGED
|
@@ -12,32 +12,6 @@ import '../../theme/emojigrid.css';
|
|
|
12
12
|
* A grid of emoji tiles. It allows browsing emojis and selecting them to be inserted into the content.
|
|
13
13
|
*/
|
|
14
14
|
export default class EmojiGridView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* A collection of the child tile views. Each tile represents a particular emoji.
|
|
17
|
-
*/
|
|
18
|
-
tiles;
|
|
19
|
-
/**
|
|
20
|
-
* Tracks information about the DOM focus in the grid.
|
|
21
|
-
*/
|
|
22
|
-
focusTracker;
|
|
23
|
-
/**
|
|
24
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
25
|
-
*/
|
|
26
|
-
keystrokes;
|
|
27
|
-
/**
|
|
28
|
-
* An array containing all emojis grouped by their categories.
|
|
29
|
-
*/
|
|
30
|
-
emojiCategories;
|
|
31
|
-
/**
|
|
32
|
-
* A collection of all already created tile views. Each tile represents a particular emoji.
|
|
33
|
-
* The cached tiles collection is used for efficiency purposes to avoid re-creating a particular
|
|
34
|
-
* tile again when the grid view has changed.
|
|
35
|
-
*/
|
|
36
|
-
cachedTiles;
|
|
37
|
-
/**
|
|
38
|
-
* A callback used to filter grid items by a specified query.
|
|
39
|
-
*/
|
|
40
|
-
_getEmojiByQuery;
|
|
41
15
|
/**
|
|
42
16
|
* @inheritDoc
|
|
43
17
|
*/
|
|
@@ -15,42 +15,6 @@ import EmojiToneView from './emojitoneview.js';
|
|
|
15
15
|
* A view that glues pieces of the emoji panel together.
|
|
16
16
|
*/
|
|
17
17
|
export default class EmojiPickerView extends View {
|
|
18
|
-
/**
|
|
19
|
-
* A collection of the focusable children of the view.
|
|
20
|
-
*/
|
|
21
|
-
items;
|
|
22
|
-
/**
|
|
23
|
-
* Tracks information about the DOM focus in the view.
|
|
24
|
-
*/
|
|
25
|
-
focusTracker;
|
|
26
|
-
/**
|
|
27
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
28
|
-
*/
|
|
29
|
-
keystrokes;
|
|
30
|
-
/**
|
|
31
|
-
* Helps cycling over focusable {@link #items} in the view.
|
|
32
|
-
*/
|
|
33
|
-
focusCycler;
|
|
34
|
-
/**
|
|
35
|
-
* An instance of the `EmojiSearchView`.
|
|
36
|
-
*/
|
|
37
|
-
searchView;
|
|
38
|
-
/**
|
|
39
|
-
* An instance of the `EmojiToneView`.
|
|
40
|
-
*/
|
|
41
|
-
toneView;
|
|
42
|
-
/**
|
|
43
|
-
* An instance of the `EmojiCategoriesView`.
|
|
44
|
-
*/
|
|
45
|
-
categoriesView;
|
|
46
|
-
/**
|
|
47
|
-
* An instance of the `EmojiGridView`.
|
|
48
|
-
*/
|
|
49
|
-
gridView;
|
|
50
|
-
/**
|
|
51
|
-
* An instance of the `EmojiGridView`.
|
|
52
|
-
*/
|
|
53
|
-
infoView;
|
|
54
18
|
/**
|
|
55
19
|
* @inheritDoc
|
|
56
20
|
*/
|
|
@@ -5,20 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module emoji/ui/emojisearchview
|
|
7
7
|
*/
|
|
8
|
-
import { escapeRegExp } from 'es
|
|
8
|
+
import { escapeRegExp } from 'lodash-es';
|
|
9
9
|
import { createLabeledInputText, SearchTextView, View } from 'ckeditor5/src/ui.js';
|
|
10
10
|
/**
|
|
11
11
|
* A view responsible for providing an input element that allows filtering emoji by the provided query.
|
|
12
12
|
*/
|
|
13
13
|
export default class EmojiSearchView extends View {
|
|
14
|
-
/**
|
|
15
|
-
* The find in text input view that stores the searched string.
|
|
16
|
-
*/
|
|
17
|
-
inputView;
|
|
18
|
-
/**
|
|
19
|
-
* An instance of the `EmojiGridView`.
|
|
20
|
-
*/
|
|
21
|
-
gridView;
|
|
22
14
|
/**
|
|
23
15
|
* @inheritDoc
|
|
24
16
|
*/
|
package/src/ui/emojitoneview.js
CHANGED
|
@@ -12,14 +12,6 @@ import '../../theme/emojitone.css';
|
|
|
12
12
|
* A view responsible for selecting a skin tone for an emoji.
|
|
13
13
|
*/
|
|
14
14
|
export default class EmojiToneView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* A dropdown element for selecting an active skin tone.
|
|
17
|
-
*/
|
|
18
|
-
dropdownView;
|
|
19
|
-
/**
|
|
20
|
-
* An array of available skin tones.
|
|
21
|
-
*/
|
|
22
|
-
_skinTones;
|
|
23
15
|
/**
|
|
24
16
|
* @inheritDoc
|
|
25
17
|
*/
|
|
@@ -45,6 +45,7 @@ export default function isEmojiSupported(unicode) {
|
|
|
45
45
|
const x = CANVAS_WIDTH + ((i / 4) % CANVAS_WIDTH);
|
|
46
46
|
const y = Math.floor(i / 4 / CANVAS_WIDTH);
|
|
47
47
|
const b = ctx.getImageData(x, y, 1, 1).data;
|
|
48
|
+
/* istanbul ignore next -- @preserve */
|
|
48
49
|
if (a[i] !== b[0] || a[i + 2] !== b[2]) {
|
|
49
50
|
return false;
|
|
50
51
|
}
|