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.8 (2023-02-08)

  • Update transforms.md (#3845) Ben
  • Fix over selection (#3838) Dominic Gannaway
  • Fix $restoreEditorState (#3842) Dominic Gannaway
  • Fix select all + delete behaviour (#3840) Dominic Gannaway
  • Fix(#3716,#3815): Prevent layout shift while using typeahead menu (#3826) rettoSea
  • Add anchor dirty node check for text length less than 2 chars (#3832) John Flockton
  • Fix reconciler bug with handling of text content (#3837) Dominic Gannaway
  • Add exportDOM and importDOM for Collapsible Container Plugin (#3827) Ivaylo Pavlov
  • Fix pasting top level nodes inline (#3238) Petar Smolic
  • Add IS_HIGHLIGHT format to combined formats to properly calculate format (#3822) moy2010
  • Add highlight markdown text format shortcut (#3823) moy2010
  • Add highlight text node theme class (#3824) moy2010
  • add importDom and exportDom method to EquationNode (#3813) Najmus Sakib
  • fix: Typo (#3816) Cornelius

Readme

Source

@lexical/utils

This package contains misc utilities for Lexical.

Keywords

FAQs

Package last updated on 08 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