feat(ui): adds support for copy pasting complex fields #11513
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.
What?
This PR introduces support for copy + pasting complex fields such as Arrays and Blocks. These changes introduce a new
ClipboardAction
component that houses logic for copy + pasting to and from the clipboard to supported fields. I've scoped this PR to include only Blocks & Arrays, however the structure of the components introduced lend themselves to be easily extended to other field types. I've limited the scope because there may be design & functional blockers that make it unclear how to add actions to particular fields.Supported fields:
Fields that may be supported in the future with minimal effort by adopting the changes introduced here:
This PR also encompasses e2e tests that check both field and row-level copy/pasting.
Why?
To make it simpler and faster to copy complex fields over between documents and rows within those docs.
How?
Introduces a new
ClipboardAction
component with helper utilities to aid in copy/pasting and validating field data.Addresses #2977 & #10703
Notes: