Socket
Socket
Sign inDemoInstall

lexical

Package Overview
Dependencies
Maintainers
6
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lexical - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

10

index.d.ts

@@ -20,11 +20,11 @@ /** @module lexical */

export type { EventHandler } from './LexicalEvents';
export { $createGridSelection, $createNodeSelection, $createRangeSelection, $getPreviousSelection, $getSelection, $isGridSelection, $isNodeSelection, $isRangeSelection, } from './LexicalSelection';
export { $createNodeSelection, $createRangeSelection, $getPreviousSelection, $getSelection, $insertNodes, $isNodeSelection, $isRangeSelection, DEPRECATED_$createGridSelection, DEPRECATED_$isGridSelection, } from './LexicalSelection';
export { $parseSerializedNode } from './LexicalUpdates';
export { $getDecoratorNode, $getNearestNodeFromDOMNode, $getNodeByKey, $getRoot, $isLeafNode, $nodesOfType, $setCompositionKey, $setSelection, } from './LexicalUtils';
export { $addUpdateTag, $getDecoratorNode, $getNearestNodeFromDOMNode, $getNodeByKey, $getRoot, $hasAncestor, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $nodesOfType, $setCompositionKey, $setSelection, } from './LexicalUtils';
export { VERSION } from './LexicalVersion';
export { $isDecoratorNode, DecoratorNode } from './nodes/LexicalDecoratorNode';
export { $isElementNode, ElementNode } from './nodes/LexicalElementNode';
export { $isGridCellNode, GridCellNode } from './nodes/LexicalGridCellNode';
export { $isGridNode, GridNode } from './nodes/LexicalGridNode';
export { $isGridRowNode, GridRowNode } from './nodes/LexicalGridRowNode';
export { DEPRECATED_$isGridCellNode, DEPRECATED_GridCellNode, } from './nodes/LexicalGridCellNode';
export { DEPRECATED_$isGridNode, DEPRECATED_GridNode, } from './nodes/LexicalGridNode';
export { DEPRECATED_$isGridRowNode, DEPRECATED_GridRowNode, } from './nodes/LexicalGridRowNode';
export type { SerializedLineBreakNode } from './nodes/LexicalLineBreakNode';

@@ -31,0 +31,0 @@ export { $createLineBreakNode, $isLineBreakNode, LineBreakNode, } from './nodes/LexicalLineBreakNode';

@@ -16,3 +16,3 @@ /**

export declare const CONTROLLED_TEXT_INSERTION_COMMAND: LexicalCommand<InputEvent | string>;
export declare const PASTE_COMMAND: LexicalCommand<ClipboardEvent | InputEvent>;
export declare const PASTE_COMMAND: LexicalCommand<ClipboardEvent | InputEvent | KeyboardEvent>;
export declare const REMOVE_TEXT_COMMAND: LexicalCommand<void>;

@@ -19,0 +19,0 @@ export declare const DELETE_WORD_COMMAND: LexicalCommand<boolean>;

@@ -18,3 +18,2 @@ /**

export declare const IS_SEGMENTED = 2;
export declare const IS_INERT = 3;
export declare const IS_BOLD = 1;

@@ -44,3 +43,3 @@ export declare const IS_ITALIC: number;

export declare const ELEMENT_FORMAT_TO_TYPE: Record<number, ElementFormatType>;
export declare const TEXT_MODE_TO_TYPE: Record<TextModeType, 0 | 1 | 2 | 3>;
export declare const TEXT_MODE_TO_TYPE: Record<TextModeType, 0 | 1 | 2>;
export declare const TEXT_TYPE_TO_MODE: Record<number, TextModeType>;

@@ -73,5 +73,16 @@ /**

table?: EditorThemeClassName;
tableAddColumns?: EditorThemeClassName;
tableAddRows?: EditorThemeClassName;
tableCellActionButton?: EditorThemeClassName;
tableCellActionButtonContainer?: EditorThemeClassName;
tableCellPrimarySelected?: EditorThemeClassName;
tableCellSelected?: EditorThemeClassName;
tableCell?: EditorThemeClassName;
tableCellEditing?: EditorThemeClassName;
tableCellHeader?: EditorThemeClassName;
tableCellResizer?: EditorThemeClassName;
tableCellSortedIndicator?: EditorThemeClassName;
tableResizeRuler?: EditorThemeClassName;
tableRow?: EditorThemeClassName;
tableSelected?: EditorThemeClassName;
text?: TextNodeThemeClasses;

@@ -78,0 +89,0 @@ embedBlock?: {

@@ -22,3 +22,3 @@ /**

};
export declare type DOMConversionFn<T extends HTMLElement = HTMLElement> = (element: T, parent?: Node) => DOMConversionOutput | null;
export declare type DOMConversionFn<T extends HTMLElement = HTMLElement> = (element: T, parent?: Node, preformatted?: boolean) => DOMConversionOutput | null;
export declare type DOMChildConversion = (lexicalNode: LexicalNode, parentLexicalNode: LexicalNode | null | undefined) => LexicalNode | null | undefined;

@@ -31,2 +31,3 @@ export declare type DOMConversionMap<T extends HTMLElement = HTMLElement> = Record<NodeName, (node: T) => DOMConversion<T> | null>;

node: LexicalNode | null;
preformatted?: boolean;
};

@@ -72,4 +73,4 @@ export declare type DOMExportOutput = {

getWritable(): this;
getTextContent(_includeInert?: boolean, _includeDirectionless?: false): string;
getTextContentSize(includeInert?: boolean, includeDirectionless?: false): number;
getTextContent(): string;
getTextContentSize(): number;
createDOM(_config: EditorConfig, _editor: LexicalEditor): HTMLElement;

@@ -76,0 +77,0 @@ updateDOM(_prevNode: unknown, _dom: HTMLElement, _config: EditorConfig): boolean;

@@ -8,3 +8,4 @@ /**

*/
import type { TextNode } from '.';
import type { RangeSelection, TextNode } from '.';
export declare function $normalizeTextNode(textNode: TextNode): void;
export declare function $normalizeSelection(selection: RangeSelection): RangeSelection;

@@ -72,2 +72,3 @@ /**

insertText(): void;
insertNodes(nodes: Array<LexicalNode>, selectStart?: boolean): boolean;
getNodes(): Array<LexicalNode>;

@@ -99,2 +100,3 @@ getTextContent(): string;

insertText(): void;
insertNodes(nodes: Array<LexicalNode>, selectStart?: boolean): boolean;
getShape(): GridSelectionShape;

@@ -104,3 +106,3 @@ getNodes(): Array<LexicalNode>;

}
export declare function $isGridSelection(x: unknown): x is GridSelection;
export declare function DEPRECATED_$isGridSelection(x: unknown): x is GridSelection;
export declare class RangeSelection implements BaseSelection {

@@ -141,3 +143,3 @@ anchor: PointType;

export declare function $createNodeSelection(): NodeSelection;
export declare function $createGridSelection(): GridSelection;
export declare function DEPRECATED_$createGridSelection(): GridSelection;
export declare function internalCreateSelection(editor: LexicalEditor): null | RangeSelection | NodeSelection | GridSelection;

@@ -152,1 +154,2 @@ export declare function internalCreateRangeSelection(lastSelection: null | RangeSelection | NodeSelection | GridSelection, domSelection: Selection | null, editor: LexicalEditor): null | RangeSelection;

export declare function updateDOMSelection(prevSelection: RangeSelection | NodeSelection | GridSelection | null, nextSelection: RangeSelection | NodeSelection | GridSelection | null, editor: LexicalEditor, domSelection: Selection, tags: Set<string>, rootElement: HTMLElement): void;
export declare function $insertNodes(nodes: Array<LexicalNode>, selectStart?: boolean): boolean;

@@ -27,4 +27,3 @@ /**

export declare function getTextDirection(text: string): 'ltr' | 'rtl' | null;
export declare function $isTokenOrInertOrSegmented(node: TextNode): boolean;
export declare function $isTokenOrInert(node: TextNode): boolean;
export declare function $isTokenOrSegmented(node: TextNode): boolean;
export declare function getDOMTextNode(element: Node | null): Text | null;

@@ -99,3 +98,6 @@ export declare function toggleTextFormatType(format: number, type: TextFormatType, alignWithFormat: null | number): number;

export declare function $maybeMoveChildrenSelectionToParent(parentNode: LexicalNode, offset?: number): RangeSelection | NodeSelection | GridSelection | null;
export declare function $hasAncestor(child: LexicalNode, targetNode: LexicalNode): boolean;
export declare function getDefaultView(domElem: HTMLElement): Window | null;
export declare function getWindow(editor: LexicalEditor): Window;
export declare function $isInlineElementOrDecoratorNode(node: LexicalNode): boolean;
export declare function $isRootOrShadowRoot(node: null | LexicalNode): boolean;

@@ -17,4 +17,4 @@ /**

isIsolated(): boolean;
isTopLevel(): boolean;
isInline(): boolean;
}
export declare function $isDecoratorNode<T>(node: LexicalNode | null | undefined): node is DecoratorNode<T>;

@@ -40,3 +40,3 @@ /**

isLastChild(): boolean;
getAllTextNodes(includeInert?: boolean): Array<TextNode>;
getAllTextNodes(): Array<TextNode>;
getFirstDescendant<T extends LexicalNode>(): null | T;

@@ -48,4 +48,5 @@ getLastDescendant<T extends LexicalNode>(): null | T;

getLastChild<T extends LexicalNode>(): null | T;
getLastChildOrThrow<T extends LexicalNode>(): T;
getChildAtIndex<T extends LexicalNode>(index: number): null | T;
getTextContent(includeInert?: boolean, includeDirectionless?: false): string;
getTextContent(): string;
getDirection(): 'ltr' | 'rtl' | null;

@@ -75,2 +76,3 @@ hasFormat(type: ElementFormatType): boolean;

isInline(): boolean;
isShadowRoot(): boolean;
canMergeWith(node: ElementNode): boolean;

@@ -77,0 +79,0 @@ extractWithChild(child: LexicalNode, selection: RangeSelection | NodeSelection | GridSelection | null, destination: 'clone' | 'html'): boolean;

@@ -14,3 +14,3 @@ /**

/** @noInheritDoc */
export declare class GridCellNode extends ElementNode {
export declare class DEPRECATED_GridCellNode extends ElementNode {
/** @internal */

@@ -21,2 +21,2 @@ __colSpan: number;

}
export declare function $isGridCellNode(node: GridCellNode | LexicalNode | null | undefined): node is GridCellNode;
export declare function DEPRECATED_$isGridCellNode(node: DEPRECATED_GridCellNode | LexicalNode | null | undefined): node is DEPRECATED_GridCellNode;

@@ -10,4 +10,4 @@ /**

import { ElementNode } from './LexicalElementNode';
export declare class GridNode extends ElementNode {
export declare class DEPRECATED_GridNode extends ElementNode {
}
export declare function $isGridNode(node: LexicalNode | null | undefined): node is GridNode;
export declare function DEPRECATED_$isGridNode(node: LexicalNode | null | undefined): node is DEPRECATED_GridNode;

@@ -10,4 +10,4 @@ /**

import { ElementNode } from './LexicalElementNode';
export declare class GridRowNode extends ElementNode {
export declare class DEPRECATED_GridRowNode extends ElementNode {
}
export declare function $isGridRowNode(node: LexicalNode | null | undefined): node is GridRowNode;
export declare function DEPRECATED_$isGridRowNode(node: LexicalNode | null | undefined): node is DEPRECATED_GridRowNode;

@@ -20,3 +20,3 @@ /**

getTopLevelElementOrThrow(): never;
getTextContent(includeInert?: boolean, includeDirectionless?: false): string;
getTextContent(): string;
remove(): never;

@@ -23,0 +23,0 @@ replace<N = LexicalNode>(node: N): never;

@@ -20,5 +20,5 @@ /**

}, SerializedLexicalNode>;
export declare type TextDetailType = 'directionless' | 'unmergable';
export declare type TextFormatType = 'bold' | 'underline' | 'strikethrough' | 'italic' | 'code' | 'subscript' | 'superscript';
export declare type TextDetailType = 'directionless' | 'unmergable';
export declare type TextModeType = 'normal' | 'token' | 'segmented' | 'inert';
export declare type TextModeType = 'normal' | 'token' | 'segmented';
export declare type TextMark = {

@@ -47,3 +47,2 @@ end: null | number;

isSegmented(): boolean;
isInert(): boolean;
isDirectionless(): boolean;

@@ -53,3 +52,3 @@ isUnmergeable(): boolean;

isSimpleText(): boolean;
getTextContent(includeInert?: boolean, includeDirectionless?: false): string;
getTextContent(): string;
getFormatFlags(type: TextFormatType, alignWithFormat: null | number): number;

@@ -56,0 +55,0 @@ createDOM(config: EditorConfig): HTMLElement;

@@ -12,3 +12,3 @@ {

"license": "MIT",
"version": "0.4.1",
"version": "0.5.0",
"main": "Lexical.js",

@@ -15,0 +15,0 @@ "repository": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc