@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.
@@ -1,68 +1,72 @@
1
1
  /**
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
- */
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
- * @module emoji/ui/emojicategoriesview
7
- */
8
- import { ButtonView, View, FocusCycler, type ViewCollection } from '@ckeditor/ckeditor5-ui';
9
- import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
10
- import type { EmojiCategory } from '../emojirepository.js';
11
- import '../../theme/emojicategories.css';
6
+ * @module emoji/ui/emojicategoriesview
7
+ */
8
+ import { ButtonView, View, FocusCycler, type ViewCollection } from "@ckeditor/ckeditor5-ui";
9
+ import { FocusTracker, KeystrokeHandler, type Locale } from "@ckeditor/ckeditor5-utils";
10
+ import type { EmojiCategory } from "../emojirepository.js";
11
+ import "../../theme/emojicategories.css";
12
12
  /**
13
- * A class representing the navigation part of the emoji UI.
14
- * It is responsible allowing the user to select a particular emoji category.
15
- */
13
+ * A class representing the navigation part of the emoji UI.
14
+ * It is responsible allowing the user to select a particular emoji category.
15
+ */
16
16
  export declare class EmojiCategoriesView extends View {
17
- /**
18
- * Currently selected emoji category name.
19
- */
20
- categoryName: string;
21
- /**
22
- * Tracks information about the DOM focus in the grid.
23
- */
24
- readonly focusTracker: FocusTracker;
25
- /**
26
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
27
- */
28
- readonly keystrokes: KeystrokeHandler;
29
- /**
30
- * Helps cycling over focusable children in the input view.
31
- */
32
- readonly focusCycler: FocusCycler;
33
- /**
34
- * A collection of the categories buttons.
35
- */
36
- readonly buttonViews: ViewCollection<ButtonView>;
37
- /**
38
- * @inheritDoc
39
- */
40
- constructor(locale: Locale, { emojiCategories, categoryName }: {
41
- emojiCategories: Array<EmojiCategory>;
42
- categoryName: string;
43
- });
44
- /**
45
- * @inheritDoc
46
- */
47
- render(): void;
48
- /**
49
- * @inheritDoc
50
- */
51
- destroy(): void;
52
- /**
53
- * @inheritDoc
54
- */
55
- focus(): void;
56
- /**
57
- * Marks all categories buttons as enabled (clickable).
58
- */
59
- enableCategories(): void;
60
- /**
61
- * Marks all categories buttons as disabled (non-clickable).
62
- */
63
- disableCategories(): void;
64
- /**
65
- * Creates a button representing a category item.
66
- */
67
- private _createCategoryButton;
17
+ /**
18
+ * Currently selected emoji category name.
19
+ */
20
+ categoryName: string;
21
+ /**
22
+ * Tracks information about the DOM focus in the grid.
23
+ */
24
+ readonly focusTracker: FocusTracker;
25
+ /**
26
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
27
+ */
28
+ readonly keystrokes: KeystrokeHandler;
29
+ /**
30
+ * Helps cycling over focusable children in the input view.
31
+ */
32
+ readonly focusCycler: FocusCycler;
33
+ /**
34
+ * A collection of the categories buttons.
35
+ */
36
+ readonly buttonViews: ViewCollection<ButtonView>;
37
+ /**
38
+ * @inheritDoc
39
+ */
40
+ constructor(locale: Locale, { emojiCategories, categoryName }: {
41
+ emojiCategories: Array<EmojiCategory>;
42
+ categoryName: string;
43
+ });
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ override render(): void;
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ override destroy(): void;
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ focus(): void;
56
+ /**
57
+ * Sets category buttons for the provided emoji categories.
58
+ */
59
+ setCategories(emojiCategories: Array<EmojiCategory>): void;
60
+ /**
61
+ * Marks all categories buttons as enabled (clickable).
62
+ */
63
+ enableCategories(): void;
64
+ /**
65
+ * Marks all categories buttons as disabled (non-clickable).
66
+ */
67
+ disableCategories(): void;
68
+ /**
69
+ * Creates a button representing a category item.
70
+ */
71
+ private _createCategoryButton;
68
72
  }
