@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,91 +1,95 @@
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/emojipickerview
7
- */
8
- import { FocusCycler, SearchInfoView, View, type FocusableView, type ViewCollection } from '@ckeditor/ckeditor5-ui';
9
- import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
10
- import { EmojiGridView, type EmojiSearchQueryCallback } from './emojigridview.js';
11
- import { EmojiCategoriesView } from './emojicategoriesview.js';
12
- import { EmojiSearchView } from './emojisearchview.js';
13
- import { EmojiToneView } from './emojitoneview.js';
14
- import type { EmojiSkinToneId } from '../emojiconfig.js';
15
- import type { EmojiCategory, EmojiSkinTone } from '../emojirepository.js';
6
+ * @module emoji/ui/emojipickerview
7
+ */
8
+ import { FocusCycler, SearchInfoView, View, type FocusableView, type ViewCollection } from "@ckeditor/ckeditor5-ui";
9
+ import { FocusTracker, KeystrokeHandler, type Locale } from "@ckeditor/ckeditor5-utils";
10
+ import { EmojiGridView, type EmojiSearchQueryCallback } from "./emojigridview.js";
11
+ import { EmojiCategoriesView } from "./emojicategoriesview.js";
12
+ import { EmojiSearchView } from "./emojisearchview.js";
13
+ import { EmojiToneView } from "./emojitoneview.js";
14
+ import type { EmojiSkinToneId } from "../emojiconfig.js";
15
+ import type { EmojiCategory, EmojiSkinTone } from "../emojirepository.js";
16
16
  /**
17
- * A view that glues pieces of the emoji panel together.
18
- */
17
+ * A view that glues pieces of the emoji panel together.
18
+ */
19
19
  export declare class EmojiPickerView extends View<HTMLDivElement> {
20
- /**
21
- * A collection of the focusable children of the view.
22
- */
23
- readonly items: ViewCollection<FocusableView>;
24
- /**
25
- * Tracks information about the DOM focus in the view.
26
- */
27
- readonly focusTracker: FocusTracker;
28
- /**
29
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
30
- */
31
- readonly keystrokes: KeystrokeHandler;
32
- /**
33
- * Helps cycling over focusable {@link #items} in the view.
34
- */
35
- readonly focusCycler: FocusCycler;
36
- /**
37
- * An instance of the `EmojiSearchView`.
38
- */
39
- readonly searchView: EmojiSearchView;
40
- /**
41
- * An instance of the `EmojiToneView`.
42
- */
43
- readonly toneView: EmojiToneView;
44
- /**
45
- * An instance of the `EmojiCategoriesView`.
46
- */
47
- readonly categoriesView: EmojiCategoriesView;
48
- /**
49
- * An instance of the `EmojiGridView`.
50
- */
51
- readonly gridView: EmojiGridView;
52
- /**
53
- * An instance of the `EmojiGridView`.
54
- */
55
- readonly infoView: SearchInfoView;
56
- /**
57
- * @inheritDoc
58
- */
59
- constructor(locale: Locale, { emojiCategories, getEmojiByQuery, skinTone, skinTones }: {
60
- emojiCategories: Array<EmojiCategory>;
61
- getEmojiByQuery: EmojiSearchQueryCallback;
62
- skinTone: EmojiSkinToneId;
63
- skinTones: Array<EmojiSkinTone>;
64
- });
65
- /**
66
- * @inheritDoc
67
- */
68
- render(): void;
69
- /**
70
- * @inheritDoc
71
- */
72
- destroy(): void;
73
- /**
74
- * Focuses the search input.
75
- */
76
- focus(): void;
77
- /**
78
- * Initializes interactions between sub-views.
79
- */
80
- private _setupEventListeners;
20
+ /**
21
+ * A collection of the focusable children of the view.
22
+ */
23
+ readonly items: ViewCollection<FocusableView>;
24
+ /**
25
+ * Tracks information about the DOM focus in the view.
26
+ */
27
+ readonly focusTracker: FocusTracker;
28
+ /**
29
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
30
+ */
31
+ readonly keystrokes: KeystrokeHandler;
32
+ /**
33
+ * Helps cycling over focusable {@link #items} in the view.
34
+ */
35
+ readonly focusCycler: FocusCycler;
36
+ /**
37
+ * An instance of the `EmojiSearchView`.
38
+ */
39
+ readonly searchView: EmojiSearchView;
40
+ /**
41
+ * An instance of the `EmojiToneView`.
42
+ */
43
+ readonly toneView: EmojiToneView;
44
+ /**
45
+ * An instance of the `EmojiCategoriesView`.
46
+ */
47
+ readonly categoriesView: EmojiCategoriesView;
48
+ /**
49
+ * An instance of the `EmojiGridView`.
50
+ */
51
+ readonly gridView: EmojiGridView;
52
+ /**
53
+ * An instance of the `EmojiGridView`.
54
+ */
55
+ readonly infoView: SearchInfoView;
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ constructor(locale: Locale, { emojiCategories, getEmojiByQuery, skinTone, skinTones }: {
60
+ emojiCategories: Array<EmojiCategory>;
61
+ getEmojiByQuery: EmojiSearchQueryCallback;
62
+ skinTone: EmojiSkinToneId;
63
+ skinTones: Array<EmojiSkinTone>;
64
+ });
65
+ /**
66
+ * @inheritDoc
67
+ */
68
+ override render(): void;
69
+ /**
70
+ * @inheritDoc
71
+ */
72
+ override destroy(): void;
73
+ /**
74
+ * Focuses the search input.
75
+ */
76
+ focus(): void;
77
+ /**
78
+ * Sets certain list of categories in categories view and performs search.
79
+ */
80
+ setCategories(categories: Array<EmojiCategory>): void;
81
+ /**
82
+ * Initializes interactions between sub-views.
83
+ */
84
+ private _setupEventListeners;
81
85
  }
