Parcourir la source

Merge branch 'master' into t/4

# Conflicts:
#	package.json
Maciej Gołaszewski il y a 6 ans
Parent
commit
cc4573080d

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 3
packages/ckeditor5-mention/.travis.yml


+ 19 - 0
packages/ckeditor5-mention/CHANGELOG.md

@@ -1,6 +1,25 @@
 Changelog
 =========
 
+## [11.0.0](https://github.com/ckeditor/ckeditor5-mention/compare/v10.0.0...v11.0.0) (2019-06-05)
+
+### Bug fixes
+
+* A mention can now be preceded by characters such as brackets, quotes, soft break, etc. Closes [#44](https://github.com/ckeditor/ckeditor5-mention/issues/44). ([86262d1](https://github.com/ckeditor/ckeditor5-mention/commit/86262d1))
+* The mention plugin should not throw errors when another `ContextualBalloon` is already visible. Closes [#67](https://github.com/ckeditor/ckeditor5-mention/issues/67). ([de9ee71](https://github.com/ckeditor/ckeditor5-mention/commit/de9ee71))
+* The mention panel should have precedence over all other panels. Closes [#74](https://github.com/ckeditor/ckeditor5-mention/issues/74). ([3e8a84c](https://github.com/ckeditor/ckeditor5-mention/commit/3e8a84c))
+* The Mention UI will use `ContextualBalloon` plugin to display to prevent balloon collisions with other features. Closes [#27](https://github.com/ckeditor/ckeditor5-mention/issues/27). ([9ae7f30](https://github.com/ckeditor/ckeditor5-mention/commit/9ae7f30))
+
+### Other changes
+
+* Remove unknown stack option from `ContextualBalloon#add()` method call. ([b6a50cf](https://github.com/ckeditor/ckeditor5-mention/commit/b6a50cf))
+* Use `Model#insertContent()` instead of `model.Writer#insertText()`. Closes [#69](https://github.com/ckeditor/ckeditor5-mention/issues/69). ([ee973bb](https://github.com/ckeditor/ckeditor5-mention/commit/ee973bb))
+
+### BREAKING CHANGES
+
+* The `MentionUI#panelView` property is removed. The mention feature now uses the `ContextualBalloon` plugin.
+
+
 ## [10.0.0](https://github.com/ckeditor/ckeditor5-mention/tree/v10.0.0) (2019-04-10)
 
 The initial release.

+ 1 - 2
packages/ckeditor5-mention/README.md

@@ -4,7 +4,6 @@ CKEditor 5 mention feature
 [![Join the chat at https://gitter.im/ckeditor/ckeditor5](https://badges.gitter.im/ckeditor/ckeditor5.svg)](https://gitter.im/ckeditor/ckeditor5?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-mention.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-mention)
 [![Build Status](https://travis-ci.org/ckeditor/ckeditor5-mention.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-mention)
-[![BrowserStack Status](https://automate.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://automate.browserstack.com/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)
 [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-mention/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-mention?branch=master)
 <br>
 [![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-mention/status.svg)](https://david-dm.org/ckeditor/ckeditor5-mention)
@@ -22,4 +21,4 @@ See the [`@ckeditor/ckeditor5-mention` package](https://ckeditor.com/docs/ckedit
 
 ## License
 
-Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file.
+Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).

+ 1 - 1
packages/ckeditor5-mention/docs/features/mentions.md

@@ -39,7 +39,7 @@ ClassicEditor
 					feed: [ '@Barney', '@Lily', '@Marshall', '@Robin', '@Ted' ],
 					minimumCharacters: 1
 				}
-			}
+			]
 		}
 	} )
 	.then( ... )

+ 16 - 17
packages/ckeditor5-mention/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ckeditor/ckeditor5-mention",
-  "version": "10.0.0",
+  "version": "11.0.0",
   "description": "Mention feature for CKEditor 5.",
   "keywords": [
     "ckeditor",
@@ -10,24 +10,23 @@
     "ckeditor5-plugin"
   ],
   "dependencies": {
-    "@ckeditor/ckeditor5-core": "^12.1.0",
-    "@ckeditor/ckeditor5-ui": "^12.1.0",
-    "@ckeditor/ckeditor5-utils": "^12.1.0",
-    "lodash-es": "^4.17.10"
+    "@ckeditor/ckeditor5-core": "^12.1.1",
+    "@ckeditor/ckeditor5-ui": "^13.0.0",
+    "@ckeditor/ckeditor5-utils": "^12.1.1"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-basic-styles": "^11.1.0",
-    "@ckeditor/ckeditor5-block-quote": "^11.0.1",
-    "@ckeditor/ckeditor5-clipboard": "^11.0.1",
-    "@ckeditor/ckeditor5-editor-classic": "^12.1.0",
-    "@ckeditor/ckeditor5-engine": "^13.1.0",
-    "@ckeditor/ckeditor5-font": "^11.1.0",
-    "@ckeditor/ckeditor5-link": "^11.0.1",
-    "@ckeditor/ckeditor5-paragraph": "^11.0.1",
-    "@ckeditor/ckeditor5-table": "^12.0.1",
-    "@ckeditor/ckeditor5-typing": "^12.0.1",
-    "@ckeditor/ckeditor5-undo": "^11.0.1",
-    "@ckeditor/ckeditor5-widget": "^11.0.1",
+    "@ckeditor/ckeditor5-basic-styles": "^11.1.1",
+    "@ckeditor/ckeditor5-block-quote": "^11.1.0",
+    "@ckeditor/ckeditor5-clipboard": "^11.0.2",
+    "@ckeditor/ckeditor5-editor-classic": "^12.1.1",
+    "@ckeditor/ckeditor5-engine": "^13.1.1",
+    "@ckeditor/ckeditor5-font": "^11.1.1",
+    "@ckeditor/ckeditor5-link": "^11.0.2",
+    "@ckeditor/ckeditor5-paragraph": "^11.0.2",
+    "@ckeditor/ckeditor5-table": "^13.0.0",
+    "@ckeditor/ckeditor5-typing": "^12.0.2",
+    "@ckeditor/ckeditor5-undo": "^11.0.2",
+    "@ckeditor/ckeditor5-widget": "^11.0.2",
     "eslint": "^5.5.0",
     "eslint-config-ckeditor5": "^1.0.11",
     "husky": "^1.3.1",

+ 2 - 1
packages/ckeditor5-mention/src/mentionui.js

@@ -432,7 +432,8 @@ export default class MentionUI extends Plugin {
 			this._balloon.add( {
 				view: this._mentionsView,
 				position: this._getBalloonPanelPositionData( markerMarker, this._mentionsView.position ),
-				withArrow: false
+				withArrow: false,
+				singleViewMode: true
 			} );
 		}
 

+ 7 - 0
packages/ckeditor5-mention/tests/mentionui.js

@@ -97,10 +97,15 @@ describe( 'MentionUI', () => {
 	} );
 
 	describe( 'contextual balloon', () => {
+		let balloonAddSpy;
+
 		beforeEach( () => {
 			return createClassicTestEditor( staticConfig )
 				.then( () => {
 					setData( model, '<paragraph>foo []</paragraph>' );
+					const contextualBalloon = editor.plugins.get( ContextualBalloon );
+
+					balloonAddSpy = sinon.spy( contextualBalloon, 'add' );
 
 					model.change( writer => {
 						writer.insertText( '@', doc.selection.getFirstPosition() );
@@ -110,6 +115,8 @@ describe( 'MentionUI', () => {
 		} );
 
 		it( 'should disable arrow', () => {
+			sinon.assert.calledOnce( balloonAddSpy );
+			sinon.assert.calledWithExactly( balloonAddSpy, sinon.match( data => data.singleViewMode ) );
 			expect( panelView.isVisible ).to.be.true;
 			expect( panelView.withArrow ).to.be.false;
 		} );