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';
|
||||
|
||||
Reference in New Issue
Block a user