feat(editor): add collapse/expand functionality to code block component (#14884)

This PR fixes #14040 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Code blocks can be collapsed and expanded via a toolbar toggle
(visible when the document is editable).
* Collapsed code blocks show a limited preview (~8 lines) with a bottom
fade overlay and reduced padding.
* Toolbar button updates icon and tooltip to reflect collapsed/expanded
state.
* Collapse state is preserved on the block so its current
collapsed/expanded setting is retained.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ahsan Khaleeq
2026-05-04 02:07:42 +05:00
committed by GitHub
parent 5d234ad6a8
commit 9e412f58ec
6 changed files with 106 additions and 1 deletions
@@ -265,6 +265,16 @@ export const CancelWrapIcon = icons.CancelWrapIcon({
height: '20',
});
export const CollapseCodeIcon = icons.CollapseIcon({
width: '20',
height: '20',
});
export const ExpandCodeIcon = icons.ToggleRightIcon({
width: '20',
height: '20',
});
// Attachment
export const ViewIcon = icons.ViewIcon({