mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 00:06:09 +08:00
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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user