82
86
  /**
83
- * Fired when the {@link module:emoji/ui/emojipickerview~EmojiPickerView} layout is changed, either by filtering emoji tiles or
84
- * showing a hint to a user regarding the provided query.
85
- *
86
- * @eventName ~EmojiPickerView#update
87
- */
87
+ * Fired when the {@link module:emoji/ui/emojipickerview~EmojiPickerView} layout is changed, either by filtering emoji tiles or
88
+ * showing a hint to a user regarding the provided query.
89
+ *
90
+ * @eventName ~EmojiPickerView#update
91
+ */
88
92
  export type EmojiPickerViewUpdateEvent = {
89
- name: 'update';
90
- args: [];
93
+ name: "update";
94
+ args: [];
91
95
  };
@@ -1,51 +1,51 @@
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
- */
5
- import { SearchTextView, View, type SearchInfoView } from '@ckeditor/ckeditor5-ui';
6
- import type { Locale } from '@ckeditor/ckeditor5-utils';
7
- import { type EmojiGridView } from './emojigridview.js';
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 { SearchTextView, View, type SearchInfoView } from "@ckeditor/ckeditor5-ui";
6
+ import type { Locale } from "@ckeditor/ckeditor5-utils";
7
+ import { type EmojiGridView } from "./emojigridview.js";
8
8
  /**
9
- * A view responsible for providing an input element that allows filtering emoji by the provided query.
10
- */
9
+ * A view responsible for providing an input element that allows filtering emoji by the provided query.
10
+ */
11
11
  export declare class EmojiSearchView extends View {
12
- /**
13
- * The find in text input view that stores the searched string.
14
- */
15
- readonly inputView: SearchTextView;
16
- /**
17
- * An instance of the `EmojiGridView`.
18
- */
19
- readonly gridView: EmojiGridView;
20
- /**
21
- * @inheritDoc
22
- */
23
- constructor(locale: Locale, { gridView, resultsView }: {
24
- gridView: EmojiGridView;
25
- resultsView: SearchInfoView;
26
- });
27
- /**
28
- * @inheritDoc
29
- */
30
- destroy(): void;
31
- /**
32
- * Searches the {@link #gridView} for the given query.
33
- *
34
- * @param query The search query string.
35
- */
36
- search(query: string): void;
37
- /**
38
- * Allows defining the default value in the search text field.
39
- *
40
- * @param value The new value.
41
- */
42
- setInputValue(value: string): void;
43
- /**
44
- * Returns an input provided by a user in the search text field.
45
- */
46
- getInputValue(): string;
47
- /**
48
- * @inheritDoc
49
- */
50
- focus(): void;
12
+ /**
13
+ * The find in text input view that stores the searched string.
14
+ */
15
+ readonly inputView: SearchTextView;
16
+ /**
17
+ * An instance of the `EmojiGridView`.
18
+ */
19
+ readonly gridView: EmojiGridView;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ constructor(locale: Locale, { gridView, resultsView }: {
24
+ gridView: EmojiGridView;
25
+ resultsView: SearchInfoView;
26
+ });
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ override destroy(): void;
31
+ /**
32
+ * Searches the {@link #gridView} for the given query.
33
+ *
34
+ * @param query The search query string.
35
+ */
36
+ search(query: string): void;
37
+ /**
38
+ * Allows defining the default value in the search text field.
39
+ *
40
+ * @param value The new value.
41
+ */
42
+ setInputValue(value: string): void;
43
+ /**
44
+ * Returns an input provided by a user in the search text field.
45
+ */
46
+ getInputValue(): string;
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ focus(): void;
51
51
  }
