Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

T/9: Table feature #10

Merged
merged 136 commits into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from 115 commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
84bb68d
Added: Initial tables support.
jodator Feb 21, 2018
0295625
Tests: Add basic tests for downcast conversion.
jodator Feb 21, 2018
65d47a2
Tests: Add manual tests for tables.
jodator Feb 21, 2018
60deb59
Other: Rename tables to table.
jodator Feb 22, 2018
036dfbc
Other: Update package.json dependencies.
jodator Feb 22, 2018
305b933
Added: Initial `InsertTableCommand` implementation.
jodator Feb 22, 2018
32e1756
Added: Initial 'insertTable' button.
jodator Feb 22, 2018
f55eb37
Changed: Bind 'insertTable' button to command.
jodator Feb 22, 2018
421b171
Other: Update package.json dependencies.
jodator Feb 22, 2018
7f3156e
Changed: Support heading rows as table attribute.
jodator Feb 22, 2018
7026f11
Tests: Add basic converter tests.
jodator Feb 22, 2018
ab6c03c
Tests: Update table/converters tests.
jodator Feb 22, 2018
c91b59c
Tests: Add basic InsertTableCommand tests.
jodator Feb 22, 2018
9fae5f5
Tests: Add basic TableUI tests for insertTableButton.
jodator Feb 22, 2018
39d61cf
Changed: Create `upcastTable()` converter.
jodator Feb 23, 2018
ba0f7d7
Changed: Unify table converter methods invocation.
jodator Feb 23, 2018
e0eaa83
Changed: Add custom upcast converter for table.
jodator Feb 26, 2018
5e087ce
Changed: Properly mark th in thead.
jodator Feb 26, 2018
a850114
Added: Support for heading cols in downcast conversion.
jodator Feb 26, 2018
8af846e
Added: Basic table heading columns calculation.
jodator Feb 26, 2018
917f9fb
Other: Added minor documentation.
jodator Feb 27, 2018
f0b9c0d
Changed: table/converters cleanup.
jodator Feb 27, 2018
832bba3
Test: Change test for splitting not allowed parent.
jodator Feb 27, 2018
781365b
Added: Heading columns calculation should consider `colspan` attribute.
jodator Feb 28, 2018
343551c
Added: Consider `colspan` attribute in `headingColumns` support in do…
jodator Feb 28, 2018
746d911
Added: Calculate heading column cells should consider rowspan and cel…
jodator Mar 1, 2018
ba19638
Changed: Refactor table converters and make CellSpans class private.
jodator Mar 2, 2018
6c06846
Changed: Extract downcastTable() and upcastTable() converters to sepa…
jodator Mar 2, 2018
7a1c197
Docs: Update `downcastTable()` documentation.
jodator Mar 5, 2018
66710c1
Docs: Update `upcastTable()` documentation.
jodator Mar 6, 2018
6accc44
Docs: Update Table & InsertTableCommand documentation.
jodator Mar 6, 2018
d5719d3
Align code to changes in heading command changes.
jodator Mar 12, 2018
78befaa
Other: Basic insert row & insert column commands.
jodator Mar 16, 2018
60a95c4
Other: Count cell spans when inserting rows & columns.
jodator Mar 19, 2018
dcbd0f8
Tests: Add temporary insertRow & insertColumn buttons tests.
jodator Mar 19, 2018
5650eb0
Other: Initial 'insert:tableRow' downcast converter implementation.
jodator Mar 20, 2018
ab4c55e
Added: Make inserted rows appear in proper table section in the view.
jodator Mar 22, 2018
aad39c9
Added: Add insert table column downcast converter.
jodator Mar 22, 2018
6d69b88
Added: Initial support for converting table attributes changes.
jodator Mar 29, 2018
91ab2c7
Other: Reorder methods in table/converters/downcasttable and add some…
jodator Mar 29, 2018
5834174
Added: Make insert row command aware of previous rowspans.
jodator Mar 30, 2018
0381c19
Tests: Add simple cell merge & split simulation tests in downcast con…
jodator Mar 30, 2018
4648335
Fix: Change table attribute should only check existing view elements …
jodator Mar 30, 2018
52c85db
Tests: Remove wrong downcast definition.
jodator Mar 30, 2018
6176753
Changed: Extract CellSpans to own file as it is used by commands and …
jodator Mar 30, 2018
d2b50d6
Added: Introduce TableIterator.
jodator Apr 3, 2018
79e6ef8
Changed: Refactor TableIterator#iterateOverRow() to TableIterator#ite…
jodator Apr 3, 2018
dfaab8f
Docs: Update TableIterator docs.
jodator Apr 3, 2018
e38cf0d
Changed: TableIterator should yield table properties also.
jodator Apr 4, 2018
ce4f50a
Changed: Refactor TableIterator to a TableWalker.
jodator Apr 4, 2018
fc9b50b
Docs: Update TableWalker documentation.
jodator Apr 4, 2018
3834b06
Changed: Cache table attributes in TableWalker.
jodator Apr 4, 2018
523cca2
Docs: Update the docs of a TableWalker.
jodator Apr 4, 2018
3652776
Other: Refactor downcasttable.
jodator Apr 4, 2018
62e4222
Docs: Review `upcastTable()` docs.
jodator Apr 9, 2018
026f0c7
Other: Update dependencies.
jodator Apr 9, 2018
783b07f
Other: Refactor exports fo downcast converters helper module.
jodator Apr 9, 2018
b5d146a
Other: Extract common utils from commands and move commands to own mo…
jodator Apr 9, 2018
22c80a4
Added: Custom remove table row downcast converter.
jodator Apr 20, 2018
98fd8d5
Fix: Change where the table cell is consumed in downcast converters.
jodator Apr 13, 2018
39b11db
Update dependencies.
jodator Apr 12, 2018
31dc1c2
Other: Enable table widget in editing view.
jodator Apr 10, 2018
a8f067c
Added: Initial Tab key support.
jodator Apr 12, 2018
1585569
Tests: Fix imports in tests.
jodator Apr 12, 2018
a65b4a0
Added: Handle Shift+Tab keystroke handling in table.
jodator Apr 12, 2018
1099d6a
Changed: Make tab movement in table select whole cell.
jodator Apr 12, 2018
2e99f2a
Tests: Add test for `asWidget` option of `downcastInsertTable()`.
jodator Apr 12, 2018
fe5d290
Other: Add Widget to Table feature requires.
jodator Apr 12, 2018
3b9d0eb
Added: Use Tab to entry table if whole widget is selected.
jodator Apr 13, 2018
62e1123
Other: Update TableEditing docs & improve code readability.
jodator Apr 16, 2018
79e9c6e
Changed: Make table cell elements render as nested editables in editi…
jodator Apr 18, 2018
db9e7e0
Added: Add includeSpanned option to TableWalker.
jodator Apr 17, 2018
34b6cbc
Added: Add split cell command.
jodator Apr 17, 2018
84a82a2
Added: RemoveRow command.
jodator Apr 20, 2018
1ef4b72
Other: Fix docs & imports.
jodator Apr 20, 2018
63e96b3
Tests: Rename formatModelTable() tests helper to formatTable().
jodator Apr 20, 2018
f6cd1d9
Other: Update dependencies.
jodator Apr 23, 2018
886e203
Added: Initial RemoveColumnCommand implementation.
jodator Apr 23, 2018
d259e99
Added: Initial mergeRight and mergeLeft commands implementation.
jodator Apr 23, 2018
2cc7f16
Changed: MergeCellCommand value should be set to a mergable tableCell.
jodator Apr 23, 2018
7891c59
Added: Initial mergeDown command implementation.
jodator Apr 24, 2018
e5a72a4
Added: Initial mergeUp command implementation.
jodator Apr 24, 2018
4780c20
Added: The `downcastAttributeChange()` conversion helper should accep…
jodator Apr 24, 2018
1d1a824
Added: Initial SetTableHeadersCommand implementation.
jodator Apr 24, 2018
17093e9
Fixed: SetTableHeadersCommand should split rowspanned cells that over…
jodator Apr 25, 2018
f431ff9
Changed: SplitCell command should split cell horizontally to given nu…
jodator Apr 26, 2018
6460741
Tests: Add tests for command/utils.
jodator Apr 27, 2018
5fa2b4a
Changed: Remove unsplitVertically() method from commands/utils.
jodator Apr 27, 2018
470b741
Changed: Refactor TableWalker.
jodator Apr 27, 2018
e2fd0b1
Changed: Refactor InsertRowCommand to TableUtils plugin and introduce…
jodator Apr 30, 2018
0cee23d
Tests: Fix TableUI tests.
jodator May 2, 2018
9866ab8
Fix: The set table headers command should properly split rowspanned c…
jodator May 2, 2018
57de23d
Changed: Extract cell splitting to TableUtils plugin.
jodator May 2, 2018
8da3296
Added: Initial `TableUtils#splitCellVertically` implementation.
jodator May 2, 2018
15bf753
Other: Update dependencies.
jodator May 2, 2018
9d772fe
Added: Support of rowspaned cells update in `TableUtils#splitCellHori…
jodator May 2, 2018
e405216
Changed: Create `TableUtils#insertColumns()` and create 'insertColumn…
jodator May 2, 2018
1584a06
Refactor the `TableUtils#insertColumns()` method.
jodator May 4, 2018
b5af141
Refactor InsertColumnCommand and create the `TableUtils#getCellLocati…
jodator May 4, 2018
2c31735
Refactor InsertRowCommand.
jodator May 4, 2018
ff13aa8
Refactor InsertTableCommand and create the `TableUtils#createTable()`…
jodator May 4, 2018
4fa50de
Refactor MergeCellCommand.
jodator May 7, 2018
3e2255b
Tests: Update manual tests UI components.
jodator May 7, 2018
b4a9bac
Refactor RemoveColumnCommand & move getColumns() to TableUtils plugin.
jodator May 7, 2018
832d9c3
Other: Refactor commands.
jodator May 8, 2018
c033c6a
Other: Refactor TableUtils class and update docs.
jodator May 9, 2018
723f8e0
Fix: The multiple rowspanned cells prevents proper column insertion.
jodator May 9, 2018
f557f70
Other: Review table commands names & add tests for TableEditing.
jodator May 10, 2018
5e1df9f
Fixed: Splitting table cell with rowspan should reduce this attribute…
jodator May 11, 2018
4372c1f
Fixed: Properly handle splitting cells depending of cell's rowspan at…
jodator May 11, 2018
7d0a897
Fixed: Properly handle splitting cells vertically that have colspan.
jodator May 11, 2018
98dc70a
Fix: Cannot insert row at index 0 if table has heading rows attribute…
jodator May 15, 2018
3904209
Align code to the latest changes in converters API.
jodator May 15, 2018
fa3c941
Fix: Splitting table cell vertically in heading section should update…
jodator May 15, 2018
1b84de8
Fix: Merge cell command should be disabled for directions that cross …
jodator May 15, 2018
4dc4c7e
Minor typos in docs and code style.
scofalik May 17, 2018
9dc22d4
Fixed: The split cell vertically and horizontally was wrongly used in…
jodator May 17, 2018
ca82cec
Other: Improve readability of downcast attribute converters.
jodator May 18, 2018
7ab358e
Docs: Update TableUtils#insertRows() and TableUtils#insertColumns() m…
jodator May 18, 2018
dde5b21
Docs: Further enhance TableUtils docs.
jodator May 18, 2018
2ec4dcf
Changed: Cleanup downcast conversion & update TableWalker internals.
jodator May 21, 2018
0169ba8
Docs: Update TableUtils.splitCell* methods docs.
jodator May 22, 2018
bec3efa
Fix: Fix TableUtils#splitCellVertically() algorithm and update docs.
jodator May 23, 2018
4b42130
Other: Remove custom upcast converter for tableRow.
jodator May 23, 2018
0e2f65e
Other: Make isHorizontal property of MergeCellCommand.
jodator May 23, 2018
c415ace
Other: Cleanup code.
jodator May 23, 2018
8e38949
Docs: Fixed @returns use. [skip ci]
Reinmar May 25, 2018
a3fb896
Fixed class names.
Reinmar May 28, 2018
229d70f
Minor API docs fixes.
Reinmar May 28, 2018
a47aea1
Changed: Remove redundant options from from table schema.
jodator May 28, 2018
ec3aacb
Docs: Fix TableUtils#splitCellVertically() description.
jodator May 28, 2018
880b911
Changed: Iterate over a row only of inserted table cell in downcast c…
jodator May 28, 2018
9411b3f
Changed: Remove redundant parseInt() for table attributes.
jodator May 28, 2018
f41171f
Changed some comments, docs and code order.
scofalik May 28, 2018
be183f4
Fixed wrong variable name.
scofalik May 28, 2018
f6bbbab
Changed: Make upcasting empty table more explicit.
jodator May 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
"ckeditor5-feature"
],
"dependencies": {
"@ckeditor/ckeditor5-core": "^10.0.0",
"@ckeditor/ckeditor5-engine": "^10.0.0",
"@ckeditor/ckeditor5-ui": "^10.0.0",
"@ckeditor/ckeditor5-widget": "^10.0.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-editor-classic": "^10.0.0",
"@ckeditor/ckeditor5-paragraph": "^10.0.0",
"@ckeditor/ckeditor5-utils": "^10.0.0",
"eslint": "^4.15.0",
"eslint-config-ckeditor5": "^1.0.7",
"husky": "^0.14.3",
"lint-staged": "^7.0.0"
},
"engines": {
"node": ">=6.0.0",
Expand Down
67 changes: 67 additions & 0 deletions src/commands/insertcolumncommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/**
* @module table/commands/insertcolumncommand
*/

import Command from '@ckeditor/ckeditor5-core/src/command';
import { getParentTable } from './utils';
import TableUtils from '../tableutils';

/**
* The insert column command.
*
* @extends module:core/command~Command
*/
export default class InsertColumnCommand extends Command {
/**
* Creates a new `InsertRowCommand` instance.
*
* @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.
* @param {Object} options
* @param {String} [options.order="after"] The order of insertion relative to a column in which caret is located.
* Possible values: "after" and "before".
*/
constructor( editor, options = {} ) {
super( editor );

/**
* The order of insertion relative to a column in which caret is located.
*
* @readonly
* @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order
*/
this.order = options.order || 'after';
}

/**
* @inheritDoc
*/
refresh() {
const selection = this.editor.model.document.selection;

const tableParent = getParentTable( selection.getFirstPosition() );

this.isEnabled = !!tableParent;
}

/**
* @inheritDoc
*/
execute() {
const editor = this.editor;
const selection = editor.model.document.selection;
const tableUtils = editor.plugins.get( TableUtils );

const table = getParentTable( selection.getFirstPosition() );
const tableCell = selection.getFirstPosition().parent;

const { column } = tableUtils.getCellLocation( tableCell );
const insertAt = this.order === 'after' ? column + 1 : column;

tableUtils.insertColumns( table, { columns: 1, at: insertAt } );
}
}
67 changes: 67 additions & 0 deletions src/commands/insertrowcommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/**
* @module table/commands/insertrowcommand
*/

import Command from '@ckeditor/ckeditor5-core/src/command';
import { getParentTable } from './utils';
import TableUtils from '../tableutils';

/**
* The insert row command.
*
* @extends module:core/command~Command
*/
export default class InsertRowCommand extends Command {
/**
* Creates a new `InsertRowCommand` instance.
*
* @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.
* @param {Object} options
* @param {String} [options.order="below"] The order of insertion relative to a row in which caret is located.
* Possible values: "above" and "below".
*/
constructor( editor, options = {} ) {
super( editor );

/**
* The order of insertion relative to a row in which caret is located.
*
* @readonly
* @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
*/
this.order = options.order || 'below';
}

/**
* @inheritDoc
*/
refresh() {
const selection = this.editor.model.document.selection;

const tableParent = getParentTable( selection.getFirstPosition() );

this.isEnabled = !!tableParent;
}

/**
* @inheritDoc
*/
execute() {
const editor = this.editor;
const selection = editor.model.document.selection;
const tableUtils = editor.plugins.get( TableUtils );

const tableCell = selection.getFirstPosition().parent;
const table = getParentTable( selection.getFirstPosition() );

const row = table.getChildIndex( tableCell.parent );
const insertAt = this.order === 'below' ? row + 1 : row;

tableUtils.insertRows( table, { rows: 1, at: insertAt } );
}
}
60 changes: 60 additions & 0 deletions src/commands/inserttablecommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/**
* @module table/commands/inserttablecommand
*/

import Command from '@ckeditor/ckeditor5-core/src/command';
import Position from '@ckeditor/ckeditor5-engine/src/model/position';
import TableUtils from '../tableutils';

/**
* The insert table command.
*
* @extends module:core/command~Command
*/
export default class InsertTableCommand extends Command {
/**
* @inheritDoc
*/
refresh() {
const model = this.editor.model;
const selection = model.document.selection;
const schema = model.schema;

const validParent = getInsertTableParent( selection.getFirstPosition() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right. Or rather looks too simple. Is it copied from somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the second one: too simple. I'll check how this can be improved.


this.isEnabled = schema.checkChild( validParent, 'table' );
}

/**
* @inheritDoc
*/
execute( options = {} ) {
const model = this.editor.model;
const selection = model.document.selection;
const tableUtils = this.editor.plugins.get( TableUtils );

const rows = parseInt( options.rows ) || 2;
const columns = parseInt( options.columns ) || 2;

const firstPosition = selection.getFirstPosition();

const isRoot = firstPosition.parent === firstPosition.root;
const insertPosition = isRoot ? Position.createAt( firstPosition ) : Position.createAfter( firstPosition.parent );

tableUtils.createTable( insertPosition, rows, columns );
}
}

// Returns valid parent to insert table
//
// @param {module:engine/model/position} position
function getInsertTableParent( position ) {
const parent = position.parent;

return parent === parent.root ? parent : parent.parent;
}
171 changes: 171 additions & 0 deletions src/commands/mergecellcommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/**
* @module table/commands/mergecellcommand
*/

import Command from '@ckeditor/ckeditor5-core/src/command';
import Position from '@ckeditor/ckeditor5-engine/src/model/position';
import Range from '@ckeditor/ckeditor5-engine/src/model/range';
import TableWalker from '../tablewalker';

/**
* The merge cell command.
*
* @extends module:core/command~Command
*/
export default class MergeCellCommand extends Command {
/**
* Creates a new `MergeCellCommand` instance.
*
* @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.
* @param {Object} options
* @param {String} options.direction Indicates which cell merge to currently selected one.
* Possible values are: "left", "right", "up" and "down".
*/
constructor( editor, options ) {
super( editor );

/**
* The direction indicates which cell will be merged to currently selected one.
*
* @readonly
* @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
*/
this.direction = options.direction;
}

/**
* @inheritDoc
*/
refresh() {
const cellToMerge = this._getMergeableCell();

this.isEnabled = !!cellToMerge;
// In order to check if currently selected cell can be merged with one defined by #direction some computation are done beforehand.
// As such we can cache it as a command's value.
this.value = cellToMerge;
}

/**
* @inheritDoc
*/
execute() {
const model = this.editor.model;
const doc = model.document;
const tableCell = doc.selection.getFirstPosition().parent;
const cellToMerge = this.value;
const direction = this.direction;

model.change( writer => {
const isMergeNext = direction == 'right' || direction == 'down';

// The merge mechanism is always the same so sort cells to be merged.
const mergeInto = isMergeNext ? tableCell : cellToMerge;
const removeCell = isMergeNext ? cellToMerge : tableCell;

writer.move( Range.createIn( removeCell ), Position.createAt( mergeInto, 'end' ) );
writer.remove( removeCell );

const spanAttribute = isHorizontal( direction ) ? 'colspan' : 'rowspan';
const cellSpan = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );

writer.setAttribute( spanAttribute, cellSpan + cellToMergeSpan, mergeInto );

writer.setSelection( Range.createIn( mergeInto ) );
} );
}

/**
* Returns a cell that it mergeable with current cell depending on command's direction.
*
* @returns {module:engine/model/element|undefined}
* @private
*/
_getMergeableCell() {
const model = this.editor.model;
const doc = model.document;
const element = doc.selection.getFirstPosition().parent;

if ( !element.is( 'tableCell' ) ) {
return;
}

// First get the cell on proper direction.
const cellToMerge = isHorizontal( this.direction ) ?
getHorizontalCell( element, this.direction ) :
getVerticalCell( element, this.direction );

if ( !cellToMerge ) {
return;
}

// If found check if the span perpendicular to merge direction is equal on both cells.
const spanAttribute = isHorizontal( this.direction ) ? 'rowspan' : 'colspan';
const span = parseInt( element.getAttribute( spanAttribute ) || 1 );

const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );

if ( cellToMergeSpan === span ) {
return cellToMerge;
}
}
}

