Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lexical

Package Overview
Dependencies
Maintainers
5
Versions
247
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.14.5 to 0.15.0

nodes/ArtificialNode.d.ts

5

index.d.ts

@@ -9,3 +9,3 @@ /**

export type { PasteCommandType } from './LexicalCommands';
export type { CommandListener, CommandListenerPriority, CommandPayloadType, CreateEditorArgs, EditableListener, EditorConfig, EditorSetOptions, EditorThemeClasses, HTMLConfig, Klass, KlassConstructor, LexicalCommand, LexicalEditor, LexicalNodeReplacement, MutationListener, NodeMutation, SerializedEditor, Spread, Transform, } from './LexicalEditor';
export type { CommandListener, CommandListenerPriority, CommandPayloadType, CreateEditorArgs, EditableListener, EditorConfig, EditorSetOptions, EditorThemeClasses, EditorThemeClassName, HTMLConfig, Klass, KlassConstructor, LexicalCommand, LexicalEditor, LexicalNodeReplacement, MutationListener, NodeMutation, SerializedEditor, Spread, Transform, } from './LexicalEditor';
export type { EditorState, SerializedEditorState } from './LexicalEditorState';

@@ -23,3 +23,4 @@ export type { DOMChildConversion, DOMConversion, DOMConversionFn, DOMConversionMap, DOMConversionOutput, DOMExportOutput, LexicalNode, NodeKey, NodeMap, SerializedLexicalNode, } from './LexicalNode';

export { $parseSerializedNode, isCurrentlyReadOnlyMode } from './LexicalUpdates';
export { $addUpdateTag, $applyNodeReplacement, $copyNode, $getAdjacentNode, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getRoot, $hasAncestor, $hasUpdateTag, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $nodesOfType, $selectAll, $setCompositionKey, $setSelection, $splitNode, getNearestEditorFromDOMNode, isHTMLAnchorElement, isHTMLElement, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, } from './LexicalUtils';
export { $addUpdateTag, $applyNodeReplacement, $copyNode, $getAdjacentNode, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getRoot, $hasAncestor, $hasUpdateTag, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $nodesOfType, $selectAll, $setCompositionKey, $setSelection, $splitNode, getNearestEditorFromDOMNode, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, } from './LexicalUtils';
export { ArtificialNode__DO_NOT_USE } from './nodes/ArtificialNode';
export { $isDecoratorNode, DecoratorNode } from './nodes/LexicalDecoratorNode';

@@ -26,0 +27,0 @@ export { $isElementNode, ElementNode } from './nodes/LexicalElementNode';

2

Lexical.js

@@ -6,5 +6,7 @@ /**

* LICENSE file in the root directory of this source tree.
*
*/
'use strict'
const Lexical = process.env.NODE_ENV === 'development' ? require('./Lexical.dev.js') : require('./Lexical.prod.js');
module.exports = Lexical;

