@textbus/core
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1397,3 +1397,3 @@ import { Fragment } from './fragment'; | ||
} | ||
else if (current instanceof AbstractComponent) { | ||
if (current instanceof AbstractComponent) { | ||
const prev = fragment.getContentAtIndex(offset - 1); | ||
@@ -1461,3 +1461,3 @@ if (typeof prev === 'string') { | ||
} | ||
else if (container.nodeType === Node.ELEMENT_NODE) { | ||
if (container.nodeType === Node.ELEMENT_NODE) { | ||
const childNodes = container.childNodes; | ||
@@ -1464,0 +1464,0 @@ if (childNodes.length === 0) { |
@@ -384,3 +384,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var _a, _b; | ||
let component = this.selection.commonAncestorComponent; | ||
const firstRange = this.selection.firstRange; | ||
let component = firstRange.startFragment.getContentAtIndex(firstRange.startIndex); //光标右边 | ||
// 当叶子组件在文档最后一行且后面没有其他内容时,就会是BrComponent | ||
if (!component || typeof component === 'string' || component instanceof BrComponent) { | ||
component = firstRange.startFragment.getContentAtIndex(firstRange.startIndex - 1); //光标左边 | ||
} | ||
if (!component || typeof component === 'string') { | ||
component = this.selection.commonAncestorComponent; | ||
} | ||
if (!component) { | ||
@@ -387,0 +395,0 @@ return []; |
{ | ||
"name": "@textbus/core", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "TextBus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.", | ||
@@ -45,3 +45,3 @@ "main": "./bundles/public-api.js", | ||
}, | ||
"gitHead": "9fbf998c48b37ab01238d2bef41f9d0f949ca620" | ||
"gitHead": "07356b30570734028be6d984259fd1e915d9d392" | ||
} |
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
622779
9006