Procházet zdrojové kódy

Merge branch 'master' into t/4

# Conflicts:
#	package.json
Maciej Gołaszewski před 6 roky
rodič
revize
cc4573080d

+ 1 - 3
packages/ckeditor5-mention/.travis.yml

@@ -28,6 +28,4 @@ after_script:
 - ckeditor5-dev-tests-notify-travis-status
 env:
   global:
-  - secure: ZQA0E73V4IrxrhGCqVMnBDZR8gP0P8MlCgdOy2qUtSB2yR+syefZBcBVoa6YYTle8UmePO4ETta4y0FMH0zZdnSETEqQ5odKGdclhkFU8I4O9+7ZXGQEfQPVriZxXHjdCX66gRShphW+6tcg5M+jGs1TlBtmgNuMn4MU7Z16lLAouO4gaicOFfDQO/FF2yO5YJURY47ThO/IVfUJB5n1a5rAkRN9WmbAubkYqtC53wOg/Ipl7I6bquxaUAcPLd+2kT1T6g+SWISoOhfOTYwwaN9Tqapzdx3wwM47DgDmjZ3tDRuhIBPLTWx7Fk70VF+8wnRi0ydhXaZYoRh6dBbjZPO9IwOArMmV6SRANWt5KAmxW3glFuvjDih/ypR1r1YzDf2kKvLijPZCQpQKzeWPZ6X+kaVGeIe8mdRz0MCh2TBvCXVRBfmh9BNFmnLhg68ympJK1zBczFtTVdoNiTJ8eV4AsKb+NED6ZRdD0Ol7ydD4LOcl2LsIpWaYj04tXuvIe+hN7AjTGiOBFqEY0VGHSu9WyGziBCHR9yboDmy8il/ChBBgWOFYJXZNGnw+VHhFrkxAXDUYbLreVIZLPUMRscB31y982R0oiU0pVsGJTSP1v6i0JMAjNJ3ZsL7V4IoFwnqk2NbKj28JxTq2BMBx5g3ry9EW9WQ1fgzxJuWOo2I=
-  - secure: dOp+yn/un5AyUPO7Zv7EY5LlEH59ASFb27DkyoIjKytcERp6iCMuHqGgbatsR1tOzSs8GF1Gqzh3K061tRjLWnIwq5iyEHlswy6o0SchHtQtsIk5Jfa/6PGwuYqsKGER9avxl4MZ4Nctdl0ljo5nZCifuRcXRB5aJFVMLDyG3KscYq38MN6RLo/YdNZ53NwaeBUwUHC6EuDEyOc7F80tCz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ZrdIweaT9p8ZvgCsXo7Hg+AUkx42fzXnWinXMCNWxuDhMQoXD0jf8UfgV0y4yy9Ky2pi8cconBhGV4ZKFXVQ=
+  - secure: xofGZGZnE+4xonNp2gGSpQCIwH3aZu4/EmR6YAfcJtN/STDaKeSnSlnLpQJExSAgQM/nxF/Jh/DO8AL0vjMfQut0CtIOIQaR/2g16/ZK983t0FMBSHdaFKWtfkHzDVlEJ0Mq+42x/FEHlBccuVD80WZ3uYk+vxqiQNUk5Ywluz8NJ2tYWJ8zpGsLJjzY6G0j1s4WXtAKAOmm2Fli6cNryBSGxoEJSQg8sEoFf5dy32W6jykmVafGWzvOi9uVN8nSZkAyqTu27YF8DA0mivZP/UmrLtTzvj3FAV53l06IvRQgQOMKvg4brXouR+HXGSPS72ohnzhvyWmHzesbYCnDmnsEqxIN6JKmWyFdcQdJkE7AAF0LCqxSQSR78Vc8hiD+1AD368xY345rOPBqVkWskCFAuyuu7+ri3ahBqseH7Elcdol/RXIDsaeakaYwt6/EOMk96rH4DWZw6K2l7ZP5kKfV/F11ZttY8Lltj0d/NuicCqNImwzV85/qYNpKxrB9g6ZcagutYpS61sSiT3pZp41hpuNdZLHuUiqb8Gz6dbdbIJje/J3J+4kn0+AWIWDrDUXve5nm6p24u6Y456dzIDzNn+H5M55tcXn+7U7wFBgbzJ+dtWxzH05JBrZcP4SCNMYdoAKczNqqXdSq8mPaU2+Jfs9tWNOb4OQG0R3aD8g=

+ 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;
 		} );