feat(editor): merge store and blocks (#9591)

This commit is contained in:
Saul-Mirone
2025-01-08 13:01:19 +00:00
parent a0cba55a5b
commit 5842d45ab1
124 changed files with 362 additions and 414 deletions

View File

@@ -8,7 +8,7 @@ import {
stdContext,
} from '@blocksuite/block-std';
import { WithDisposable } from '@blocksuite/global/utils';
import type { BlockModel, Blocks } from '@blocksuite/store';
import type { BlockModel, Store } from '@blocksuite/store';
import { Text } from '@blocksuite/store';
import { consume } from '@lit/context';
import { css, html, nothing } from 'lit';
@@ -161,7 +161,7 @@ export class BlockCaptionEditor<
accessor display = false;
@consume({ context: docContext })
accessor doc!: Blocks;
accessor doc!: Store;
@query('.block-caption-editor')
accessor input!: HTMLInputElement;

View File

@@ -26,7 +26,7 @@ import {
ZERO_WIDTH_NON_JOINER,
ZERO_WIDTH_SPACE,
} from '@blocksuite/inline';
import type { Blocks, DocMeta } from '@blocksuite/store';
import type { DocMeta, Store } from '@blocksuite/store';
import { css, html, nothing } from 'lit';
import { property, state } from 'lit/decorators.js';
import { choose } from 'lit/directives/choose.js';
@@ -73,7 +73,7 @@ export class AffineReference extends WithDisposable(ShadowlessElement) {
}
`;
private readonly _updateRefMeta = (doc: Blocks) => {
private readonly _updateRefMeta = (doc: Store) => {
const refAttribute = this.delta.attributes?.reference;
if (!refAttribute) {
return;

View File

@@ -1,9 +1,9 @@
import type { BlockStdScope, EditorHost } from '@blocksuite/block-std';
import type { GfxModel } from '@blocksuite/block-std/gfx';
import type { BlockModel, Blocks } from '@blocksuite/store';
import type { BlockModel, Store } from '@blocksuite/store';
export abstract class MenuContext {
abstract get doc(): Blocks;
abstract get doc(): Store;
get firstElement(): GfxModel | null {
return null;