feat(editor): replace slot with rxjs subject (#10768)

This commit is contained in:
Mirone
2025-03-12 11:29:24 +09:00
committed by GitHub
parent 19f978d9aa
commit cd63e0ed8b
302 changed files with 1405 additions and 1251 deletions
@@ -161,7 +161,7 @@ export class AffineFrameTitle extends SignalWatcher(
this._nestedFrame = this._isInsideFrame();
_disposables.add(
doc.slots.blockUpdated.on(payload => {
doc.slots.blockUpdated.subscribe(payload => {
if (
(payload.type === 'update' &&
payload.props.key === 'xywh' &&
@@ -182,14 +182,14 @@ export class AffineFrameTitle extends SignalWatcher(
);
_disposables.add(
this.model.propsUpdated.on(() => {
this.model.propsUpdated.subscribe(() => {
this._xywh = this.model.xywh;
this.requestUpdate();
})
);
_disposables.add(
gfx.selection.slots.updated.on(() => {
gfx.selection.slots.updated.subscribe(() => {
this._editing =
gfx.selection.selectedIds[0] === this.model.id &&
gfx.selection.editing;
@@ -197,7 +197,7 @@ export class AffineFrameTitle extends SignalWatcher(
);
_disposables.add(
gfx.viewport.viewportUpdated.on(({ zoom }) => {
gfx.viewport.viewportUpdated.subscribe(({ zoom }) => {
this._zoom = zoom;
this.requestUpdate();
})