mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
feat: bump blocksuite (#6010)
This commit is contained in:
@@ -72,12 +72,12 @@
|
||||
"uuid": "^9.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/global": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/blocks": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/global": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/icons": "2.1.44",
|
||||
"@blocksuite/lit": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/presets": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/store": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/lit": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/presets": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/store": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@storybook/addon-actions": "^7.6.17",
|
||||
"@storybook/addon-essentials": "^7.6.17",
|
||||
"@storybook/addon-interactions": "^7.6.17",
|
||||
|
||||
@@ -6,7 +6,7 @@ const require = createRequire(import.meta.url);
|
||||
const packageJson = require('../package.json');
|
||||
|
||||
const editorFlags: BlockSuiteFeatureFlags = {
|
||||
enable_synced_doc_block: false,
|
||||
enable_synced_doc_block: true,
|
||||
enable_expand_database_block: false,
|
||||
enable_bultin_ledits: false,
|
||||
};
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@affine/workspace-impl": "workspace:*",
|
||||
"@blocksuite/block-std": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/blocks": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/global": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/block-std": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/blocks": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/global": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/icons": "2.1.44",
|
||||
"@blocksuite/inline": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/lit": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/presets": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/store": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/inline": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/lit": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/presets": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/store": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@dnd-kit/core": "^6.1.0",
|
||||
"@dnd-kit/modifiers": "^7.0.0",
|
||||
"@dnd-kit/sortable": "^8.0.0",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import 'fake-indexeddb/auto';
|
||||
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import { AffineSchemas } from '@blocksuite/blocks/schemas';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { Schema, Workspace as BlockSuiteWorkspace } from '@blocksuite/store';
|
||||
@@ -16,7 +16,7 @@ import { useBlockSuitePagePreview } from '../use-block-suite-page-preview';
|
||||
let blockSuiteWorkspace: BlockSuiteWorkspace;
|
||||
|
||||
const schema = new Schema();
|
||||
schema.register(AffineSchemas).register(__unstableSchemas);
|
||||
schema.register(AffineSchemas);
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.useFakeTimers({ toFake: ['requestIdleCallback'] });
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
"@affine-test/kit": "workspace:*",
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/native": "workspace:*",
|
||||
"@blocksuite/blocks": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/lit": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/presets": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/store": "0.12.0-canary-202402271448-6d3a709",
|
||||
"@blocksuite/blocks": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/lit": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/presets": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@blocksuite/store": "0.12.0-canary-202403050308-3789d0e",
|
||||
"@electron-forge/cli": "^7.3.0",
|
||||
"@electron-forge/core": "^7.3.0",
|
||||
"@electron-forge/core-utils": "^7.3.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { SqliteConnection } from '@affine/native';
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import { AffineSchemas } from '@blocksuite/blocks/schemas';
|
||||
import { Schema } from '@blocksuite/store';
|
||||
import {
|
||||
forceUpgradePages,
|
||||
@@ -51,7 +51,7 @@ export const migrateToLatest = async (
|
||||
await connection.setVersion(version);
|
||||
}
|
||||
const schema = new Schema();
|
||||
schema.register(AffineSchemas).register(__unstableSchemas);
|
||||
schema.register(AffineSchemas);
|
||||
const rootDoc = new YDoc();
|
||||
const downloadBinary = async (doc: YDoc, isRoot: boolean): Promise<void> => {
|
||||
const update = (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'fake-indexeddb/auto';
|
||||
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import { AffineSchemas } from '@blocksuite/blocks/schemas';
|
||||
import { Schema, Workspace } from '@blocksuite/store';
|
||||
import { SyncEngine, SyncEngineStep, SyncPeerStep } from '@toeverything/infra';
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
@@ -11,7 +11,7 @@ import { createTestStorage } from './test-storage';
|
||||
|
||||
const schema = new Schema();
|
||||
|
||||
schema.register(AffineSchemas).register(__unstableSchemas);
|
||||
schema.register(AffineSchemas);
|
||||
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers({ toFake: ['requestIdleCallback'] });
|
||||
@@ -41,12 +41,27 @@ describe('SyncEngine', () => {
|
||||
id: 'page0',
|
||||
});
|
||||
page.load();
|
||||
const pageBlockId = page.addBlock('affine:page', {
|
||||
title: new page.Text(''),
|
||||
});
|
||||
page.addBlock('affine:surface', {}, pageBlockId);
|
||||
const frameId = page.addBlock('affine:note', {}, pageBlockId);
|
||||
page.addBlock('affine:paragraph', {}, frameId);
|
||||
const pageBlockId = page.addBlock(
|
||||
'affine:page' as keyof BlockSuite.BlockModels,
|
||||
{
|
||||
title: new page.Text(''),
|
||||
}
|
||||
);
|
||||
page.addBlock(
|
||||
'affine:surface' as keyof BlockSuite.BlockModels,
|
||||
{},
|
||||
pageBlockId
|
||||
);
|
||||
const frameId = page.addBlock(
|
||||
'affine:note' as keyof BlockSuite.BlockModels,
|
||||
{},
|
||||
pageBlockId
|
||||
);
|
||||
page.addBlock(
|
||||
'affine:paragraph' as keyof BlockSuite.BlockModels,
|
||||
{},
|
||||
frameId
|
||||
);
|
||||
await syncEngine.waitForSynced();
|
||||
syncEngine.forceStop();
|
||||
prev = workspace.doc.toJSON();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'fake-indexeddb/auto';
|
||||
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import { AffineSchemas } from '@blocksuite/blocks/schemas';
|
||||
import { Schema, Workspace } from '@blocksuite/store';
|
||||
import { SyncPeer, SyncPeerStep } from '@toeverything/infra';
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
@@ -9,7 +9,7 @@ import { IndexedDBSyncStorage } from '..';
|
||||
|
||||
const schema = new Schema();
|
||||
|
||||
schema.register(AffineSchemas).register(__unstableSchemas);
|
||||
schema.register(AffineSchemas);
|
||||
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers({ toFake: ['requestIdleCallback'] });
|
||||
@@ -35,12 +35,27 @@ describe('SyncPeer', () => {
|
||||
id: 'page0',
|
||||
});
|
||||
page.load();
|
||||
const pageBlockId = page.addBlock('affine:page', {
|
||||
title: new page.Text(''),
|
||||
});
|
||||
page.addBlock('affine:surface', {}, pageBlockId);
|
||||
const frameId = page.addBlock('affine:note', {}, pageBlockId);
|
||||
page.addBlock('affine:paragraph', {}, frameId);
|
||||
const pageBlockId = page.addBlock(
|
||||
'affine:page' as keyof BlockSuite.BlockModels,
|
||||
{
|
||||
title: new page.Text(''),
|
||||
}
|
||||
);
|
||||
page.addBlock(
|
||||
'affine:surface' as keyof BlockSuite.BlockModels,
|
||||
{},
|
||||
pageBlockId
|
||||
);
|
||||
const frameId = page.addBlock(
|
||||
'affine:note' as keyof BlockSuite.BlockModels,
|
||||
{},
|
||||
pageBlockId
|
||||
);
|
||||
page.addBlock(
|
||||
'affine:paragraph' as keyof BlockSuite.BlockModels,
|
||||
{},
|
||||
frameId
|
||||
);
|
||||
await syncPeer.waitForSynced();
|
||||
syncPeer.stop();
|
||||
prev = workspace.doc.toJSON();
|
||||
@@ -85,7 +100,7 @@ describe('SyncPeer', () => {
|
||||
expect(syncPeer.status.step).toBe(SyncPeerStep.LoadingSubDoc);
|
||||
page.load();
|
||||
await syncPeer.waitForSynced();
|
||||
page.addBlock('affine:page', {
|
||||
page.addBlock('affine:page' as keyof BlockSuite.BlockModels, {
|
||||
title: new page.Text(''),
|
||||
});
|
||||
expect(syncPeer.status.step).toBe(SyncPeerStep.Syncing);
|
||||
|
||||
Reference in New Issue
Block a user