Sfoglia il codice sorgente

Merge branch 'master' into i/6139

Marek Lewandowski 5 anni fa
parent
commit
68f0d9c08e

+ 13 - 0
packages/ckeditor5-core/CHANGELOG.md

@@ -1,6 +1,19 @@
 Changelog
 =========
 
+## [17.0.0](https://github.com/ckeditor/ckeditor5-core/compare/v16.0.0...v17.0.0) (2020-02-19)
+
+### Features
+
+* Introduced the concept of editor contexts and context plugins. Contexts provide a common, higher-level environment for solutions which use multiple editors and/or plugins that work outside an editor. Closes [ckeditor/ckeditor5#5891](https://github.com/ckeditor/ckeditor5/issues/5891). ([672e55e](https://github.com/ckeditor/ckeditor5-core/commit/672e55e))
+* Added vertical alignment icons. Moved horizontal alignment icons form `@ckeditor/ckeditor5-alignment` (see [ckeditor/ckeditor5-table#227](https://github.com/ckeditor/ckeditor5-table/issues/227)). ([ada4a79](https://github.com/ckeditor/ckeditor5-core/commit/ada4a79))
+* Introduced `Plugin#isEnabled`, `Plugin#forceDisabled()` and `Plugin#clearForceDisabled()`. ([7449450](https://github.com/ckeditor/ckeditor5-core/commit/7449450))
+
+### Other changes
+
+* Updated translations. ([6a2b584](https://github.com/ckeditor/ckeditor5-core/commit/6a2b584))
+
+
 ## [16.0.0](https://github.com/ckeditor/ckeditor5-core/compare/v15.0.0...v16.0.0) (2019-12-04)
 
 ### Other changes

+ 2 - 1
packages/ckeditor5-core/lang/contexts.json

@@ -1,4 +1,5 @@
 {
 	"Save": "Label for the Save button.",
-	"Cancel": "Label for the Cancel button."
+	"Cancel": "Label for the Cancel button.",
+	"Remove color": "The label used by a button next to the color palette in the color picker that removes the color (resets it to an empty value, example usages in font color or table properties)."
 }

+ 17 - 17
packages/ckeditor5-core/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ckeditor/ckeditor5-core",
-  "version": "16.0.0",
+  "version": "17.0.0",
   "description": "The core architecture of CKEditor 5 – the best browser-based rich text editor.",
   "keywords": [
     "ckeditor5-lib",
@@ -21,25 +21,25 @@
     "framework"
   ],
   "dependencies": {
-    "@ckeditor/ckeditor5-engine": "^16.0.0",
-    "@ckeditor/ckeditor5-utils": "^16.0.0",
+    "@ckeditor/ckeditor5-engine": "^17.0.0",
+    "@ckeditor/ckeditor5-utils": "^17.0.0",
     "lodash-es": "^4.17.10"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-autoformat": "^16.0.0",
-    "@ckeditor/ckeditor5-basic-styles": "^16.0.0",
-    "@ckeditor/ckeditor5-block-quote": "^16.0.0",
-    "@ckeditor/ckeditor5-editor-classic": "^16.0.0",
-    "@ckeditor/ckeditor5-essentials": "^16.0.0",
-    "@ckeditor/ckeditor5-heading": "^16.0.0",
-    "@ckeditor/ckeditor5-image": "^16.0.0",
-    "@ckeditor/ckeditor5-indent": "^16.0.0",
-    "@ckeditor/ckeditor5-link": "^16.0.0",
-    "@ckeditor/ckeditor5-list": "^16.0.0",
-    "@ckeditor/ckeditor5-media-embed": "^16.0.0",
-    "@ckeditor/ckeditor5-paragraph": "^16.0.0",
-    "@ckeditor/ckeditor5-table": "^16.0.0",
-    "@ckeditor/ckeditor5-ui": "^16.0.0",
+    "@ckeditor/ckeditor5-autoformat": "^17.0.0",
+    "@ckeditor/ckeditor5-basic-styles": "^17.0.0",
+    "@ckeditor/ckeditor5-block-quote": "^17.0.0",
+    "@ckeditor/ckeditor5-editor-classic": "^17.0.0",
+    "@ckeditor/ckeditor5-essentials": "^17.0.0",
+    "@ckeditor/ckeditor5-heading": "^17.0.0",
+    "@ckeditor/ckeditor5-image": "^17.0.0",
+    "@ckeditor/ckeditor5-indent": "^17.0.0",
+    "@ckeditor/ckeditor5-link": "^17.0.0",
+    "@ckeditor/ckeditor5-list": "^17.0.0",
+    "@ckeditor/ckeditor5-media-embed": "^17.0.0",
+    "@ckeditor/ckeditor5-paragraph": "^17.0.0",
+    "@ckeditor/ckeditor5-table": "^17.0.0",
+    "@ckeditor/ckeditor5-ui": "^17.0.0",
     "eslint": "^5.5.0",
     "eslint-config-ckeditor5": "^2.0.0",
     "husky": "^1.3.1",

+ 4 - 2
packages/ckeditor5-core/src/editor/editor.js

@@ -61,7 +61,9 @@ export default class Editor {
 		this._context = config.context || new Context( { language: config.language } );
 		this._context._addEditor( this, !config.context );
 
-		const availablePlugins = this.constructor.builtinPlugins;
+		// Clone the plugins to make sure that the plugin array will not be shared
+		// between editors and make the watchdog feature work correctly.
+		const availablePlugins = Array.from( this.constructor.builtinPlugins || [] );
 
 		/**
 		 * Stores all configurations specific to this editor instance.
@@ -227,7 +229,7 @@ export default class Editor {
 	 */
 	initPlugins() {
 		const config = this.config;
-		const plugins = config.get( 'plugins' ) || [];
+		const plugins = config.get( 'plugins' );
 		const removePlugins = config.get( 'removePlugins' ) || [];
 		const extraPlugins = config.get( 'extraPlugins' ) || [];
 

+ 17 - 1
packages/ckeditor5-core/tests/editor/editor.js

@@ -262,7 +262,23 @@ describe( 'Editor', () => {
 			const context = await Context.create( { plugins: [ ContextPlugin ] } );
 			const editor = await TestEditor.create( { context } );
 
-			expect( editor.config.get( 'plugins' ) ).to.be.undefined;
+			expect( editor.config.get( 'plugins' ) ).to.be.empty;
+		} );
+
+		it( 'should copy builtin plugins', async () => {
+			TestEditor.builtinPlugins = [ PluginA ];
+
+			class ContextPlugin {
+				static get isContextPlugin() {
+					return true;
+				}
+			}
+
+			const context = await Context.create( { plugins: [ ContextPlugin ] } );
+			const editor = await TestEditor.create( { context } );
+
+			expect( editor.config.get( 'plugins' ) ).to.deep.equal( [ PluginA ] );
+			expect( editor.config.get( 'plugins' ) ).to.not.equal( TestEditor.builtinPlugins );
 		} );
 
 		it( 'should pass DOM element using reference, not copy', async () => {

+ 1 - 1
packages/ckeditor5-core/theme/icons/align-bottom.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.239 13.938l-2.88-1.663a.75.75 0 01.75-1.3L9 12.067V4.75a.75.75 0 111.5 0v7.318l1.89-1.093a.75.75 0 01.75 1.3l-2.879 1.663a.752.752 0 01-.511.187.752.752 0 01-.511-.187zM4.25 17a.75.75 0 110-1.5h10.5a.75.75 0 010 1.5H4.25z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.239 13.938l-2.88-1.663a.75.75 0 01.75-1.3L9 12.067V4.75a.75.75 0 111.5 0v7.318l1.89-1.093a.75.75 0 01.75 1.3l-2.879 1.663a.752.752 0 01-.511.187.752.752 0 01-.511-.187zM4.25 17a.75.75 0 110-1.5h10.5a.75.75 0 010 1.5H4.25z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/align-center.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 100-1.5H5.036a.75.75 0 00-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 100-1.5H5.036a.75.75 0 00-.75.75z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/align-justify.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/align-left.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 100-1.5H2.75a.75.75 0 00-.75.75z"/></svg>

File diff suppressed because it is too large
+ 1 - 1
packages/ckeditor5-core/theme/icons/align-middle.svg


+ 1 - 1
packages/ckeditor5-core/theme/icons/align-right.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 01-.75.75H2.75a.75.75 0 110-1.5h14.5a.75.75 0 01.75.75zm0 8a.75.75 0 01-.75.75H2.75a.75.75 0 110-1.5h14.5a.75.75 0 01.75.75zm0 4a.75.75 0 01-.75.75H7.321a.75.75 0 110-1.5h9.929a.75.75 0 01.75.75zm0-8a.75.75 0 01-.75.75H7.321a.75.75 0 110-1.5h9.929a.75.75 0 01.75.75z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/align-top.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.261 7.062l2.88 1.663a.75.75 0 01-.75 1.3L10.5 8.933v7.317a.75.75 0 11-1.5 0V8.932l-1.89 1.093a.75.75 0 01-.75-1.3l2.879-1.663a.752.752 0 01.511-.187.752.752 0 01.511.187zM15.25 4a.75.75 0 110 1.5H4.75a.75.75 0 010-1.5h10.5z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.261 7.062l2.88 1.663a.75.75 0 01-.75 1.3L10.5 8.933v7.317a.75.75 0 11-1.5 0V8.932l-1.89 1.093a.75.75 0 01-.75-1.3l2.879-1.663a.752.752 0 01.511-.187.752.752 0 01.511.187zM15.25 4a.75.75 0 110 1.5H4.75a.75.75 0 010-1.5h10.5z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/cancel.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.591 10.177l4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.591 10.177l4.243 4.242a1 1 0 01-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 01-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 015.934 4.52l4.243 4.243 4.242-4.243a1 1 0 111.415 1.414l-4.243 4.243z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/check.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 01-.744-.292l-4.596-4.596a1 1 0 111.414-1.414l3.926 3.926 9.937-9.937a1 1 0 011.414 1.415L7.717 16.323a.997.997 0 01-.745.292z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/eraser.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.636 9.531l-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.636 9.531l-2.758 3.94a.5.5 0 00.122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 01-.491-2.786l6.673-9.53a2 2 0 012.785-.49l3.742 2.62a2 2 0 01.491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/image.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 01.87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 113.4-1.96 1.96 1.96 0 01-3.4 1.96z"/></svg>

File diff suppressed because it is too large
+ 1 - 1
packages/ckeditor5-core/theme/icons/low-vision.svg


+ 1 - 1
packages/ckeditor5-core/theme/icons/pencil.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.3 17.37l-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506L13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5L9.375 17H19v1.5H8z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.3 17.37l-.061.088a1.518 1.518 0 01-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 01.187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506L13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5L9.375 17H19v1.5H8z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/pilcrow.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.999 2H15a1 1 0 010 2h-1.004v13a1 1 0 11-2 0V4H8.999v13a1 1 0 11-2 0v-7A4 4 0 013 6a4 4 0 013.999-4z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/quote.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 016.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 016.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>

+ 1 - 1
packages/ckeditor5-core/theme/icons/three-vertical-dots.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>