@ckeditor/ckeditor5-emoji 48.2.0 → 48.3.0-alpha.1
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/dist/augmentation.d.ts +23 -23
- package/dist/emoji.d.ts +27 -27
- package/dist/emojicommand.d.ts +21 -19
- package/dist/emojiconfig.d.ts +103 -103
- package/dist/emojimention.d.ts +68 -72
- package/dist/emojipicker.d.ts +103 -103
- package/dist/emojirepository.d.ts +155 -160
- package/dist/emojiutils.d.ts +70 -70
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js +1912 -1837
- package/dist/index.js.map +1 -1
- package/dist/ui/emojicategoriesview.d.ts +67 -63
- package/dist/ui/emojigridview.d.ts +128 -128
- package/dist/ui/emojipickerformview.d.ts +68 -68
- package/dist/ui/emojipickerview.d.ts +87 -83
- package/dist/ui/emojisearchview.d.ts +47 -47
- package/dist/ui/emojitoneview.d.ts +41 -41
- package/dist/utils/emojirepositorycache.d.ts +48 -0
- package/dist/utils/isemojisupported.d.ts +9 -9
- package/package.json +7 -7
package/dist/emojipicker.d.ts
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { ContextualBalloon, Dialog } from
|
|
9
|
-
import { Plugin } from
|
|
10
|
-
import { Typing } from
|
|
11
|
-
import { EmojiRepository } from
|
|
12
|
-
import { EmojiPickerView } from
|
|
13
|
-
import { EmojiPickerFormView } from
|
|
14
|
-
import type { EmojiSkinToneId } from
|
|
15
|
-
import
|
|
6
|
+
* @module emoji/emojipicker
|
|
7
|
+
*/
|
|
8
|
+
import { ContextualBalloon, Dialog } from "@ckeditor/ckeditor5-ui";
|
|
9
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { Typing } from "@ckeditor/ckeditor5-typing";
|
|
11
|
+
import { EmojiRepository } from "./emojirepository.js";
|
|
12
|
+
import { EmojiPickerView } from "./ui/emojipickerview.js";
|
|
13
|
+
import { EmojiPickerFormView } from "./ui/emojipickerformview.js";
|
|
14
|
+
import type { EmojiSkinToneId } from "./emojiconfig.js";
|
|
15
|
+
import "../theme/emojipicker.css";
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
* The emoji picker plugin.
|
|
18
|
+
*
|
|
19
|
+
* Introduces the `'emoji'` dropdown.
|
|
20
|
+
*/
|
|
21
21
|
export declare class EmojiPicker extends Plugin {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The actions view displayed inside the balloon.
|
|
24
|
+
*/
|
|
25
|
+
emojiPickerView: EmojiPickerView | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The form view displayed inside the balloon.
|
|
28
|
+
*/
|
|
29
|
+
emojiPickerFormView: EmojiPickerFormView | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The contextual balloon plugin instance.
|
|
32
|
+
*/
|
|
33
|
+
balloonPlugin: ContextualBalloon;
|
|
34
|
+
/**
|
|
35
|
+
* An instance of the {@link module:emoji/emojirepository~EmojiRepository} plugin.
|
|
36
|
+
*/
|
|
37
|
+
emojiRepositoryPlugin: EmojiRepository;
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
static get requires(): PluginDependenciesOf<[EmojiRepository, ContextualBalloon, Dialog, Typing]>;
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
static get pluginName(): "EmojiPicker";
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
static override get isOfficialPlugin(): true;
|
|
50
|
+
/**
|
|
51
|
+
* @inheritDoc
|
|
52
|
+
*/
|
|
53
|
+
init(): void;
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
override destroy(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Represents an active skin tone. Its value depends on the emoji UI plugin.
|
|
60
|
+
*
|
|
61
|
+
* Before opening the UI for the first time, the returned value is read from the editor configuration.
|
|
62
|
+
* Otherwise, it reflects the user's intention.
|
|
63
|
+
*/
|
|
64
|
+
get skinTone(): EmojiSkinToneId;
|
|
65
|
+
/**
|
|
66
|
+
* Displays the balloon with the emoji picker.
|
|
67
|
+
*
|
|
68
|
+
* @param [searchValue=''] A default query used to filer the grid when opening the UI.
|
|
69
|
+
*/
|
|
70
|
+
showUI(searchValue?: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a button for toolbar and menu bar that will show the emoji dialog.
|
|
73
|
+
*/
|
|
74
|
+
private _createButton;
|
|
75
|
+
/**
|
|
76
|
+
* Creates an instance of the `EmojiPickerView` class that represents an emoji balloon.
|
|
77
|
+
*/
|
|
78
|
+
private _createEmojiPickerView;
|
|
79
|
+
/**
|
|
80
|
+
* Creates an instance of the `EmojiPickerFormView` class that represents a balloon with the emoji picker.
|
|
81
|
+
*/
|
|
82
|
+
private _createEmojiPickerFormView;
|
|
83
|
+
/**
|
|
84
|
+
* Hides the balloon with the emoji picker.
|
|
85
|
+
*
|
|
86
|
+
* @param updateFocus Whether to focus the editor after closing the emoji picker.
|
|
87
|
+
*/
|
|
88
|
+
private _hideUI;
|
|
89
|
+
/**
|
|
90
|
+
* Registers converters.
|
|
91
|
+
*/
|
|
92
|
+
private _setupConversion;
|
|
93
|
+
/**
|
|
94
|
+
* Returns positioning options for the balloon plugin. They control the way the balloon is attached
|
|
95
|
+
* to the target element or selection.
|
|
96
|
+
*/
|
|
97
|
+
private _getBalloonPositionData;
|
|
98
|
+
/**
|
|
99
|
+
* Displays a fake visual selection when the contextual balloon is displayed.
|
|
100
|
+
*
|
|
101
|
+
* This adds an 'emoji-picker' marker into the document that is rendered as a highlight on selected text fragment.
|
|
102
|
+
*/
|
|
103
|
+
private _showFakeVisualSelection;
|
|
104
|
+
/**
|
|
105
|
+
* Hides the fake visual selection.
|
|
106
|
+
*/
|
|
107
|
+
private _hideFakeVisualSelection;
|
|
108
108
|
}
|
|
@@ -1,177 +1,172 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { type Editor, Plugin } from
|
|
6
|
-
import { EmojiUtils } from
|
|
7
|
-
import type { EmojiSkinToneId } from
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
import { type Editor, Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import { EmojiUtils } from "./emojiutils.js";
|
|
7
|
+
import type { EmojiSkinToneId } from "./emojiconfig.js";
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
* The emoji repository plugin.
|
|
10
|
+
*
|
|
11
|
+
* Loads the emoji repository from URL during plugin initialization and provides utility methods to search it.
|
|
12
|
+
*/
|
|
13
13
|
export declare class EmojiRepository extends Plugin {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Whether the emoji repository has been successfully loaded.
|
|
16
|
+
*
|
|
17
|
+
* - `null` – the repository is still being loaded (initial state).
|
|
18
|
+
* - `true` – the repository has been loaded successfully.
|
|
19
|
+
* - `false` – the repository failed to load (e.g. network error or empty response).
|
|
20
|
+
*/
|
|
21
|
+
isRepositoryReady: boolean | null;
|
|
22
|
+
/**
|
|
23
|
+
* The resolved URL from which the emoji repository is downloaded.
|
|
24
|
+
*/
|
|
25
|
+
private readonly _url;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): PluginDependenciesOf<[EmojiUtils]>;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get pluginName(): "EmojiRepository";
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static override get isOfficialPlugin(): true;
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
constructor(editor: Editor);
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
init(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Calls `callback` once the repository finishes loading, passing the result as the argument.
|
|
48
|
+
*
|
|
49
|
+
* @param callback Receives `true` when the repository loaded successfully, `false` on failure.
|
|
50
|
+
* Note: if the editor is destroyed before loading completes, the callback may never be called.
|
|
51
|
+
* Use {@link #isReady} instead if you need a guaranteed resolution in all cases.
|
|
52
|
+
*/
|
|
53
|
+
onReady(callback: (isReady: boolean) => void): void;
|
|
54
|
+
/**
|
|
55
|
+
* Returns an array of emoji entries that match the search query.
|
|
56
|
+
* If the emoji repository is not loaded this method returns an empty array.
|
|
57
|
+
*
|
|
58
|
+
* @param searchQuery A search query to match emoji.
|
|
59
|
+
* @returns An array of emoji entries that match the search query.
|
|
60
|
+
*/
|
|
61
|
+
getEmojiByQuery(searchQuery: string): Array<EmojiEntry>;
|
|
62
|
+
/**
|
|
63
|
+
* Groups all emojis by categories.
|
|
64
|
+
* If the emoji repository is not loaded, it returns an empty array.
|
|
65
|
+
*
|
|
66
|
+
* @returns An array of emoji entries grouped by categories.
|
|
67
|
+
*/
|
|
68
|
+
getEmojiCategories(): Array<EmojiCategory>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns an array of available skin tones.
|
|
71
|
+
*/
|
|
72
|
+
getSkinTones(): Array<EmojiSkinTone>;
|
|
73
|
+
/**
|
|
74
|
+
* Returns a promise that resolves once the repository finishes loading.
|
|
75
|
+
*
|
|
76
|
+
* Resolves with `true` if the repository loaded successfully, or `false` if loading failed.
|
|
77
|
+
* Rejects if the editor was destroyed before loading completed.
|
|
78
|
+
*/
|
|
79
|
+
isReady(): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the URL from which the emoji repository is downloaded. If the URL is not provided
|
|
82
|
+
* in the configuration, the default URL is used with the version from the configuration.
|
|
83
|
+
*
|
|
84
|
+
* If both the URL and version are provided, a warning is logged.
|
|
85
|
+
*/
|
|
86
|
+
private _getUrl;
|
|
87
|
+
/**
|
|
88
|
+
* Warn users on self-hosted installations that this plugin uses a CDN to fetch the emoji repository.
|
|
89
|
+
*/
|
|
90
|
+
private _warnAboutCdnUse;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the normalised emoji repository for this editor instance if it is
|
|
93
|
+
* a non-empty array, or `null` otherwise.
|
|
94
|
+
*/
|
|
95
|
+
private _getItems;
|
|
96
|
+
/**
|
|
97
|
+
* Normalizes the raw data fetched from CDN. By normalization, we meant:
|
|
98
|
+
*
|
|
99
|
+
* * Filter out unsupported emoji (these that will not render correctly),
|
|
100
|
+
* * Prepare skin tone variants if an emoji defines them.
|
|
101
|
+
*/
|
|
102
|
+
private _normalizeEmoji;
|
|
103
|
+
/**
|
|
104
|
+
* Cache key segments that distinguish the transformation result for this editor instance.
|
|
105
|
+
*/
|
|
106
|
+
private get _cacheKeys();
|
|
107
|
+
/**
|
|
108
|
+
* Process-global cache that stores fetched emojis.
|
|
109
|
+
*/
|
|
110
|
+
private static _cache;
|
|
105
111
|
}
|
|
106
112
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
* Represents a single group of the emoji category, e.g., "Smileys & Expressions".
|
|
114
|
+
*/
|
|
109
115
|
export type EmojiCategory = {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
/**
|
|
117
|
+
* A name of the category.
|
|
118
|
+
*/
|
|
119
|
+
title: string;
|
|
120
|
+
/**
|
|
121
|
+
* An example emoji representing items belonging to the category.
|
|
122
|
+
*/
|
|
123
|
+
icon: string;
|
|
124
|
+
/**
|
|
125
|
+
* Group id used to assign {@link #items}.
|
|
126
|
+
*/
|
|
127
|
+
groupId: number;
|
|
128
|
+
/**
|
|
129
|
+
* An array of emojis.
|
|
130
|
+
*/
|
|
131
|
+
items: Array<EmojiEntry>;
|
|
126
132
|
};
|
|
127
133
|
/**
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
* Represents a single item fetched from the CDN.
|
|
135
|
+
*/
|
|
130
136
|
export type EmojiCdnResource = {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
annotation: string;
|
|
138
|
+
emoji: string;
|
|
139
|
+
group: number;
|
|
140
|
+
order: number;
|
|
141
|
+
version: number;
|
|
142
|
+
emoticon?: string;
|
|
143
|
+
shortcodes?: Array<string>;
|
|
144
|
+
skins?: Array<{
|
|
145
|
+
emoji: string;
|
|
146
|
+
tone: number;
|
|
147
|
+
version: number;
|
|
148
|
+
}>;
|
|
149
|
+
tags?: Array<string>;
|
|
144
150
|
};
|
|
145
151
|
/**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
export type EmojiEntry = Omit<EmojiCdnResource,
|
|
149
|
-
|
|
152
|
+
* Represents a single emoji item used by the Emoji feature.
|
|
153
|
+
*/
|
|
154
|
+
export type EmojiEntry = Omit<EmojiCdnResource, "skins"> & {
|
|
155
|
+
skins: EmojiMap;
|
|
150
156
|
};
|
|
151
157
|
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
export type EmojiMap = {
|
|
157
|
-
|
|
158
|
-
} & {
|
|
159
|
-
default: string;
|
|
158
|
+
* Represents mapping between a skin tone and its corresponding emoji.
|
|
159
|
+
*
|
|
160
|
+
* The `default` key is always present. Additional values are assigned only if an emoji supports skin tones.
|
|
161
|
+
*/
|
|
162
|
+
export type EmojiMap = { [K in Exclude<EmojiSkinToneId, "default">]?: string } & {
|
|
163
|
+
default: string;
|
|
160
164
|
};
|
|
161
165
|
/**
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
* Represents an emoji skin tone variant.
|
|
167
|
+
*/
|
|
164
168
|
export type EmojiSkinTone = {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
id: EmojiSkinToneId;
|
|
170
|
+
icon: string;
|
|
171
|
+
tooltip: string;
|
|
168
172
|
};
|
|
169
|
-
/**
|
|
170
|
-
* Unable to load the emoji repository from the URL.
|
|
171
|
-
*
|
|
172
|
-
* If the URL works properly and there is no disruption of communication, please check your
|
|
173
|
-
* {@glink getting-started/setup/csp Content Security Policy (CSP)} setting and make sure
|
|
174
|
-
* the URL connection is allowed by the editor.
|
|
175
|
-
*
|
|
176
|
-
* @error emoji-repository-load-failed
|
|
177
|
-
*/
|