@@ -1,46 +1,46 @@
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/emojitoneview
7
- */
8
- import { View, type DropdownView } from '@ckeditor/ckeditor5-ui';
9
- import { type Locale } from '@ckeditor/ckeditor5-utils';
10
- import type { EmojiSkinToneId } from '../emojiconfig.js';
11
- import type { EmojiSkinTone } from '../emojirepository.js';
12
- import '../../theme/emojitone.css';
6
+ * @module emoji/ui/emojitoneview
7
+ */
8
+ import { View, type DropdownView } from "@ckeditor/ckeditor5-ui";
9
+ import { type Locale } from "@ckeditor/ckeditor5-utils";
10
+ import type { EmojiSkinToneId } from "../emojiconfig.js";
11
+ import type { EmojiSkinTone } from "../emojirepository.js";
12
+ import "../../theme/emojitone.css";
13
13
  /**
14
- * A view responsible for selecting a skin tone for an emoji.
15
- */
14
+ * A view responsible for selecting a skin tone for an emoji.
15
+ */
16
16
  export declare class EmojiToneView extends View {
17
- /**
18
- * Active skin tone.
19
- *
20
- * @observable
21
- */
22
- skinTone: EmojiSkinToneId;
23
- /**
24
- * A dropdown element for selecting an active skin tone.
25
- */
26
- readonly dropdownView: DropdownView;
27
- /**
28
- * An array of available skin tones.
29
- */
30
- private readonly _skinTones;
31
- /**
32
- * @inheritDoc
33
- */
34
- constructor(locale: Locale, { skinTone, skinTones }: {
35
- skinTone: EmojiSkinToneId;
36
- skinTones: Array<EmojiSkinTone>;
37
- });
38
- /**
39
- * @inheritDoc
40
- */
41
- focus(): void;
42
- /**
43
- * Helper method for receiving an object describing the active skin tone.
44
- */
45
- private _getSkinTone;
17
+ /**
18
+ * Active skin tone.
19
+ *
20
+ * @observable
21
+ */
22
+ skinTone: EmojiSkinToneId;
23
+ /**
24
+ * A dropdown element for selecting an active skin tone.
25
+ */
26
+ readonly dropdownView: DropdownView;
27
+ /**
28
+ * An array of available skin tones.
29
+ */
30
+ private readonly _skinTones;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ constructor(locale: Locale, { skinTone, skinTones }: {
35
+ skinTone: EmojiSkinToneId;
36
+ skinTones: Array<EmojiSkinTone>;
37
+ });
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ focus(): void;
42
+ /**
43
+ * Helper method for receiving an object describing the active skin tone.
44
+ */
45
+ private _getSkinTone;
46
46
  }
