mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-16 03:12:48 +02:00
Don't import slate-history in slate-react (#4266)
This commit is contained in:
parent
a7e3a18187
commit
411e5a193b
5
.changeset/bright-cameras-drum.md
Normal file
5
.changeset/bright-cameras-drum.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
Removed accidental bundling of `slate-history` inside `slate-react`
|
@ -25,7 +25,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"slate": "^0.63.0",
|
||||
"slate-history": "^0.62.0",
|
||||
"slate-hyperscript": "^0.62.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
@ -10,7 +10,6 @@ import {
|
||||
Path,
|
||||
} from 'slate'
|
||||
import getDirection from 'direction'
|
||||
import { HistoryEditor } from 'slate-history'
|
||||
import throttle from 'lodash/throttle'
|
||||
import scrollIntoView from 'scroll-into-view-if-needed'
|
||||
|
||||
@ -865,9 +864,10 @@ export const Editable = (props: EditableProps) => {
|
||||
// hotkeys ourselves. (2019/11/06)
|
||||
if (Hotkeys.isRedo(nativeEvent)) {
|
||||
event.preventDefault()
|
||||
const maybeHistoryEditor: any = editor
|
||||
|
||||
if (HistoryEditor.isHistoryEditor(editor)) {
|
||||
editor.redo()
|
||||
if (typeof maybeHistoryEditor.redo === 'function') {
|
||||
maybeHistoryEditor.redo()
|
||||
}
|
||||
|
||||
return
|
||||
@ -875,9 +875,10 @@ export const Editable = (props: EditableProps) => {
|
||||
|
||||
if (Hotkeys.isUndo(nativeEvent)) {
|
||||
event.preventDefault()
|
||||
const maybeHistoryEditor: any = editor
|
||||
|
||||
if (HistoryEditor.isHistoryEditor(editor)) {
|
||||
editor.undo()
|
||||
if (typeof maybeHistoryEditor.undo === 'function') {
|
||||
maybeHistoryEditor.undo()
|
||||
}
|
||||
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user