feat(editor): add editor store (#9584)

This commit is contained in:
Saul-Mirone
2025-01-08 07:47:43 +00:00
parent 0554df6bc2
commit fe727412be
25 changed files with 203 additions and 67 deletions
@@ -12,7 +12,7 @@ import {
DisposableGroup,
WithDisposable,
} from '@blocksuite/global/utils';
import { type Blocks, type Query } from '@blocksuite/store';
import { type Blocks, type Query, Store } from '@blocksuite/store';
import { css, html, nothing, type PropertyValues } from 'lit';
import { property, query, state } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
@@ -155,6 +155,7 @@ export class FramePreview extends WithDisposable(ShadowlessElement) {
private _renderSurfaceContent() {
if (!this._previewDoc || !this.frame) return nothing;
const { width, height } = this.frameViewportWH;
const store = new Store({ blocks: this._previewDoc });
const _previewSpec = this._previewSpec.value;
return html`<div
@@ -172,7 +173,7 @@ export class FramePreview extends WithDisposable(ShadowlessElement) {
})}
>
${new BlockStdScope({
doc: this._previewDoc,
store,
extensions: _previewSpec,
}).render()}
</div>