lexical 0.7.6 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ export declare const IS_UNDERLINE: number;
22
22
  export declare const IS_CODE: number;
23
23
  export declare const IS_SUBSCRIPT: number;
24
24
  export declare const IS_SUPERSCRIPT: number;
25
+ export declare const IS_HIGHLIGHT: number;
25
26
  export declare const IS_ALL_FORMATTING: number;
26
27
  export declare const IS_DIRECTIONLESS = 1;
27
28
  export declare const IS_UNMERGEABLE: number;
@@ -17,6 +17,7 @@ export declare type TextNodeThemeClasses = {
17
17
  base?: EditorThemeClassName;
18
18
  bold?: EditorThemeClassName;
19
19
  code?: EditorThemeClassName;
20
+ highlight?: EditorThemeClassName;
20
21
  italic?: EditorThemeClassName;
21
22
  strikethrough?: EditorThemeClassName;
22
23
  subscript?: EditorThemeClassName;
package/LexicalNode.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
  import type { EditorConfig, LexicalEditor } from './LexicalEditor';
9
- import type { RangeSelection } from './LexicalSelection';
9
+ import type { GridSelection, NodeSelection, RangeSelection } from './LexicalSelection';
10
10
  import { ElementNode } from '.';
11
11
  export declare type NodeMap = Map<NodeKey, LexicalNode>;
12
12
  export declare type SerializedLexicalNode = {
@@ -50,7 +50,7 @@ export declare class LexicalNode {
50
50
  constructor(key?: NodeKey);
51
51
  getType(): string;
52
52
  isAttached(): boolean;
53
- isSelected(): boolean;
53
+ isSelected(selection?: null | RangeSelection | NodeSelection | GridSelection): boolean;
54
54
  getKey(): NodeKey;
55
55
  getIndexWithinParent(): number;
56
56
  getParent<T extends ElementNode>(): T | null;
@@ -82,6 +82,8 @@ export declare class LexicalNode {
82
82
  replace<N extends LexicalNode>(replaceWith: N, includeChildren?: boolean): N;
83
83
  insertAfter(nodeToInsert: LexicalNode, restoreSelection?: boolean): LexicalNode;
84
84
  insertBefore(nodeToInsert: LexicalNode, restoreSelection?: boolean): LexicalNode;
85
+ isParentRequired(): boolean;
86
+ createParentElementNode(): ElementNode;
85
87
  selectPrevious(anchorOffset?: number, focusOffset?: number): RangeSelection;
86
88
  selectNext(anchorOffset?: number, focusOffset?: number): RangeSelection;
87
89
  markDirty(): void;
package/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export type { EventHandler } from './LexicalEvents';
21
21
  export { $normalizeSelection as $normalizeSelection__EXPERIMENTAL } from './LexicalNormalization';
22
22
  export { $createNodeSelection, $createRangeSelection, $getPreviousSelection, $getSelection, $getTextContent, $insertNodes, $isNodeSelection, $isRangeSelection, DEPRECATED_$createGridSelection, DEPRECATED_$isGridSelection, } from './LexicalSelection';
23
23
  export { $parseSerializedNode } from './LexicalUpdates';
24
- export { $addUpdateTag, $applyNodeReplacement, $copyNode, $getAdjacentNode, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getRoot, $hasAncestor, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $nodesOfType, $setCompositionKey, $setSelection, } from './LexicalUtils';
24
+ export { $addUpdateTag, $applyNodeReplacement, $copyNode, $getAdjacentNode, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getRoot, $hasAncestor, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $nodesOfType, $setCompositionKey, $setSelection, isSelectionWithinEditor, } from './LexicalUtils';
25
25
  export { $isDecoratorNode, DecoratorNode } from './nodes/LexicalDecoratorNode';
26
26
  export { $isElementNode, ElementNode } from './nodes/LexicalElementNode';
27
27
  export { DEPRECATED_$isGridCellNode, DEPRECATED_GridCellNode, } from './nodes/LexicalGridCellNode';
@@ -19,7 +19,7 @@ export declare class ParagraphNode extends ElementNode {
19
19
  static getType(): string;
20
20
  static clone(node: ParagraphNode): ParagraphNode;
21
21
  createDOM(config: EditorConfig): HTMLElement;
22
- updateDOM(prevNode: ParagraphNode, dom: HTMLElement): boolean;
22
+ updateDOM(prevNode: ParagraphNode, dom: HTMLElement, config: EditorConfig): boolean;
23
23
  static importDOM(): DOMConversionMap | null;
24
24
  exportDOM(editor: LexicalEditor): DOMExportOutput;
25
25
  static importJSON(serializedNode: SerializedParagraphNode): ParagraphNode;
@@ -17,7 +17,7 @@ export declare type SerializedTextNode = Spread<{
17
17
  text: string;
18
18
  }, SerializedLexicalNode>;
19
19
  export declare type TextDetailType = 'directionless' | 'unmergable';
20
- export declare type TextFormatType = 'bold' | 'underline' | 'strikethrough' | 'italic' | 'code' | 'subscript' | 'superscript';
20
+ export declare type TextFormatType = 'bold' | 'underline' | 'strikethrough' | 'italic' | 'highlight' | 'code' | 'subscript' | 'superscript';
21
21
  export declare type TextModeType = 'normal' | 'token' | 'segmented';
22
22
  export declare type TextMark = {
23
23
  end: null | number;
@@ -71,6 +71,7 @@ export declare class TextNode extends LexicalNode {
71
71
  spliceText(offset: number, delCount: number, newText: string, moveSelection?: boolean): TextNode;
72
72
  canInsertTextBefore(): boolean;
73
73
  canInsertTextAfter(): boolean;
74
+ canContainTabs(): boolean;
74
75
  splitText(...splitOffsets: Array<number>): Array<TextNode>;
75
76
  mergeWithSibling(target: TextNode): TextNode;
76
77
  isTextEntity(): boolean;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "rich-text"
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "0.7.6",
12
+ "version": "0.7.8",
13
13
  "main": "Lexical.js",
14
14
  "repository": {
15
15
  "type": "git",