feat(admin): add table support to PortableText editor#222
feat(admin): add table support to PortableText editor#222tohaitrieu wants to merge 2 commits intoemdash-cms:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 4c42de0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
78907f8 to
7ecfe74
Compare
|
Thanks! Could you add a changeset, so this is included in the changelog and triggers a release. There's more info in |
91a8cbf to
09eb300
Compare
|
There seems to be quite a bit of extra stuff in here, beyond the main feature |
- Add TipTap table extensions (@tiptap/extension-table, table-row, table-cell, table-header) - Add table to slash commands menu (/table) - Add TableBubbleMenu for editing tables (add/remove rows/columns, toggle header, delete) - Update prosemirrorToPortableText converter to handle tables - Update portableTextToProsemirror converter to handle tables - Add CSS styles for table editing including dark mode support - Place table extensions after slash commands for keyboard priority
09eb300 to
96ba2e1
Compare
Overlapping PRsThis PR modifies files that are also changed by other open PRs: This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
ascorbic
left a comment
There was a problem hiding this comment.
Thanks. This is a great addition. It just needs a few changes. Can you also add unit tests for both conversion directions and ensure oyu have completed the checklist in the description.
|
|
||
| .ProseMirror td, | ||
| .ProseMirror th { | ||
| border: 1px solid #d1d5db; |
There was a problem hiding this comment.
Can we avoid using hard-coded colours. The rest of the admin UI uses Tailwind and Kumo design tokens, and these won't follow that. That applies to the other places in here too.
| "@tiptap/extension-table": "^3.22.1", | ||
| "@tiptap/extension-table-cell": "^3.22.1", | ||
| "@tiptap/extension-table-header": "^3.22.1", | ||
| "@tiptap/extension-table-row": "^3.22.1", |
There was a problem hiding this comment.
Can we use catalog dependencies here, and ensure they match the other tiptap extension versions
| : "tableCell"; | ||
|
|
||
| // Map PortableText marks to ProseMirror marks | ||
| const markNameMap: Record<string, string> = { |
There was a problem hiding this comment.
There's already a convertPTMarks function in this file that handles the PT/PM mark mapping. Please use that instead of the inline markNameMap here – it handles link markDefs too, which this version silently drops.
What does this PR do?
Adds table support to the TipTap/PortableText editor in the admin UI. Users can now insert, edit, and manage tables in content with proper toolbar controls.
Changes:
Discussion: #217
Type of change
Checklist
pnpm typecheckpassespnpm --silent lint:json | jq '.diagnostics | length'returns 0pnpm testpasses (or targeted tests for my change)pnpm formathas been run