@@ -0,0 +1,48 @@
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
+ */
5
+ /**
6
+ * @module emoji/utils/emojirepositorycache
7
+ */
8
+ import type { EmojiCdnResource, EmojiEntry } from "../emojirepository.js";
9
+ /**
10
+ * Cache for emoji repository data.
11
+ *
12
+ * @internal
13
+ */
14
+ export declare class EmojiRepositoryCache {
15
+ /**
16
+ * Fetch-and-transform promises, keyed by composite key.
17
+ */
18
+ private _cache;
19
+ /**
20
+ * Fetches emoji data for `url`, runs it through `transform`, and caches the result.
21
+ * At most one HTTP request is issued per unique `[url, ...cacheKeys]` combination.
22
+ * Returns `[]` on network or HTTP failure.
23
+ *
24
+ * @param params Fetch parameters.
25
+ * @param params.url URL of the emoji repository JSON file.
26
+ * @param params.cacheKeys Extra segments that differentiate results for the same URL.
27
+ * The URL itself is always the first segment of the composite key.
28
+ * @param params.transform Converts raw CDN resources into `EmojiEntry` objects.
29
+ */
30
+ fetch({ url, cacheKeys, transform }: FetchParams): Promise<Array<EmojiEntry>>;
31
+ /**
32
+ * Synchronously returns the already-transformed array for the given `url` + `cacheKeys`,
33
+ * or `null` if the result is not yet available.
34
+ */
35
+ getSync({ url, cacheKeys }: CacheKeyParams): Array<EmojiEntry> | null;
36
+ /**
37
+ * Clears the cache.
38
+ */
39
+ clear(): void;
40
+ }
41
+ type CacheKeyParams = {
42
+ url: string;
43
+ cacheKeys: Array<string>;
44
+ };
45
+ type FetchParams = CacheKeyParams & {
46
+ transform: (raw: Array<EmojiCdnResource>) => Array<EmojiEntry>;
47
+ };
48
+ export {};
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2023, Koala Interactive SAS
3
- * For licensing, see https://github.com/koala-interactive/is-emoji-supported/blob/master/LICENSE.md
4
- */
2
+ * @license Copyright (c) 2023, Koala Interactive SAS
3
+ * For licensing, see https://github.com/koala-interactive/is-emoji-supported/blob/master/LICENSE.md
4
+ */
5
5
  /**
6
- * @module emoji/utils/isemojisupported
7
- */
6
+ * @module emoji/utils/isemojisupported
7
+ */
8
8
  /**
9
- * Checks if the two pixels parts are the same using canvas.
10
- *
11
- * @internal
12
- */
9
+ * Checks if the two pixels parts are the same using canvas.
10
+ *
11
+ * @internal
12
+ */
13
13
  export declare function isEmojiSupported(unicode: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-emoji",
3
- "version": "48.2.0",
3
+ "version": "48.3.0-alpha.1",
4
4
  "description": "Emoji feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -30,12 +30,12 @@
30
30
  "dist/translations/*.umd.js"
31
31
  ],
32
32
  "dependencies": {
33
- "@ckeditor/ckeditor5-core": "48.2.0",
34
- "@ckeditor/ckeditor5-icons": "48.2.0",
35
- "@ckeditor/ckeditor5-mention": "48.2.0",
36
- "@ckeditor/ckeditor5-typing": "48.2.0",
37
- "@ckeditor/ckeditor5-ui": "48.2.0",
38
- "@ckeditor/ckeditor5-utils": "48.2.0",
33
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.1",
34
+ "@ckeditor/ckeditor5-icons": "48.3.0-alpha.1",
35
+ "@ckeditor/ckeditor5-mention": "48.3.0-alpha.1",
36
+ "@ckeditor/ckeditor5-typing": "48.3.0-alpha.1",
37
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.1",
38
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.1",
39
39
  "fuzzysort": "3.1.0",
40
40
  "es-toolkit": "1.45.1"
41
41
  },