From 1240a4841be1b6683d7df3170163df42c2919807 Mon Sep 17 00:00:00 2001 From: Witek Socha Date: Thu, 20 Feb 2025 18:05:40 +0100 Subject: [PATCH 1/2] Improve emoji's docs. --- .../ckeditor5-emoji/docs/features/emoji.md | 21 ++++++++++++++----- .../ckeditor5-emoji/src/emojirepository.ts | 6 ++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/ckeditor5-emoji/docs/features/emoji.md b/packages/ckeditor5-emoji/docs/features/emoji.md index 6332d13fc68..1b30ccbdf12 100644 --- a/packages/ckeditor5-emoji/docs/features/emoji.md +++ b/packages/ckeditor5-emoji/docs/features/emoji.md @@ -120,7 +120,7 @@ The feature can be configured via the {@link module:emoji/emojiconfig~EmojiConfi .catch( /* ... */ ); ``` -* `version` – the emoji database version. +* `version` – the emoji database version. By default, the version 16 is used. This option is ignored if `definitionsUrl` is provided. ```js ClassicEditor @@ -133,12 +133,23 @@ The feature can be configured via the {@link module:emoji/emojiconfig~EmojiConfi .then( /* ... */ ) .catch( /* ... */ ); ``` +### Emoji's source - - The emoji feature uses the `:` marker that opens a panel with a table of selectable emojis. If you are using {@link features/mentions mentions} or {@link features/merge-fields merge fields} features, they can also show UI panels by pressing a pre-configured key, and it may conflict with the emoji feature. In such a case, the {@link module:emoji/emojimention~EmojiMention} plugin will not integrate the autocompletion mechanism. +The database of english emoji is by default loaded from our CDN. Make sure that your {@link getting-started/setup/csp CSP} rules are correctly set up. - To prevent conflicts, make sure that {@link module:mention/mentionconfig~MentionFeed#marker mention's `marker`} and {@link module:merge-fields/mergefieldsconfig~MergeFieldsConfig#prefix merge field's `prefix`} configuration options are defined differently than `:`. - +If you do not want to use our distribution and prefer to self-host emoji, you can use the {@link module:emoji/emojiconfig~EmojiConfig#definitionsUrl `definitionsUrl`} option. You can download the data directly from the package mentioned above or from our CDN, and place it under a static assets URL, for example: + +1. Download emoji database from [https://cdn.ckeditor.com/ckeditor5/data/emoji/16/en.json](https://cdn.ckeditor.com/ckeditor5/data/emoji/16/en.json), or version `15` for older Unicode versions. +2. Place the downloaded file in your application's assets folder, for example `public/emoji/en.json`. The specific location may vary depending on your framework and setup. +3. Update the configuration to point `definitionsUrl` to the URL of your assets, like `https://example.com/emoji/en.json`. + +You can prepare your own database with a different emoji set, but it must be identical in structure to ours. Otherwise, the emoji feature will not work. + +### Marker conflicts + +The emoji feature uses the `:` marker that opens a panel with a table of selectable emojis. If you are using {@link features/mentions mentions} or {@link features/merge-fields merge fields} features, they can also show UI panels by pressing a pre-configured key, and it may conflict with the emoji feature. In such a case, the {@link module:emoji/emojimention~EmojiMention} plugin will not integrate the autocompletion mechanism. + +To prevent conflicts, make sure that {@link module:mention/mentionconfig~MentionFeed#marker mention's `marker`} and {@link module:merge-fields/mergefieldsconfig~MergeFieldsConfig#prefix merge field's `prefix`} configuration options are defined differently than `:`. ## Related features diff --git a/packages/ckeditor5-emoji/src/emojirepository.ts b/packages/ckeditor5-emoji/src/emojirepository.ts index bf981d365c8..b01c2e4bf53 100644 --- a/packages/ckeditor5-emoji/src/emojirepository.ts +++ b/packages/ckeditor5-emoji/src/emojirepository.ts @@ -270,8 +270,10 @@ export default class EmojiRepository extends Plugin { } /** - * By default, the Emoji plugin fetches the emoji repository from CKEditor 5 CDN. To avoid this, - * you can use the {@link module:emoji/emojiconfig~EmojiConfig#definitionsUrl `emoji.definitionsUrl`} + * It was detected that your installation uses a commercial self-hosted license key, + * and the default {@glink features/emoji#emojis-source CKEditor CDN for Emoji plugin data}. + * + * To avoid this, you can use the {@link module:emoji/emojiconfig~EmojiConfig#definitionsUrl `emoji.definitionsUrl`} * configuration option to provide a URL to your own emoji repository. * * If you only want to suppress this warning, set this configuration option to `cdn`. From d586084e5b2309b4b8931201f40652eed7d7bf3a Mon Sep 17 00:00:00 2001 From: Bartek Biedrzycki Date: Fri, 21 Feb 2025 07:07:48 +0100 Subject: [PATCH 2/2] Docs: a review. [short flow] --- packages/ckeditor5-emoji/docs/features/emoji.md | 17 +++++++++-------- packages/ckeditor5-emoji/src/emojirepository.ts | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/ckeditor5-emoji/docs/features/emoji.md b/packages/ckeditor5-emoji/docs/features/emoji.md index 1b30ccbdf12..2921536d076 100644 --- a/packages/ckeditor5-emoji/docs/features/emoji.md +++ b/packages/ckeditor5-emoji/docs/features/emoji.md @@ -120,7 +120,7 @@ The feature can be configured via the {@link module:emoji/emojiconfig~EmojiConfi .catch( /* ... */ ); ``` -* `version` – the emoji database version. By default, the version 16 is used. This option is ignored if `definitionsUrl` is provided. +* `version` – the emoji database version. By default, version 16 is used. This option is ignored if the `definitionsUrl` setting is provided. ```js ClassicEditor @@ -133,23 +133,24 @@ The feature can be configured via the {@link module:emoji/emojiconfig~EmojiConfi .then( /* ... */ ) .catch( /* ... */ ); ``` -### Emoji's source -The database of english emoji is by default loaded from our CDN. Make sure that your {@link getting-started/setup/csp CSP} rules are correctly set up. +### Emoji source + +The database of English emoji is loaded by default from our CDN. Make sure that your {@link getting-started/setup/csp CSP rules} are correctly set up. If you do not want to use our distribution and prefer to self-host emoji, you can use the {@link module:emoji/emojiconfig~EmojiConfig#definitionsUrl `definitionsUrl`} option. You can download the data directly from the package mentioned above or from our CDN, and place it under a static assets URL, for example: -1. Download emoji database from [https://cdn.ckeditor.com/ckeditor5/data/emoji/16/en.json](https://cdn.ckeditor.com/ckeditor5/data/emoji/16/en.json), or version `15` for older Unicode versions. +1. Download the latest emoji database from [https://cdn.ckeditor.com/ckeditor5/data/emoji/16/en.json](https://cdn.ckeditor.com/ckeditor5/data/emoji/16/en.json), or download version 15 for older Unicode versions. 2. Place the downloaded file in your application's assets folder, for example `public/emoji/en.json`. The specific location may vary depending on your framework and setup. -3. Update the configuration to point `definitionsUrl` to the URL of your assets, like `https://example.com/emoji/en.json`. +3. Update the configuration option `definitionsUrl` to point to the URL of your assets, for example: `https://example.com/emoji/en.json`. -You can prepare your own database with a different emoji set, but it must be identical in structure to ours. Otherwise, the emoji feature will not work. +You can prepare your own database with a different emoji set, but it must have an identical structure as ours. Otherwise, the emoji feature will not work. ### Marker conflicts -The emoji feature uses the `:` marker that opens a panel with a table of selectable emojis. If you are using {@link features/mentions mentions} or {@link features/merge-fields merge fields} features, they can also show UI panels by pressing a pre-configured key, and it may conflict with the emoji feature. In such a case, the {@link module:emoji/emojimention~EmojiMention} plugin will not integrate the autocompletion mechanism. +The emoji feature uses the `:` marker that opens a panel with a table of selectable emojis. If you are using the {@link features/mentions mentions} or {@link features/merge-fields merge fields} features, they can also show UI panels by pressing a pre-configured key, and it may conflict with the emoji feature. In such a case, the {@link module:emoji/emojimention~EmojiMention} plugin will not integrate the autocompletion mechanism. -To prevent conflicts, make sure that {@link module:mention/mentionconfig~MentionFeed#marker mention's `marker`} and {@link module:merge-fields/mergefieldsconfig~MergeFieldsConfig#prefix merge field's `prefix`} configuration options are defined differently than `:`. +To prevent conflicts, make sure that the {@link module:mention/mentionconfig~MentionFeed#marker mention's `marker`} and {@link module:merge-fields/mergefieldsconfig~MergeFieldsConfig#prefix merge field's `prefix`} configuration options are not defined as `:`. ## Related features diff --git a/packages/ckeditor5-emoji/src/emojirepository.ts b/packages/ckeditor5-emoji/src/emojirepository.ts index b01c2e4bf53..6b3669cb2e0 100644 --- a/packages/ckeditor5-emoji/src/emojirepository.ts +++ b/packages/ckeditor5-emoji/src/emojirepository.ts @@ -271,7 +271,7 @@ export default class EmojiRepository extends Plugin { /** * It was detected that your installation uses a commercial self-hosted license key, - * and the default {@glink features/emoji#emojis-source CKEditor CDN for Emoji plugin data}. + * and the default {@glink features/emoji#emoji-source CKEditor CDN for Emoji plugin data}. * * To avoid this, you can use the {@link module:emoji/emojiconfig~EmojiConfig#definitionsUrl `emoji.definitionsUrl`} * configuration option to provide a URL to your own emoji repository.