@blocksuite/inline
Advanced tools
Comparing version 0.12.0-canary-202402210317-3698d1d to 0.12.0-canary-202402211337-37cbfcb
@@ -1,2 +0,1 @@ | ||
import { ZERO_WIDTH_SPACE } from '../consts.js'; | ||
import { findDocumentOrShadowRoot, isInEmbedElement, } from '../utils/index.js'; | ||
@@ -60,11 +59,2 @@ import { isMaybeInlineRangeEqual } from '../utils/inline-range.js'; | ||
const range = selection.getRangeAt(0); | ||
if (range.startContainer === range.endContainer && | ||
range.startContainer.textContent === ZERO_WIDTH_SPACE && | ||
range.startOffset === 1) { | ||
range.setStart(range.startContainer, 0); | ||
range.setEnd(range.endContainer, 0); | ||
selection.removeAllRanges(); | ||
selection.addRange(range); | ||
return; | ||
} | ||
if (!range.intersectsNode(rootElement)) { | ||
@@ -71,0 +61,0 @@ const isContainerSelected = range.endContainer.contains(rootElement) && |
{ | ||
"name": "@blocksuite/inline", | ||
"version": "0.12.0-canary-202402210317-3698d1d", | ||
"version": "0.12.0-canary-202402211337-37cbfcb", | ||
"description": "A micro editor.", | ||
@@ -33,3 +33,3 @@ "type": "module", | ||
"zod": "^3.22.4", | ||
"@blocksuite/global": "0.12.0-canary-202402210317-3698d1d" | ||
"@blocksuite/global": "0.12.0-canary-202402211337-37cbfcb" | ||
}, | ||
@@ -36,0 +36,0 @@ "scripts": { |
@@ -1,2 +0,1 @@ | ||
import { ZERO_WIDTH_SPACE } from '../consts.js'; | ||
import type { InlineEditor } from '../inline-editor.js'; | ||
@@ -110,15 +109,2 @@ import type { InlineRange, NativePoint } from '../types.js'; | ||
const range = selection.getRangeAt(0); | ||
if ( | ||
range.startContainer === range.endContainer && | ||
range.startContainer.textContent === ZERO_WIDTH_SPACE && | ||
range.startOffset === 1 | ||
) { | ||
range.setStart(range.startContainer, 0); | ||
range.setEnd(range.endContainer, 0); | ||
selection.removeAllRanges(); | ||
selection.addRange(range); | ||
return; | ||
} | ||
if (!range.intersectsNode(rootElement)) { | ||
@@ -125,0 +111,0 @@ const isContainerSelected = |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
309685
5354
+ Added@blocksuite/global@0.12.0-canary-202402211337-37cbfcb(transitive)
- Removed@blocksuite/global@0.12.0-canary-202402210317-3698d1d(transitive)
Updated@blocksuite/global@0.12.0-canary-202402211337-37cbfcb