mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor(core): move block collection to affine and implement as doc (#9514)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { DeltaInsert } from '@blocksuite/affine/inline';
|
||||
import type { Workspace } from '@blocksuite/affine/store';
|
||||
import { Text, type Workspace } from '@blocksuite/affine/store';
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
@@ -10,7 +10,7 @@ export function useReferenceLinkHelper(docCollection: Workspace) {
|
||||
if (!page) {
|
||||
return;
|
||||
}
|
||||
const text = new page.Text([
|
||||
const text = new Text([
|
||||
{
|
||||
insert: ' ',
|
||||
attributes: {
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'fake-indexeddb/auto';
|
||||
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import type { Blocks } from '@blocksuite/affine/store';
|
||||
import { type Blocks, Text } from '@blocksuite/affine/store';
|
||||
import { Schema } from '@blocksuite/store';
|
||||
import { TestWorkspace } from '@blocksuite/store/test';
|
||||
import { renderHook } from '@testing-library/react';
|
||||
@@ -27,7 +27,7 @@ beforeEach(async () => {
|
||||
expect(page).not.toBeNull();
|
||||
assertExists(page);
|
||||
const pageBlockId = page.addBlock('affine:page', {
|
||||
title: new page.Text(''),
|
||||
title: new Text(''),
|
||||
});
|
||||
const frameId = page.addBlock('affine:note', {}, pageBlockId);
|
||||
page.addBlock('affine:paragraph', {}, frameId);
|
||||
@@ -41,7 +41,7 @@ describe('useBlockSuitePagePreview', () => {
|
||||
const id = page.addBlock(
|
||||
'affine:paragraph',
|
||||
{
|
||||
text: new page.Text('Hello, world!'),
|
||||
text: new Text('Hello, world!'),
|
||||
},
|
||||
page.getBlockByFlavour('affine:note')[0].id
|
||||
);
|
||||
@@ -58,7 +58,7 @@ describe('useBlockSuitePagePreview', () => {
|
||||
page.addBlock(
|
||||
'affine:paragraph',
|
||||
{
|
||||
text: new page.Text('First block!'),
|
||||
text: new Text('First block!'),
|
||||
},
|
||||
page.getBlockByFlavour('affine:note')[0].id,
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user