lexical 0.9.0 → 0.9.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/Lexical.dev.js +3599 -3525
- package/Lexical.js.flow +33 -6
- package/Lexical.prod.js +185 -182
- package/LexicalNode.d.ts +1 -1
- package/LexicalSelection.d.ts +11 -2
- package/LexicalUtils.d.ts +1 -0
- package/index.d.ts +3 -3
- package/nodes/LexicalGridCellNode.d.ts +3 -0
- package/nodes/LexicalLineBreakNode.d.ts +1 -4
- package/nodes/LexicalParagraphNode.d.ts +2 -5
- package/package.json +1 -1
package/LexicalNode.d.ts
CHANGED
|
@@ -247,7 +247,7 @@ export declare class LexicalNode {
|
|
|
247
247
|
exportJSON(): SerializedLexicalNode;
|
|
248
248
|
/**
|
|
249
249
|
* Controls how the this node is deserialized from JSON. This is usually boilerplate,
|
|
250
|
-
* but provides an abstraction
|
|
250
|
+
* but provides an abstraction between the node implementation and serialized interface that can
|
|
251
251
|
* be important if you ever make breaking changes to a node schema (by adding or removing properties).
|
|
252
252
|
* See [Serialization & Deserialization](https://lexical.dev/docs/concepts/serialization#lexical---html).
|
|
253
253
|
*
|
package/LexicalSelection.d.ts
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { LexicalEditor } from './LexicalEditor';
|
|
9
9
|
import type { EditorState } from './LexicalEditorState';
|
|
10
|
-
import type {
|
|
10
|
+
import type { NodeKey } from './LexicalNode';
|
|
11
11
|
import type { ElementNode } from './nodes/LexicalElementNode';
|
|
12
12
|
import type { TextFormatType } from './nodes/LexicalTextNode';
|
|
13
|
-
import { TextNode } from '.';
|
|
13
|
+
import { DEPRECATED_GridCellNode, DEPRECATED_GridNode, DEPRECATED_GridRowNode, TextNode } from '.';
|
|
14
|
+
import { LexicalNode } from './LexicalNode';
|
|
14
15
|
export declare type TextPointType = {
|
|
15
16
|
_selection: RangeSelection | GridSelection;
|
|
16
17
|
getNode: () => TextNode;
|
|
@@ -32,6 +33,12 @@ export declare type ElementPointType = {
|
|
|
32
33
|
type: 'element';
|
|
33
34
|
};
|
|
34
35
|
export declare type PointType = TextPointType | ElementPointType;
|
|
36
|
+
export declare type GridMapValueType = {
|
|
37
|
+
cell: DEPRECATED_GridCellNode;
|
|
38
|
+
startRow: number;
|
|
39
|
+
startColumn: number;
|
|
40
|
+
};
|
|
41
|
+
export declare type GridMapType = Array<Array<GridMapValueType>>;
|
|
35
42
|
export declare class Point {
|
|
36
43
|
key: NodeKey;
|
|
37
44
|
offset: number;
|
|
@@ -149,3 +156,5 @@ export declare function adjustPointOffsetForMergedSibling(point: PointType, isBe
|
|
|
149
156
|
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;
|
|
150
157
|
export declare function $insertNodes(nodes: Array<LexicalNode>, selectStart?: boolean): boolean;
|
|
151
158
|
export declare function $getTextContent(): string;
|
|
159
|
+
export declare function DEPRECATED_$computeGridMap(grid: DEPRECATED_GridNode, cellA: DEPRECATED_GridCellNode, cellB: DEPRECATED_GridCellNode): [GridMapType, GridMapValueType, GridMapValueType];
|
|
160
|
+
export declare function DEPRECATED_$getNodeTriplet(source: PointType | LexicalNode | DEPRECATED_GridCellNode): [DEPRECATED_GridCellNode, DEPRECATED_GridRowNode, DEPRECATED_GridNode];
|
package/LexicalUtils.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export declare function isReturn(keyCode: number): boolean;
|
|
|
83
83
|
export declare function isBackspace(keyCode: number): boolean;
|
|
84
84
|
export declare function isEscape(keyCode: number): boolean;
|
|
85
85
|
export declare function isDelete(keyCode: number): boolean;
|
|
86
|
+
export declare function isSelectAll(keyCode: number, metaKey: boolean, ctrlKey: boolean): boolean;
|
|
86
87
|
export declare function getCachedClassNameArray(classNamesTheme: EditorThemeClasses, classNameThemeType: string): Array<string>;
|
|
87
88
|
export declare function setMutatedNode(mutatedNodes: MutatedNodes, registeredNodes: RegisteredNodes, mutationListeners: MutationListeners, node: LexicalNode, mutation: NodeMutation): void;
|
|
88
89
|
export declare function $nodesOfType<T extends LexicalNode>(klass: Klass<T>): Array<T>;
|
package/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type { PasteCommandType } from './LexicalCommands';
|
|
|
10
10
|
export type { CommandListener, CommandListenerPriority, CommandPayloadType, CreateEditorArgs, EditableListener, EditorConfig, EditorThemeClasses, Klass, LexicalCommand, LexicalEditor, MutationListener, NodeMutation, SerializedEditor, Spread, } from './LexicalEditor';
|
|
11
11
|
export type { EditorState, SerializedEditorState } from './LexicalEditorState';
|
|
12
12
|
export type { DOMChildConversion, DOMConversion, DOMConversionFn, DOMConversionMap, DOMConversionOutput, DOMExportOutput, LexicalNode, NodeKey, NodeMap, SerializedLexicalNode, } from './LexicalNode';
|
|
13
|
-
export type { BaseSelection, ElementPointType as ElementPoint, GridSelection, GridSelectionShape, NodeSelection, Point, RangeSelection, TextPointType as TextPoint, } from './LexicalSelection';
|
|
13
|
+
export type { BaseSelection, ElementPointType as ElementPoint, GridMapType, GridMapValueType, GridSelection, GridSelectionShape, NodeSelection, Point, RangeSelection, TextPointType as TextPoint, } from './LexicalSelection';
|
|
14
14
|
export type { ElementFormatType, SerializedElementNode, } from './nodes/LexicalElementNode';
|
|
15
15
|
export type { SerializedGridCellNode } from './nodes/LexicalGridCellNode';
|
|
16
16
|
export type { SerializedRootNode } from './nodes/LexicalRootNode';
|
|
@@ -19,9 +19,9 @@ export { BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND,
|
|
|
19
19
|
export { COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, createEditor, } from './LexicalEditor';
|
|
20
20
|
export type { EventHandler } from './LexicalEvents';
|
|
21
21
|
export { $normalizeSelection as $normalizeSelection__EXPERIMENTAL } from './LexicalNormalization';
|
|
22
|
-
export { $createNodeSelection, $createRangeSelection, $getPreviousSelection, $getSelection, $getTextContent, $insertNodes, $isNodeSelection, $isRangeSelection, DEPRECATED_$createGridSelection, DEPRECATED_$isGridSelection, } from './LexicalSelection';
|
|
22
|
+
export { $createNodeSelection, $createRangeSelection, $getPreviousSelection, $getSelection, $getTextContent, $insertNodes, $isNodeSelection, $isRangeSelection, DEPRECATED_$computeGridMap, DEPRECATED_$createGridSelection, DEPRECATED_$getNodeTriplet, 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, $splitNode, isSelectionWithinEditor, } from './LexicalUtils';
|
|
24
|
+
export { $addUpdateTag, $applyNodeReplacement, $copyNode, $getAdjacentNode, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getRoot, $hasAncestor, $hasUpdateTag, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $nodesOfType, $setCompositionKey, $setSelection, $splitNode, getNearestEditorFromDOMNode, isSelectionCapturedInDecoratorInput, 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';
|
|
@@ -9,6 +9,7 @@ import type { LexicalNode, NodeKey, SerializedElementNode, Spread } from 'lexica
|
|
|
9
9
|
import { ElementNode } from './LexicalElementNode';
|
|
10
10
|
export declare type SerializedGridCellNode = Spread<{
|
|
11
11
|
colSpan: number;
|
|
12
|
+
rowSpan: number;
|
|
12
13
|
}, SerializedElementNode>;
|
|
13
14
|
/** @noInheritDoc */
|
|
14
15
|
export declare class DEPRECATED_GridCellNode extends ElementNode {
|
|
@@ -17,7 +18,9 @@ export declare class DEPRECATED_GridCellNode extends ElementNode {
|
|
|
17
18
|
__rowSpan: number;
|
|
18
19
|
constructor(colSpan: number, key?: NodeKey);
|
|
19
20
|
exportJSON(): SerializedGridCellNode;
|
|
21
|
+
getColSpan(): number;
|
|
20
22
|
setColSpan(colSpan: number): this;
|
|
23
|
+
getRowSpan(): number;
|
|
21
24
|
setRowSpan(rowSpan: number): this;
|
|
22
25
|
}
|
|
23
26
|
export declare function DEPRECATED_$isGridCellNode(node: DEPRECATED_GridCellNode | LexicalNode | null | undefined): node is DEPRECATED_GridCellNode;
|
|
@@ -6,11 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import type { DOMConversionMap, NodeKey, SerializedLexicalNode } from '../LexicalNode';
|
|
9
|
-
import type { Spread } from 'lexical';
|
|
10
9
|
import { LexicalNode } from '../LexicalNode';
|
|
11
|
-
export declare type SerializedLineBreakNode =
|
|
12
|
-
type: 'linebreak';
|
|
13
|
-
}, SerializedLexicalNode>;
|
|
10
|
+
export declare type SerializedLineBreakNode = SerializedLexicalNode;
|
|
14
11
|
/** @noInheritDoc */
|
|
15
12
|
export declare class LineBreakNode extends LexicalNode {
|
|
16
13
|
static getType(): string;
|
|
@@ -8,12 +8,9 @@
|
|
|
8
8
|
import type { EditorConfig, LexicalEditor } from '../LexicalEditor';
|
|
9
9
|
import type { DOMConversionMap, DOMExportOutput, LexicalNode } from '../LexicalNode';
|
|
10
10
|
import type { SerializedElementNode } from './LexicalElementNode';
|
|
11
|
-
import type { RangeSelection
|
|
11
|
+
import type { RangeSelection } from 'lexical';
|
|
12
12
|
import { ElementNode } from './LexicalElementNode';
|
|
13
|
-
export declare type SerializedParagraphNode =
|
|
14
|
-
type: 'paragraph';
|
|
15
|
-
version: 1;
|
|
16
|
-
}, SerializedElementNode>;
|
|
13
|
+
export declare type SerializedParagraphNode = SerializedElementNode;
|
|
17
14
|
/** @noInheritDoc */
|
|
18
15
|
export declare class ParagraphNode extends ElementNode {
|
|
19
16
|
static getType(): string;
|