Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TablePlugin] Table cells merging POC #2590

Closed
wants to merge 98 commits into from

Conversation

dimaanj
Copy link
Collaborator

@dimaanj dimaanj commented Aug 24, 2023

Summary

What had been done

  • Merge
  • Unmerge
  • Resize with merged cells
  • Handy cells selection
  • Inserting and removal rows and columns

Things to consider

  • Performance for huge tables
  • insertTableRow and insertTableColumn calls keep state of colIndex, rowIndex, colSpan, rowSpan for all cells. So running them multiple times synchronously won't lead to a problems.
  • ⚠️ deleteColumn, deleteRow, mergeCells, unmergeCells will modify cells structure and won't update colIndex, rowIndex, colSpan, rowSpan for affected cells. It's ok, since valid indexes and spans will be assigned in useTableCellElementState hook on each render, but invoking that functions multiple times synchronously won't work.
  • Inserting subtables might be flaky with merged cells if you can spot it
  • Tiny issues with resize, if you can find them

Functionality

merging.mp4

Pasting from Word

pasting-from-word.mp4

Pasting from other sites

pasting-from-sites.mp4

@dimaanj dimaanj self-assigned this Aug 24, 2023
@changeset-bot
Copy link

changeset-bot bot commented Aug 24, 2023

⚠️ No Changeset found

Latest commit: 06315fd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ❌ Failed (Inspect) Oct 3, 2023 4:37pm

@reviewpad reviewpad bot added the large Pull request is large label Aug 24, 2023
@dimaanj dimaanj changed the title [SlateEditor] Table cells merging POC [TablePlugin] Table cells merging POC Aug 25, 2023
@dimaanj dimaanj marked this pull request as ready for review August 28, 2023 09:45
@dimaanj dimaanj requested review from zbeyens and 12joan August 28, 2023 09:45
@WcaleNieWolny
Copy link
Collaborator

image

Your code does not build

@dimaanj
Copy link
Collaborator Author

dimaanj commented Aug 29, 2023

Your code does not build

Will check it

…lls-merging-poc-2

# Conflicts:
#	packages/table/src/transforms/insertTableRow.ts
#	yarn.lock
@zbeyens
Copy link
Member

zbeyens commented Oct 3, 2023

Continues in #2666

@zbeyens zbeyens closed this Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Pull request is large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants