@ckeditor/ckeditor5-basic-styles
Advanced tools
Comparing version 10.0.1 to 10.0.2
Changelog | ||
========= | ||
## [10.0.2](https://github.com/ckeditor/ckeditor5-basic-styles/compare/v10.0.1...v10.0.2) (2018-07-18) | ||
### Bug fixes | ||
* The value of `AttributeCommand` should be taken from the first node on which this style is allowed. Closes [#56](https://github.com/ckeditor/ckeditor5-basic-styles/issues/56). ([64a0dbc](https://github.com/ckeditor/ckeditor5-basic-styles/commit/64a0dbc)) | ||
### Other changes | ||
* Updated translations. ([df8bcc4](https://github.com/ckeditor/ckeditor5-basic-styles/commit/df8bcc4)) | ||
## [10.0.1](https://github.com/ckeditor/ckeditor5-basic-styles/compare/v10.0.0...v10.0.1) (2018-06-21) | ||
@@ -5,0 +16,0 @@ |
{ | ||
"name": "@ckeditor/ckeditor5-basic-styles", | ||
"version": "10.0.1", | ||
"version": "10.0.2", | ||
"description": "Basic styles feature for CKEditor 5.", | ||
@@ -12,13 +12,13 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^10.1.0", | ||
"@ckeditor/ckeditor5-engine": "^10.1.0", | ||
"@ckeditor/ckeditor5-ui": "^10.1.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^10.1.0" | ||
"@ckeditor/ckeditor5-core": "^11.0.0", | ||
"@ckeditor/ckeditor5-engine": "^10.2.0", | ||
"@ckeditor/ckeditor5-ui": "^11.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^11.0.0" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-cloud-services": "^10.0.1", | ||
"@ckeditor/ckeditor5-editor-classic": "^10.0.1", | ||
"@ckeditor/ckeditor5-essentials": "^10.1.0", | ||
"@ckeditor/ckeditor5-paragraph": "^10.0.1", | ||
"@ckeditor/ckeditor5-utils": "^10.1.0", | ||
"@ckeditor/ckeditor5-cloud-services": "^10.0.2", | ||
"@ckeditor/ckeditor5-editor-classic": "^11.0.0", | ||
"@ckeditor/ckeditor5-essentials": "^10.1.1", | ||
"@ckeditor/ckeditor5-paragraph": "^10.0.2", | ||
"@ckeditor/ckeditor5-utils": "^10.2.0", | ||
"eslint": "^4.15.0", | ||
@@ -30,3 +30,3 @@ "eslint-config-ckeditor5": "^1.0.7", | ||
"engines": { | ||
"node": ">=6.0.0", | ||
"node": ">=6.9.0", | ||
"npm": ">=3.0.0" | ||
@@ -33,0 +33,0 @@ }, |
@@ -44,3 +44,3 @@ /** | ||
* | ||
* * If the selection is not empty – That it starts in a text (or another node) which has the attribute set. | ||
* * If the selection is not empty – That the attribute is set on the first node in the selection that allows this attribute. | ||
* * If the selection is empty – That the selection has the attribute itself (which means that newly typed | ||
@@ -62,3 +62,3 @@ * text will have this attribute, too). | ||
this.value = doc.selection.hasAttribute( this.attributeKey ); | ||
this.value = this._getValueFromFirstAllowedNode(); | ||
this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey ); | ||
@@ -113,2 +113,29 @@ } | ||
} | ||
/** | ||
* Checks the attribute value of the first node in the selection that allows the attribute. | ||
* For the collapsed selection returns the selection attribute. | ||
* | ||
* @private | ||
* @returns {Boolean} The attribute value. | ||
*/ | ||
_getValueFromFirstAllowedNode() { | ||
const model = this.editor.model; | ||
const schema = model.schema; | ||
const selection = model.document.selection; | ||
if ( selection.isCollapsed ) { | ||
return selection.hasAttribute( this.attributeKey ); | ||
} | ||
for ( const range of selection.getRanges() ) { | ||
for ( const item of range.getItems() ) { | ||
if ( schema.checkAttribute( item, this.attributeKey ) ) { | ||
return item.hasAttribute( this.attributeKey ); | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67001
716
+ Added@ckeditor/ckeditor5-core@11.1.0(transitive)
+ Added@ckeditor/ckeditor5-engine@12.0.0(transitive)
+ Added@ckeditor/ckeditor5-theme-lark@11.1.012.0.0(transitive)
+ Added@ckeditor/ckeditor5-ui@11.2.0(transitive)
+ Added@ckeditor/ckeditor5-utils@11.1.0(transitive)
+ Addedlodash-es@4.17.21(transitive)
- Removed@ckeditor/ckeditor5-core@10.1.0(transitive)
- Removed@ckeditor/ckeditor5-theme-lark@10.1.0(transitive)
- Removed@ckeditor/ckeditor5-ui@10.1.0(transitive)