mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 02:13:00 +08:00
feat: improve editor performance (#14429)
#### PR Dependency Tree * **PR #14429** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * HTML import now splits lines on <br> into separate paragraphs while preserving inline formatting. * **Bug Fixes** * Paste falls back to inserting after the first paragraph when no explicit target is found. * **Style** * Improved page-mode viewport styling for consistent content layout. * **Tests** * Added snapshot tests for <br>-based paragraph splitting; re-enabled an e2e drag-page test. * **Chores** * Deferred/deduplicated font loading, inline text caching, drag-handle/pointer optimizations, and safer inline render synchronization. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { cssVar } from '@toeverything/theme';
|
||||
import { cssVarV2 } from '@toeverything/theme/v2';
|
||||
import { style } from '@vanilla-extract/css';
|
||||
import { globalStyle, style } from '@vanilla-extract/css';
|
||||
|
||||
export const mainContainer = style({
|
||||
containerType: 'inline-size',
|
||||
@@ -47,6 +47,12 @@ export const affineDocViewport = style({
|
||||
},
|
||||
});
|
||||
|
||||
export const pageModeViewportContentBox = style({});
|
||||
globalStyle(`${pageModeViewportContentBox} >:first-child`, {
|
||||
display: 'table !important',
|
||||
minWidth: '100%',
|
||||
});
|
||||
|
||||
export const scrollbar = style({
|
||||
marginRight: '4px',
|
||||
});
|
||||
|
||||
@@ -347,7 +347,8 @@ const DetailPageImpl = memo(function DetailPageImpl() {
|
||||
className={clsx(
|
||||
'affine-page-viewport',
|
||||
styles.affineDocViewport,
|
||||
styles.editorContainer
|
||||
styles.editorContainer,
|
||||
{ [styles.pageModeViewportContentBox]: mode === 'page' }
|
||||
)}
|
||||
>
|
||||
<PageDetailEditor onLoad={onLoad} readonly={readonly} />
|
||||
|
||||
Reference in New Issue
Block a user