mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
refactor(editor): replace-id middlware (#12250)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved the internal structure and clarity of ID handling during import processes, leading to more maintainable and modular code. No changes to user-facing functionality. - **Chores** - Enhanced type definitions for import events to improve code readability and maintainability. No impact on end-user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -11,13 +11,15 @@ import type {
|
||||
SliceSnapshot,
|
||||
} from './type.js';
|
||||
|
||||
export type BeforeImportBlockPayload = {
|
||||
snapshot: BlockSnapshot;
|
||||
type: 'block';
|
||||
parent?: string;
|
||||
index?: number;
|
||||
};
|
||||
|
||||
export type BeforeImportPayload =
|
||||
| {
|
||||
snapshot: BlockSnapshot;
|
||||
type: 'block';
|
||||
parent?: string;
|
||||
index?: number;
|
||||
}
|
||||
| BeforeImportBlockPayload
|
||||
| {
|
||||
snapshot: SliceSnapshot;
|
||||
type: 'slice';
|
||||
@@ -71,14 +73,16 @@ export type AfterExportPayload =
|
||||
type: 'info';
|
||||
};
|
||||
|
||||
export type AfterImportBlockPayload = {
|
||||
snapshot: BlockSnapshot;
|
||||
type: 'block';
|
||||
model: BlockModel;
|
||||
parent?: string;
|
||||
index?: number;
|
||||
};
|
||||
|
||||
export type AfterImportPayload =
|
||||
| {
|
||||
snapshot: BlockSnapshot;
|
||||
type: 'block';
|
||||
model: BlockModel;
|
||||
parent?: string;
|
||||
index?: number;
|
||||
}
|
||||
| AfterImportBlockPayload
|
||||
| {
|
||||
snapshot: DocSnapshot;
|
||||
type: 'page';
|
||||
|
||||
Reference in New Issue
Block a user