mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
c23b8f604b
### What Changes - Fixed incorrect edgeless viewport display in peek view - Moved page block viewport fit animation logic from `EdgelessRootBlockComponent` to note config extension - Disabled page block viewport fit animation in peek view, using default `fitToScreen` instead - @doodlewind Fixed viewport resizing issues by adding a immediate update mechanism to ensure proper rendering during peek view operations. The setViewportByBound is only called once during peek view initialization, so there are barely perf overhead. - Updated related test cases - Refactored peek view test cases to make them clearer and more reliable - Added new test helper function `getViewportBound` for getting viewport boundary information
24 lines
665 B
TypeScript
24 lines
665 B
TypeScript
import type { NoteBlockModel } from '@blocksuite/affine-model';
|
|
import {
|
|
type BlockStdScope,
|
|
ConfigExtensionFactory,
|
|
} from '@blocksuite/block-std';
|
|
import type { TemplateResult } from 'lit';
|
|
|
|
type NoteBlockContext = {
|
|
note: NoteBlockModel;
|
|
std: BlockStdScope;
|
|
};
|
|
|
|
export type NoteConfig = {
|
|
edgelessNoteHeader: (context: NoteBlockContext) => TemplateResult;
|
|
pageBlockTitle: (context: NoteBlockContext) => TemplateResult;
|
|
/**
|
|
* @returns if the viewport fit animation executed
|
|
*/
|
|
pageBlockViewportFitAnimation?: (context: NoteBlockContext) => boolean;
|
|
};
|
|
|
|
export const NoteConfigExtension =
|
|
ConfigExtensionFactory<NoteConfig>('affine:note');
|