-
#4048 by @zbeyens – Move store state
selectedCells
andselectedTables
fromuseTableStore
toTablePlugin
options store. This fixes the issue to get access to those state outside a table element (e.g. the toolbar) -
#4048 by @zbeyens – Upgrade to
jotai-x@2
. Migration needed only if you use one of these stores:useCommentStore
usePlaceholderStore
useResizableStore
useTableStore
- #4027 by @zbeyens –
- Support controlling many selected cells (previously only one cell)
- Fix selected cells to sync after cell operation
- #3974 by @felixfeng33 – Remove useless html parser.
- #3943 by @felixfeng33 – Support deserialization from PlateStatic.
-
#3920 by @zbeyens – Major performance improvement: all table cells were re-rendering when a single cell changed. This is now fixed.
TablePlugin
now depends onNodeIdPlugin
.- Table merging is now enabled by default:
- Renamed
enableMerging
todisableMerge
. - Migration:
enableMerging: true
→ remove the option.- otherwise →
TablePlugin.configure({ options: { disableMerge: true } })
- Renamed
- Renamed
unmergeTableCells
tosplitTableCell
. - Renamed
editor.api.create.cell
toeditor.api.create.tableCell
. - In
useTableMergeState
, renamedcanUnmerge
tocanSplit
. insertTableRow
andinsertTableColumn
: removeddisableSelect
in favor ofselect
. Migration: replace it with the opposite boolean.getTableCellBorders
: params(element, options)
→(editor, options)
; removedisFirstCell
andisFirstRow
.- Merged
useTableCellElementState
intouseTableCellElement
:- Removed its parameter.
- Removed
hovered
andhoveredLeft
returns (use CSS instead). - Renamed
rowSize
tominHeight
. - Computes column sizes and returns
width
.
- Merged
useTableCellElementResizableState
intouseTableCellElementResizable
:- Removed
onHover
andonHoverEnd
props (use CSS instead).
- Removed
- Merged
useTableElementState
intouseTableElement
:- Removed its parameter.
- No longer computes and returns
colSizes
,minColumnWidth
, andcolGroupProps
.
-
TablePlugin
new api and transforms:
type TableApi = { create: { table: OmitFirst<typeof getEmptyTableNode>; /** Cell node factory used each time a cell is created. */ tableCell: OmitFirst<typeof getEmptyCellNode>; tableRow: OmitFirst<typeof getEmptyRowNode>; }; table: { getCellBorders: OmitFirst<typeof getTableCellBorders>; getCellSize: OmitFirst<typeof getTableCellSize>; getColSpan: typeof getColSpan; getRowSpan: typeof getRowSpan; }; }; type TableTransforms = { insert: { table: OmitFirst<typeof insertTable>; }; remove: { table: OmitFirst<typeof deleteTable>; tableColumn: OmitFirst<typeof deleteColumn>; tableRow: OmitFirst<typeof deleteRow>; }; table: { merge: OmitFirst<typeof mergeTableCells>; split: OmitFirst<typeof splitTableCell>; }; };
insertTableColumn
addbefore
option to insert a column before the current column.insertTableRow
addbefore
option to insert a row before the current row.insertTable
now supports inserting a table after the current table.
-
#3830 by @felixfeng33 – Move from
@udecode/plate-table/react
to@udecode/plate-table
:deleteColumn
deleteColumnWhenExpanded
deleteRow
deleteRowWhenExpanded
getTableColumn
getTableGridAbove
getTableGridByRange
getTableRow
insertTable
mergeTableCells
moveSelectionFromCell
overrideSelectionFromCell
unmergeTableCells
withDeleteTable
withGetFragmentlable
withInsertFragmentTable
withInsertTextTable
withMarkTable
withSelectionTable
withSetFragmentDataTable
withTable
-
#3830 by @felixfeng33 – Move
node.props
plugin attributes from/react
to/
-
#3830 by @felixfeng33 – Replace
findNodePath
withfindPath
aa3456425606bc7680f51bc64412e3cb5aaabe8a
by @zbeyens – fix lodash imports
- #3550 by @oleg-orlov-quantori – Fix table attributes disappear during copying
f26ed56053b14e697fea2e6a7e33a73ce28593e4
by @12joan – Add thecolspan
androwspan
attributes todangerouslyAllowAttributes
for TableCellPlugin and TableCellHeaderPlugin
-
#3552 by @natamox – Fix unmerge & compute cell indices
Remove computeAllCellIndices, use computeCellIndices instead
- #3420 by @zbeyens –
createTablePlugin
->TablePlugin
- NEW
TableRowPlugin
,TableCellPlugin
,TableCellHeaderPlugin
- Replace
insertTableColumn
witheditor.insert.tableColumn
- Replace
insertTableRow
witheditor.insert.tableRow
- Move
cellFactory
option tocreate.cell
api - Move
getCellChildren
option totable.getCellChildren
api
- #3463 by @beeant0512 – fixed the judgment logic of deleting the last row of the table
- #3461 by @beeant0512 – fix delete last row will cause editor crash when
enableMerging: true
- #3406 by @beeant0512 – fix: where total or num is a string
- #3410 by @AHappyAtlas – Recalculate the split cells after unmerge
- #3368 by @beeant0512 – fix table column count when first row has merged columns
- #3383 by @EvanSmith93 – Fix table header property and apply header to only the top row of new tables
a115f969d2032af53ea88c6add7d1dfa7cf3610f
– AddgetCellChildren
option toTablePlugin
- #3313 by @zbeyens –
- Add
cellFactory
option toTablePlugin
, called each time a cell is created. Default isgetEmptyCellNode
- Remove
newCellChildren
option fromTablePlugin
, usecellFactory
instead
- Add
- #3172 by @KorovinQuantori – Add computeCellIndices fallback for table insert functions
- #3138 by @felixfeng33 – Fix: adding marks in a cell is applying to the whole cell
- #3118 by @felixfeng33 – Missing exports
- #3090 by @felixfeng33 – fix can not remove table column when selection is expanded
- #3086 by @felixfeng33 – fix add/removeMark behavior When selection is aboving table.
-
#3037 by @KorovinQuantori – Hotfix: reset cell entries list when table is overflown
-
#3083 by @KorovinQuantori – Use getRowSpan\getColSpan instead of pointing at
rowspan
andcolspan
fields directly
-
#3037 by @KorovinQuantori – Hotfix: reset cell entries list when table is overflown
-
#3034 by @KorovinQuantori – canMerge = true only if user selected more than one cell
- #3029 by @KorovinQuantori – Ensure that table selection is always a valid sub-table
- #3026 by @KorovinQuantori – Copy rowSpan and colSpan properties of cell when set fragment data
4cbed7159
by @zbeyens – Move@udecode/plate-common
to peerDeps to fix a bug when multiple instances were installed
- #2867 by @12joan – Fix: in v28,
TableProvider
was incorrectly shared by all tables in the editor.TableProvider
must now be rendered as part ofTableElement
.
- #2860 by @johnrazeur – Remove unused code from withDeleteTable
- #2833 by @AndreyMarchuk – Fix lodash import
-
#2724 by @duckRabbitPy – Table row insertion: cells in a newly added row will now receive header styling only if they satisfy specific criteria:
- Every cell in the column is a header cell,
- The table contains more than one row, or
- The column possesses a predefined header property.
-
0b5962d0
by @zbeyens – Fix:useTableMergeState
should return false values whenenableMerging: false
- #2771 by @KorovinQuantori – Fixed table insertion inside text nodes
- #2768 by @KorovinQuantori – Fixed copy behaviour, when not all table cells are filled with some nodes
- #2733 by @dimaanj –
- Table plugin has now merging support. To enable it, use option
enableMerging: true
- Table plugin has now merging support. To enable it, use option
- #2682 by @kristian-puccio – newCellChildren is now passed as an option to insertTable or the plugin option is used
- #2594 by @OliverWales – Fix column deletion early return
- #2581 by @OliverWales – Modify insertTableRow and insertTableColumn to support header columns to preserve header columns if they exist + not blindly assume that it's a header row if the first cell in that row is a header cell.
- #2557 by @zbeyens – Add support of table cell background styles. To update the component, run:
npx @udecode/plate-ui@latest add table-cell-element
- #2555 by @zbeyens – Major changes missing from 23.0.0:
- Removed
TableCellElementResizable
. UseuseTableCellElementResizableState
anduseTableCellElementResizable
instead.
- Removed
- #2471 by @zbeyens – Removed:
TableCellElement
TableCellElementResizableWrapper
TableCellElementRoot
TableElement
TableElementCol
TableElementColGroup
TableElementRoot
TableElementTBody
TableRowElement
ArrowDropDownCircleIcon
BorderAllIcon
BorderBottomIcon
BorderLeftIcon
BorderNoneIcon
BorderOuterIcon
BorderRightIcon
BorderTopIcon
- #2302 by @zbeyens –
- Table margin left resizing. Fixes #2301
- Remove depedency on
re-resizable
in favor of new@udecode/resizable
package.
- #2289 by @zbeyens – New queries:
getTableCellBorders
getLeftTableCell
getTopTableCell
isTableBorderHidden
New transforms:setBorderSize
TableCellElementState
new field:borders: BorderStylesDefault
- #2276 by @12joan – Table width is now preserved when resizing columns, except when resizing the last column
- #2273 by @12joan –
TablePlugin
new option:minColumnWidth
- Sets the minimum width a column can be resized toinsertTableColumn
now shrinks columns if the new total width would exceedinitialTableWidth
- #2270 by @12joan –
- Make rows resizable in addition to columns
TableCellElement.ResizableWrapper
no longer takes acolIndex
propTableCellElement.Resizable
now takesstepX
andstepY
as overrides forstep
to set the resize increments for the X and Y axessetTableRowSize
- sets the height of the selected row
- Make rows resizable in addition to columns
- #2251 by @zbeyens –
TablePlugin
optiondisableUnsetSingleColSize
has been renamed and inverted intoenableUnsetSingleColSize
. New default is disabled. Migration:- if using
disableUnsetSingleColSize: true
, the option can be removed - if using
disableUnsetSingleColSize: false
, useenableUnsetSingleColSize: true
- if using
getTableColumnIndex
second parameter type is now:cellNode: TElement
- #2251 by @zbeyens –
TablePlugin
new option:initialTableWidth
– If defined, a normalizer will set each undefined tablecolSizes
to this value divided by the number of columns. Merged cells not yet supported. If not defined, the table column sizes will stay toauto
.insertTableColumn
: if optioninitialTableWidth
is defined, the column size will be set to (a) the size of the next column if defined, (b) the size of the current column if it's the last one or (c)initialTableWidth / colSizes.length
. If not defined, the column size stays toauto
.- Headless UI:
TableElement
:onMouseDown
will collapse the selection if some cells are selected
TableCellElement
- new prop
resizableProps.step?: number
: Resize by step instead of by pixel.
- new prop
TableRowElement
- #2165 by @OliverWales – Override setFragmentData for table range selections #2137
- #1829 by @osamatanveer –
- fix import
- #1835 by @zbeyens – New table plugin option:
disableUnsetSingleColSize
. Disable unsetting the first column width when the table has one column. Set it to true if you want to resize the table width when there is only one column. Keep it false if you have a full-width table.
-
- Fixes #1356
- Fixes #1359
-
#1819 by @zbeyens – Fix: udecode/editor-protocol#76
- #1796 by @zbeyens –
- Fixes #1795
- Fixes #1794
- Fixes #1793
- Fixes #1791
- Fixes #1798
getTableCellEntry
:- renamed to
getTableEntries
- returns
table
,row
,cell
- is now working when selecting many blocks in a cell
- renamed to
moveSelectionFromCell
:- new option
fromOneCell
- should not do anything when
at
is in a single cell, unlessfromOneCell
istrue
- new option
overrideSelectionFromCell
: Override the new selection if the previous selection and the new one are in different cells
- #1778 by @zbeyens –
- on delete many cells:
- replace cell children by a paragraph then reselect all the selected cells
- on get fragment (copy):
- copying in a single cell should not copy the table anymore
- on insert fragment (paste):
- pasting multiple blocks into many selected cells will replace these cells children by the same blocks
- replace cell children by a paragraph then reselect all the selected cells
- on insert text:
- it should delete the cells content by preserving the cells
- normalize cells:
- wrap cell children in a paragraph if they are texts
- normalize selection:
- it was easy to destroy the table structure when selection goes beyond a table. The current fix is to normalize the selection so it selects the whole table (see the specs)
- specs:
- on delete many cells:
- #1569 by @zbeyens –
- udecode/editor-protocol#32
addRow
deprecated in favor ofinsertTableRow
addColumn
deprecated in favor ofinsertTableColumn
insertTableRow
now selects the cell below selected cell (previously it was selecting the last cell)
- #1560 by @zbeyens –
- fix: tab / untab when composing with IME
- update peerDeps:
"slate": ">=0.78.0"
"slate-react": ">=0.79.0"
- #1554 by @mrganser – fix onKeyDownTable so it only acts with Tab key when selection is within a table, so default or others handlers can work outside
-
getTableGridAbove
: Get sub table above anchor and focusgetTableGridByRange
: Get sub table between 2 cell paths.moveSelectionFromCell
: Move selection by cell unit.getCellTypes
: Get td and th types.getEmptyCellNode
,getEmptyRowNode
,getEmptyTableNode
:cellChildren
optiongetEmptyTableNode
:rowCount
,colCount
optionspreventDeleteTableCell
withDeleteTable
: Prevent cell deletionwithGetFragmentTable
: If selection is in a table, get subtable abovewithInsertFragmentTable
Cell selection:
- udecode/editor-protocol#26
- udecode/editor-protocol#27
- udecode/editor-protocol#28
- udecode/editor-protocol#29
- udecode/editor-protocol#15
- udecode/editor-protocol#17
- udecode/editor-protocol#30
- udecode/editor-protocol#31
- udecode/editor-protocol#12
- udecode/editor-protocol#25
- udecode/editor-protocol#20
Copy/paste:
Delete:
- #1429 by @zbeyens –
TableElement
:- fix undefined case
- fix warning "Unknown event handler property
onRenderContainer
. It will be ignored."
- #1334 by @Pedrobusou – prevent extra nodes from being copy pasted
- #1331 by @Pedrobusou – add missing getPluginType usage
- #1322 by @sctang2020 – fix #1216, set cusor to first cell for newly created table
- #1161 by @zbeyens – Added:
getTableColumnCount
getTableColumnIndex
: Get table column index of a cell node.setTableColSize
TableNodeData: { colSizes?: number[] }
- Updated dependencies [
a6bf8c5e
]:- @udecode/[email protected]
- Updated dependencies [
8aec270f
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
7ee21356
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
503956fd
]:- @udecode/[email protected]
- Updated dependencies [
b22c06aa
]:- @udecode/[email protected]
- Updated dependencies [
58f6fb53
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
6af469cd
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
f1da7267
,35caf35d
]:- @udecode/[email protected]
- @udecode/[email protected]
-
#1006
56b2551b
Thanks @tjramage! - Adds more natural default header option when inserting table columns -
Updated dependencies [
58387c6d
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
f6c58134
]:- @udecode/[email protected]
-
#997
1244bcb7
Thanks @z0al! - fix(table): jump to next header cell on TAB -
#994
5651aed7
Thanks @z0al! - fix(table): only mark first row as table header
- Updated dependencies [
ec4d5b7b
]:- @udecode/[email protected]
-
#918
7d045d8d
Thanks @zbeyens! - addslate-history
as a peerDep -
Updated dependencies [
7d045d8d
]:- @udecode/[email protected]
🎉 The Slate Plugins project has evolved to Plate 🎉
To migrate, install @udecode/plate[-x]
then find and replace all
occurrences of:
slate-plugins
toplate
SlatePlugins
toPlate
SlatePlugin
toPlatePlugin
This is the last version of
@udecode/slate-plugins[-x]
, please install@udecode/plate[-x]
.
- Updated dependencies [
7c26cf32
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
3a3eb1b8
]:- @udecode/[email protected]
- Updated dependencies [
75b39f18
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
abaf4a11
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
d906095d
]:- @udecode/[email protected]
- Updated dependencies [
42360b44
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
6e9068f6
]:- @udecode/[email protected]
- Updated dependencies [
15048e6f
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
b444071e
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
2cf618c3
]:- @udecode/[email protected]
- Updated dependencies [
7cbd7bd9
,806e1632
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
33605a49
,28f30c8a
,75e6d25d
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
dfbde8bd
,dfbde8bd
]:- @udecode/[email protected]
- @udecode/[email protected]
- Updated dependencies [
201a7993
]:- @udecode/[email protected]
- @udecode/[email protected]