@ckeditor/ckeditor5-emoji 0.0.0-nightly-next-20250227.1 → 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.
@@ -20,6 +20,5 @@
20
20
  "Medium Light skin tone": "Dropdown option label for using the \"Medium Light skin tone\" variant. Example emoji: 👋🏼.",
21
21
  "Medium skin tone": "Dropdown option label for using the \"Medium skin tone\" variant. Example emoji: 👋🏽.",
22
22
  "Medium Dark skin tone": "Dropdown option label for using the \"Medium Dark skin tone\" variant. Example emoji: 👋🏾.",
23
- "Dark skin tone": "Dropdown option label for using the \"Dark skin tone\" variant. Example emoji: 👋🏿.",
24
- "Emoji picker": "Header of the emoji picker balloon panel."
23
+ "Dark skin tone": "Dropdown option label for using the \"Dark skin tone\" variant. Example emoji: 👋🏿."
25
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-emoji",
3
- "version": "0.0.0-nightly-next-20250227.1",
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-next-20250227.1",
17
- "@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-20250227.1",
18
- "@ckeditor/ckeditor5-mention": "0.0.0-nightly-next-20250227.1",
19
- "@ckeditor/ckeditor5-typing": "0.0.0-nightly-next-20250227.1",
20
- "@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-20250227.1",
21
- "@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-20250227.1",
22
- "ckeditor5": "0.0.0-nightly-next-20250227.1",
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-toolkit": "1.32.0"
23
+ "lodash-es": "4.17.21"
25
24
  },
26
25
  "author": "CKSource (http://cksource.com/)",
27
26
  "license": "SEE LICENSE IN LICENSE.md",
@@ -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
  */
@@ -10,7 +10,6 @@ import { Plugin } from 'ckeditor5/src/core.js';
10
10
  import { Typing } from 'ckeditor5/src/typing.js';
11
11
  import EmojiRepository from './emojirepository.js';
12
12
  import EmojiPickerView from './ui/emojipickerview.js';
13
- import EmojiPickerFormView from './ui/emojipickerformview.js';
14
13
  import type { SkinToneId } from './emojiconfig.js';
15
14
  import '../theme/emojipicker.css';
16
15
  /**
@@ -23,10 +22,6 @@ export default class EmojiPicker extends Plugin {
23
22
  * The actions view displayed inside the balloon.
24
23
  */
25
24
  emojiPickerView: EmojiPickerView | undefined;
26
- /**
27
- * The form view displayed inside the balloon.
28
- */
29
- emojiPickerFormView: EmojiPickerFormView | undefined;
30
25
  /**
31
26
  * The contextual balloon plugin instance.
32
27
  */
