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.3.11 to 0.4.0

5

index.d.ts

@@ -0,1 +1,2 @@

/** @module lexical */
/**

@@ -8,3 +9,3 @@ * Copyright (c) Meta Platforms, Inc. and affiliates.

*/
export type { CommandListenerPriority, CommandPayloadType, EditorConfig, EditorThemeClasses, IntentionallyMarkedAsDirtyElement, Klass, LexicalCommand, LexicalEditor, MutationListener, NodeMutation, ReadOnlyListener, SerializedEditor, Spread, } from './LexicalEditor';
export type { CommandListenerPriority, CommandPayloadType, EditableListener, EditorConfig, EditorThemeClasses, IntentionallyMarkedAsDirtyElement, Klass, LexicalCommand, LexicalEditor, MutationListener, NodeMutation, SerializedEditor, Spread, } from './LexicalEditor';
export type { EditorState, SerializedEditorState } from './LexicalEditorState';

@@ -29,5 +30,7 @@ export type { DOMChildConversion, DOMConversion, DOMConversionFn, DOMConversionMap, DOMConversionOutput, DOMExportOutput, LexicalNode, NodeKey, NodeMap, SerializedLexicalNode, } from './LexicalNode';

export { $isGridRowNode, GridRowNode } from './nodes/LexicalGridRowNode';
export type { SerializedLineBreakNode } from './nodes/LexicalLineBreakNode';
export { $createLineBreakNode, $isLineBreakNode, LineBreakNode, } from './nodes/LexicalLineBreakNode';
export type { SerializedParagraphNode } from './nodes/LexicalParagraphNode';
export { $createParagraphNode, $isParagraphNode, ParagraphNode, } from './nodes/LexicalParagraphNode';
export { $isRootNode, RootNode } from './nodes/LexicalRootNode';
export { $createTextNode, $isTextNode, TextNode } from './nodes/LexicalTextNode';

21

LexicalEditor.d.ts

@@ -114,3 +114,3 @@ /**

export declare type CommandListener<P> = (payload: P, editor: LexicalEditor) => boolean;
export declare type ReadOnlyListener = (readOnly: boolean) => void;
export declare type EditableListener = (editable: boolean) => void;
export declare type CommandListenerPriority = 0 | 1 | 2 | 3 | 4;

@@ -148,3 +148,3 @@ export declare const COMMAND_PRIORITY_EDITOR = 0;

mutation: MutationListeners;
readonly: Set<ReadOnlyListener>;
editable: Set<EditableListener>;
root: Set<RootListener>;

@@ -154,4 +154,4 @@ textcontent: Set<TextContentListener>;

};
export declare type Listener = DecoratorListener | ReadOnlyListener | MutationListener | RootListener | TextContentListener | UpdateListener;
export declare type ListenerType = 'update' | 'root' | 'decorator' | 'textcontent' | 'mutation' | 'readonly';
export declare type Listener = DecoratorListener | EditableListener | MutationListener | RootListener | TextContentListener | UpdateListener;
export declare type ListenerType = 'update' | 'root' | 'decorator' | 'textcontent' | 'mutation' | 'editable';
export declare type TransformerType = 'text' | 'decorator' | 'element' | 'root';

@@ -171,3 +171,3 @@ export declare type IntentionallyMarkedAsDirtyElement = boolean;

parentEditor?: LexicalEditor;
readOnly?: boolean;
editable?: boolean;
theme?: EditorThemeClasses;

@@ -202,7 +202,8 @@ }): LexicalEditor;

_htmlConversions: DOMConversionCache;
_readOnly: boolean;
constructor(editorState: EditorState, parentEditor: null | LexicalEditor, nodes: RegisteredNodes, config: EditorConfig, onError: ErrorHandler, htmlConversions: DOMConversionCache, readOnly: boolean);
_window: null | Window;
_editable: boolean;
constructor(editorState: EditorState, parentEditor: null | LexicalEditor, nodes: RegisteredNodes, config: EditorConfig, onError: ErrorHandler, htmlConversions: DOMConversionCache, editable: boolean);
isComposing(): boolean;
registerUpdateListener(listener: UpdateListener): () => void;
registerReadOnlyListener(listener: ReadOnlyListener): () => void;
registerEditableListener(listener: EditableListener): () => void;
registerDecoratorListener<T>(listener: DecoratorListener<T>): () => void;

@@ -227,6 +228,6 @@ registerTextContentListener(listener: TextContentListener): () => void;

blur(): void;
isReadOnly(): boolean;
setReadOnly(readOnly: boolean): void;
isEditable(): boolean;
setEditable(editable: boolean): void;
toJSON(): SerializedEditor;
}
export {};

@@ -38,4 +38,7 @@ /**

[x: string]: any;
/** @internal */
__type: string;
/** @internal */
__key: string;
/** @internal */
__parent: null | NodeKey;

