mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor(editor): merge inline to std (#11025)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { RichTextCell } from '@blocksuite/affine/blocks/database';
|
||||
import { ZERO_WIDTH_SPACE } from '@blocksuite/affine/inline';
|
||||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
|
||||
import {
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
getEditorLocator,
|
||||
waitNextFrame,
|
||||
} from '../utils/actions/misc.js';
|
||||
import { ZERO_WIDTH_SPACE } from '../utils/inline-editor.js';
|
||||
|
||||
export async function press(page: Page, content: string) {
|
||||
await page.keyboard.press(content, { delay: 50 });
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import type {
|
||||
InlineEditor,
|
||||
InlineRange,
|
||||
} from '@blocksuite/affine/block-std/inline';
|
||||
import type { DeltaInsert } from '@blocksuite/affine/store';
|
||||
import type { InlineEditor, InlineRange } from '@blocksuite/inline';
|
||||
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
|
||||
import { expect, type Page, test } from '@playwright/test';
|
||||
|
||||
import { ZERO_WIDTH_SPACE } from '../utils/inline-editor.js';
|
||||
// FIXME(mirone): copy paste from framework/inline/__tests__/utils.ts
|
||||
const defaultPlaygroundURL = new URL(
|
||||
`http://localhost:${process.env.CI ? 4173 : 5173}/`
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import {
|
||||
@@ -25,6 +24,7 @@ import {
|
||||
assertRichTextInlineDeltas,
|
||||
assertRichTextInlineRange,
|
||||
} from '../utils/asserts.js';
|
||||
import { ZERO_WIDTH_SPACE } from '../utils/inline-editor.js';
|
||||
import { test } from '../utils/playwright.js';
|
||||
|
||||
test('add inline latex at the start of line', async ({ page }) => {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import '../declare-test-window.js';
|
||||
|
||||
import type { InlineRange, InlineRootElement } from '@blocksuite/affine/inline';
|
||||
import type {
|
||||
InlineRange,
|
||||
InlineRootElement,
|
||||
} from '@blocksuite/affine/block-std/inline';
|
||||
import type { DatabaseBlockModel, ListType } from '@blocksuite/affine/model';
|
||||
import type { RichText } from '@blocksuite/affine/rich-text';
|
||||
import type { BlockModel } from '@blocksuite/affine/store';
|
||||
|
||||
@@ -5,8 +5,8 @@ import type {
|
||||
EditorHost,
|
||||
TextSelection,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import type { InlineRootElement } from '@blocksuite/affine/block-std/inline';
|
||||
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,
|
||||
|
||||
@@ -20,3 +20,10 @@ export async function getStringFromRichText(
|
||||
[index]
|
||||
);
|
||||
}
|
||||
|
||||
// Why? we can't import from `@blocksuite/affine/block-std/inline` because playwright will throw an error
|
||||
export const ZERO_WIDTH_SPACE = /Apple Computer/.test(
|
||||
globalThis.navigator?.vendor
|
||||
)
|
||||
? '\u200C'
|
||||
: '\u200B';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
"name": "@affine-test/blocksuite",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "yarn playwright test"
|
||||
},
|
||||
@@ -14,16 +13,5 @@
|
||||
"json-stable-stringify": "^1.2.1",
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"bsImport": {
|
||||
"@atlaskit/pragmatic-drag-and-drop/element/adapter": "@atlaskit/pragmatic-drag-and-drop/dist/cjs/entry-point/element/adapter.js",
|
||||
"@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview": "@atlaskit/pragmatic-drag-and-drop/dist/cjs/entry-point/element/disable-native-drag-preview.js",
|
||||
"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview": "@atlaskit/pragmatic-drag-and-drop/dist/cjs/entry-point/element/set-custom-native-drag-preview.js",
|
||||
"@atlaskit/pragmatic-drag-and-drop-auto-scroll/element": "@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/cjs/entry-point/element.js",
|
||||
"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge": "@atlaskit/pragmatic-drag-and-drop-hitbox/dist/cjs/closest-edge.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/toeverything/blocksuite.git"
|
||||
},
|
||||
"version": "0.20.0"
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
|
||||
},
|
||||
"include": ["./e2e"],
|
||||
"include": ["e2e"],
|
||||
"references": [
|
||||
{ "path": "../../blocksuite/affine/all" },
|
||||
{ "path": "../../blocksuite/integration-test" }
|
||||
|
||||
Reference in New Issue
Block a user