@tiptap/core
Advanced tools
+3
-3
| { | ||
| "name": "@tiptap/core", | ||
| "version": "3.27.2", | ||
| "version": "3.27.3", | ||
| "description": "headless rich text editor", | ||
@@ -64,6 +64,6 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@tiptap/pm": "^3.27.2" | ||
| "@tiptap/pm": "^3.27.3" | ||
| }, | ||
| "peerDependencies": { | ||
| "@tiptap/pm": "3.27.2" | ||
| "@tiptap/pm": "3.27.3" | ||
| }, | ||
@@ -70,0 +70,0 @@ "scripts": { |
@@ -79,3 +79,2 @@ import type { ResolvedPos, Schema } from '@tiptap/pm/model' | ||
| ({ state, dispatch }) => { | ||
| const { $from, $to } = state.selection | ||
| if (state.selection.empty) { | ||
@@ -85,7 +84,17 @@ return false | ||
| const { from, to } = expandSelectionForInlineText($from, $to, state.schema) | ||
| if (dispatch) { | ||
| const tr = state.tr | ||
| const { ranges } = state.selection | ||
| const mapFrom = tr.steps.length | ||
| if (dispatch) { | ||
| state.tr.deleteRange(from, to).scrollIntoView() | ||
| dispatch(state.tr) | ||
| ranges.forEach(range => { | ||
| const mapping = tr.mapping.slice(mapFrom) | ||
| const $from = tr.doc.resolve(mapping.map(range.$from.pos)) | ||
| const $to = tr.doc.resolve(mapping.map(range.$to.pos)) | ||
| const { from, to } = expandSelectionForInlineText($from, $to, state.schema) | ||
| tr.deleteRange(from, to) | ||
| }) | ||
| tr.scrollIntoView() | ||
| dispatch(tr) | ||
| } | ||
@@ -92,0 +101,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2423715
0.08%33172
0.07%