@udecode/plate-table
Advanced tools
Comparing version 34.0.0 to 35.1.0
import * as _udecode_plate_common_server from '@udecode/plate-common/server'; | ||
import { Value as Value$1, PlateEditor as PlateEditor$1, WithPlatePlugin, KeyboardHandlerReturnType, TElement as TElement$1, TDescendant as TDescendant$1, TNodeEntry, TElementEntry, TEditor, GetAboveNodeOptions, InsertNodesOptions, TRange } from '@udecode/plate-common/server'; | ||
import { TDescendant, Value as Value$1, PlateEditor as PlateEditor$1, WithPlatePlugin, KeyboardHandlerReturnType, TElement as TElement$1, TNodeEntry, TElementEntry, TEditor, GetAboveNodeOptions, InsertNodesOptions, TRange } from '@udecode/plate-common/server'; | ||
import * as _udecode_slate from '@udecode/slate'; | ||
import { Value, PlateEditor, TDescendant, TElement, TReactEditor } from '@udecode/plate-common'; | ||
import { Value, PlateEditor, TElement, TReactEditor } from '@udecode/plate-common'; | ||
import { Path, Range, Location } from 'slate'; | ||
@@ -20,2 +20,7 @@ import * as _udecode_utils from '@udecode/utils'; | ||
type CellFactoryOptions = { | ||
children?: TDescendant[]; | ||
header?: boolean; | ||
row?: TTableRowElement; | ||
}; | ||
interface TablePlugin<V extends Value = Value> { | ||
@@ -27,2 +32,4 @@ /** | ||
_cellIndices?: TableStoreCellAttributes; | ||
/** Cell node factory used each time a cell is created. */ | ||
cellFactory?: (options?: CellFactoryOptions) => TTableCellElement; | ||
/** Disable expanding the table when inserting cells. */ | ||
@@ -62,4 +69,2 @@ disableExpandOnInsert?: boolean; | ||
minColumnWidth?: number; | ||
/** @default empty paragraph */ | ||
newCellChildren?: TDescendant[]; | ||
} | ||
@@ -282,7 +287,2 @@ type TableStoreCellAttributes = WeakMap<TTableCellElement, { | ||
declare const createEmptyCell: <V extends Value$1>(editor: PlateEditor$1<V>, row: TTableRowElement, newCellChildren?: TDescendant$1[], header?: boolean) => { | ||
children: TDescendant$1[]; | ||
type: string; | ||
}; | ||
declare const deleteTableMergeColumn: <V extends Value$1>(editor: PlateEditor$1<V>) => void; | ||
@@ -493,19 +493,7 @@ | ||
interface GetEmptyCellNodeOptions extends Omit<TablePlugin, '_cellIndices'> { | ||
/** Header cell */ | ||
header?: boolean; | ||
} | ||
declare const getEmptyCellNode: <V extends Value$1>(editor: PlateEditor$1<V>, { header, newCellChildren }: GetEmptyCellNodeOptions) => { | ||
children: _udecode_slate.TDescendant[]; | ||
type: string; | ||
}; | ||
interface GetEmptyRowNodeOptions extends Omit<GetEmptyCellNodeOptions, '_cellIndices'> { | ||
interface GetEmptyRowNodeOptions extends CellFactoryOptions { | ||
colCount?: number; | ||
} | ||
declare const getEmptyRowNode: <V extends Value$1>(editor: PlateEditor$1<V>, { colCount, ...options }?: GetEmptyRowNodeOptions) => { | ||
children: { | ||
children: _udecode_slate.TDescendant[]; | ||
type: string; | ||
}[]; | ||
declare const getEmptyRowNode: <V extends Value$1>(editor: PlateEditor$1<V>, { colCount, ...cellOptions }?: GetEmptyRowNodeOptions) => { | ||
children: TTableCellElement[]; | ||
type: string; | ||
@@ -517,6 +505,6 @@ }; | ||
} | ||
declare const getEmptyTableNode: <V extends Value$1>(editor: PlateEditor$1<V>, { colCount, header, newCellChildren, rowCount, }?: GetEmptyTableNodeOptions) => TTableElement; | ||
declare const getEmptyTableNode: <V extends Value$1>(editor: PlateEditor$1<V>, { colCount, rowCount, ...cellOptions }?: GetEmptyTableNodeOptions) => TTableElement; | ||
/** Insert table if selection not in table. Select start of table. */ | ||
declare const insertTable: <V extends Value$1>(editor: PlateEditor$1<V>, { colCount, header, newCellChildren, rowCount, }?: GetEmptyTableNodeOptions, options?: InsertNodesOptions<V>) => void; | ||
declare const insertTable: <V extends Value$1>(editor: PlateEditor$1<V>, { colCount, header, rowCount }?: GetEmptyTableNodeOptions, options?: InsertNodesOptions<V>) => void; | ||
@@ -582,2 +570,7 @@ declare const insertTableColumn: <V extends Value$1>(editor: PlateEditor$1<V>, options?: { | ||
export { type BorderDirection, type BorderStyle, type BorderStylesDefault, ELEMENT_TABLE, ELEMENT_TD, ELEMENT_TH, ELEMENT_TR, type GetEmptyCellNodeOptions, type GetEmptyRowNodeOptions, type GetEmptyTableNodeOptions, type GetTableGridAboveOptions, type GetTableGridByRangeOptions, MIN_COLUMN_HEIGHT, type TTableCellElement, type TTableElement, type TTableRowElement, type TableCellElementResizableOptions, type TableCellElementState, type TableElementState, type TablePlugin, TableProvider, type TableStoreCellAttributes, type TableStoreSizeOverrides, computeAllCellIndices, computeCellIndices, createEmptyCell, createTablePlugin, deleteColumn, deleteColumnWhenExpanded, deleteRow, deleteRowWhenExpanded, deleteTable, deleteTableMergeColumn, deleteTableMergeRow, findCellByIndexes, getCellInNextTableRow, getCellInPreviousTableRow, getCellIndices, getCellIndicesWithSpans, getCellPath, getCellRowIndexByPath, getCellTypes, getColSpan, getEmptyCellNode, getEmptyRowNode, getEmptyTableNode, getLeftTableCell, getNextTableCell, getOnSelectTableBorderFactory, getPreviousTableCell, getRowSpan, getSelectionWidth, getTableAbove, getTableCellBorders, getTableColumnCount, getTableColumnIndex, getTableEntries, getTableGridAbove, getTableGridByRange, getTableMergeGridByRange, getTableMergedColumnCount, getTableOverriddenColSizes, getTableRowIndex, getTopTableCell, insertTable, insertTableColumn, insertTableMergeColumn, insertTableMergeRow, insertTableRow, isTableBorderHidden, isTableRectangular, keyShiftEdges, mergeTableCells, moveSelectionFromCell, onKeyDownTable, overrideSelectionFromCell, preventDeleteTableCell, roundCellSizeToStep, setBorderSize, setTableColSize, setTableMarginLeft, setTableRowSize, tableStore, unmergeTableCells, useIsCellSelected, useOverrideColSize, useOverrideMarginLeft, useOverrideRowSize, useSelectedCells, useTableBordersDropdownMenuContentState, useTableCellElement, useTableCellElementResizable, useTableCellElementResizableState, useTableCellElementState, useTableColSizes, useTableElement, useTableElementState, useTableMergeState, useTableStore, withDeleteTable, withGetFragmentTable, withInsertFragmentTable, withInsertTextTable, withMarkTable, withNormalizeTable, withSelectionTable, withSetFragmentDataTable, withTable }; | ||
declare const getEmptyCellNode: <V extends Value$1>(editor: PlateEditor$1<V>, { children, header, row }?: CellFactoryOptions) => { | ||
children: _udecode_slate.TDescendant[]; | ||
type: string; | ||
}; | ||
export { type BorderDirection, type BorderStyle, type BorderStylesDefault, type CellFactoryOptions, ELEMENT_TABLE, ELEMENT_TD, ELEMENT_TH, ELEMENT_TR, type GetEmptyRowNodeOptions, type GetEmptyTableNodeOptions, type GetTableGridAboveOptions, type GetTableGridByRangeOptions, MIN_COLUMN_HEIGHT, type TTableCellElement, type TTableElement, type TTableRowElement, type TableCellElementResizableOptions, type TableCellElementState, type TableElementState, type TablePlugin, TableProvider, type TableStoreCellAttributes, type TableStoreSizeOverrides, computeAllCellIndices, computeCellIndices, createTablePlugin, deleteColumn, deleteColumnWhenExpanded, deleteRow, deleteRowWhenExpanded, deleteTable, deleteTableMergeColumn, deleteTableMergeRow, findCellByIndexes, getCellInNextTableRow, getCellInPreviousTableRow, getCellIndices, getCellIndicesWithSpans, getCellPath, getCellRowIndexByPath, getCellTypes, getColSpan, getEmptyCellNode, getEmptyRowNode, getEmptyTableNode, getLeftTableCell, getNextTableCell, getOnSelectTableBorderFactory, getPreviousTableCell, getRowSpan, getSelectionWidth, getTableAbove, getTableCellBorders, getTableColumnCount, getTableColumnIndex, getTableEntries, getTableGridAbove, getTableGridByRange, getTableMergeGridByRange, getTableMergedColumnCount, getTableOverriddenColSizes, getTableRowIndex, getTopTableCell, insertTable, insertTableColumn, insertTableMergeColumn, insertTableMergeRow, insertTableRow, isTableBorderHidden, isTableRectangular, keyShiftEdges, mergeTableCells, moveSelectionFromCell, onKeyDownTable, overrideSelectionFromCell, preventDeleteTableCell, roundCellSizeToStep, setBorderSize, setTableColSize, setTableMarginLeft, setTableRowSize, tableStore, unmergeTableCells, useIsCellSelected, useOverrideColSize, useOverrideMarginLeft, useOverrideRowSize, useSelectedCells, useTableBordersDropdownMenuContentState, useTableCellElement, useTableCellElementResizable, useTableCellElementResizableState, useTableCellElementState, useTableColSizes, useTableElement, useTableElementState, useTableMergeState, useTableStore, withDeleteTable, withGetFragmentTable, withInsertFragmentTable, withInsertTextTable, withMarkTable, withNormalizeTable, withSelectionTable, withSetFragmentDataTable, withTable }; |
{ | ||
"name": "@udecode/plate-table", | ||
"version": "34.0.0", | ||
"version": "35.1.0", | ||
"description": "Table plugin for Plate", | ||
@@ -49,3 +49,3 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@udecode/plate-common": ">=34.0.0", | ||
"@udecode/plate-common": ">=34.0.5", | ||
"react": ">=16.8.0", | ||
@@ -52,0 +52,0 @@ "react-dom": ">=16.8.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
728452
7487