refactor(editor): orgnize exports (#10709)
This commit is contained in:
@@ -9,12 +9,15 @@ export async function updateBlockType(
|
||||
) {
|
||||
await page.evaluate(
|
||||
([flavour, type]) => {
|
||||
window.host.std.command.exec(window.$blocksuite.blocks.updateBlockType, {
|
||||
flavour,
|
||||
props: {
|
||||
type,
|
||||
},
|
||||
});
|
||||
window.host.std.command.exec(
|
||||
window.$blocksuite.blocks.note.updateBlockType,
|
||||
{
|
||||
flavour,
|
||||
props: {
|
||||
type,
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
[flavour, type] as [string, string?]
|
||||
);
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import '../declare-test-window.js';
|
||||
|
||||
import type {
|
||||
DatabaseBlockModel,
|
||||
ListType,
|
||||
RichText,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { InlineRange, InlineRootElement } from '@blocksuite/affine/inline';
|
||||
import type { DatabaseBlockModel, ListType } from '@blocksuite/affine/model';
|
||||
import type { RichText } from '@blocksuite/affine/rich-text';
|
||||
import type { BlockModel } from '@blocksuite/affine/store';
|
||||
import { uuidv4 } from '@blocksuite/affine/store';
|
||||
import type { TestAffineEditorContainer } from '@blocksuite/integration-test';
|
||||
@@ -341,9 +338,8 @@ export async function initEmptyDatabaseState(page: Page, rootId?: string) {
|
||||
noteId
|
||||
);
|
||||
const model = doc.getBlockById(databaseId) as DatabaseBlockModel;
|
||||
const datasource = new window.$blocksuite.blocks.DatabaseBlockDataSource(
|
||||
model
|
||||
);
|
||||
const datasource =
|
||||
new window.$blocksuite.blocks.database.DatabaseBlockDataSource(model);
|
||||
datasource.viewManager.viewAdd('table');
|
||||
doc.captureSync();
|
||||
return { rootId, noteId, databaseId };
|
||||
@@ -378,9 +374,8 @@ export async function initKanbanViewState(
|
||||
noteId
|
||||
);
|
||||
const model = doc.getBlockById(databaseId) as DatabaseBlockModel;
|
||||
const datasource = new window.$blocksuite.blocks.DatabaseBlockDataSource(
|
||||
model
|
||||
);
|
||||
const datasource =
|
||||
new window.$blocksuite.blocks.database.DatabaseBlockDataSource(model);
|
||||
const rowIds = config.rows.map(rowText => {
|
||||
const rowId = doc.addBlock(
|
||||
'affine:paragraph',
|
||||
@@ -435,9 +430,8 @@ export async function initEmptyDatabaseWithParagraphState(
|
||||
noteId
|
||||
);
|
||||
const model = doc.getBlockById(databaseId) as DatabaseBlockModel;
|
||||
const datasource = new window.$blocksuite.blocks.DatabaseBlockDataSource(
|
||||
model
|
||||
);
|
||||
const datasource =
|
||||
new window.$blocksuite.blocks.database.DatabaseBlockDataSource(model);
|
||||
datasource.viewManager.viewAdd('table');
|
||||
doc.addBlock('affine:paragraph', {}, noteId);
|
||||
doc.captureSync();
|
||||
|
||||
@@ -5,14 +5,13 @@ import type {
|
||||
EditorHost,
|
||||
TextSelection,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import type { EdgelessNoteBackground } from '@blocksuite/affine/blocks/note';
|
||||
import type { InlineRootElement } from '@blocksuite/affine/inline';
|
||||
import type { NoteBlockModel, RootBlockModel } from '@blocksuite/affine/model';
|
||||
import type {
|
||||
AffineInlineEditor,
|
||||
EdgelessNoteBackground,
|
||||
NoteBlockModel,
|
||||
RichText,
|
||||
RootBlockModel,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { InlineRootElement } from '@blocksuite/affine/inline';
|
||||
} from '@blocksuite/affine/rich-text';
|
||||
import type { BlockModel } from '@blocksuite/affine/store';
|
||||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
|
||||
|
||||
@@ -12,7 +12,10 @@ declare global {
|
||||
*/
|
||||
$blocksuite: {
|
||||
store: typeof import('@blocksuite/affine/store');
|
||||
blocks: typeof import('@blocksuite/affine/blocks');
|
||||
blocks: {
|
||||
database: typeof import('@blocksuite/affine/blocks/database');
|
||||
note: typeof import('@blocksuite/affine/blocks/note');
|
||||
};
|
||||
global: {
|
||||
utils: typeof import('@blocksuite/affine/global/utils');
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import type {
|
||||
MindmapElementModel,
|
||||
MindmapNode,
|
||||
ShapeElementModel,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
} from '@blocksuite/affine/model';
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
import { clickView } from './actions/click.js';
|
||||
|
||||
Reference in New Issue
Block a user