Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into i/5569
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Jan 21, 2020
2 parents 055ccd0 + b2a8189 commit ee93cf6
Show file tree
Hide file tree
Showing 308 changed files with 4,465 additions and 1,966 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
indent_style = space
tab_width = 2
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Suggested merge commit message ([convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention))

Type: Message. Closes #000.
Type: Message. Closes ckeditor/ckeditor5#000.

---

Expand Down
3 changes: 3 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-ckeditor5"
}
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
Changelog
=========

## [16.0.0](https://github.com/ckeditor/ckeditor5-engine/compare/v15.0.0...v16.0.0) (2019-12-04)

### Other changes

* Split debug tools between the engine files. You do not need to add debug plugin to the editor if you want to use `--debug engine` building flag anymore. Closes [ckeditor/ckeditor5#5649](https://github.com/ckeditor/ckeditor5/issues/5649). ([353f091](https://github.com/ckeditor/ckeditor5-engine/commit/353f091))


## [15.0.0](https://github.com/ckeditor/ckeditor5-engine/compare/v14.0.0...v15.0.0) (2019-10-23)

### MAJOR BREAKING CHANGES

* The behavior of block filler detection on DOM to view conversion was changed. Now, it specifically checks the parent of a text node to check whether it is a block. Which means that a list of block element names has to be used. If you use custom elements or use one of the HTML elements which CKEditor 5 does not recognize as a block element, see [#404](https://github.com/ckeditor/ckeditor5-engine/issues/404) and `DomConverter.blockElements` documentation.
* The `Selection#getTopMostBlocks()` was removed from the public API. Use `Selection#getSelectedBlocks()` instead.
* The `Selection#getSelectedBlocks()` does not return blocks nested in other blocks now.

### Features

* Added support for creating elements from other XML namespaces. See [ckeditor/ckeditor5#2088](https://github.com/ckeditor/ckeditor5/issues/2088). ([a9190c9](https://github.com/ckeditor/ckeditor5-engine/commit/a9190c9))

### Bug fixes

* Added a proper check for name-only view matcher in attribute upcast converters. Closes [#1786](https://github.com/ckeditor/ckeditor5-engine/issues/1786). ([2210696](https://github.com/ckeditor/ckeditor5-engine/commit/2210696))
* Improved filtering out disallowed attributes on child elements. [#1789](https://github.com/ckeditor/ckeditor5-engine/issues/1789). ([c5033b6](https://github.com/ckeditor/ckeditor5-engine/commit/c5033b6))
* Improved performance when working with fake selections. Closes [#1791](https://github.com/ckeditor/ckeditor5-engine/issues/1791). ([f073ad5](https://github.com/ckeditor/ckeditor5-engine/commit/f073ad5))
* Placeholder should not be visible in the read-only mode. Closes [ckeditor/ckeditor5#1987](https://github.com/ckeditor/ckeditor5/issues/1987). ([730c417](https://github.com/ckeditor/ckeditor5-engine/commit/730c417))
* Remove only real block fillers on DOM to view conversion. Closes [#404](https://github.com/ckeditor/ckeditor5-engine/issues/404). ([6d2810b](https://github.com/ckeditor/ckeditor5-engine/commit/6d2810b))
* The renderer should not update DOM selection when document has active composition. Closes [#1782](https://github.com/ckeditor/ckeditor5-engine/issues/1782). Closes [ckeditor/ckeditor5#1333](https://github.com/ckeditor/ckeditor5/issues/1333). ([c698683](https://github.com/ckeditor/ckeditor5-engine/commit/c698683))

### Other changes

* Added error handling to the common code execution paths. Part of [ckeditor/ckeditor5#1304](https://github.com/ckeditor/ckeditor5/issues/1304). ([220b52f](https://github.com/ckeditor/ckeditor5-engine/commit/220b52f))
* Removed the `Selection#getTopMostBlocks()` method. Closes [ckeditor/ckeditor5-widget#95](https://github.com/ckeditor/ckeditor5-widget/issues/95). Closes [ckeditor/ckeditor5-table#199](https://github.com/ckeditor/ckeditor5-table/issues/199). ([7970f17](https://github.com/ckeditor/ckeditor5-engine/commit/7970f17))


## [14.0.0](https://github.com/ckeditor/ckeditor5-engine/compare/v13.2.1...v14.0.0) (2019-08-26)

### Features
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Software License Agreement
==========================

**CKEditor 5 Editing Engine**https://github.com/ckeditor/ckeditor5-engine <br>
Copyright (c) 2003-2019, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
Copyright (c) 2003-2020, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.

Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).

Expand Down
2 changes: 1 addition & 1 deletion docs/_snippets/framework/build-extending-content-source.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
42 changes: 24 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ckeditor/ckeditor5-engine",
"version": "14.0.0",
"version": "16.0.0",
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
"keywords": [
"wysiwyg",
Expand All @@ -21,28 +21,30 @@
"ckeditor 5"
],
"dependencies": {
"@ckeditor/ckeditor5-utils": "^14.0.0",
"@ckeditor/ckeditor5-utils": "^16.0.0",
"lodash-es": "^4.17.10"
},
"devDependencies": {
"@ckeditor/ckeditor5-basic-styles": "^11.1.4",
"@ckeditor/ckeditor5-block-quote": "^11.1.3",
"@ckeditor/ckeditor5-core": "^12.3.0",
"@ckeditor/ckeditor5-editor-classic": "^12.1.4",
"@ckeditor/ckeditor5-enter": "^11.1.0",
"@ckeditor/ckeditor5-essentials": "^11.0.5",
"@ckeditor/ckeditor5-heading": "^11.0.5",
"@ckeditor/ckeditor5-link": "^11.1.2",
"@ckeditor/ckeditor5-list": "^12.1.0",
"@ckeditor/ckeditor5-paragraph": "^11.0.5",
"@ckeditor/ckeditor5-theme-lark": "^14.2.0",
"@ckeditor/ckeditor5-typing": "^12.2.0",
"@ckeditor/ckeditor5-undo": "^11.0.5",
"@ckeditor/ckeditor5-widget": "^11.1.0",
"@ckeditor/ckeditor5-basic-styles": "^16.0.0",
"@ckeditor/ckeditor5-block-quote": "^16.0.0",
"@ckeditor/ckeditor5-core": "^16.0.0",
"@ckeditor/ckeditor5-editor-classic": "^16.0.0",
"@ckeditor/ckeditor5-enter": "^16.0.0",
"@ckeditor/ckeditor5-essentials": "^16.0.0",
"@ckeditor/ckeditor5-heading": "^16.0.0",
"@ckeditor/ckeditor5-link": "^16.0.0",
"@ckeditor/ckeditor5-list": "^16.0.0",
"@ckeditor/ckeditor5-paragraph": "^16.0.0",
"@ckeditor/ckeditor5-theme-lark": "^16.0.0",
"@ckeditor/ckeditor5-typing": "^16.0.0",
"@ckeditor/ckeditor5-undo": "^16.0.0",
"@ckeditor/ckeditor5-widget": "^16.0.0",
"eslint": "^5.5.0",
"eslint-config-ckeditor5": "^2.0.0",
"husky": "^1.3.1",
"lint-staged": "^7.0.0"
"lint-staged": "^7.0.0",
"stylelint": "^11.1.1",
"stylelint-config-ckeditor5": "^1.0.0"
},
"engines": {
"node": ">=8.0.0",
Expand All @@ -62,11 +64,15 @@
"theme"
],
"scripts": {
"lint": "eslint --quiet '**/*.js'"
"lint": "eslint --quiet '**/*.js'",
"stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css' 'docs/**/*.css'"
},
"lint-staged": {
"**/*.js": [
"eslint --quiet"
],
"**/*.css": [
"stylelint --quiet --allow-empty-input"
]
},
"eslintIgnore": [
Expand Down
2 changes: 1 addition & 1 deletion src/controller/datacontroller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
16 changes: 14 additions & 2 deletions src/controller/editingcontroller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand All @@ -17,6 +17,8 @@ import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
import mix from '@ckeditor/ckeditor5-utils/src/mix';
import { convertSelectionChange } from '../conversion/upcasthelpers';

// @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );

/**
* Controller for the editing pipeline. The editing pipeline controls {@link ~EditingController#model model} rendering,
* including selection handling. It also creates the {@link ~EditingController#view view} which builds a
Expand Down Expand Up @@ -73,7 +75,7 @@ export default class EditingController {
// model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection
// is converted). We disable rendering for the length of the outermost model change() block to prevent that.
//
// See https://github.com/ckeditor/ckeditor5-engine/issues/1528
// See https://github.com/ckeditor/ckeditor5-engine/issues/1528
this.listenTo( this.model, '_beforeChanges', () => {
this.view._disableRendering( true );
}, { priority: 'highest' } );
Expand Down Expand Up @@ -121,6 +123,16 @@ export default class EditingController {

return viewRoot;
} );

// @if CK_DEBUG_ENGINE // initDocumentDumping( this.model.document );
// @if CK_DEBUG_ENGINE // initDocumentDumping( this.view.document );

// @if CK_DEBUG_ENGINE // dumpTrees( this.model.document, this.model.document.version );
// @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );

// @if CK_DEBUG_ENGINE // this.model.document.on( 'change', () => {
// @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
// @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/conversion/conversion.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/conversion/conversionhelpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/conversion/downcastdispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
15 changes: 14 additions & 1 deletion src/conversion/downcasthelpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down Expand Up @@ -204,6 +204,19 @@ export default class DowncastHelpers extends ConversionHelpers {
* view: modelAttributeValue => ( { key: 'class', value: 'styled-' + modelAttributeValue } )
* } );
*
* **Note**: Downcasting to a style property requires providing `value` as an object:
*
* editor.conversion.for( 'downcast' ).attributeToAttribute( {
* model: 'lineHeight',
* view: modelAttributeValue => ( {
* key: 'style',
* value: {
* 'line-height': modelAttributeValue,
* 'border-bottom': '1px dotted #ba2'
* }
* } )
* } );
*
* See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
* to the conversion process.
*
Expand Down
2 changes: 1 addition & 1 deletion src/conversion/mapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/conversion/modelconsumable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/conversion/upcastdispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down
29 changes: 28 additions & 1 deletion src/conversion/upcasthelpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Expand Down Expand Up @@ -237,6 +237,33 @@ export default class UpcastHelpers extends ConversionHelpers {
* }
* } );
*
* Converting styles works a bit differently as it requires `view.styles` to be an object and by default
* a model attribute will be set to `true` by such a converter. You can set the model attribute to any value by providing the `value`
* callback that returns the desired value.
*
* // Default conversion of font-weight style will result in setting bold attribute to true.
* editor.conversion.for( 'upcast' ).attributeToAttribute( {
* view: {
* styles: {
* 'font-weight': 'bold'
* }
* },
* model: 'bold'
* } );
*
* // This converter will pass any style value to the `lineHeight` model attribute.
* editor.conversion.for( 'upcast' ).attributeToAttribute( {
* view: {
* styles: {
* 'line-height': /[\s\S]+/
* }
* },
* model: {
* key: 'lineHeight',
* value: viewElement => viewElement.getStyle( 'line-height' )
* }
* } );
*
* See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
* to the conversion process.
*
Expand Down
Loading

0 comments on commit ee93cf6

Please sign in to comment.