refactor(editor): remove blocks package (#10708)

This commit is contained in:
Saul-Mirone
2025-03-09 05:44:26 +00:00
parent 0766a2d9ae
commit 12bc142809
277 changed files with 904 additions and 1060 deletions
@@ -1,5 +1,8 @@
import type { RichTextCell, RichTextCellEditing } from '@blocksuite/blocks';
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
import type {
RichTextCell,
RichTextCellEditing,
} from '@blocksuite/affine/blocks';
import { ZERO_WIDTH_SPACE } from '@blocksuite/affine/inline';
import { expect, type Locator, type Page } from '@playwright/test';
import {
@@ -110,7 +110,7 @@ test.describe('auto-complete', () => {
await enterPlaygroundRoom(page);
await page.evaluate(() => {
window.doc
.get(window.$blocksuite.blocks.FeatureFlagService)
.get(window.$blocksuite.services.FeatureFlagService)
.setFlag('enable_edgeless_text', false);
});
await initEmptyEdgelessState(page);
@@ -1,5 +1,5 @@
import type { EdgelessTextBlockComponent } from '@blocksuite/blocks';
import { Bound } from '@blocksuite/global/gfx';
import type { EdgelessTextBlockComponent } from '@blocksuite/affine/blocks';
import { Bound } from '@blocksuite/affine/global/gfx';
import { expect, type Page } from '@playwright/test';
import {
@@ -647,7 +647,7 @@ test.describe('shape hit test', () => {
await enterPlaygroundRoom(page);
await page.evaluate(() => {
window.doc
.get(window.$blocksuite.blocks.FeatureFlagService)
.get(window.$blocksuite.services.FeatureFlagService)
.setFlag('enable_edgeless_text', false);
});
await initEmptyEdgelessState(page);
@@ -41,7 +41,7 @@ test.describe('edgeless canvas text', () => {
await enterPlaygroundRoom(page);
await page.evaluate(() => {
window.doc
.get(window.$blocksuite.blocks.FeatureFlagService)
.get(window.$blocksuite.services.FeatureFlagService)
.setFlag('enable_edgeless_text', false);
});
await initEmptyEdgelessState(page);
@@ -1,4 +1,4 @@
import type { DatabaseBlockModel } from '@blocksuite/blocks';
import type { DatabaseBlockModel } from '@blocksuite/affine/blocks';
import { expect, type Page } from '@playwright/test';
import { switchEditorMode } from './utils/actions/edgeless.js';
@@ -4,11 +4,11 @@ import type {
DatabaseBlockModel,
ListType,
RichText,
} from '@blocksuite/blocks';
import type { InlineRange, InlineRootElement } from '@blocksuite/inline';
} from '@blocksuite/affine/blocks';
import type { InlineRange, InlineRootElement } from '@blocksuite/affine/inline';
import type { BlockModel } from '@blocksuite/affine/store';
import { uuidv4 } from '@blocksuite/affine/store';
import type { TestAffineEditorContainer } from '@blocksuite/integration-test';
import type { BlockModel } from '@blocksuite/store';
import { uuidv4 } from '@blocksuite/store';
import type { ConsoleMessage, Locator, Page } from '@playwright/test';
import { expect } from '@playwright/test';
import lz from 'lz-string';
@@ -1249,7 +1249,7 @@ export async function mockParseDocUrlService(
) {
await page.evaluate(mapping => {
const parseDocUrlService = window.host.std.get(
window.$blocksuite.blocks.ParseDocUrlProvider
window.$blocksuite.services.ParseDocUrlProvider
);
parseDocUrlService.parseDocUrl = (url: string) => {
const docId = mapping[url];
+4 -4
View File
@@ -4,16 +4,16 @@ import type {
BlockComponent,
EditorHost,
TextSelection,
} from '@blocksuite/block-std';
} from '@blocksuite/affine/block-std';
import type {
AffineInlineEditor,
EdgelessNoteBackground,
NoteBlockModel,
RichText,
RootBlockModel,
} from '@blocksuite/blocks';
import type { InlineRootElement } from '@blocksuite/inline';
import type { BlockModel } from '@blocksuite/store';
} from '@blocksuite/affine/blocks';
import type { InlineRootElement } from '@blocksuite/affine/inline';
import type { BlockModel } from '@blocksuite/affine/store';
import { expect, type Locator, type Page } from '@playwright/test';
import {
@@ -1,7 +1,7 @@
import type { EditorHost } from '@blocksuite/block-std';
import type * as Effects from '@blocksuite/blocks/effects';
import type { EditorHost } from '@blocksuite/affine/block-std';
import type * as Effects from '@blocksuite/affine/effects';
import type { Store, Transformer, Workspace } from '@blocksuite/affine/store';
import type { TestAffineEditorContainer } from '@blocksuite/integration-test';
import type { Store, Transformer, Workspace } from '@blocksuite/store';
declare const _GLOBAL_: typeof Effects;
@@ -11,13 +11,14 @@ declare global {
* the following instance are initialized in `packages/playground/apps/starter/main.ts`
*/
$blocksuite: {
store: typeof import('@blocksuite/store');
blocks: typeof import('@blocksuite/blocks');
store: typeof import('@blocksuite/affine/store');
blocks: typeof import('@blocksuite/affine/blocks');
global: {
utils: typeof import('@blocksuite/global/utils');
utils: typeof import('@blocksuite/affine/global/utils');
};
services: typeof import('@blocksuite/affine/shared/services');
editor: typeof import('@blocksuite/integration-test');
blockStd: typeof import('@blocksuite/block-std');
blockStd: typeof import('@blocksuite/affine/block-std');
};
collection: Workspace;
doc: Store;
+1 -1
View File
@@ -2,7 +2,7 @@ import type {
MindmapElementModel,
MindmapNode,
ShapeElementModel,
} from '@blocksuite/blocks';
} from '@blocksuite/affine/blocks';
import type { Page } from '@playwright/test';
import { clickView } from './actions/click.js';