mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
chore: bump version (#3606)
This commit is contained in:
2
packages/env/package.json
vendored
2
packages/env/package.json
vendored
@@ -5,7 +5,7 @@
|
||||
"main": "./src/index.ts",
|
||||
"module": "./src/index.ts",
|
||||
"devDependencies": {
|
||||
"@blocksuite/global": "0.0.0-20230806233219-17ca6eee-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230807164933-9f6fb698-nightly",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"zod": "^3.21.4"
|
||||
|
||||
28
packages/env/src/blocksuite/subdoc-migration.ts
vendored
28
packages/env/src/blocksuite/subdoc-migration.ts
vendored
@@ -1,6 +1,8 @@
|
||||
import type { Schema } from '@blocksuite/store';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
type XYWH = [number, number, number, number];
|
||||
|
||||
function deserializeXYWH(xywh: string): XYWH {
|
||||
return JSON.parse(xywh) as XYWH;
|
||||
}
|
||||
@@ -240,14 +242,26 @@ export function migrateToSubdoc(doc: Y.Doc): Y.Doc {
|
||||
return output;
|
||||
}
|
||||
|
||||
export async function migrateDatabaseBlockTo3(doc: Y.Doc) {
|
||||
const { migratePageBlock } = await import(
|
||||
'@blocksuite/store/workspace/migration/migrate-block'
|
||||
);
|
||||
migratePageBlock(doc, {
|
||||
'affine:database': 2,
|
||||
export async function migrateDatabaseBlockTo3(rootDoc: Y.Doc, schema: Schema) {
|
||||
const spaces = rootDoc.getMap('spaces') as Y.Map<any>;
|
||||
spaces.forEach(space => {
|
||||
schema.upgradePage(
|
||||
{
|
||||
'affine:note': 1,
|
||||
'affine:bookmark': 1,
|
||||
'affine:database': 2,
|
||||
'affine:divider': 1,
|
||||
'affine:image': 1,
|
||||
'affine:list': 1,
|
||||
'affine:code': 1,
|
||||
'affine:page': 2,
|
||||
'affine:paragraph': 1,
|
||||
'affine:surface': 3,
|
||||
},
|
||||
space
|
||||
);
|
||||
});
|
||||
const meta = doc.getMap('meta') as Y.Map<unknown>;
|
||||
const meta = rootDoc.getMap('meta') as Y.Map<unknown>;
|
||||
const versions = meta.get('blockVersions') as Y.Map<number>;
|
||||
versions.set('affine:database', 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user