@udecode/plate-table
Advanced tools
Comparing version 9.0.0 to 9.1.1
# @udecode/plate-table | ||
## 9.1.1 | ||
### Patch Changes | ||
- [#1322](https://github.com/udecode/plate/pull/1322) by [@sctang2020](https://github.com/sctang2020) – fix #1216, set cusor to first cell for newly created table | ||
## 9.0.0 | ||
@@ -4,0 +10,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { someNode, getPluginType, getParent, getAbove, isCollapsed, isElement, createPluginFactory, findNodePath, ELEMENT_DEFAULT, insertNodes, findNode, setNodes } from '@udecode/plate-core'; | ||
import { someNode, getPluginType, getParent, getAbove, isCollapsed, isElement, createPluginFactory, findNodePath, ELEMENT_DEFAULT, insertNodes, selectEditor, findNode, setNodes } from '@udecode/plate-core'; | ||
import { Editor, Path, Transforms, Node, Point } from 'slate'; | ||
@@ -566,2 +566,19 @@ | ||
})); | ||
if (editor.selection) { | ||
const tableEntry = getAbove(editor, { | ||
match: { | ||
type: getPluginType(editor, ELEMENT_TABLE) | ||
} | ||
}); | ||
if (!tableEntry) { | ||
return; | ||
} | ||
const point = Editor.start(editor, tableEntry[1]); | ||
selectEditor(editor, { | ||
at: point | ||
}); | ||
} | ||
} | ||
@@ -568,0 +585,0 @@ }; |
@@ -570,2 +570,19 @@ 'use strict'; | ||
})); | ||
if (editor.selection) { | ||
const tableEntry = plateCore.getAbove(editor, { | ||
match: { | ||
type: plateCore.getPluginType(editor, ELEMENT_TABLE) | ||
} | ||
}); | ||
if (!tableEntry) { | ||
return; | ||
} | ||
const point = slate.Editor.start(editor, tableEntry[1]); | ||
plateCore.selectEditor(editor, { | ||
at: point | ||
}); | ||
} | ||
} | ||
@@ -572,0 +589,0 @@ }; |
{ | ||
"name": "@udecode/plate-table", | ||
"version": "9.0.0", | ||
"version": "9.1.1", | ||
"description": "Table plugin for Plate", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
141290
1263