// Checks whether merge direction is horizontal.
//
// returns {Boolean}
function isHorizontal( direction ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this easily could be the command's property.

return direction == 'right' || direction == 'left';
}

// Returns horizontally mergeable cell.
//
// @param {module:engine/model/element~Element} tableCell
// @param {String} direction
// @returns {module:engine/model/node~Node|null}
function getHorizontalCell( tableCell, direction ) {
return direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;
}

// Returns vertically mergeable cell.
//
// @param {module:engine/model/element~Element} tableCell
// @param {String} direction
// @returns {module:engine/model/node~Node|null}
function getVerticalCell( tableCell, direction ) {
const tableRow = tableCell.parent;
const table = tableRow.parent;

const rowIndex = table.getChildIndex( tableRow );

// Don't search for mergeable cell if direction points out of the table.
if ( ( direction == 'down' && rowIndex === table.childCount - 1 ) || ( direction == 'up' && rowIndex === 0 ) ) {
return;
}

const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );

// Don't search for mergeable cell if direction points out of the current table section.
if ( headingRows && ( ( direction == 'down' && rowIndex === headingRows - 1 ) || ( direction == 'up' && rowIndex === headingRows ) ) ) {
return;
}

const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
const mergeRow = direction == 'down' ? rowIndex + rowspan : rowIndex;

const tableMap = [ ...new TableWalker( table, { endRow: mergeRow } ) ];

const currentCellData = tableMap.find( value => value.cell === tableCell );
const mergeColumn = currentCellData.column;

const cellToMergeData = tableMap.find( ( { row, column } ) => {
return column === mergeColumn && ( direction == 'down' ? mergeRow === row : mergeRow === rowspan + row );
} );

return cellToMergeData && cellToMergeData.cell;
}
Loading