Skip to content

Commit

Permalink
Merge branch 'main' into feature/support-capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum authored Dec 14, 2024
2 parents 39132d6 + 70cfd2f commit 8138785
Show file tree
Hide file tree
Showing 43 changed files with 774 additions and 171 deletions.
7 changes: 0 additions & 7 deletions packages/lexical-code/flow/LexicalCode.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ declare export class CodeHighlightNode extends TextNode {
// $FlowFixMe
static clone(node: CodeHighlightNode): CodeHighlightNode;
createDOM(config: EditorConfig): HTMLElement;
updateDOM(
// $FlowFixMe
prevNode: CodeHighlightNode,
dom: HTMLElement,
config: EditorConfig,
): boolean;
setFormat(format: number): this;
}

Expand Down Expand Up @@ -125,7 +119,6 @@ declare export class CodeNode extends ElementNode {
static clone(node: CodeNode): CodeNode;
constructor(language: ?string, key?: NodeKey): void;
createDOM(config: EditorConfig): HTMLElement;
updateDOM(prevNode: CodeNode, dom: HTMLElement): boolean;
insertNewAfter(
selection: RangeSelection,
restoreSelection?: boolean,
Expand Down
6 changes: 1 addition & 5 deletions packages/lexical-code/src/CodeHighlightNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ export class CodeHighlightNode extends TextNode {
return element;
}

updateDOM(
prevNode: CodeHighlightNode,
dom: HTMLElement,
config: EditorConfig,
): boolean {
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean {
const update = super.updateDOM(prevNode, dom, config);
const prevClassName = getHighlightThemeClass(
config.theme,
Expand Down
6 changes: 1 addition & 5 deletions packages/lexical-code/src/CodeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ export class CodeNode extends ElementNode {
}
return element;
}
updateDOM(
prevNode: CodeNode,
dom: HTMLElement,
config: EditorConfig,
): boolean {
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean {
const language = this.__language;
const prevLanguage = prevNode.__language;

Expand Down
5 changes: 0 additions & 5 deletions packages/lexical-link/flow/LexicalLink.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ declare export class LinkNode extends ElementNode {
static clone(node: LinkNode): LinkNode;
constructor(url: string, attributes?: LinkAttributes, key?: NodeKey): void;
createDOM(config: EditorConfig): HTMLElement;
updateDOM(
prevNode: LinkNode,
dom: HTMLElement,
config: EditorConfig,
): boolean;
static importDOM(): DOMConversionMap | null;
exportJSON(): SerializedLinkNode;
getURL(): string;
Expand Down
4 changes: 2 additions & 2 deletions packages/lexical-link/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class LinkNode extends ElementNode {
}

updateDOM(
prevNode: LinkNode,
prevNode: this,
anchor: LinkHTMLElementType,
config: EditorConfig,
): boolean {
Expand Down Expand Up @@ -393,7 +393,7 @@ export class AutoLinkNode extends LinkNode {
}

updateDOM(
prevNode: AutoLinkNode,
prevNode: this,
anchor: LinkHTMLElementType,
config: EditorConfig,
): boolean {
Expand Down
6 changes: 1 addition & 5 deletions packages/lexical-list/src/LexicalListNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ export class ListNode extends ElementNode {
return dom;
}

updateDOM(
prevNode: ListNode,
dom: HTMLElement,
config: EditorConfig,
): boolean {
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean {
if (prevNode.__tag !== this.__tag) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-mark/src/MarkNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class MarkNode extends ElementNode {
}

updateDOM(
prevNode: MarkNode,
prevNode: this,
element: HTMLElement,
config: EditorConfig,
): boolean {
Expand Down
1 change: 0 additions & 1 deletion packages/lexical-overflow/flow/LexicalOverflow.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ declare export class OverflowNode extends ElementNode {
static clone(node: OverflowNode): OverflowNode;
constructor(key?: NodeKey): void;
createDOM(config: EditorConfig): HTMLElement;
updateDOM(prevNode: OverflowNode, dom: HTMLElement): boolean;
insertNewAfter(selection: RangeSelection): null | LexicalNode;
excludeFromCopy(): boolean;
static importJSON(serializedNode: SerializedOverflowNode): OverflowNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-overflow/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class OverflowNode extends ElementNode {
return div;
}

updateDOM(prevNode: OverflowNode, dom: HTMLElement): boolean {
updateDOM(prevNode: this, dom: HTMLElement): boolean {
return false;
}

Expand Down
35 changes: 30 additions & 5 deletions packages/lexical-playground/__tests__/e2e/Autocomplete.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ test.describe('Autocomplete', () => {
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">Sort by alpha</span>
<span data-lexical-text="true"></span>
<span
class="PlaygroundEditorTheme__autocomplete"
style="font-size: 15px; display: none"
data-lexical-text="true">
betical (TAB)
</span>
</p>
`,
);
Expand Down Expand Up @@ -118,7 +123,12 @@ test.describe('Autocomplete', () => {
data-lexical-text="true">
Test
</strong>
<span data-lexical-text="true"></span>
<strong
class="PlaygroundEditorTheme__textUnderlineStrikethrough PlaygroundEditorTheme__textBold PlaygroundEditorTheme__textItalic PlaygroundEditorTheme__autocomplete"
style="font-size: 17px; display: none"
data-lexical-text="true">
imonials (TAB)
</strong>
</p>
`,
);
Expand Down Expand Up @@ -204,7 +214,12 @@ test.describe('Autocomplete', () => {
data-lexical-text="true">
Test
</strong>
<span data-lexical-text="true"></span>
<strong
class="PlaygroundEditorTheme__textUnderlineStrikethrough PlaygroundEditorTheme__textBold PlaygroundEditorTheme__textItalic PlaygroundEditorTheme__autocomplete"
style="font-size: 17px; display: none"
data-lexical-text="true">
imonials (TAB)
</strong>
</p>
`,
);
Expand Down Expand Up @@ -241,7 +256,12 @@ test.describe('Autocomplete', () => {
data-lexical-text="true">
Test
</strong>
<span data-lexical-text="true"></span>
<strong
class="PlaygroundEditorTheme__textUnderlineStrikethrough PlaygroundEditorTheme__textBold PlaygroundEditorTheme__textItalic"
style="font-size: 17px; display: none"
data-lexical-text="true">
imonials
</strong>
</p>
`,
);
Expand Down Expand Up @@ -278,7 +298,12 @@ test.describe('Autocomplete', () => {
data-lexical-text="true">
Test
</strong>
<span data-lexical-text="true"></span>
<strong
class="PlaygroundEditorTheme__textUnderlineStrikethrough PlaygroundEditorTheme__textBold PlaygroundEditorTheme__textItalic PlaygroundEditorTheme__autocomplete"
style="font-size: 17px; display: none"
data-lexical-text="true">
imonials (TAB)
</strong>
</p>
`,
);
Expand Down
Loading

0 comments on commit 8138785

Please sign in to comment.