refactor(editor): remove readonly in awareness (#9597)

This commit is contained in:
Saul-Mirone
2025-01-09 05:15:35 +00:00
parent d21ef47ae8
commit 422bac6cbe
17 changed files with 71 additions and 179 deletions

View File

@@ -3,6 +3,7 @@ import { ShadowlessElement } from '@blocksuite/block-std';
import type { RichText, RootBlockModel } from '@blocksuite/blocks';
import { assertExists, WithDisposable } from '@blocksuite/global/utils';
import type { Store } from '@blocksuite/store';
import { effect } from '@preact/signals-core';
import { css, html } from 'lit';
import { property, query, state } from 'lit/decorators.js';
@@ -111,7 +112,7 @@ export class DocTitle extends WithDisposable(ShadowlessElement) {
this._isReadonly = this.doc.readonly;
this._disposables.add(
this.doc.awarenessStore.slots.update.on(() => {
effect(() => {
if (this._isReadonly !== this.doc.readonly) {
this._isReadonly = this.doc.readonly;
this.requestUpdate();