@ckeditor/ckeditor5-ui
Advanced tools
Comparing version
{ | ||
"name": "@ckeditor/ckeditor5-ui", | ||
"version": "20.0.0", | ||
"version": "21.0.0", | ||
"description": "The UI framework and standard UI library of CKEditor 5.", | ||
@@ -12,22 +12,22 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^20.0.0", | ||
"@ckeditor/ckeditor5-utils": "^20.0.0", | ||
"@ckeditor/ckeditor5-core": "^21.0.0", | ||
"@ckeditor/ckeditor5-utils": "^21.0.0", | ||
"lodash-es": "^4.17.15" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^20.0.0", | ||
"@ckeditor/ckeditor5-block-quote": "^20.0.0", | ||
"@ckeditor/ckeditor5-editor-balloon": "^20.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^20.0.0", | ||
"@ckeditor/ckeditor5-engine": "^20.0.0", | ||
"@ckeditor/ckeditor5-enter": "^20.0.0", | ||
"@ckeditor/ckeditor5-essentials": "^20.0.0", | ||
"@ckeditor/ckeditor5-heading": "^20.0.0", | ||
"@ckeditor/ckeditor5-image": "^20.0.0", | ||
"@ckeditor/ckeditor5-link": "^20.0.0", | ||
"@ckeditor/ckeditor5-list": "^20.0.0", | ||
"@ckeditor/ckeditor5-mention": "^20.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^20.0.0", | ||
"@ckeditor/ckeditor5-horizontal-line": "^20.0.0", | ||
"@ckeditor/ckeditor5-typing": "^20.0.0" | ||
"@ckeditor/ckeditor5-basic-styles": "^21.0.0", | ||
"@ckeditor/ckeditor5-block-quote": "^21.0.0", | ||
"@ckeditor/ckeditor5-editor-balloon": "^21.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^21.0.0", | ||
"@ckeditor/ckeditor5-engine": "^21.0.0", | ||
"@ckeditor/ckeditor5-enter": "^21.0.0", | ||
"@ckeditor/ckeditor5-essentials": "^21.0.0", | ||
"@ckeditor/ckeditor5-heading": "^21.0.0", | ||
"@ckeditor/ckeditor5-image": "^21.0.0", | ||
"@ckeditor/ckeditor5-link": "^21.0.0", | ||
"@ckeditor/ckeditor5-list": "^21.0.0", | ||
"@ckeditor/ckeditor5-mention": "^21.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^21.0.0", | ||
"@ckeditor/ckeditor5-horizontal-line": "^21.0.0", | ||
"@ckeditor/ckeditor5-typing": "^21.0.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "engines": { |
@@ -62,3 +62,3 @@ /** | ||
* @private | ||
* @member {HTMLElement} #_editableElement | ||
* @type {HTMLElement} | ||
*/ | ||
@@ -72,3 +72,3 @@ this._editableElement = editableElement; | ||
* @private | ||
* @member {Boolean} #_hasExternalElement | ||
* @type {Boolean} | ||
*/ | ||
@@ -86,3 +86,3 @@ this._hasExternalElement = !!this._editableElement; | ||
* @protected | ||
* @member {module:engine/view/view~View} #isFocused | ||
* @type {module:engine/view/view~View} | ||
*/ | ||
@@ -89,0 +89,0 @@ this._editingView = editingView; |
@@ -279,7 +279,7 @@ /** | ||
fillFromConfig( config, factory ) { | ||
config.map( name => { | ||
this.items.addMany( config.map( name => { | ||
if ( name == '|' ) { | ||
this.items.add( new ToolbarSeparatorView() ); | ||
return new ToolbarSeparatorView(); | ||
} else if ( factory.has( name ) ) { | ||
this.items.add( factory.create( name ) ); | ||
return factory.create( name ); | ||
} else { | ||
@@ -306,3 +306,3 @@ /** | ||
} | ||
} ); | ||
} ).filter( item => item !== undefined ) ); | ||
} | ||
@@ -550,28 +550,32 @@ } | ||
// ToolbarView#items is dynamic. When an item is added, it should be automatically | ||
// ToolbarView#items is dynamic. When an item is added or removed, it should be automatically | ||
// represented in either grouped or ungrouped items at the right index. | ||
// In other words #items == concat( #ungroupedItems, #groupedItems ) | ||
// (in length and order). | ||
view.items.on( 'add', ( evt, item, index ) => { | ||
if ( index > this.ungroupedItems.length ) { | ||
this.groupedItems.add( item, index - this.ungroupedItems.length ); | ||
} else { | ||
this.ungroupedItems.add( item, index ); | ||
view.items.on( 'change', ( evt, changeData ) => { | ||
const index = changeData.index; | ||
// Removing. | ||
for ( const removedItem of changeData.removed ) { | ||
if ( index >= this.ungroupedItems.length ) { | ||
this.groupedItems.remove( removedItem ); | ||
} else { | ||
this.ungroupedItems.remove( removedItem ); | ||
} | ||
} | ||
// When a new ungrouped item joins in and lands in #ungroupedItems, there's a chance it causes | ||
// the toolbar to overflow. | ||
this._updateGrouping(); | ||
} ); | ||
// Adding. | ||
for ( let currentIndex = index; currentIndex < index + changeData.added.length; currentIndex++ ) { | ||
const addedItem = changeData.added[ currentIndex - index ]; | ||
// When an item is removed from ToolbarView#items, it should be automatically | ||
// removed from either grouped or ungrouped items. | ||
view.items.on( 'remove', ( evt, item, index ) => { | ||
if ( index > this.ungroupedItems.length ) { | ||
this.groupedItems.remove( item ); | ||
} else { | ||
this.ungroupedItems.remove( item ); | ||
if ( currentIndex > this.ungroupedItems.length ) { | ||
this.groupedItems.add( addedItem, currentIndex - this.ungroupedItems.length ); | ||
} else { | ||
this.ungroupedItems.add( addedItem, currentIndex ); | ||
} | ||
} | ||
// Whether removed from grouped or ungrouped items, there is a chance | ||
// When new ungrouped items join in and land in #ungroupedItems, there's a chance it causes | ||
// the toolbar to overflow. | ||
// Consequently if removed from grouped or ungrouped items, there is a chance | ||
// some new space is available and we could do some ungrouping. | ||
@@ -578,0 +582,0 @@ this._updateGrouping(); |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
578848
0.64%143
0.7%10502
0.03%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed