@ckeditor/ckeditor5-widget
Advanced tools
Comparing version 0.0.0-nightly-20240905.0 to 0.0.0-nightly-20240906.0
{ | ||
"name": "@ckeditor/ckeditor5-widget", | ||
"version": "0.0.0-nightly-20240905.0", | ||
"version": "0.0.0-nightly-20240906.0", | ||
"description": "Widget API for CKEditor 5.", | ||
@@ -15,8 +15,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "0.0.0-nightly-20240905.0", | ||
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-20240905.0", | ||
"@ckeditor/ckeditor5-enter": "0.0.0-nightly-20240905.0", | ||
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-20240905.0", | ||
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-20240905.0", | ||
"@ckeditor/ckeditor5-typing": "0.0.0-nightly-20240905.0", | ||
"@ckeditor/ckeditor5-core": "0.0.0-nightly-20240906.0", | ||
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-20240906.0", | ||
"@ckeditor/ckeditor5-enter": "0.0.0-nightly-20240906.0", | ||
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-20240906.0", | ||
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-20240906.0", | ||
"@ckeditor/ckeditor5-typing": "0.0.0-nightly-20240906.0", | ||
"lodash-es": "4.17.21" | ||
@@ -23,0 +23,0 @@ }, |
@@ -220,2 +220,6 @@ /** | ||
let element = domEventData.target; | ||
// Some of DOM elements have no view element representation so it may be null. | ||
if (!element) { | ||
return; | ||
} | ||
// If triple click should select entire paragraph. | ||
@@ -518,6 +522,11 @@ if (domEventData.domEvent.detail >= 3) { | ||
const domRange = getRangeFromMouseEvent(domEventData.domEvent); | ||
if (!domRange) { | ||
return null; | ||
let viewRange = null; | ||
if (domRange) { | ||
viewRange = view.domConverter.domRangeToView(domRange); | ||
} | ||
const viewRange = view.domConverter.domRangeToView(domRange); | ||
else { | ||
// Fallback to create range in target element. It happens frequently on Safari browser. | ||
// See more: https://github.com/ckeditor/ckeditor5/issues/16978 | ||
viewRange = view.createRange(view.createPositionAt(domEventData.target, 0)); | ||
} | ||
if (!viewRange) { | ||
@@ -530,5 +539,16 @@ return null; | ||
} | ||
// Click after a widget tend to return position at the end of the editable element | ||
// so use the node before it if range is at the end of a parent. | ||
const viewNode = viewPosition.parent.is('editableElement') && viewPosition.isAtEnd && viewPosition.nodeBefore || viewPosition.parent; | ||
let viewNode = viewPosition.parent; | ||
if (viewPosition.parent.is('editableElement')) { | ||
if (viewPosition.isAtEnd && viewPosition.nodeBefore) { | ||
// Click after a widget tend to return position at the end of the editable element | ||
// so use the node before it if range is at the end of a parent. | ||
viewNode = viewPosition.nodeBefore; | ||
} | ||
else if (viewPosition.isAtStart && viewPosition.nodeAfter) { | ||
// Click before a widget tend to return position at the start of the editable element | ||
// so use the node after it if range is at the start of a parent. | ||
// See more: https://github.com/ckeditor/ckeditor5/issues/16992 | ||
viewNode = viewPosition.nodeAfter; | ||
} | ||
} | ||
if (viewNode.is('$text')) { | ||
@@ -535,0 +555,0 @@ return viewNode.parent; |
Sorry, the diff of this file is too big to display
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
1392661
10661
+ Added@ckeditor/ckeditor5-core@0.0.0-nightly-20240906.0(transitive)
+ Added@ckeditor/ckeditor5-engine@0.0.0-nightly-20240906.0(transitive)
+ Added@ckeditor/ckeditor5-enter@0.0.0-nightly-20240906.0(transitive)
+ Added@ckeditor/ckeditor5-typing@0.0.0-nightly-20240906.0(transitive)
+ Added@ckeditor/ckeditor5-ui@0.0.0-nightly-20240906.0(transitive)
+ Added@ckeditor/ckeditor5-utils@0.0.0-nightly-20240906.0(transitive)
+ Added@ckeditor/ckeditor5-watchdog@0.0.0-nightly-20240906.0(transitive)
- Removed@ckeditor/ckeditor5-core@0.0.0-nightly-20240905.0(transitive)
- Removed@ckeditor/ckeditor5-engine@0.0.0-nightly-20240905.0(transitive)
- Removed@ckeditor/ckeditor5-enter@0.0.0-nightly-20240905.0(transitive)
- Removed@ckeditor/ckeditor5-typing@0.0.0-nightly-20240905.0(transitive)
- Removed@ckeditor/ckeditor5-ui@0.0.0-nightly-20240905.0(transitive)
- Removed@ckeditor/ckeditor5-utils@0.0.0-nightly-20240905.0(transitive)
- Removed@ckeditor/ckeditor5-watchdog@0.0.0-nightly-20240905.0(transitive)