refactor(editor): introduce store container to make implement doc easier (#12146)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced a new store management system for handling document stores, improving efficiency and flexibility when working with document data.

- **Refactor**
  - Updated internal store handling to use a centralized store container, simplifying store retrieval and removal across various components.
  - Renamed and updated several store-related method signatures for consistency and clarity.
  - Replaced editor extension loading logic with a new local implementation for better modularity.

- **Chores**
  - Improved and streamlined the export of store-related modules for better maintainability.
  - Removed obsolete and redundant code related to previous store management approaches.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Saul-Mirone
2025-05-07 06:08:43 +00:00
parent 93b1d6c729
commit 267bb3a975
11 changed files with 144 additions and 129 deletions

View File

@@ -34,7 +34,7 @@ import {
LifeCycleWatcher,
} from '@blocksuite/std';
import { GfxControllerIdentifier, GfxExtension } from '@blocksuite/std/gfx';
import { type GetBlocksOptions, type Query, Text } from '@blocksuite/store';
import { type GetStoreOptions, type Query, Text } from '@blocksuite/store';
import { computed, signal } from '@preact/signals-core';
import { html, nothing, type PropertyValues } from 'lit';
import { query, state } from 'lit/decorators.js';
@@ -403,7 +403,7 @@ export class EmbedSyncedDocBlockComponent extends EmbedBlockComponent<EmbedSynce
}
get syncedDoc() {
const options: GetBlocksOptions = { readonly: true };
const options: GetStoreOptions = { readonly: true };
if (this.isPageMode) options.query = this._pageFilter;
const doc = this.std.workspace.getDoc(this.model.props.pageId);
return doc?.getStore(options) ?? null;