@@ -1,140 +1,140 @@
1
1
  /**
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
- */
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
- * @module emoji/ui/emojigridview
7
- */
8
- import { ButtonView, type FilteredView, View, type ViewCollection } from '@ckeditor/ckeditor5-ui';
9
- import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
10
- import type { EmojiCategory, EmojiEntry } from '../emojirepository.js';
11
- import type { EmojiSkinToneId } from '../emojiconfig.js';
12
- import '../../theme/emojigrid.css';
6
+ * @module emoji/ui/emojigridview
7
+ */
8
+ import { ButtonView, type FilteredView, View, type ViewCollection } from "@ckeditor/ckeditor5-ui";
9
+ import { FocusTracker, KeystrokeHandler, type Locale } from "@ckeditor/ckeditor5-utils";
10
+ import type { EmojiCategory, EmojiEntry } from "../emojirepository.js";
11
+ import type { EmojiSkinToneId } from "../emojiconfig.js";
12
+ import "../../theme/emojigrid.css";
13
13
  /**
14
- * A grid of emoji tiles. It allows browsing emojis and selecting them to be inserted into the content.
15
- */
14
+ * A grid of emoji tiles. It allows browsing emojis and selecting them to be inserted into the content.
15
+ */
16
16
  export declare class EmojiGridView extends View<HTMLDivElement> implements FilteredView {
17
- /**
18
- * Defines the active category name.
19
- *
20
- * @observable
21
- */
22
- categoryName: string;
23
- /**
24
- * Active skin tone.
25
- *
26
- * @observable
27
- */
28
- skinTone: EmojiSkinToneId;
29
- /**
30
- * Set to `true` when the {@link #tiles} collection does not contain items to display.
31
- *
32
- * @observable
33
- */
34
- isEmpty: boolean;
35
- /**
36
- * A collection of the child tile views. Each tile represents a particular emoji.
37
- */
38
- readonly tiles: ViewCollection<ButtonView>;
39
- /**
40
- * Tracks information about the DOM focus in the grid.
41
- */
42
- readonly focusTracker: FocusTracker;
43
- /**
44
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
45
- */
46
- readonly keystrokes: KeystrokeHandler;
47
- /**
48
- * An array containing all emojis grouped by their categories.
49
- */
50
- readonly emojiCategories: Array<EmojiCategory>;
51
- /**
52
- * A collection of all already created tile views. Each tile represents a particular emoji.
53
- * The cached tiles collection is used for efficiency purposes to avoid re-creating a particular
54
- * tile again when the grid view has changed.
55
- */
56
- readonly cachedTiles: ViewCollection<ButtonView>;
57
- /**
58
- * A callback used to filter grid items by a specified query.
59
- */
60
- private readonly _getEmojiByQuery;
61
- /**
62
- * @inheritDoc
63
- */
64
- constructor(locale: Locale, { categoryName, emojiCategories, getEmojiByQuery, skinTone }: {
65
- categoryName: string;
66
- emojiCategories: Array<EmojiCategory>;
67
- getEmojiByQuery: EmojiSearchQueryCallback;
68
- skinTone: EmojiSkinToneId;
69
- });
70
- /**
71
- * @inheritDoc
72
- */
73
- render(): void;
74
- /**
75
- * @inheritDoc
76
- */
77
- destroy(): void;
78
- /**
79
- * Focuses the first focusable in {@link ~EmojiGridView#tiles} if available.
80
- */
81
- focus(): void;
82
- /**
83
- * Filters the grid view by the given regular expression.
84
- *
85
- * It filters either by the pattern or an emoji category, but never both.
86
- *
87
- * @param pattern Expression to search or `null` when filter by category name.
88
- */
89
- filter(pattern: RegExp | null): {
90
- resultsCount: number;
91
- totalItemsCount: number;
92
- };
93
- /**
94
- * Filters emojis to show based on the specified query phrase.
95
- *
96
- * @param query A query used to filter the grid.
97
- */
98
- private _getItemsByQuery;
99
- /**
100
- * Returns emojis that belong to the specified category.
101
- */
102
- private _getItemsByCategory;
103
- /**
104
- * Updates the grid by removing the existing items and insert the new ones.
105
- *
106
- * @param items An array of items to insert.
107
- */
108
- private _updateGrid;
109
- /**
110
- * Creates a new tile for the grid. Created tile is added to the {@link #cachedTiles} collection for further usage, if needed.
111
- *
112
- * @param emoji The emoji itself.
113
- * @param name The name of the emoji (e.g. "Smiling Face with Smiling Eyes").
114
- */
115
- private _createTile;
17
+ /**
18
+ * Defines the active category name.
19
+ *
20
+ * @observable
21
+ */
22
+ categoryName: string;
23
+ /**
24
+ * Active skin tone.
25
+ *
26
+ * @observable
27
+ */
28
+ skinTone: EmojiSkinToneId;
29
+ /**
30
+ * Set to `true` when the {@link #tiles} collection does not contain items to display.
31
+ *
32
+ * @observable
33
+ */
34
+ isEmpty: boolean;
35
+ /**
36
+ * A collection of the child tile views. Each tile represents a particular emoji.
37
+ */
38
+ readonly tiles: ViewCollection<ButtonView>;
39
+ /**
40
+ * Tracks information about the DOM focus in the grid.
41
+ */
42
+ readonly focusTracker: FocusTracker;
43
+ /**
44
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
45
+ */
46
+ readonly keystrokes: KeystrokeHandler;
47
+ /**
48
+ * An array containing all emojis grouped by their categories.
49
+ */
50
+ readonly emojiCategories: Array<EmojiCategory>;
51
+ /**
52
+ * A collection of all already created tile views. Each tile represents a particular emoji.
53
+ * The cached tiles collection is used for efficiency purposes to avoid re-creating a particular
54
+ * tile again when the grid view has changed.
55
+ */
56
+ readonly cachedTiles: ViewCollection<ButtonView>;
57
+ /**
58
+ * A callback used to filter grid items by a specified query.
59
+ */
60
+ private readonly _getEmojiByQuery;
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ constructor(locale: Locale, { categoryName, emojiCategories, getEmojiByQuery, skinTone }: {
65
+ categoryName: string;
66
+ emojiCategories: Array<EmojiCategory>;
67
+ getEmojiByQuery: EmojiSearchQueryCallback;
68
+ skinTone: EmojiSkinToneId;
69
+ });
70
+ /**
71
+ * @inheritDoc
72
+ */
73
+ override render(): void;
74
+ /**
75
+ * @inheritDoc
76
+ */
77
+ override destroy(): void;
78
+ /**
79
+ * Focuses the first focusable in {@link ~EmojiGridView#tiles} if available.
80
+ */
81
+ focus(): void;
82
+ /**
83
+ * Filters the grid view by the given regular expression.
84
+ *
85
+ * It filters either by the pattern or an emoji category, but never both.
86
+ *
87
+ * @param pattern Expression to search or `null` when filter by category name.
88
+ */
89
+ filter(pattern: RegExp | null): {
90
+ resultsCount: number;
91
+ totalItemsCount: number;
92
+ };
93
+ /**
94
+ * Filters emojis to show based on the specified query phrase.
95
+ *
96
+ * @param query A query used to filter the grid.
97
+ */
98
+ private _getItemsByQuery;
99
+ /**
100
+ * Returns emojis that belong to the specified category.
101
+ */
102
+ private _getItemsByCategory;
103
+ /**
104
+ * Updates the grid by removing the existing items and insert the new ones.
105
+ *
106
+ * @param items An array of items to insert.
107
+ */
108
+ private _updateGrid;
109
+ /**
110
+ * Creates a new tile for the grid. Created tile is added to the {@link #cachedTiles} collection for further usage, if needed.
111
+ *
112
+ * @param emoji The emoji itself.
113
+ * @param name The name of the emoji (e.g. "Smiling Face with Smiling Eyes").
114
+ */
115
+ private _createTile;
116
116
  }
