feat(editor): life cycle ext (#10668)

This commit is contained in:
Saul-Mirone
2025-03-06 12:28:55 +00:00
parent b85812d8dd
commit 2e86bfffae
9 changed files with 79 additions and 18 deletions

View File

@@ -30,6 +30,7 @@ import {
TelemetryProvider,
ThemeProvider,
} from '@blocksuite/affine-shared/services';
import { EditorLifeCycleExtension } from '@blocksuite/block-std';
import { Bound } from '@blocksuite/global/gfx';
import { WithDisposable } from '@blocksuite/global/lit';
import {
@@ -210,7 +211,9 @@ export class EdgelessChangeNoteButton extends WithDisposable(LitElement) {
const addHandler = this.doc.history.on('stack-item-added', closeNotify);
const popHandler = this.doc.history.on('stack-item-popped', closeNotify);
const disposable = this.edgeless.std.host.slots.unmounted.on(closeNotify);
const disposable = this.edgeless.std
.get(EditorLifeCycleExtension)
.slots.unmounted.on(closeNotify);
const undo = () => {
this.doc.undo();