You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@lexical/utils

Package Overview
Dependencies
Maintainers
6
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/utils

This package contains misc utilities for Lexical.


Version published
Weekly downloads
495K
increased by5.62%
Maintainers
6
Created
Weekly downloads
 

Package description

What is @lexical/utils?

@lexical/utils is a utility package for the Lexical framework, which is a modern, extensible text editor framework. This package provides various utility functions to facilitate the manipulation and management of Lexical nodes, editors, and other related components.

What are @lexical/utils's main functionalities?

Node Manipulation

This feature allows you to create and manipulate nodes within the Lexical editor. In this example, a text node is created and appended to the root node.

const { $createTextNode, $getRoot } = require('@lexical/utils');

const root = $getRoot();
const textNode = $createTextNode('Hello, world!');
root.append(textNode);

Editor State Management

This feature provides functions to get and set the editor state, allowing for more controlled and dynamic updates to the editor's content.

const { $getEditorState, $setEditorState } = require('@lexical/utils');

const editorState = $getEditorState();
// Modify the editor state as needed
$setEditorState(editorState);

Event Handling

This feature allows you to add and remove event listeners to the Lexical editor, enabling custom event handling and interaction.

const { $addEventListener, $removeEventListener } = require('@lexical/utils');

const handleClick = (event) => {
  console.log('Editor clicked!', event);
};

$addEventListener('click', handleClick);
// Later, if needed
$removeEventListener('click', handleClick);

Other packages similar to @lexical/utils

Changelog

Source

v0.7.7 (2023-02-03)

  • Add list-style-position:inside (#3814) John Flockton
  • Fix is selected noop (#3805) James Abels
  • Add createParentElementNode method on LexicalNode to fix copy/paste issues with clipboard (#3800) John Flockton
  • Remove innerHTML injection from table selection (#3804) John Flockton
  • Better tab handling (#3770) James Abels
  • Fix line delete bug in history (#3769) James Abels
  • List node export dom with css classes (#3801) Maksim Horbachevsky
  • Add highlight TextFormatType (#3583) moy2010
  • Add check that target is not the root node (#3797) John Flockton
  • Fix $generateJSONFromSelectedNodes with a custom selection passed in (#3749) William Wang
  • Improve selection docs (#3798) Dominic Gannaway
  • Fix copy paste wrong order in TableOfContents (#3786) Daniel Voigt
  • fix(lexical-playground): fix bugs related to ComponentPickerPlugin (#3787) Shota Shimizu
  • fix: styling information of paragraph are missing while importing dom (#3771) Rajatava Mukherjee
  • Stabilize WeakMap in NodeEventPlugin (#3780) James Abels
  • Clean up wonky logic (#3768) Dominic Gannaway
  • Remove deprecated modules from core code base (#3729) John Flockton
  • Edit CSS to fix marker alignment issue in Safari (#3753) John Flockton
  • Move horizontal rule plugin to lexical/react (#3751) John Flockton
  • Fix equation transformer in Playground (#3758) Leonardo E. Dominguez
  • Fix list normalization on HTML paste. (#3757) Acy Watson
  • Remove preventDefault from $copyToClipboardEvent (#3742) John Flockton
  • fix(lexical-playground): NewTablePlugin is not draggable (#3747) Shota Shimizu
  • Attach checkbox click listeners to editor root element instead of document (#3738) John Flockton
  • Update listener in toc (#3726) Stepan Bolotnikov
  • Close Excalidraw only on Escape key down (#3737) John Flockton
  • fix: type-ahead menu scroll problem (#3672) huang yao
  • Tweak CodeNode to allow for overrides (#3731) James Abels
  • Discard empty TextNode that can creep into appendJSON (#3695) James Abels
  • Add config to updateDOM in ParagraphNode (#3693) James Abels

Readme

Source

@lexical/utils

This package contains misc utilities for Lexical.

Keywords

FAQs

Package last updated on 03 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc