-
Notifications
You must be signed in to change notification settings - Fork 40
Rename attribute names from singular to plural #1389
Conversation
Changed and its build on Travis: https://travis-ci.org/ckeditor/ckeditor5/builds/359785064. |
@@ -638,7 +638,7 @@ export function removeUIElement() { | |||
* The converter automatically consumes corresponding value from consumables list and stops the event (see | |||
* {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}). | |||
* | |||
* modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => { | |||
* modelDispatcher.on( 'attributes:customAttr:myElem', changeAttribute( ( value, data ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOK
@@ -738,7 +738,7 @@ export function changeAttribute( attributeCreator ) { | |||
* The converter automatically consumes corresponding value from consumables list, stops the event (see | |||
* {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}). | |||
* | |||
* modelDispatcher.on( 'attribute:bold', wrapItem( ( modelAttributeValue, viewWriter ) => { | |||
* modelDispatcher.on( 'attributes:bold', wrapItem( ( modelAttributeValue, viewWriter ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOK
src/conversion/modelconsumable.js
Outdated
@@ -21,8 +21,8 @@ import TextProxy from '../model/textproxy'; | |||
* during conversion, when given part of model item is converted (i.e. the view element has been inserted into the view, | |||
* but without attributes), consumable value is removed from `ModelConsumable`. | |||
* | |||
* For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addAttribute:<attributeKey>`, | |||
* `changeAttribute:<attributeKey>`, `removeAttribute:<attributeKey>`. | |||
* For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattributes:<attributeKey>`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOK
src/conversion/modelconsumable.js
Outdated
@@ -312,7 +312,7 @@ export default class ModelConsumable { | |||
|
|||
// Returns a normalized consumable type name from given string. A normalized consumable type name is a string that has | |||
// at most one colon, for example: `insert` or `addMarker:highlight`. If string to normalize has more "parts" (more colons), | |||
// the other parts are dropped, for example: `addAttribute:bold:$text` -> `addAttribute:bold`. | |||
// the other parts are dropped, for example: `addattributes:bold:$text` -> `addattributes:bold`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOK
src/conversion/viewconsumable.js
Outdated
* | ||
* @error viewconsumable-invalid-attribute | ||
*/ | ||
throw new CKEditorError( 'viewconsumable-invalid-attribute: Classes and styles should be handled separately.' ); | ||
throw new CKEditorError( 'viewconsumable-invalid-attributes: Classes and styles should be handled separately.' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOK
@@ -20,7 +20,7 @@ import compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays'; | |||
* However, it is **very important** that nodes already attached to model tree should be only changed through | |||
* {@link module:engine/model/writer~Writer Writer API}. | |||
* | |||
* Changes done by `Node` methods, like {@link module:engine/model/element~Element#_insertChildren _insertChildren} or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section needs to be rewritten because it does not make any sense.
|
||
dispatcher.on( 'attribute:class', ( evt, data, conversionApi ) => { | ||
conversionApi.consumable.consume( data.item, 'attribute:class' ); | ||
conversionApi.consumable.consume( data.item, 'attributes:class' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOK
I reverted changes that shouldn't be committed. URL to Travis build – https://travis-ci.org/ckeditor/ckeditor5/builds/361986154. Two tests fail but there is a ticket for it – https://github.com/ckeditor/ckeditor5-image/issues/198. |
All look great! I'm waiting for final confirmation from @pjasiun and will be merging this. |
Suggested merge commit message (convention)
Other: Renamed plural method names to singular and singular attribute names to plural. See ckeditor/ckeditor5#742.
BREAKING CHANGES: Properties in
module:engine/view/matcher~MatcherPattern
have been renamed:class
toclasses
,style
tostyles
,attribute
toattributes
.NOTE: Keys of
engine/conversion/viewconsumable~ViewElementConsumables#_consumables
have been renamed from singular to plural.NOTE: All protected
_insertChildren()
and_appendChildren()
methods have been renamed to_insertChild()
and_appendChild()
.Should be merged together with: