Skip to content

Commit

Permalink
Merge branch 'main' into reconciler-children
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum authored Nov 11, 2024
2 parents 9bc9c33 + 23f4a7e commit 6453a4b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/lexical-list/src/LexicalListNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@ export class ListNode extends ElementNode {
if ($isListNode(currentNode)) {
listItemNode.append(currentNode);
} else if ($isElementNode(currentNode)) {
const textNode = $createTextNode(currentNode.getTextContent());
listItemNode.append(textNode);
if (currentNode.isInline()) {
listItemNode.append(currentNode);
} else {
const textNode = $createTextNode(currentNode.getTextContent());
listItemNode.append(textNode);
}
} else {
listItemNode.append(currentNode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ test.describe('Clear All Formatting', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -180,6 +181,7 @@ test.describe('Clear All Formatting', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ test.describe('Composition', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -950,6 +951,7 @@ test.describe('Composition', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2)"
data-lexical-text="true">
Luke Skywalker
Expand Down
33 changes: 33 additions & 0 deletions packages/lexical-playground/__tests__/e2e/Mentions.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -137,6 +138,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -168,6 +170,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -232,6 +235,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -264,6 +268,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Skywalker
Expand Down Expand Up @@ -308,6 +313,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -340,6 +346,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -384,6 +391,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -407,6 +415,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -486,6 +495,7 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">abc</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -511,6 +521,7 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">abc</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -590,27 +601,31 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -646,20 +661,23 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -677,20 +695,23 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -714,20 +735,23 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -743,20 +767,23 @@ test.describe('Mentions', () => {
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -783,13 +810,15 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -807,13 +836,15 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -879,6 +910,7 @@ test.describe('Mentions', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -971,6 +1003,7 @@ test.describe('Mentions', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test.describe('Regression test #379', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -57,6 +58,7 @@ test.describe('Regression test #379', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down
1 change: 1 addition & 0 deletions packages/lexical-playground/src/nodes/MentionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class MentionNode extends TextNode {
const dom = super.createDOM(config);
dom.style.cssText = mentionStyle;
dom.className = 'mention';
dom.spellcheck = false;
return dom;
}

Expand Down

0 comments on commit 6453a4b

Please sign in to comment.