@@ -11,3 +11,3 @@ /**

export declare function $flushMutations(editor: LexicalEditor, mutations: Array<MutationRecord>, observer: MutationObserver): void;
export declare function flushRootMutations(editor: LexicalEditor): void;
export declare function $flushRootMutations(editor: LexicalEditor): void;
export declare function initMutationObserver(editor: LexicalEditor): void;

@@ -17,3 +17,3 @@ /**

};
export declare function removeNode(nodeToRemove: LexicalNode, restoreSelection: boolean, preserveEmptyParent?: boolean): void;
export declare function $removeNode(nodeToRemove: LexicalNode, restoreSelection: boolean, preserveEmptyParent?: boolean): void;
export type DOMConversion<T extends HTMLElement = HTMLElement> = {

@@ -20,0 +20,0 @@ conversion: DOMConversionFn<T>;

@@ -12,4 +12,4 @@ /**

type IntentionallyMarkedAsDirtyElement = boolean;
export declare function reconcileRoot(prevEditorState: EditorState, nextEditorState: EditorState, editor: LexicalEditor, dirtyType: 0 | 1 | 2, dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>, dirtyLeaves: Set<NodeKey>): MutatedNodes;
export declare function $reconcileRoot(prevEditorState: EditorState, nextEditorState: EditorState, editor: LexicalEditor, dirtyType: 0 | 1 | 2, dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>, dirtyLeaves: Set<NodeKey>): MutatedNodes;
export declare function storeDOMWithKey(key: NodeKey, dom: HTMLElement, editor: LexicalEditor): void;
export {};

@@ -271,8 +271,8 @@ /**

export declare function $isBlockElementNode(node: LexicalNode | null | undefined): node is ElementNode;
export declare function internalMakeRangeSelection(anchorKey: NodeKey, anchorOffset: number, focusKey: NodeKey, focusOffset: number, anchorType: 'text' | 'element', focusType: 'text' | 'element'): RangeSelection;
export declare function $internalMakeRangeSelection(anchorKey: NodeKey, anchorOffset: number, focusKey: NodeKey, focusOffset: number, anchorType: 'text' | 'element', focusType: 'text' | 'element'): RangeSelection;
export declare function $createRangeSelection(): RangeSelection;
export declare function $createNodeSelection(): NodeSelection;
export declare function internalCreateSelection(editor: LexicalEditor): null | BaseSelection;
export declare function $internalCreateSelection(editor: LexicalEditor): null | BaseSelection;
export declare function $createRangeSelectionFromDom(domSelection: Selection | null, editor: LexicalEditor): null | RangeSelection;
export declare function internalCreateRangeSelection(lastSelection: null | BaseSelection, domSelection: Selection | null, editor: LexicalEditor, event: UIEvent | Event | null): null | RangeSelection;
export declare function $internalCreateRangeSelection(lastSelection: null | BaseSelection, domSelection: Selection | null, editor: LexicalEditor, event: UIEvent | Event | null): null | RangeSelection;
export declare function $getSelection(): null | BaseSelection;

@@ -279,0 +279,0 @@ export declare function $getPreviousSelection(): null | BaseSelection;

@@ -22,5 +22,5 @@ /**

export declare function readEditorState<V>(editorState: EditorState, callbackFn: () => V): V;
export declare function commitPendingUpdates(editor: LexicalEditor, recoveryEditorState?: EditorState): void;
export declare function $commitPendingUpdates(editor: LexicalEditor, recoveryEditorState?: EditorState): void;
export declare function triggerListeners(type: 'update' | 'root' | 'decorator' | 'textcontent' | 'editable', editor: LexicalEditor, isCurrentlyEnqueuingUpdates: boolean, ...payload: unknown[]): void;
export declare function triggerCommandListeners<TCommand extends LexicalCommand<unknown>>(editor: LexicalEditor, type: TCommand, payload: CommandPayloadType<TCommand>): boolean;
export declare function updateEditor(editor: LexicalEditor, updateFn: () => void, options?: EditorUpdateOptions): void;

@@ -38,3 +38,3 @@ /**

export declare function $getNodeByKey<T extends LexicalNode>(key: NodeKey, _editorState?: EditorState): T | null;
export declare function getNodeFromDOMNode(dom: Node, editorState?: EditorState): LexicalNode | null;
export declare function $getNodeFromDOMNode(dom: Node, editorState?: EditorState): LexicalNode | null;
export declare function $getNearestNodeFromDOMNode(startingDOM: Node, editorState?: EditorState): LexicalNode | null;

@@ -48,3 +48,3 @@ export declare function cloneDecorators(editor: LexicalEditor): Record<NodeKey, unknown>;

export declare function $flushMutations(): void;
export declare function getNodeFromDOM(dom: Node): null | LexicalNode;
export declare function $getNodeFromDOM(dom: Node): null | LexicalNode;
export declare function getTextNodeOffset(node: TextNode, moveSelectionToEnd: boolean): number;

@@ -58,33 +58,33 @@ export declare function doesContainGrapheme(str: string): boolean;

export declare function $shouldInsertTextAfterOrBeforeTextNode(selection: RangeSelection, node: TextNode): boolean;
export declare function isTab(keyCode: number, altKey: boolean, ctrlKey: boolean, metaKey: boolean): boolean;
export declare function isBold(keyCode: number, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isItalic(keyCode: number, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isUnderline(keyCode: number, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isParagraph(keyCode: number, shiftKey: boolean): boolean;
export declare function isLineBreak(keyCode: number, shiftKey: boolean): boolean;
export declare function isOpenLineBreak(keyCode: number, ctrlKey: boolean): boolean;
export declare function isDeleteWordBackward(keyCode: number, altKey: boolean, ctrlKey: boolean): boolean;
export declare function isDeleteWordForward(keyCode: number, altKey: boolean, ctrlKey: boolean): boolean;
export declare function isDeleteLineBackward(keyCode: number, metaKey: boolean): boolean;
export declare function isDeleteLineForward(keyCode: number, metaKey: boolean): boolean;
export declare function isDeleteBackward(keyCode: number, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isDeleteForward(keyCode: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isUndo(keyCode: number, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isRedo(keyCode: number, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isCopy(keyCode: number, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isCut(keyCode: number, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isMoveBackward(keyCode: number, ctrlKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveToStart(keyCode: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveForward(keyCode: number, ctrlKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveToEnd(keyCode: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveUp(keyCode: number, ctrlKey: boolean, metaKey: boolean): boolean;
export declare function isMoveDown(keyCode: number, ctrlKey: boolean, metaKey: boolean): boolean;
export declare function isTab(code: string, altKey: boolean, ctrlKey: boolean, metaKey: boolean): boolean;
export declare function isBold(code: string, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isItalic(code: string, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isUnderline(code: string, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isParagraph(code: string, shiftKey: boolean): boolean;
export declare function isLineBreak(keyCode: string, shiftKey: boolean): boolean;
export declare function isOpenLineBreak(code: string, ctrlKey: boolean): boolean;
export declare function isDeleteWordBackward(code: string, altKey: boolean, ctrlKey: boolean): boolean;
export declare function isDeleteWordForward(code: string, altKey: boolean, ctrlKey: boolean): boolean;
export declare function isDeleteLineBackward(code: string, metaKey: boolean): boolean;
export declare function isDeleteLineForward(code: string, metaKey: boolean): boolean;
export declare function isDeleteBackward(code: string, altKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isDeleteForward(code: string, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isUndo(code: string, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isRedo(code: string, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isCopy(code: string, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isCut(code: string, shiftKey: boolean, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isMoveBackward(code: string, ctrlKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveToStart(code: string, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveForward(code: string, ctrlKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveToEnd(code: string, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isMoveUp(code: string, ctrlKey: boolean, metaKey: boolean): boolean;
export declare function isMoveDown(code: string, ctrlKey: boolean, metaKey: boolean): boolean;
export declare function isModifier(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
export declare function isSpace(keyCode: number): boolean;
export declare function isSpace(code: string): boolean;
export declare function controlOrMeta(metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isReturn(keyCode: number): boolean;
export declare function isBackspace(keyCode: number): boolean;
export declare function isEscape(keyCode: number): boolean;
export declare function isDelete(keyCode: number): boolean;
export declare function isSelectAll(keyCode: number, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function isReturn(code: string): boolean;
export declare function isBackspace(code: string): boolean;
export declare function isEscape(code: string): boolean;
export declare function isDelete(code: string): boolean;
export declare function isSelectAll(code: string, metaKey: boolean, ctrlKey: boolean): boolean;
export declare function $selectAll(): void;

@@ -135,2 +135,14 @@ export declare function getCachedClassNameArray(classNamesTheme: EditorThemeClasses, classNameThemeType: string): Array<string>;

/**
*
* @param node - the Dom Node to check
* @returns if the Dom Node is an inline node
*/
export declare function isInlineDomNode(node: Node): boolean;
/**
*
* @param node - the Dom Node to check
* @returns if the Dom Node is a block node
*/
export declare function isBlockDomNode(node: Node): boolean;
/**
* This function is for internal use of the library.

@@ -137,0 +149,0 @@ * Please do not use it as it may change in the future.

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

"license": "MIT",
"version": "0.14.5",
"version": "0.15.0",
"main": "Lexical.js",

@@ -15,0 +15,0 @@ "types": "index.d.ts",

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 not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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