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

View File

@@ -1,6 +1,6 @@
import { BlockSuiteError } from '@blocksuite/global/exceptions';
import type { Doc } from '../store/index.js';
import type { Blocks } from '../store/index.js';
import type { AssetsManager } from '../transformer/assets.js';
import type { DraftModel, Job, Slice } from '../transformer/index.js';
import type {
@@ -93,7 +93,7 @@ export abstract class BaseAdapter<AdapterTarget = unknown> {
| Promise<FromBlockSnapshotResult<AdapterTarget>>
| FromBlockSnapshotResult<AdapterTarget>;
async fromDoc(doc: Doc) {
async fromDoc(doc: Blocks) {
try {
const docSnapshot = this.job.docToSnapshot(doc);
if (!docSnapshot) return;
@@ -138,7 +138,7 @@ export abstract class BaseAdapter<AdapterTarget = unknown> {
async toBlock(
payload: ToBlockSnapshotPayload<AdapterTarget>,
doc: Doc,
doc: Blocks,
parent?: string,
index?: number
) {
@@ -175,7 +175,7 @@ export abstract class BaseAdapter<AdapterTarget = unknown> {
async toSlice(
payload: ToSliceSnapshotPayload<AdapterTarget>,
doc: Doc,
doc: Blocks,
parent?: string,
index?: number
) {