lexical 0.7.1 → 0.7.2

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.
package/LexicalNode.d.ts CHANGED
@@ -79,7 +79,7 @@ export declare class LexicalNode {
79
79
  exportJSON(): SerializedLexicalNode;
80
80
  static importJSON(_serializedNode: SerializedLexicalNode): LexicalNode;
81
81
  remove(preserveEmptyParent?: boolean): void;
82
- replace<N extends LexicalNode>(replaceWith: N, restoreSelection?: boolean): N;
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
85
  selectPrevious(anchorOffset?: number, focusOffset?: number): RangeSelection;
@@ -144,6 +144,6 @@ export declare function $updateElementSelectionOnCreateDeleteNode(selection: Ran
144
144
  export declare function applySelectionTransforms(nextEditorState: EditorState, editor: LexicalEditor): void;
145
145
  export declare function moveSelectionPointToSibling(point: PointType, node: LexicalNode, parent: ElementNode, prevSibling: LexicalNode | null, nextSibling: LexicalNode | null): void;
146
146
  export declare function adjustPointOffsetForMergedSibling(point: PointType, isBefore: boolean, key: NodeKey, target: TextNode, textLength: number): void;
147
- export declare function updateDOMSelection(prevSelection: RangeSelection | NodeSelection | GridSelection | null, nextSelection: RangeSelection | NodeSelection | GridSelection | null, editor: LexicalEditor, domSelection: Selection, tags: Set<string>, rootElement: HTMLElement, dirtyLeavesCount: number): void;
147
+ export declare function updateDOMSelection(prevSelection: RangeSelection | NodeSelection | GridSelection | null, nextSelection: RangeSelection | NodeSelection | GridSelection | null, editor: LexicalEditor, domSelection: Selection, tags: Set<string>, rootElement: HTMLElement, nodeCount: number): void;
148
148
  export declare function $insertNodes(nodes: Array<LexicalNode>, selectStart?: boolean): boolean;
149
149
  export declare function $getTextContent(): string;
@@ -14,6 +14,7 @@ export declare function errorOnReadOnly(): void;
14
14
  export declare function errorOnInfiniteTransforms(): void;
15
15
  export declare function getActiveEditorState(): EditorState;
16
16
  export declare function getActiveEditor(): LexicalEditor;
17
+ export declare function internalGetActiveEditor(): LexicalEditor | null;
17
18
  export declare function $applyTransforms(editor: LexicalEditor, node: LexicalNode, transformsCache: Map<string, Array<Transform<LexicalNode>>>): void;
18
19
  export declare function $parseSerializedNode(serializedNode: SerializedLexicalNode): LexicalNode;
19
20
  export declare function parseEditorState(serializedEditorState: SerializedEditorState, editor: LexicalEditor, updateFn: void | (() => void)): EditorState;
@@ -22,4 +23,3 @@ export declare function commitPendingUpdates(editor: LexicalEditor): void;
22
23
  export declare function triggerListeners(type: 'update' | 'root' | 'decorator' | 'textcontent' | 'editable', editor: LexicalEditor, isCurrentlyEnqueuingUpdates: boolean, ...payload: unknown[]): void;
23
24
  export declare function triggerCommandListeners<TCommand extends LexicalCommand<unknown>>(editor: LexicalEditor, type: TCommand, payload: CommandPayloadType<TCommand>): boolean;
24
25
  export declare function updateEditor(editor: LexicalEditor, updateFn: () => void, options?: EditorUpdateOptions): void;
25
- export declare function internalGetActiveEditor(): null | LexicalEditor;
package/LexicalUtils.d.ts CHANGED
@@ -91,7 +91,7 @@ export declare function isFirefoxClipboardEvents(editor: LexicalEditor): boolean
91
91
  export declare function dispatchCommand<TCommand extends LexicalCommand<unknown>>(editor: LexicalEditor, command: TCommand, payload: CommandPayloadType<TCommand>): boolean;
92
92
  export declare function $textContentRequiresDoubleLinebreakAtEnd(node: ElementNode): boolean;
93
93
  export declare function getElementByKeyOrThrow(editor: LexicalEditor, key: NodeKey): HTMLElement;
94
- export declare function getParentElement(element: HTMLElement): HTMLElement | null;
94
+ export declare function getParentElement(node: Node): HTMLElement | null;
95
95
  export declare function scrollIntoViewIfNeeded(editor: LexicalEditor, selectionRect: DOMRect, rootElement: HTMLElement): void;
96
96
  export declare function $hasUpdateTag(tag: string): boolean;
97
97
  export declare function $addUpdateTag(tag: string): void;
@@ -108,3 +108,4 @@ export declare function errorOnInsertTextNodeOnRoot(node: LexicalNode, insertNod
108
108
  export declare function $getNodeByKeyOrThrow<N extends LexicalNode>(key: NodeKey): N;
109
109
  export declare function removeDOMBlockCursorElement(blockCursorElement: HTMLElement, editor: LexicalEditor, rootElement: HTMLElement): void;
110
110
  export declare function updateDOMBlockCursorElement(editor: LexicalEditor, rootElement: HTMLElement, nextSelection: null | RangeSelection | NodeSelection | GridSelection): void;
111
+ export declare function getDOMSelection(): null | Selection;
package/index.d.ts CHANGED
@@ -22,7 +22,6 @@ export { $normalizeSelection as $normalizeSelection__EXPERIMENTAL } from './Lexi
22
22
  export { $createNodeSelection, $createRangeSelection, $getPreviousSelection, $getSelection, $getTextContent, $insertNodes, $isNodeSelection, $isRangeSelection, DEPRECATED_$createGridSelection, DEPRECATED_$isGridSelection, } from './LexicalSelection';
23
23
  export { $parseSerializedNode } from './LexicalUpdates';
24
24
  export { $addUpdateTag, $applyNodeReplacement, $copyNode, $getAdjacentNode, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getRoot, $hasAncestor, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $nodesOfType, $setCompositionKey, $setSelection, } from './LexicalUtils';
25
- export { VERSION } from './LexicalVersion';
26
25
  export { $isDecoratorNode, DecoratorNode } from './nodes/LexicalDecoratorNode';
27
26
  export { $isElementNode, ElementNode } from './nodes/LexicalElementNode';
28
27
  export { DEPRECATED_$isGridCellNode, DEPRECATED_GridCellNode, } from './nodes/LexicalGridCellNode';
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "rich-text"
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "0.7.1",
12
+ "version": "0.7.2",
13
13
  "main": "Lexical.js",
14
14
  "repository": {
15
15
  "type": "git",
@@ -1,8 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- export declare const VERSION = "0.7.1";