feat: update to slate 0.58 && fix site build

This commit is contained in:
cudr
2020-05-11 09:21:49 +03:00
parent 0fd9390a99
commit 6adf4082dc
30 changed files with 180 additions and 107 deletions

View File

@@ -16,17 +16,17 @@ export const setCursor = (
const newCursor = cursorOps[cursorOps.length - 1]?.newProperties || {}
if (selection) {
doc.cursors[id] = JSON.stringify(
Object.assign(
(doc.cursors[id] && JSON.parse(doc.cursors[id])) || {},
newCursor,
selection,
{
...cursorData,
isForward: Boolean(newCursor.focus)
}
)
const newCursorData = Object.assign(
(doc.cursors[id] && JSON.parse(doc.cursors[id])) || {},
newCursor,
selection,
{
...cursorData,
isForward: Range.isForward(selection)
}
)
doc.cursors[id] = JSON.stringify(newCursorData)
} else {
delete doc.cursors[id]
}