refactor(editor): doc as store extension (#12170)

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

## Summary by CodeRabbit

- **New Features**
  - Introduced new exports related to workspace management, making additional workspace features available.

- **Refactor**
  - Updated how document and workspace types are imported and exported, consolidating and reorganizing module structure.
  - Shifted dependency management for document instances to use an internal provider mechanism.
  - Streamlined and centralized type imports across various modules.

- **Bug Fixes**
  - Removed an unused schema definition to improve code clarity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Saul-Mirone
2025-05-07 09:17:01 +00:00
parent 610565e617
commit eb62d0e853
12 changed files with 38 additions and 29 deletions
@@ -1,12 +1,8 @@
import * as Y from 'yjs';
import type { Doc, GetStoreOptions, Workspace } from '../extension/index.js';
import type { YBlock } from '../model/block/types.js';
import {
type Doc,
type GetStoreOptions,
StoreContainer,
type Workspace,
} from '../model/index.js';
import { StoreContainer } from '../model/index.js';
import type { AwarenessStore } from '../yjs/index.js';
import type { TestWorkspace } from './test-workspace.js';
@@ -5,7 +5,7 @@ import type {
DocMeta,
DocsPropertiesMeta,
WorkspaceMeta,
} from '../model/index.js';
} from '../extension/index.js';
import { createYProxy } from '../reactive/proxy.js';
type DocCollectionMetaState = {
@@ -14,8 +14,12 @@ import { Subject } from 'rxjs';
import { Awareness } from 'y-protocols/awareness.js';
import * as Y from 'yjs';
import type { ExtensionType } from '../extension/extension.js';
import type { Doc, Workspace, WorkspaceMeta } from '../model/index.js';
import type {
Doc,
ExtensionType,
Workspace,
WorkspaceMeta,
} from '../extension/index.js';
import { type IdGenerator, nanoid } from '../utils/id-generator.js';
import { AwarenessStore } from '../yjs/index.js';
import { TestDoc } from './test-doc.js';