There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix: can not copy text other than block
QiShaoXuan6b6e70f02c04
diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.tsindex a4f0c76044..675b1d603f 100644--- a/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts+++ b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts@@ -72,21 +72,21 @@ export class ClipboardEventDispatcher {);}- private _copyHandler(e: ClipboardEvent) {- if (!this._utils.shouldHandlerContinue(e)) {+ private async _copyHandler(e: ClipboardEvent) {+ if (!(await this._utils.shouldHandlerContinue(e))) {return;}this._editor.getHooks().onCopy(e);}- private _cutHandler(e: ClipboardEvent) {- if (!this._utils.shouldHandlerContinue(e)) {+ private async _cutHandler(e: ClipboardEvent) {+ if (!(await this._utils.shouldHandlerContinue(e))) {return;}this._editor.getHooks().onCut(e);}- private _pasteHandler(e: ClipboardEvent) {- if (!this._utils.shouldHandlerContinue(e)) {+ private async _pasteHandler(e: ClipboardEvent) {+ if (!(await this._utils.shouldHandlerContinue(e))) {return;}diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.tsindex 09c532273c..2b93912d67 100644--- a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts+++ b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts@@ -11,7 +11,7 @@ export class ClipboardUtils {this._editor = editor;}- shouldHandlerContinue(event: ClipboardEvent) {+ async shouldHandlerContinue(event: ClipboardEvent) {const filterNodes = ['INPUT', 'SELECT', 'TEXTAREA'];if (event.defaultPrevented) {@@ -20,8 +20,12 @@ export class ClipboardUtils {if (filterNodes.includes((event.target as HTMLElement)?.tagName)) {return false;}+ const selectInfo = await this._editor.selectionManager.getSelectInfo();- return this._editor.selectionManager.currentSelectInfo.type !== 'None';+ return (+ selectInfo.blocks.length &&+ this._editor.selectionManager.currentSelectInfo.type !== 'None'+ );}async getClipInfoOfBlockById(blockId: string) {