-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[lexical-yjs][lexical-react] Feature: initial implementation of collab v2 #7616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f0a01f0
8d91369
e59f560
7160838
c68770e
64bd3ad
169c242
0f63303
7bcf36a
28235aa
21aa07e
4e7a3ac
2208ab0
faee909
b60c886
1080cf0
586b6af
d7b6d2d
9fffb0c
2892aed
13a41c3
1c5f8bd
2b951ea
fb16e9a
5d8b4ec
edd7129
e13bd4b
a9d7f44
cd975d3
0d9fc70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ import { | |
| getHTML, | ||
| html, | ||
| initialize, | ||
| IS_COLLAB_V2, | ||
| LEGACY_EVENTS, | ||
| pasteFromClipboard, | ||
| pressToggleBold, | ||
|
|
@@ -906,6 +907,9 @@ test.describe.parallel('Markdown', () => { | |
| }); | ||
|
|
||
| test('can import single decorator node (#2604)', async ({page}) => { | ||
| // TODO(collab-v2): nested editors are not supported yet | ||
| test.skip(IS_COLLAB_V2); | ||
|
|
||
| await focusEditor(page); | ||
| await page.keyboard.type( | ||
| '```markdown  => { | |
| test('can import several text match transformers in a same line (#5385)', async ({ | ||
| page, | ||
| }) => { | ||
| // TODO(collab-v2): nested editors are not supported yet | ||
| test.skip(IS_COLLAB_V2); | ||
|
|
||
| await focusEditor(page); | ||
| await page.keyboard.type( | ||
| '```markdown [link](https://lexical.dev)[link](https://lexical.dev) => { | |
|
|
||
| const TYPED_MARKDOWN = `# Markdown Shortcuts | ||
| This is *italic*, _italic_, **bold**, __bold__, ~~strikethrough~~ text | ||
| This is *__~~bold italic strikethrough~~__* text, ___~~this one too~~___ | ||
| This is ~~*__bold italic strikethrough__*~~ text, ___~~this one too~~___ | ||
| It ~~___works [with links](https://lexical.io) too___~~ | ||
| *Nested **stars tags** are handled too* | ||
| # Title | ||
|
|
@@ -1101,7 +1108,7 @@ const TYPED_MARKDOWN_HTML = html` | |
| <p class="PlaygroundEditorTheme__paragraph" dir="auto"> | ||
| <span data-lexical-text="true">This is</span> | ||
| <strong | ||
| class="PlaygroundEditorTheme__textBold PlaygroundEditorTheme__textStrikethrough PlaygroundEditorTheme__textItalic" | ||
| class="PlaygroundEditorTheme__textBold PlaygroundEditorTheme__textItalic PlaygroundEditorTheme__textStrikethrough" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was seeing class names be applied in a different order between left and right clients. Didn't get to the bottom of why, by changing the order of the markdown modifiers above then the test here seemed to fix it. |
||
| data-lexical-text="true"> | ||
| bold italic strikethrough | ||
| </strong> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,12 +29,13 @@ import { | |
| dragMouse, | ||
| expect, | ||
| focusEditor, | ||
| getExpectedDateTimeHtml, | ||
| getPageOrFrame, | ||
| html, | ||
| initialize, | ||
| insertCollapsible, | ||
| insertDateTime, | ||
| insertHorizontalRule, | ||
| insertSampleImage, | ||
| insertTable, | ||
| insertTableColumnBefore, | ||
| insertTableRowAbove, | ||
|
|
@@ -46,7 +47,6 @@ import { | |
| LEGACY_EVENTS, | ||
| mergeTableCells, | ||
| pasteFromClipboard, | ||
| SAMPLE_IMAGE_URL, | ||
| selectCellFromTableCoord, | ||
| selectCellsFromTableCords, | ||
| selectFromAdditionalStylesDropdown, | ||
|
|
@@ -1356,7 +1356,7 @@ test.describe.parallel('Tables', () => { | |
| await focusEditor(page); | ||
| await page.keyboard.type('Text before'); | ||
| await page.keyboard.press('Enter'); | ||
| await insertSampleImage(page); | ||
| await insertDateTime(page); | ||
| await page.keyboard.press('Enter'); | ||
| await page.keyboard.type('Text after'); | ||
| await insertTable(page, 2, 3); | ||
|
|
@@ -1448,7 +1448,7 @@ test.describe.parallel('Tables', () => { | |
| }); | ||
|
|
||
| test( | ||
| 'Table selection: can select multiple cells and insert an image', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's nothing special about images here from what I can tell, so switched it to another decorator node so that the test can still run on v2. |
||
| 'Table selection: can select multiple cells and insert a decorator', | ||
| { | ||
| tag: '@flaky', | ||
| }, | ||
|
|
@@ -1468,11 +1468,9 @@ test.describe.parallel('Tables', () => { | |
| await page.keyboard.press('ArrowDown'); | ||
| await page.keyboard.up('Shift'); | ||
|
|
||
| await insertSampleImage(page); | ||
| await insertDateTime(page); | ||
| await page.keyboard.type(' <- it works!'); | ||
|
|
||
| await waitForSelector(page, '.editor-image img'); | ||
|
|
||
| await assertHTML( | ||
| page, | ||
| html` | ||
|
|
@@ -1501,18 +1499,7 @@ test.describe.parallel('Tables', () => { | |
| </th> | ||
| <td class="PlaygroundEditorTheme__tableCell"> | ||
| <p class="PlaygroundEditorTheme__paragraph"> | ||
| <span | ||
| class="editor-image" | ||
| contenteditable="false" | ||
| data-lexical-decorator="true"> | ||
| <div draggable="false"> | ||
| <img | ||
| alt="Yellow flower in tilt shift lens" | ||
| draggable="false" | ||
| src="${SAMPLE_IMAGE_URL}" | ||
| style="height: inherit; max-width: 500px; width: inherit" /> | ||
| </div> | ||
| </span> | ||
| ${getExpectedDateTimeHtml()} | ||
| <span data-lexical-text="true"><- it works!</span> | ||
| </p> | ||
| </td> | ||
|
|
@@ -6703,6 +6690,8 @@ test.describe.parallel('Tables', () => { | |
| // undo is used so we need to wait for history | ||
| await sleep(1050); | ||
|
|
||
| await sleep(1050); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To ensure that undo on v2 doesn't delete the whole table. |
||
|
|
||
| await withExclusiveClipboardAccess(async () => { | ||
| const clipboard = await copyToClipboard(page); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same overall outcome. This was the driver for #7794.