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

@lexical/list

Package Overview
Dependencies
Maintainers
6
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/list

This package provides the list feature for Lexical.


Version published
Weekly downloads
485K
decreased by-0.15%
Maintainers
6
Created
Weekly downloads
 

Package description

What is @lexical/list?

@lexical/list is a package designed to provide list functionalities within the Lexical framework, a modern web text editor. It allows developers to create, manage, and manipulate ordered and unordered lists in a rich text editor environment.

What are @lexical/list's main functionalities?

Creating Ordered Lists

This feature allows you to create an ordered list (numbered list) within the Lexical editor. The code sample demonstrates how to create a new ordered list node and append it to the editor's root.

import { $createListNode, ListNode } from '@lexical/list';

const orderedListNode = $createListNode('number');
editor.update(() => {
  const root = $getRoot();
  root.append(orderedListNode);
});

Creating Unordered Lists

This feature allows you to create an unordered list (bulleted list) within the Lexical editor. The code sample shows how to create a new unordered list node and append it to the editor's root.

import { $createListNode, ListNode } from '@lexical/list';

const unorderedListNode = $createListNode('bullet');
editor.update(() => {
  const root = $getRoot();
  root.append(unorderedListNode);
});

Converting List Types

This feature allows you to convert an existing list from one type to another (e.g., from ordered to unordered). The code sample demonstrates how to find a list node in the current selection and change its type.

import { $createListNode, ListNode } from '@lexical/list';

editor.update(() => {
  const selection = $getSelection();
  if (selection !== null) {
    const listNode = selection.getNodes().find(node => node instanceof ListNode);
    if (listNode !== null) {
      listNode.setListType('bullet'); // Convert to unordered list
    }
  }
});

Other packages similar to @lexical/list

Changelog

Source

v0.7.5 (2022-12-23)

  • selectionChange fix (#3623) Dominic Gannaway
  • Add docs for root listener (#3625) Acy Watson
  • Add docs re: working with DOM Events (#3624) Acy Watson
  • background-repeat: no-repeat; (#3621) Aloento
  • Add logic in isSelectionCapturedInDecoratorInput for contentEditables (#3622) Dominic Gannaway
  • Fix bug in convertTextFormatElement (#3618) Dominic Gannaway
  • Add size limit report (#3600) Maksim Horbachevsky
  • Allow focus/blur propagation in useYjsFocusTracking (#3617) Dominic Gannaway
  • Add missing changelog for 0.7.4 (#3598) John Flockton
  • Fix getSelectedNode logic for forward selection (#3609) moy2010
  • Fix typo in documentation (#3614) Jeremy Bernier
  • Fix bad rebase (#3607) Dominic Gannaway
  • Escape plus signs of the tag in MarkdownImport, fixes #3596 (#3599) Teemu Pöntelin
  • Add HTML paste support for checklists (#3579) Acy Watson
  • Preserve empty parent during replacement (#3595) Maksim Horbachevsky

Readme

Source

@lexical/list

This package contains the functionality for the List feature of Lexical.

Keywords

FAQs

Package last updated on 23 Dec 2022

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