117
117
  /**
118
- * A callback used to filter grid items by a specified query.
119
- */
118
+ * A callback used to filter grid items by a specified query.
119
+ */
120
120
  export type EmojiSearchQueryCallback = (query: string) => Array<EmojiEntry>;
121
121
  /**
122
- * Fired when any of {@link ~EmojiGridView#tiles grid tiles} is clicked.
123
- *
124
- * @eventName ~EmojiGridView#execute
125
- * @param data Additional information about the event.
126
- */
122
+ * Fired when any of {@link ~EmojiGridView#tiles grid tiles} is clicked.
123
+ *
124
+ * @eventName ~EmojiGridView#execute
125
+ * @param data Additional information about the event.
126
+ */
127
127
  export type EmojiGridViewExecuteEvent = {
128
- name: 'execute';
129
- args: [data: EmojiGridViewEventData];
128
+ name: "execute";
129
+ args: [data: EmojiGridViewEventData];
130
130
  };
131
131
  export type EmojiGridViewEventData = {
132
- /**
133
- * The name of the emoji (e.g. "Smiling Face with Smiling Eyes").
134
- */
135
- name: string;
136
- /**
137
- * The emoji itself.
138
- */
139
- emoji: string;
132
+ /**
133
+ * The name of the emoji (e.g. "Smiling Face with Smiling Eyes").
134
+ */
135
+ name: string;
136
+ /**
137
+ * The emoji itself.
138
+ */
139
+ emoji: string;
140
140
  };
@@ -1,76 +1,76 @@
1
1
  /**
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
- */
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
- * @module emoji/ui/emojipickerformview
7
- */
8
- import { ButtonView, View, ViewCollection } from '@ckeditor/ckeditor5-ui';
9
- import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
10
- import '../../theme/emojipickerform.css';
6
+ * @module emoji/ui/emojipickerformview
7
+ */
8
+ import { ButtonView, View, ViewCollection } from "@ckeditor/ckeditor5-ui";
9
+ import { FocusTracker, KeystrokeHandler, type Locale } from "@ckeditor/ckeditor5-utils";
10
+ import "../../theme/emojipickerform.css";
11
11
  /**
12
- * The emoji picker form view.
13
- */
12
+ * The emoji picker form view.
13
+ */
14
14
  export declare class EmojiPickerFormView extends View {
15
- /**
16
- * The Back button view displayed in the header.
17
- */
18
- backButtonView: ButtonView;
19
- /**
20
- * Tracks information about DOM focus in the form.
21
- */
22
- readonly focusTracker: FocusTracker;
23
- /**
24
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
25
- */
26
- readonly keystrokes: KeystrokeHandler;
27
- /**
28
- * A collection of child views.
29
- */
30
- readonly children: ViewCollection;
31
- /**
32
- * A collection of views that can be focused in the form.
33
- */
34
- private readonly _focusables;
35
- /**
36
- * Helps cycling over {@link #_focusables} in the form.
37
- */
38
- private readonly _focusCycler;
39
- /**
40
- * Creates an instance of the {@link module:emoji/ui/emojipickerformview~EmojiPickerFormView} class.
41
- *
42
- * Also see {@link #render}.
43
- *
44
- * @param locale The localization services instance.
45
- */
46
- constructor(locale: Locale);
47
- /**
48
- * @inheritDoc
49
- */
50
- render(): void;
51
- /**
52
- * @inheritDoc
53
- */
54
- destroy(): void;
55
- /**
56
- * Focuses the fist {@link #_focusables} in the form.
57
- */
58
- focus(): void;
59
- /**
60
- * Creates a back button view that cancels the form.
61
- */
62
- private _createBackButton;
63
- /**
64
- * Creates a header view for the form.
65
- */
66
- private _createHeaderView;
15
+ /**
16
+ * The Back button view displayed in the header.
17
+ */
18
+ backButtonView: ButtonView;
19
+ /**
20
+ * Tracks information about DOM focus in the form.
21
+ */
22
+ readonly focusTracker: FocusTracker;
23
+ /**
24
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
25
+ */
26
+ readonly keystrokes: KeystrokeHandler;
27
+ /**
28
+ * A collection of child views.
29
+ */
30
+ readonly children: ViewCollection;
31
+ /**
32
+ * A collection of views that can be focused in the form.
33
+ */
34
+ private readonly _focusables;
35
+ /**
36
+ * Helps cycling over {@link #_focusables} in the form.
37
+ */
38
+ private readonly _focusCycler;
39
+ /**
40
+ * Creates an instance of the {@link module:emoji/ui/emojipickerformview~EmojiPickerFormView} class.
41
+ *
42
+ * Also see {@link #render}.
43
+ *
44
+ * @param locale The localization services instance.
45
+ */
46
+ constructor(locale: Locale);
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ override render(): void;
51
+ /**
52
+ * @inheritDoc
53
+ */
54
+ override destroy(): void;
55
+ /**
56
+ * Focuses the fist {@link #_focusables} in the form.
57
+ */
58
+ focus(): void;
59
+ /**
60
+ * Creates a back button view that cancels the form.
61
+ */
62
+ private _createBackButton;
63
+ /**
64
+ * Creates a header view for the form.
65
+ */
66
+ private _createHeaderView;
67
67
  }
68
68
  /**
69
- * Fired when the form view is canceled, for example with a click on {@link ~EmojiPickerFormView#backButtonView}.
70
- *
71
- * @eventName ~EmojiPickerFormView#cancel
72
- */
69
+ * Fired when the form view is canceled, for example with a click on {@link ~EmojiPickerFormView#backButtonView}.
70
+ *
71
+ * @eventName ~EmojiPickerFormView#cancel
72
+ */
73
73
  export type EmojiPickerFormViewCancelEvent = {
74
- name: 'cancel';
75
- args: [];
74
+ name: "cancel";
75
+ args: [];
76
76
  };