@@ -42,0 +45,0 @@ static getType(): string;

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

export declare function commitPendingUpdates(editor: LexicalEditor): void;
export declare function triggerListeners(type: 'update' | 'root' | 'decorator' | 'textcontent' | 'readonly', editor: LexicalEditor, isCurrentlyEnqueuingUpdates: boolean, ...payload: unknown[]): void;
export declare function triggerListeners(type: 'update' | 'root' | 'decorator' | 'textcontent' | 'editable', editor: LexicalEditor, isCurrentlyEnqueuingUpdates: boolean, ...payload: unknown[]): void;
export declare function triggerCommandListeners<P>(editor: LexicalEditor, type: LexicalCommand<P>, payload: P): boolean;
export declare function updateEditor(editor: LexicalEditor, updateFn: () => void, options?: EditorUpdateOptions): void;
export declare function internalGetActiveEditor(): null | LexicalEditor;

@@ -22,2 +22,4 @@ /**

export declare const scheduleMicroTask: (fn: () => void) => void;
export declare function $isSelectionCapturedInDecorator(node: Node): boolean;
export declare function isSelectionCapturedInDecoratorInput(anchorDOM: Node): boolean;
export declare function isSelectionWithinEditor(editor: LexicalEditor, anchorDOM: null | Node, focusDOM: null | Node): boolean;

@@ -89,3 +91,3 @@ export declare function getNearestEditorFromDOMNode(node: Node | null): LexicalEditor | null;

export declare function $getDecoratorNode(focus: PointType, isBackward: boolean): null | LexicalNode;
export declare function isFirefoxClipboardEvents(): boolean;
export declare function isFirefoxClipboardEvents(editor: LexicalEditor): boolean;
export declare function dispatchCommand<TCommand extends LexicalCommand<unknown>, TPayload extends CommandPayloadType<TCommand>>(editor: LexicalEditor, type: TCommand, payload: TPayload): boolean;

@@ -98,1 +100,3 @@ export declare function $textContentRequiresDoubleLinebreakAtEnd(node: ElementNode): boolean;

export declare function $maybeMoveChildrenSelectionToParent(parentNode: LexicalNode, offset?: number): RangeSelection | NodeSelection | GridSelection | null;
export declare function getDefaultView(domElem: HTMLElement): Window | null;
export declare function getWindow(editor: LexicalEditor): Window;

@@ -8,2 +8,2 @@ /**

*/
export declare const VERSION = "0.3.11";
export declare const VERSION = "0.4.0";

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

import { LexicalNode } from '../LexicalNode';
/** @noInheritDoc */
export declare class DecoratorNode<T> extends LexicalNode {

@@ -14,0 +15,0 @@ constructor(key?: NodeKey);

@@ -20,6 +20,11 @@ /**

export declare type ElementFormatType = 'left' | 'center' | 'right' | 'justify' | '';
/** @noInheritDoc */
export declare class ElementNode extends LexicalNode {
/** @internal */
__children: Array<NodeKey>;
/** @internal */
__format: number;
/** @internal */
__indent: number;
/** @internal */
__dir: 'ltr' | 'rtl' | null;

@@ -26,0 +31,0 @@ constructor(key?: NodeKey);

@@ -13,3 +13,5 @@ /**

}, SerializedElementNode>;
/** @noInheritDoc */
export declare class GridCellNode extends ElementNode {
/** @internal */
__colSpan: number;

@@ -16,0 +18,0 @@ constructor(colSpan: number, key?: NodeKey);

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

}, SerializedLexicalNode>;
/** @noInheritDoc */
export declare class LineBreakNode extends LexicalNode {

@@ -16,0 +17,0 @@ static getType(): string;

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

}, SerializedElementNode>;
/** @noInheritDoc */
export declare class ParagraphNode extends ElementNode {

@@ -19,0 +20,0 @@ static getType(): string;

@@ -12,3 +12,5 @@ /**

export declare type SerializedRootNode = SerializedElementNode;
/** @noInheritDoc */
export declare class RootNode extends ElementNode {
/** @internal */
__cachedText: null | string;

@@ -15,0 +17,0 @@ static getType(): string;

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

export declare type TextMarks = Array<TextMark>;
/** @noInheritDoc */
export declare class TextNode extends LexicalNode {

@@ -31,0 +32,0 @@ __text: string;

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

"license": "MIT",
"version": "0.3.11",
"version": "0.4.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