@@ -76,10 +71,6 @@ export default class EmojiPicker extends Plugin {
76
71
  * Creates an instance of the `EmojiPickerView` class that represents an emoji balloon.
77
72
  */
78
73
  private _createEmojiPickerView;
79
- /**
80
- * Creates an instance of the `EmojiPickerFormView` class that represents a balloon with the emoji picker.
81
- */
82
- private _createEmojiPickerFormView;
83
74
  /**
84
75
  * Hides the balloon with the emoji picker.
85
76
  */
@@ -6,13 +6,11 @@
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';
15
- import EmojiPickerFormView from './ui/emojipickerformview.js';
16
14
  import '../theme/emojipicker.css';
17
15
  const VISUAL_SELECTION_MARKER_NAME = 'emoji-picker';
18
16
  /**
@@ -101,14 +99,9 @@ export default class EmojiPicker extends Plugin {
101
99
  this.emojiPickerView.searchView.setInputValue(searchValue);
102
100
  }
103
101
  this.emojiPickerView.searchView.search(searchValue);
104
- if (!this.emojiPickerFormView) {
105
- this.emojiPickerFormView = this._createEmojiPickerFormView();
106
- }
107
- if (!this.balloonPlugin.hasView(this.emojiPickerFormView)) {
108
- // Show back button if there is another balloon view visible.
109
- this.emojiPickerFormView.backButtonView.isVisible = !!this.balloonPlugin.visibleView;
102
+ if (!this.balloonPlugin.hasView(this.emojiPickerView)) {
110
103
  this.balloonPlugin.add({
111
- view: this.emojiPickerFormView,
104
+ view: this.emojiPickerView,
112
105
  position: this._getBalloonPositionData()
113
106
  });
114
107
  }
@@ -123,7 +116,7 @@ export default class EmojiPicker extends Plugin {
123
116
  buttonView.bind('isEnabled').to(command, 'isEnabled');
124
117
  buttonView.set({
125
118
  label: t('Emoji'),
126
- icon: IconEmoji,
119
+ icon: icons.emoji,
127
120
  isToggleable: true
128
121
  });
129
122
  buttonView.on('execute', () => {
@@ -150,43 +143,31 @@ export default class EmojiPicker extends Plugin {
150
143
  this._hideUI();
151
144
  editor.execute('insertText', { text: textToInsert });
152
145
  });
153
- return emojiPickerView;
154
- }
155
- /**
156
- * Creates an instance of the `EmojiPickerFormView` class that represents a balloon with the emoji picker.
157
- */
158
- _createEmojiPickerFormView() {
159
- const emojiPickerFormView = new EmojiPickerFormView(this.editor.locale);
160
- emojiPickerFormView.children.add(this.emojiPickerView);
161
146
  // Update the balloon position when layout is changed.
162
- this.listenTo(this.emojiPickerView, 'update', () => {
163
- if (this.balloonPlugin.visibleView === emojiPickerFormView) {
147
+ this.listenTo(emojiPickerView, 'update', () => {
148
+ if (this.balloonPlugin.visibleView === emojiPickerView) {
164
149
  this.balloonPlugin.updatePosition();
165
150
  }
166
151
  });
167
- // Close the dialog when the back button is clicked.
168
- this.listenTo(emojiPickerFormView, 'cancel', () => {
169
- this._hideUI();
170
- });
171
152
  // Close the panel on `Esc` key press when the **actions have focus**.
172
- emojiPickerFormView.keystrokes.set('Esc', (data, cancel) => {
153
+ emojiPickerView.keystrokes.set('Esc', (data, cancel) => {
173
154
  this._hideUI();
174
155
  cancel();
175
156
  });
176
157
  // Close the dialog when clicking outside of it.
177
158
  clickOutsideHandler({
178
- emitter: emojiPickerFormView,
159
+ emitter: emojiPickerView,
179
160
  contextElements: [this.balloonPlugin.view.element],
180
161
  callback: () => this._hideUI(),
181
- activator: () => this.balloonPlugin.visibleView === emojiPickerFormView
162
+ activator: () => this.balloonPlugin.visibleView === emojiPickerView
182
163
  });
183
- return emojiPickerFormView;
164
+ return emojiPickerView;
184
165
  }
185
166
  /**
186
167
  * Hides the balloon with the emoji picker.
187
168
  */
188
169
  _hideUI() {
189
- this.balloonPlugin.remove(this.emojiPickerFormView);
170
+ this.balloonPlugin.remove(this.emojiPickerView);
190
171
  this.emojiPickerView.searchView.setInputValue('');
191
172
  this.editor.editing.view.focus();
192
173
  this._hideFakeVisualSelection();
@@ -6,7 +6,7 @@
6
6
  * @module emoji/emojirepository
7
7
  */
8
8
  import fuzzysort from 'fuzzysort';
9
- import { groupBy } from 'es-toolkit/compat';
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
- return emojiEntry.tags?.filter(t => t.startsWith(tok));
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, item => item.group);
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
- * By default, the Emoji plugin fetches the emoji repository from CKEditor 5 CDN. To avoid this,
220
- * you can use the {@link module:emoji/emojiconfig~EmojiConfig#definitionsUrl `emoji.definitionsUrl`}
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 only want to suppress this warning, set this configuration option to `cdn`.
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
  */
@@ -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-toolkit/compat';
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
  */
@@ -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
  */
@@ -13,10 +13,6 @@
13
13
  padding-bottom: var(--ck-spacing-medium);
14
14
  justify-content: space-between;
15
15
  align-items: center;
16
-
17
- & > .ck.ck-search {
18
- flex: 1;
19
- }
20
16
  }
21
17
 
22
18
  /*
@@ -1,78 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2025, 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
- /**
6
- * @module emoji/ui/emojipickerformview
7
- */
8
- import { ButtonView, View, ViewCollection } from 'ckeditor5/src/ui.js';
9
- import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
10
- import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
11
- import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
12
- import '../../theme/emojipickerform.css';
13
- /**
14
- * The emoji picker form view.
15
- */
16
- export default class EmojiPickerFormView extends View {
17
- /**
18
- * The Back button view displayed in the header.
19
- */
20
- backButtonView: ButtonView;
21
- /**
22
- * Tracks information about DOM focus in the form.
23
- */
24
- readonly focusTracker: FocusTracker;
25
- /**
26
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
27
- */
28
- readonly keystrokes: KeystrokeHandler;
29
- /**
30
- * A collection of child views.
31
- */
32
- readonly children: ViewCollection;
33
- /**
34
- * A collection of views that can be focused in the form.
35
- */
36
- private readonly _focusables;
37
- /**
38
- * Helps cycling over {@link #_focusables} in the form.
39
- */
40
- private readonly _focusCycler;
41
- /**
42
- * Creates an instance of the {@link module:emoji/ui/emojipickerformview~EmojiPickerFormView} class.
43
- *
44
- * Also see {@link #render}.
45
- *
46
- * @param locale The localization services instance.
47
- */
48
- constructor(locale: Locale);
49
- /**
50
- * @inheritDoc
51
- */
52
- render(): void;
53
- /**
54
- * @inheritDoc
55
- */
56
- destroy(): void;
57
- /**
58
- * Focuses the fist {@link #_focusables} in the form.
59
- */
60
- focus(): void;
61
- /**
62
- * Creates a back button view that cancels the form.
63
- */
64
- private _createBackButton;
65
- /**
66
- * Creates a header view for the form.
67
- */
68
- private _createHeaderView;
69
- }
70
- /**
71
- * Fired when the form view is canceled, for example with a click on {@link ~EmojiPickerFormView#backButtonView}.
72
- *
73
- * @eventName ~EmojiPickerFormView#cancel
74
- */
75
- export type EmojiPickerFormViewCancelEvent = {
76
- name: 'cancel';
77
- args: [];
78
- };
@@ -1,146 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2025, 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
- /**
6
- * @module emoji/ui/emojipickerformview
7
- */
8
- import { ButtonView, FocusCycler, FormHeaderView, View, ViewCollection, isFocusable, isViewWithFocusCycler } from 'ckeditor5/src/ui.js';
9
- import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
10
- import { IconPreviousArrow } from 'ckeditor5/src/icons.js';
11
- // See: https://github.com/ckeditor/ckeditor5/issues/8833
12
- // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
13
- import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
14
- // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
15
- import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
16
- import '../../theme/emojipickerform.css';
17
- /**
18
- * The emoji picker form view.
19
- */
20
- export default class EmojiPickerFormView extends View {
21
- /**
22
- * The Back button view displayed in the header.
23
- */
24
- backButtonView;
25
- /**
26
- * Tracks information about DOM focus in the form.
27
- */
28
- focusTracker = new FocusTracker();
29
- /**
30
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
31
- */
32
- keystrokes = new KeystrokeHandler();
33
- /**
34
- * A collection of child views.
35
- */
36
- children;
37
- /**
38
- * A collection of views that can be focused in the form.
39
- */
40
- _focusables = new ViewCollection();
41
- /**
42
- * Helps cycling over {@link #_focusables} in the form.
43
- */
44
- _focusCycler;
45
- /**
46
- * Creates an instance of the {@link module:emoji/ui/emojipickerformview~EmojiPickerFormView} class.
47
- *
48
- * Also see {@link #render}.
49
- *
50
- * @param locale The localization services instance.
51
- */
52
- constructor(locale) {
53
- super(locale);
54
- this.backButtonView = this._createBackButton();
55
- this.children = this.createCollection([
56
- this._createHeaderView()
57
- ]);
58
- this._focusCycler = new FocusCycler({
59
- focusables: this._focusables,
60
- focusTracker: this.focusTracker,
61
- keystrokeHandler: this.keystrokes,
62
- actions: {
63
- // Navigate form fields backward using the Shift + Tab keystroke.
64
- focusPrevious: 'shift + tab',
65
- // Navigate form fields forwards using the Tab key.
66
- focusNext: 'tab'
67
- }
68
- });
69
- this.setTemplate({
70
- tag: 'div',
71
- attributes: {
72
- class: [
73
- 'ck',
74
- 'ck-form',
75
- 'ck-emoji-picker-form',
76
- 'ck-responsive-form'
77
- ],
78
- // https://github.com/ckeditor/ckeditor5-link/issues/90
79
- tabindex: '-1'
80
- },
81
- children: this.children
82
- });
83
- }
84
- /**
85
- * @inheritDoc
86
- */
87
- render() {
88
- super.render();
89
- const childViews = [
90
- ...this.children.filter(isFocusable),
91
- this.backButtonView
92
- ];
93
- childViews.forEach(v => {
94
- // Register the view as focusable.
95
- this._focusables.add(v);
96
- // Register the view in the focus tracker.
97
- this.focusTracker.add(v.element);
98
- // Register the view in the focus cycler to avoid nested focus cycles traps.
99
- if (isViewWithFocusCycler(v)) {
100
- this._focusCycler.chain(v.focusCycler);
101
- }
102
- });
103
- // Start listening for the keystrokes coming from #element.
104
- this.keystrokes.listenTo(this.element);
105
- }
106
- /**
107
- * @inheritDoc
108
- */
109
- destroy() {
110
- super.destroy();
111
- this.focusTracker.destroy();
112
- this.keystrokes.destroy();
113
- }
114
- /**
115
- * Focuses the fist {@link #_focusables} in the form.
116
- */
117
- focus() {
118
- this._focusCycler.focusFirst();
119
- }
120
- /**
121
- * Creates a back button view that cancels the form.
122
- */
123
- _createBackButton() {
124
- const t = this.locale.t;
125
- const backButton = new ButtonView(this.locale);
126
- backButton.set({
127
- class: 'ck-button-back',
128
- label: t('Back'),
129
- icon: IconPreviousArrow,
130
- tooltip: true
131
- });
132
- backButton.delegate('execute').to(this, 'cancel');
133
- return backButton;
134
- }
135
- /**
136
- * Creates a header view for the form.
137
- */
138
- _createHeaderView() {
139
- const t = this.locale.t;
140
- const header = new FormHeaderView(this.locale, {
141
- label: t('Emoji picker')
142
- });
143
- header.children.add(this.backButtonView, 0);
144
- return header;
145
- }
146
- }
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright (c) 2003-2025, 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
-
6
- .ck.ck-form.ck-emoji-picker-form {
7
- padding-bottom: 0;
8
-
9
- /*
10
- * `.ck-form` overrides styling of all dropdowns by adding border around them.
11
- * The border is not needed in the emoji picker form so try to remove it keeping
12
- * specificity high enough to override the form styling.
13
- */
14
- & .ck-dropdown .ck-dropdown__button:not(:focus) {
15
- border-color: transparent;
16
- }
17
- }