Selaa lähdekoodia

Merge branch 'master' into t/12

Maciej Gołaszewski 6 vuotta sitten
vanhempi
commit
8184cc9ef6

+ 9 - 0
packages/ckeditor5-mention/.github/PULL_REQUEST_TEMPLATE.md

@@ -0,0 +1,9 @@
+### Suggested merge commit message ([convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention))
+
+Type: Message. Closes #000.
+
+---
+
+### Additional information
+
+*For example – encountered issues, assumptions you had to make, other affected tickets, etc.*

+ 2 - 7
packages/ckeditor5-mention/docs/_snippets/features/mention-customization.js

@@ -7,11 +7,6 @@
 
 import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
 
-import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
-
-// The link plugin using highest priority in conversion pipeline.
-const HIGHER_THEN_HIGHEST = priorities.highest + 50;
-
 ClassicEditor
 	.create( document.querySelector( '#snippet-mention-customization' ), {
 		cloudServices: CS_CONFIG,
@@ -70,7 +65,7 @@ function CustomMention( editor ) {
 				return mentionValue;
 			}
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 
 	function isFullMention( viewElement ) {
@@ -107,7 +102,7 @@ function CustomMention( editor ) {
 				'href': modelAttributeValue.link
 			} );
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 }
 

+ 3 - 8
packages/ckeditor5-mention/docs/features/mention.md

@@ -157,14 +157,9 @@ To a link:
 <a class="mention" data-mention="Ted Mosby" data-user-id="5" href="https://www.imdb.com/title/tt0460649/characters/nm1102140">@Ted Mosby</a>
 ```
 
-The below converters must have priority higher then link attribute converter. The mention item in the model must be stored as a plain object with `name` attribute.
+The below converters must have priority 'high' priority as the link attribute converter has 'normal' priority. The mention item in the model must be stored as a plain object with `name` attribute.
 
 ```js
-import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
-
-// The link plugin using highest priority in conversion pipeline.
-const HIGHER_THEN_HIGHEST = priorities.highest + 50;
-
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Mention, CustomMention, ... ],    // Add custom mention plugin function.
@@ -207,7 +202,7 @@ function CustomMention( editor ) {
 				return mentionValue;
 			}
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 
 	function isFullMention( viewElement ) {
@@ -244,7 +239,7 @@ function CustomMention( editor ) {
 				'href': modelAttributeValue.link
 			} );
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 }
 ```

+ 2 - 0
packages/ckeditor5-mention/src/mention.js

@@ -12,6 +12,8 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import MentionEditing from './mentionediting';
 import MentionUI from './mentionui';
 
+import '../theme/mention.css';
+
 /**
  * The mention plugin.
  *

+ 0 - 2
packages/ckeditor5-mention/src/mentionediting.js

@@ -12,8 +12,6 @@ import uid from '@ckeditor/ckeditor5-utils/src/uid';
 
 import MentionCommand from './mentioncommand';
 
-import '../theme/mentionediting.css';
-
 /**
  * The mention editing feature.
  *

+ 2 - 5
packages/ckeditor5-mention/tests/manual/mention-custom-view.js

@@ -22,13 +22,10 @@ import Link from '@ckeditor/ckeditor5-link/src/link';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
 
 import MentionUI from '../../src/mentionui';
 import MentionEditing from '../../src/mentionediting';
 
-const HIGHER_THEN_HIGHEST = priorities.highest + 50;
-
 class CustomMentionAttributeView extends Plugin {
 	init() {
 		const editor = this.editor;
@@ -53,7 +50,7 @@ class CustomMentionAttributeView extends Plugin {
 					return mentionValue;
 				}
 			},
-			converterPriority: HIGHER_THEN_HIGHEST
+			converterPriority: 'high'
 		} );
 
 		editor.conversion.for( 'downcast' ).attributeToElement( {
@@ -69,7 +66,7 @@ class CustomMentionAttributeView extends Plugin {
 					'href': modelAttributeValue.link
 				} );
 			},
-			converterPriority: HIGHER_THEN_HIGHEST
+			converterPriority: 'high'
 		} );
 	}
 }

packages/ckeditor5-mention/theme/mentionediting.css → packages/ckeditor5-mention/theme/mention.css