feat: allow custom props on tables to persist #2450
+394
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates tables so that custom props work on the table block.
Potentially fixes #1749
Disclaimer The updates to the library code (block.ts, nodeToBlock.ts) were made by Claude Sonnet 4.5 via Claude Code. I wrote the example app myself for testing.
Rationale
I need to store custom props on table blocks.
Having looked at the block code for tables further it looks like most of the functionality I'd need (e.g. custom rendering of a cell based on props) would require modifying the implementation of TiptapTableCell/TiptapTableNode. This is a much larger change than I am comfortable doing but I think being able to store props on the table can still be useful.
Changes
createTableBlockSpecnow accepts an optional prop definition, which is then persistedImpact
N/A
Testing
Manual testing was done via the example added in this PR. I was unsure about the correct place to add automated tests.
Screenshots/Video
Checklist
Additional Notes