refactor(editor): rename doc to blocks (#9510)

This commit is contained in:
Saul-Mirone
2025-01-03 12:49:33 +00:00
parent 2074bda8ff
commit 4457cb7266
99 changed files with 271 additions and 256 deletions
@@ -1,7 +1,7 @@
import { BlockStdScope, ShadowlessElement } from '@blocksuite/block-std';
import { EdgelessEditorBlockSpecs, ThemeProvider } from '@blocksuite/blocks';
import { SignalWatcher, WithDisposable } from '@blocksuite/global/utils';
import type { Doc } from '@blocksuite/store';
import type { Blocks } from '@blocksuite/store';
import { css, html, nothing, type TemplateResult } from 'lit';
import { property, state } from 'lit/decorators.js';
import { guard } from 'lit/directives/guard.js';
@@ -85,7 +85,7 @@ export class EdgelessEditor extends SignalWatcher(
}
@property({ attribute: false })
accessor doc!: Doc;
accessor doc!: Blocks;
@property({ attribute: false })
accessor editor!: TemplateResult;
@@ -11,7 +11,7 @@ import {
ThemeProvider,
} from '@blocksuite/blocks';
import { SignalWatcher, Slot, WithDisposable } from '@blocksuite/global/utils';
import type { BlockModel, Doc } from '@blocksuite/store';
import type { BlockModel, Blocks } from '@blocksuite/store';
import { computed, signal } from '@preact/signals-core';
import { css, html } from 'lit';
import { property } from 'lit/decorators.js';
@@ -88,7 +88,7 @@ export class AffineEditorContainer
}
`;
private readonly _doc = signal<Doc>();
private readonly _doc = signal<Blocks>();
private readonly _edgelessSpecs = signal<ExtensionType[]>(
EdgelessEditorBlockSpecs
@@ -123,10 +123,10 @@ export class AffineEditorContainer
};
get doc() {
return this._doc.value as Doc;
return this._doc.value as Blocks;
}
set doc(doc: Doc) {
set doc(doc: Blocks) {
this._doc.value = doc;
}
@@ -5,7 +5,7 @@ import {
} from '@blocksuite/block-std';
import { PageEditorBlockSpecs, ThemeProvider } from '@blocksuite/blocks';
import { noop, SignalWatcher, WithDisposable } from '@blocksuite/global/utils';
import type { Doc } from '@blocksuite/store';
import type { Blocks } from '@blocksuite/store';
import { css, html, nothing } from 'lit';
import { property, state } from 'lit/decorators.js';
import { guard } from 'lit/directives/guard.js';
@@ -101,7 +101,7 @@ export class PageEditor extends SignalWatcher(
}
@property({ attribute: false })
accessor doc!: Doc;
accessor doc!: Blocks;
@property({ type: Boolean })
accessor hasViewport = true;