refactor(core): move workspace implementation to affine (#9504)

This commit is contained in:
Saul-Mirone
2025-01-03 08:13:57 +00:00
parent 897c7d4284
commit cfd64f1fa5
18 changed files with 284 additions and 48 deletions

View File

@@ -18,7 +18,8 @@
"@blocksuite/global": "workspace:*",
"@blocksuite/inline": "workspace:*",
"@blocksuite/presets": "workspace:*",
"@blocksuite/store": "workspace:*"
"@blocksuite/store": "workspace:*",
"@blocksuite/sync": "workspace:*"
},
"exports": {
".": "./src/index.ts",
@@ -37,7 +38,8 @@
"./inline/types": "./src/inline/types.ts",
"./presets": "./src/presets/index.ts",
"./blocks": "./src/blocks/index.ts",
"./blocks/schemas": "./src/blocks/schemas.ts"
"./blocks/schemas": "./src/blocks/schemas.ts",
"./sync": "./src/sync/index.ts"
},
"typesVersions": {
"*": {
@@ -88,6 +90,9 @@
],
"blocks/schemas": [
"dist/blocks/schemas.d.ts"
],
"sync": [
"dist/sync/index.d.ts"
]
}
},

View File

@@ -0,0 +1 @@
export * from '@blocksuite/sync';

View File

@@ -70,10 +70,6 @@ const FLAGS_PRESET = {
readonly: {},
} satisfies BlockSuiteFlags;
export interface StackItem {
meta: Map<'cursor-location' | 'selection-state', unknown>;
}
export class DocCollection implements Workspace {
protected readonly _schema: Schema;

View File

@@ -3,5 +3,5 @@ export { DocCollection } from './collection.js';
export type * from './doc/block-collection.js';
export * from './doc/index.js';
export * from './id.js';
export type * from './meta.js';
export * from './meta.js';
export * from './workspace.js';

View File

@@ -84,3 +84,7 @@ export interface Workspace {
dispose(): void;
}
export interface StackItem {
meta: Map<'cursor-location' | 'selection-state', unknown>;
}

View File

@@ -13,6 +13,9 @@
},
{
"path": "./store"
},
{
"path": "./sync"
}
]
}