@ckeditor/ckeditor5-ui
Advanced tools
Comparing version 19.0.1 to 20.0.0
{ | ||
"name": "@ckeditor/ckeditor5-ui", | ||
"version": "19.0.1", | ||
"version": "20.0.0", | ||
"description": "The UI framework and standard UI library of CKEditor 5.", | ||
@@ -12,24 +12,25 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^19.0.1", | ||
"@ckeditor/ckeditor5-utils": "^19.0.1", | ||
"lodash-es": "^4.17.10" | ||
"@ckeditor/ckeditor5-core": "^20.0.0", | ||
"@ckeditor/ckeditor5-utils": "^20.0.0", | ||
"lodash-es": "^4.17.15" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^19.0.1", | ||
"@ckeditor/ckeditor5-block-quote": "^19.0.1", | ||
"@ckeditor/ckeditor5-editor-balloon": "^19.0.1", | ||
"@ckeditor/ckeditor5-editor-classic": "^19.0.1", | ||
"@ckeditor/ckeditor5-engine": "^19.0.1", | ||
"@ckeditor/ckeditor5-enter": "^19.0.1", | ||
"@ckeditor/ckeditor5-essentials": "^19.0.1", | ||
"@ckeditor/ckeditor5-heading": "^19.0.1", | ||
"@ckeditor/ckeditor5-image": "^19.0.1", | ||
"@ckeditor/ckeditor5-link": "^19.0.1", | ||
"@ckeditor/ckeditor5-list": "^19.0.1", | ||
"@ckeditor/ckeditor5-mention": "^19.0.1", | ||
"@ckeditor/ckeditor5-paragraph": "^19.1.0", | ||
"@ckeditor/ckeditor5-typing": "^19.0.1" | ||
"@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" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0", | ||
"node": ">=12.0.0", | ||
"npm": ">=5.7.1" | ||
@@ -36,0 +37,0 @@ }, |
@@ -212,2 +212,4 @@ /** | ||
const editor = this.editor; | ||
const selection = editor.model.document.selection; | ||
const schema = editor.model.schema; | ||
@@ -220,6 +222,12 @@ // Do not add the toolbar to the balloon stack twice. | ||
// Do not show the toolbar when the selection is collapsed. | ||
if ( editor.model.document.selection.isCollapsed ) { | ||
if ( selection.isCollapsed ) { | ||
return; | ||
} | ||
// Do not show the toolbar when there is more than one range in the selection and they fully contain object elements. | ||
// See https://github.com/ckeditor/ckeditor5/issues/6443. | ||
if ( selectionContainsOnlyMultipleObjects( selection, schema ) ) { | ||
return; | ||
} | ||
// Don not show the toolbar when all components inside are disabled | ||
@@ -361,2 +369,22 @@ // see https://github.com/ckeditor/ckeditor5-ui/issues/269. | ||
// Returns "true" when the selection has multiple ranges and each range contains an object | ||
// and nothing else. | ||
// | ||
// @private | ||
// @param {module:engine/model/selection~Selection} selection | ||
// @param {module:engine/model/schema~Schema} schema | ||
// @returns {Boolean} | ||
function selectionContainsOnlyMultipleObjects( selection, schema ) { | ||
// It doesn't contain multiple objects if there is only one range. | ||
if ( selection.rangeCount === 1 ) { | ||
return false; | ||
} | ||
return [ ...selection.getRanges() ].every( range => { | ||
const element = range.getContainedElement(); | ||
return element && schema.isObject( element ); | ||
} ); | ||
} | ||
/** | ||
@@ -363,0 +391,0 @@ * Contextual toolbar configuration. Used by the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar} |
Sorry, the diff of this file is not supported yet
575140
10499
15
+ Added@ckeditor/ckeditor5-core@20.0.0(transitive)
+ Added@ckeditor/ckeditor5-engine@20.0.0(transitive)
+ Added@ckeditor/ckeditor5-utils@20.0.0(transitive)
- Removed@ckeditor/ckeditor5-core@19.0.1(transitive)
- Removed@ckeditor/ckeditor5-engine@19.0.1(transitive)
- Removed@ckeditor/ckeditor5-utils@19.0.2(transitive)
Updatedlodash-es@^4.17.15