Tiptap RTE: Add clipboard copy/paste support for RTE blocks#21604
Open
leekelleher wants to merge 10 commits intomainfrom
Open
Tiptap RTE: Add clipboard copy/paste support for RTE blocks#21604leekelleher wants to merge 10 commits intomainfrom
leekelleher wants to merge 10 commits intomainfrom
Conversation
in other Block editor components.
If not, don't show the action button.
we can't make this generic for all RTEs, since it is bound to the property-editor UI alias.
for Tiptap RTE Blocks.
Change paste translator to output UmbPropertyEditorRteValueType (with markup and blocks) instead of UmbBlockRteValueModel (flat structure). This ensures the cloner receives the correct type and can properly regenerate content keys. Also optimize the cloner to skip DOM parsing when markup is empty, which is always the case for clipboard paste operations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add debounceTime to the contents observable to batch rapid emissions when pasting multiple blocks from clipboard. This prevents the #updateBlocks method from being called multiple times in quick succession. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds clipboard copy/paste support for blocks in the TipTap Rich Text Editor (RTE). Users can now copy blocks from Block List, Block Grid, or other Block RTEs and paste them into an RTE, with automatic compatibility filtering based on configured block types.
Changes:
- Adds new clipboard translators to convert between RTE block format and standard block clipboard format
- Implements "Copy to clipboard" button on RTE blocks with full context information (workspace name, property label, block label)
- Adds clipboard filtering in the block catalogue modal to show only compatible blocks based on configured block types
- Optimizes property value cloner with a fast path for empty markup (common when pasting blocks)
- Adds 20ms debounce on TipTap contents observable to prevent race conditions during rapid multi-block pasting
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/tiptap-rte/constants.ts |
Adds constant for property editor UI alias to enable reuse across clipboard and manifest files |
src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/tiptap-rte/manifests.ts |
Refactors to use constant instead of hardcoded alias string |
src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/constants.ts |
Exports the new RTE constants |
src/Umbraco.Web.UI.Client/src/packages/tiptap/manifests.ts |
Registers clipboard manifests with the extension system |
src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tiptap-api.ts |
Adds debounce to contents observable and refines null handling |
src/Umbraco.Web.UI.Client/src/packages/tiptap/clipboard/manifests.ts |
Defines clipboard property context and registers copy/paste translators |
src/Umbraco.Web.UI.Client/src/packages/tiptap/clipboard/block/paste/manifest.ts |
Manifest for paste translator from clipboard blocks to RTE format |
src/Umbraco.Web.UI.Client/src/packages/tiptap/clipboard/block/paste/block-to-block-rte-paste-translator.ts |
Translates clipboard block entries to RTE property value format with compatibility checking |
src/Umbraco.Web.UI.Client/src/packages/tiptap/clipboard/block/copy/manifest.ts |
Manifest for copy translator from RTE format to clipboard blocks |
src/Umbraco.Web.UI.Client/src/packages/tiptap/clipboard/block/copy/block-rte-to-block-copy-translator.ts |
Translates RTE blocks to clipboard format, removing RTE-specific properties |
src/Umbraco.Web.UI.Client/src/packages/block/block-single/components/block-single-entry/block-single-entry.element.ts |
Uses localized label for copy button |
src/Umbraco.Web.UI.Client/src/packages/block/block-rte/property-value-cloner/property-value-cloner-block-rte.cloner.ts |
Optimizes cloning with fast path for empty markup and fixes value structure handling |
src/Umbraco.Web.UI.Client/src/packages/block/block-rte/context/block-rte-entries.context.ts |
Implements clipboard filtering, paste handling, and inserts blocks from clipboard |
src/Umbraco.Web.UI.Client/src/packages/block/block-rte/components/block-rte-entry/block-rte-entry.element.ts |
Adds copy to clipboard button and handler to RTE block entries |
src/Umbraco.Web.UI.Client/src/packages/block/block-list/components/block-list-entry/block-list-entry.element.ts |
Uses localized label for copy button |
src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.ts |
Uses localized label for copy button |
src/Umbraco.Web.UI.Client/src/packages/tiptap/clipboard/block/paste/manifest.ts
Show resolved
Hide resolved
...b.UI.Client/src/packages/tiptap/clipboard/block/paste/block-to-block-rte-paste-translator.ts
Outdated
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/block/block-rte/context/block-rte-entries.context.ts
Outdated
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/block/block-rte/context/block-rte-entries.context.ts
Outdated
Show resolved
Hide resolved
...Web.UI.Client/src/packages/tiptap/clipboard/block/copy/block-rte-to-block-copy-translator.ts
Show resolved
Hide resolved
...b.UI.Client/src/packages/tiptap/clipboard/block/paste/block-to-block-rte-paste-translator.ts
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/tiptap/clipboard/block/copy/manifest.ts
Show resolved
Hide resolved
- Add missing await on insert() and insertFromRtePropertyValues() - Remove redundant optional chaining on blockContentTypes.every() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This was referenced Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prerequisites
Description
This PR adds clipboard copy/paste support for blocks within the Tiptap Rich Text Editor (RTE). Users can now copy blocks from Block List, Block Grid, or other Block RTEs and paste them into an RTE.
This is a partial fix towards #21345.
Key Changes
New Clipboard Translators (
src/packages/tiptap/clipboard/)block-rte-to-block-copy-translator.ts- Copies RTE blocks to clipboard formatblock-to-block-rte-paste-translator.ts- Translates clipboard blocks to RTE formatBlock RTE Entry (
block-rte-entry.element.ts)Block RTE Entries Context (
block-rte-entries.context.ts)#insertFromRtePropertyValuesfor handling pasted blocksisCompatibleValuefrom paste translatorProperty Value Cloner (
property-value-cloner-block-rte.cloner.ts)UmbPropertyEditorRteValueTypestructureTiptap Block API (
block.tiptap-api.ts)How to Test
Create a Document Type with:
Create content using this Document Type
Test copy from Block List to RTE:
Test copy from RTE to RTE:
Test multiple blocks:
Test compatibility filtering:
🤖 Generated with Claude Code