Lexical is an extensible JavaScript web text-editor framework with an emphasis on reliability, accessibility and performance

Overview

Lexical

Note: Lexical is currently in early development and APIs and packages are likely to change quite often.

Lexical is an extensible JavaScript web text-editor framework with an emphasis on reliability, accessibility and performance. Lexical aims to provide a best-in-class developer experience, so you can easily prototype and build features with confidence. Combined with a highly extensible architecture, Lexical allows developers to create unique text editing experiences that scale in size and functionality.

For documentation and more information about Lexical, be sure to visit the Lexical website.

Here are some examples of what you can do with Lexical:

Getting started with React

Note: Lexical is not only limited to React. Lexical can support any underlying DOM based library once bindings for that library have been created.

Install lexical and @lexical/react:

npm install --save lexical @lexical/react

Below is an example of a basic plain text editor using lexical and @lexical/react (try it yourself).

import {$getRoot, $getSelection} from 'lexical';
import {useEffect} from 'react';

import LexicalComposer from '@lexical/react/LexicalComposer';
import LexicalPlainTextPlugin from '@lexical/react/LexicalPlainTextPlugin';
import LexicalContentEditable from '@lexical/react/LexicalContentEditable';
import {HistoryPlugin} from '@lexical/react/LexicalHistoryPlugin';
import LexicalOnChangePlugin from '@lexical/react/LexicalOnChangePlugin';
import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';

const theme = {
  // Theme styling goes here
  ...
}

// When the editor changes, you can get notified via the
// LexicalOnChangePlugin!
function onChange(editorState) {
  editorState.read(() => {
    // Read the contents of the EditorState here.
    const root = $getRoot();
    const selection = $getSelection();

    console.log(root, selection);
  });
}

// Lexical React plugins are React components, which makes them
// highly composable. Furthermore, you can lazy load plugins if
// desired, so you don't pay the cost for plugins until you
// actually use them.
function MyCustomAutoFocusPlugin() {
  const [editor] = useLexicalComposerContext();

  useEffect(() => {
    // Focus the editor when the effect fires!
    editor.focus();
  }, [editor]);

  return null;
}

// Catch any errors that occur during Lexical updates and log them
// or throw them as needed. If you don't throw them, Lexical will
// try to recover gracefully without losing user data.
function onError(error) {
  console.error(error);
}

function Editor() {
  const initialConfig = {
    theme,
    onError,
  };

  return (
    <LexicalComposer initialConfig={initialConfig}>
      <LexicalPlainTextPlugin
        contentEditable={<LexicalContentEditable />}
        placeholder={<div>Enter some text...</div>}
      />
      <LexicalOnChangePlugin onChange={onChange} />
      <HistoryPlugin />
      <MyCustomAutoFocusPlugin />
    </LexicalComposer>
  );
}

Lexical is a framework

The core of Lexical is a dependency-free text editor framework that allows developers to build powerful, simple and complex, editor surfaces. Lexical's underlying engine provides three main parts:

  • editor instances that each attach to a single content editable element and act as a pub/sub for specific events and commands.
  • a set of editor states that represent the current and pending states of the editor at any given time.
  • a DOM reconciler that takes a set of editor states, diffs the changes, and updates the DOM according to their state.

By design, the core of Lexical tries to be as minimal as possible. Lexical doesn't directly concern itself with things that monolithic editors tend to do – such as UI components, toolbars or rich-text features and markdown. Instead the logic for those features can be included via a plugin interface and used as and when they're needed. This ensures great extensibilty and keeps code-sizes to a minimal – ensuring apps only pay the cost for what they actually import.

For React apps, Lexical has tight integration with React 18+ via the optional @lexical/react package. This package provides production-ready utility functions, helpers and React hooks that make it seemless to create text editors within React.

Working with Lexical

This section covers how to use Lexical, independently of any framework or library. For those intending to use Lexical in their React applications, it's advisable to check out the source-code for the hooks that are shipped in @lexical/react.

Creating an editor and using it

When you work with Lexical, you normally work with a single editor instance. An editor instance can be thought of as the one responsible for wiring up an EditorState with the DOM. The editor is also the place where you can register custom nodes, add listeners, and transforms.

An editor instance can be created from the lexical package and accepts an optional configuration object that allows for theming and other options:

import {createEditor} from 'lexical';

const config = {
  theme: {
    ...
  },
};

const editor = createEditor(config);

Once you have an editor instance, when ready, you can associate the editor instance with a content editable

element in your document:

const contentEditableElement = document.getElementById('editor');

editor.setRootElement(contentEditableElement);

If you want to clear the editor instance from the element, you can pass null. Alternatively, you can switch to another element if need be, just pass an alternative element reference to setRootElement().

Understanding the Editor State

With Lexical, the source of truth is not the DOM, but rather an underlying state model that Lexical maintains and associates with an editor instance. You can get the latest editor state from an editor by calling editor.getEditorState().

Editor states have two phases:

  • During an update they can be thought of as "mutable". See "Updating an editor" below to mutate an editor state.
  • After an update, the editor state is then locked and deemed immutable from there on. This editor state can therefore be thought of as a "snapshot".

Editor states contain two core things:

  • The editor node tree (starting from the root node).
  • The editor selection (which can be null).

Editor states are serializable to JSON, and the editor instance provides a useful method to deserialize stringified editor states.

const stringifiedEditorState = JSON.stringify(editor.getEditorState().toJSON());

const newEditorState = editor.parseEditorState(stringifiedEditorState);

Updating an editor

There are a few ways to update an editor instance:

  • Trigger an update with editor.update()
  • Setting the editor state via editor.setEditorState()
  • Applying a change as part of an existing update via editor.registerNodeTransform()
  • Using a command listener with editor.registerCommand(EXAMPLE_COMMAND, () => {...}, priority)

The most common way to update the editor is to use editor.update(). Calling this function requires a function to be passed in that will provide access to mutate the underlying editor state. When starting a fresh update, the current editor state is cloned and used as the starting point. From a technical perspective, this means that Lexical leverages a technique called double-buffering during updates. There's an editor state to represent what is current on the screen, and another work-in-progress editor state that represents future changes.

Creating an update is typically an async process that allows Lexical to batch multiple updates together in a single update – improving performance. When Lexical is ready to commit the update to the DOM, the underlying mutations and changes in the update will form a new immutable editor state. Calling editor.getEditorState() will then return the latest editor state based on the changes from the update.

Here's an example of how you can update an editor instance:

import {$getRoot, $getSelection, $createParagraphNode} from 'lexical';

// Inside the `editor.update` you can use special $ prefixed helper functions.
// These functions cannot be used outside the closure, and will error if you try.
// (If you're familiar with React, you can imagine these to be a bit like using a hook
// outside of a React function component).
editor.update(() => {
  // Get the RootNode from the EditorState
  const root = $getRoot();

  // Get the selection from the EditorState
  const selection = $getSelection();

  // Create a new ParagraphNode
  const paragraphNode = $createParagraphNode();

  // Create a new TextNode
  const textNode = $createTextNode('Hello world');

  // Append the text node to the paragraph
  paragraphNode.append(textNode);

  // Finally, append the paragraph to the root
  root.append(paragraphNode);
});

If you want to know when the editor updates so you can react to the changes, you can add an update listener to the editor, as shown below:

editor.registerUpdateListener(({editorState}) => {
  // The latest EditorState can be found as `editorState`.
  // To read the contents of the EditorState, use the following API:

  editorState.read(() => {
    // Just like editor.update(), .read() expects a closure where you can use
    // the $ prefixed helper functions.
  });
});

Creating custom Lexical nodes

Contributing to Lexical

  1. Clone this repository

  2. Install dependencies

    • npm install
  3. Start local server and run tests

    • npm run start
    • npm run test
      • The server needs to be running for the e2e tests

Note: for collaboration, ensure you start the websocket server separately with npm run collab.

Optional but recommended, use VSCode for development

  1. Download and install VSCode

    • Download from here (it’s recommended to use the unmodified version)
  2. Install extensions

    • Flow Language Support
      • Make sure to follow the setup steps in the README
    • Prettier
      • Set prettier as the default formatter in editor.defaultFormatter
      • Optional: set format on save editor.formatOnSave
    • ESlint

Documentation

Browser Support

  • Firefox 52+
  • Chrome 49+
  • Edge 79+ (when Edge switched to Chromium)
  • Safari 11+
  • iOS 11+ (Safari)
  • iPad OS 13+ (Safari)
  • Android Chrome 72+

Note: Lexical does not support Internet Explorer or legacy versions of Edge.

Contributing

  1. Create a new branch
    • git checkout -b my-new-branch
  2. Commit your changes
    • git commit -a -m 'Description of the changes'
      • There are many ways of doing this and this is just a suggestion
  3. Push your branch to GitHub
    • git push origin my-new-branch
  4. Go to the repository page in GitHub and click on "Compare & pull request"
    • The GitHub CLI allows you to skip the web interface for this step (and much more)

Support

If you have any questions about Lexical, would like to discuss a bug report, or have questions about new integrations, feel free to add yourself to our Discord server.

Lexical engineers are checking this regularly.

Running tests

  • npm run test-unit runs only unit tests.
  • npm run test-e2e:chromium runs only chromium e2e tests.
  • npm run debug-test-e2e:chromium runs only chromium e2e tests in head mode for debugging.
  • npm run test-e2e:firefox runs only firefox e2e tests.
  • npm run debug-test-e2e:firefox runs only firefox e2e tests in head mode for debugging.
  • npm run test-e2e:webkit runs only webkit e2e tests.
  • npm run debug-test-e2e:webkit runs only webkit e2e tests in head mode for debugging.

License

Lexical is MIT licensed.

Comments
  • Bug: CollaborationPlugin not working with minimal code example

    Bug: CollaborationPlugin not working with minimal code example

    Lexical version:0.2.9 browser: chrome lasted version computer: mac

    Steps To Reproduce

    1. yarn create vite
    2. copy the example code from https://lexical.dev/docs/collaboration/react to src/App.tsx
    3. add dependencies then run 'yarn install' and 'yarn dev'
    4. start a websocket server by running 'PORT=1234 npx y-websocket-server'
    5. open two tabs in browser with link 'http://localhost:3000/' and editing on one tab

    Link to code example: https://github.com/jullite/hello-lexical

    The current behavior

    content of editor not sync between two tabs

    The expected behavior

    content of editor will sync between two tabs

    all-platforms-bug community collab 
    opened by jullite 32
  • Decoupling plugin and nodes

    Decoupling plugin and nodes

    Problem

    Plugins and nodes are tightly coupled and it makes it harder to extend default nodes and maintaining existing plugins functionality.

    Example

    Let's take markdown plugin (copy/paste logic is also a good example), it exports bunch of node creation helpers ($createHeadingNode, $createCodeBlockNode, $createListNode, etc).

    Then if I want to extend HeadingNode behaviour, for example to add id attribute to each heading so it can be used as an anchor (smth like <h1 id="getting-started-with-react">Getting started with React</h1>, see our README doing it). To do so I'd extend default node and add new behaviour on top:

    class AnchorHeadingNode extends HeadingNode {
      static getType() {
        return 'heading';
      }
    
      createDOM<EditorContext>(config: EditorConfig<EditorContext>): HTMLElement {
        const element = super.createDOM(config);
        element.setAttribute('id', getAnchorID(this));
        return element;
      }
    
      updateDOM(prevNode: HeadingNode, dom: HTMLElement): boolean {
        dom.setAttribute('id', getAnchorID(this));
        return false;
      }
    }
    

    But now the problem is that all plugins that might insert HeadingNode (markdown, toolbar, copy/paste), they all keep using default HeadingNode, because they all use $createHeadingNode imported from default heading node file.

    Potential solution:

    Replace $createHeadingNode() implementation from

    function $createHeadingNode(tag): HeadingNode {
      return new HeadingNode(tag);
    }
    

    to

    function $createHeadingNode(tag): HeadingNode {
      const NodeConstructor = $getNodeFromRegistry(HeadingNode);
      return new NodeConstructor(tag);
    }
    
    ...
    // and smth like:
    function $getNodeFromRegistry<T>(nodeKlass: T): T {
      return $getActiveEditor()._registeredNodes.get(nodeKlass.getType());
    }
    

    This will allow passing AnchorHeadingNode into LexicalComposer, and since it has the same type ('heading'), it'll be used whenever $createHeadingNode is used, so all callsites that create heading will use our extended heading node.

    question 
    opened by fantactuka 31
  • HTML import/export utility

    HTML import/export utility

    There seems to be some good demand in utilities to import and export from HTML. This comes from developers who either store it as HTML on the backend already (coming from other libraries) or want it to render.

    Leaving aside that HTML is not as effective as EditorState I think we should explore the possibilities to enable such API. In a way we already have this in the @lexical/clipboard, it's just a matter of abstracting it in a way and ergonomic way that other developers can use as well as the copy-paste functionality.

    feature 
    opened by zurfyx 24
  • PoC of more advanced elements in createDOM

    PoC of more advanced elements in createDOM

    Following the discussions here and here, I've started experimenting with whether it's possible to return nested elements from createDOM

    Why?

    This is useful for all scenarios where you want more find-grained control over the DOM output of Lexical, but don't want to do so by changing the data model (Lexical nodes, etc). E.g.:

    • A checkbox list item where the checkbox is an actual <input>
    • @LuciNyan mentioned it would be useful for draggable blocks
    • ...

    PR

    In this PR, I modified the Reconciler to insert children in the spot indicated by an attribute data-gap. I've also modified the quote element in the playground to include a checkbox. This implementation is mainly meant for discussing the overall feature, I think this way (with an attribute) is too hacky / non type-safe to be considered a viable API.

    Demo

    https://user-images.githubusercontent.com/368857/192089088-14386e69-f1d3-48bb-a4c4-1a921aaf441d.mp4

    Known bugs

    • ~~Cursor handling: in the demo we can position the cursur around the checkbox~~ (fixed in https://github.com/facebook/lexical/pull/3062/commits/e81effef02bf1637328531f71d6e707be3625ee2)
    • ~~backspace before the quote doesn't work~~ (fixed in https://github.com/facebook/lexical/pull/3062/commits/e81effef02bf1637328531f71d6e707be3625ee2)

    Questions

    • Do you see other possible bugs with an implementation like this? I'm not an expert yet on the internals of Lexical, so I'd love to hear from someone who is whether it might conflict with other parts of the framework.
    • What would be a viable API for this? I think we could explore modifying the createDOM contract to return something like:
    type LexicalNodeDomRepresentation = HTMLElement | { element:  HTMLElement; parentNodeOfChildren: HTMLElement; }
    
    • An alternative could be to provide functions to hook into the reconciler, where the "parentNode" can be returned on the fly. This might offer more flexibility, but is probably not ideal in terms of keeping the reconciler clean and performant
    CLA Signed 
    opened by YousefED 22
  • feat: move images by dragging on the editor

    feat: move images by dragging on the editor

    Description

    • I added a div layer to the LazyImage component to change the body of the drag from an image to a div so that I could work with dataTransfer.setDragImage on safari to remove the default shadow that occurs when dragging.
    • because when dragging occurs, although we can see the cursor in the document with our mouse movement, but in fact that is a new cursor only when dragging, we can not getSelection().getRange(0) to get the exact location of the cursor, so I implemented a getDragSelection method.

    Related Issues 📦

    #1852

    https://user-images.githubusercontent.com/22126563/165798807-8b299a54-3a54-4bd2-adda-81ed7ef422d8.mov

    CLA Signed 
    opened by LuciNyan 21
  • Fix insertion when the existing anchor node is orphaned

    Fix insertion when the existing anchor node is orphaned

    Fixes #3460.

    Consists of three changes:

    1. In #3429 we tweaked $shouldPreventDefaultAndInsertText so that the check for replacing a range with a single character or grapheme is only applied for input events (not beforeinput events) unless we determine that it is a dangling input event but we likely meant to && that condition with the remaining conditions (not || it).

      See analysis here: https://github.com/facebook/lexical/issues/3460#issuecomment-1334744872

      This patch effectively changes the || to and && (and drops a few no-longer-needed braces in the process).

    2. We have observed in some circumstances (thought to be when using a newer version of Playwright) that Webkit can end up in a state where, during the input event, the DOM node for our lexical selection anchor has been orphaned.

      The second change in this patch makes $shouldPreventDefaultAndInsertText detect this case and return true (i.e. cause us to dispatch a controlled text insertion in this case).

    3. Finally, in order to ensure that we do, in fact, dispatch a controlled text insertion in the case described in (2), this patch also alters the condition inside onInput to ensure we perform the insertion when the DOM node for our lexical anchor is orphaned.

    CLA Signed 
    opened by birtles 18
  • Proposal: Clean up core APIs

    Proposal: Clean up core APIs

    Change add* to register*

    I had some really nice feedback tonight from some of the old folks who used to work at Meta on DraftJS. They mentioned that the current pattern of addListener, addTransform etc was confusing – as it's assumed to be just "adding" something. They expected there to be an opposite API of removeListener and removeTransform.

    They mentioned that we could do what other popular libraries do, and create an observe or use a register prefix, which infers that you're creating something that has a return signature. This would mean the following changes:

    • addListener -> registerListener
    • addNodeTransform -> registerNodeTransform

    This should hopefully make it clear that these APIs return the removal variants of themselves.

    Let's break out command listeners

    They're not really listeners, and never have been. Listeners don't expect the function to return anything, but command listeners do – and they also have priorities! So let's come up with a better naming for both the listening part and the dispatching part! My current thinking is:

    • addListener('command', function, priority) -> registerCommandHandler(function, priority)
    • execCommand(commandType, payload) -> dispatchCommand(commandType, payload)

    Let's remove root listeners

    I really don't feel they push folks down the path of success. They encourage adding listeners to the contenteditable, but really they should probably be delegating events to the document and, where possible, leveraging commands instead.

    enhancement 
    opened by trueadm 18
  • Fix onInput events inside decorator nodes

    Fix onInput events inside decorator nodes

    Problem

    Input elements inside decorator nodes do not receive input events because lexical stops propagation in the parent editor.

    Solution

    Check if the target element of the input event is from a decorator node, if so - do not stop propagation of the event.

    Related conversation in discord: https://discord.com/channels/953974421008293909/1006976156748222464/1007339073683337327

    CLA Signed 
    opened by Piliuta 16
  • feat: Add support for Giphy API's in lexical

    feat: Add support for Giphy API's in lexical

    Changelog:

    1. Added @giphy/react-components, @giphy/js-fetch-api, @giphy/js-types, react-use to the lexical-playground package
    2. Remove the hard-coded cat gif
    3. Added a component to display the giphy plugin in the modal
    4. Insert a gif on select

    Relates to #1820

    Screen recording

    https://user-images.githubusercontent.com/10229595/176993308-a619ceaa-c237-4f52-9f4f-b8e7f6a9ad24.mp4

    CLA Signed 
    opened by rimildeyjsr 16
  • Bug: syncYjsChangesToLexical unable to find active editor in headless mode

    Bug: syncYjsChangesToLexical unable to find active editor in headless mode

    I am currently working on converting the representation of lexical in yjs to html. I received a very helpful gist when I initially enquired about this in discord. Whilst working on implementing this, I have come across an issue using the syncYjsChangesToLexical method. The stack trace of the error is as follows:

     Error: Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().
    [0]     at getActiveEditor (C:<project 
    -path>\node_modules\lexical\Lexical.dev.js:5541:13)
    [0]     at $setNodeKey (C:<project 
    -path>\node_modules\lexical\Lexical.dev.js:550:18)
    [0]     at new LexicalNode (C:<project 
    -path>\node_modules\lexical\Lexical.dev.js:6334:5)
    [0]     at new ElementNode (C:<project 
    -path>\node_modules\lexical\Lexical.dev.js:7077:5)
    [0]     at new LinkNode (C:<project 
    -path>\node_modules\@lexical\link\LexicalLink.dev.js:33:5)
    [0]     at createLexicalNodeFromCollabNode (C:<project 
    -path>\node_modules\@lexical\yjs\LexicalYjs.dev.js:336:23)
    [0]     at CollabElementNode.syncChildrenFromYjs (C:<project 
    -path>\node_modules\@lexical\yjs\LexicalYjs.dev.js:847:34)
    [0]     at createLexicalNodeFromCollabNode (C:<project 
    -path>\node_modules\@lexical\yjs\LexicalYjs.dev.js:345:16)
    [0]     at CollabElementNode.syncChildrenFromYjs (C:\<project 
    -path>\node_modules\@lexical\yjs\LexicalYjs.dev.js:847:34)
    [0]     at syncEvent (C:<project 
    -path>\node_modules\@lexical\yjs\LexicalYjs.dev.js:1523:18)
    

    This errror does not occur when the editor contains simple text. Once I start using more sophisticated nodes such as links and tables, the error is thrown.

    Lexical version: 0.6.0

    Steps To Reproduce

    1. Create a nodejs project
    2. implement a headless editor using jsdom
    3. Try to generate html from yjs doc

    An example of code to reproduce this is shown below.

    Link to code example:

    A gist containing a modified version of the gist provided previously can be found here.

    The current behavior

    As mentionned above, when generating html which only contains text, this works as expected. When generating html which contains nodes such as tables and links, an error with the stack trace above is shown.

    The expected behavior

    I would expect that the behaviour is the same for both text nodes and other nodes.

    opened by adamkona 15
  • Bug: Text cursor indicator not following cursor

    Bug: Text cursor indicator not following cursor

    OS: Windows 10 Browser: Chrome 88 AT: NVDA 2020.4, Text Cursor indicator

    I have text cursor indicator turned on in windows and I noticed the indicator was not following the cursor when using up and down arrows to navigate between two paragraphs.

    To turn on text cursor indicator:

    • Hit Windows Key
    • Type accessibility
    • Open the ease of access center
    • Navigate to "text cursor"
    • select the switch to "Turn on text cursor indicator"
    • adjust settings to make it easily to see, I attached a screenshot of mine

    image

    Test Steps Write two paragraphs Use the up arrow to navigate to the space between both paragraphs

    Expected Results The cursor indicator should follow the cursor

    Actual Results the cursor indicator stays in place and the cursor moves to the space between the paragraphs

    Notes

    • hitting the up arrow a second time will rejoin the cursor with the cursor indicator
    • I noticed this is also an issue in github's text editor so it may be browser or OS related.

    Screenshot I couldn't find a way to actually screenshot the cursor so the red line shows where the cursor was when I took the screenshot. image

    opened by a11yHolli 15
  • Bug: text node broken after removing selection as entering a composition symbol like korean.

    Bug: text node broken after removing selection as entering a composition symbol like korean.

    Lexical version: 0.7.5 (latest)

    This bug only happens in Chrome, Safari and not in FF.

    Steps To Reproduce

    1. Select more than two text nodes (above one should be fully wrapped)
    2. Enter any symbol affecting composition event like Korean symbol.
    3. selection will be removed but symbol doesn't appear and can't write any word at the focusing text node

    https://user-images.githubusercontent.com/74358372/210831408-eef66347-c4aa-4baa-846d-5240e8895517.mov

    The current behavior

    When the selected text nodes are replaced, the new node has empty TextContent and can't be modified. (until newline)

    The expected behavior

    When the selected text nodes are replaced, the new one will have contents I typed and work correctly.

    opened by conatus-recedendi 1
  • Bug: Additional break line when initializing or copy/pasting in the editor with break lines

    Bug: Additional break line when initializing or copy/pasting in the editor with break lines

    When I initialize the Lexical editor from an DOM like <p><br></p>, passing through generateNodesFromDOM and inserting the generated nodes to the editor, it imports it with an additional break line like <p><br><br></p>. This makes the editor have more break lines than expected. It is also curious that both
    count as one character if I delete them and count the characters.

    @zeitstein mentioned in a discord chat that when trying to pass a single <p></p> without break lines, it also imports it with an additional break line like <p><br></p>. They also mention that that this PR can be related -> https://github.com/facebook/lexical/pull/3581 (thanks for rising this up in the discord chat, here is the full thread: https://discord.com/channels/953974421008293909/1060331843578249376)

    I also managed to reproduce it when copying some text with break lines from the Notes Application from my Mac.

    Lexical version: 0.7.5

    Steps To Reproduce

    1. Write something like this (with some break lines) in a Note in the Mac Notes Application:
    First line
    
    
    
    Fifth line
    
    1. Copy the five lines (or the block of text you have written) and paste it in the lexical playground editor
    2. You can find that there are more than 5 lines in this particular case.
    image

    Here is an example of the InitialState plugin to initialize the editor from a preview HTML string (not sure why is duplicating the text in the codesandbox, in my code only runs once): https://codesandbox.io/s/break-line-example-w1ic2x?file=/src/plugins/InitialState.js

    The current behavior

    When copying or initializing some text with break lines, it duplicates them, making the text different from the expected one.

    The expected behavior

    When copying or initializing some text with break lines, the number of break lines is exactly the same as the one inserted in the editor.

    opened by ErPacheco 0
  • Bug: Text changes from Grammarly (desktop version) not always recognised in editor

    Bug: Text changes from Grammarly (desktop version) not always recognised in editor

    If you spell a word incorrectly and change it through the desktop version of Grammarly, the text editor will appear to update, but if you check the text in debug mode, you'll see that it hasn't actually updated. If you then add text after the word that's been edited, it will correct itself in the nodes, but often our users just go through and make the changes at the end without adding more text.

    This doesn't appear to be an issue with the Grammarly Chrome Extension and can be a bit inconsistent to replicate.

    Lexical version: 0.6.4 (also occurs in the playground)

    Steps To Reproduce

    1. Turn on Grammarly desktop (ensure Chrome extension is off)
    2. Set editor to debug=true
    3. Spell a word incorrectly
    4. Change it with Grammarly's recommendation
    5. Debug shows previous spelling despite RTE displaying correct spelling.
    6. Click back on the editor and type something else after the word and debug should update.

    The current behavior

    Word has been changed by Grammarly and appears differently in the RTE to the debug console

    Screenshot 2023-01-04 at 10 34 00

    When I start typing afterwards it corrects itself

    Screenshot 2023-01-04 at 10 34 18

    Example in Lexical playground where I wrote some extra text and then went back and changed the word "obstruction". You can see it hasn't updated correctly in the debug console.

    Screenshot 2023-01-04 at 10 07 18

    opened by scvet-ct 6
  • fix: type-ahead menu scroll problem

    fix: type-ahead menu scroll problem

    fix an issue where the menu would cause the editor to scroll.

    before

    https://user-images.githubusercontent.com/5945154/210514922-d4bea9a7-009e-45a0-8015-1774ad5fb6fa.mp4

    after

    Only scrollIntoView will be done when there are not enough positions.

    https://user-images.githubusercontent.com/5945154/210514951-e3e60bdf-497a-4b8e-bd68-455842d38f73.mp4

    opened by kirakiray 2
  • Feature: make excluded properties from yjs sync configurable

    Feature: make excluded properties from yjs sync configurable

    I need to be able to exclude specific fields from yjs sync, because i want to centralize logic related to the node in the node class not just the node's data

    I see there a Set called excludedProperties defined statically in lexical code https://github.com/facebook/lexical/blob/4dae4fb39d1ba6e4cc181b22652bfeed72a67e34/packages/lexical-yjs/src/Utils.ts#L42-L52 I mainly want a way to be able to add more filed in that set

    the alternative solution is to keep a map that observe the nodes create through a mutation listener and just keep the data i don't want to sync there

    I can make a PR if it is okay to implement this feature

    enhancement 
    opened by husseinraoouf 0
Releases(v0.7.5)
  • v0.7.5(Dec 23, 2022)

    • 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
    Source code(tar.gz)
    Source code(zip)
  • v0.7.4(Dec 20, 2022)

    • Add missing usages of $applyNodeReplacement (#3592) John Flockton
    • Fix import issue with line break nodes (#3593) John Flockton
    • Allow LinkNode to be replaced by custom node, fix bug in #3367 (#3588) Nhan Ho
    Source code(tar.gz)
    Source code(zip)
  • v0.7.3(Dec 18, 2022)

    • Fix bold italic exportDOM (#3584) Dominic Gannaway
    • Fix copy/paste issue with line breaks within paragraphs (#3581) John Flockton
    • Fix various collaboration cursor bugs (#3582) Dominic Gannaway
    • Update PlaygroundEditorTheme.css (#3553) pavan-reddy-28
    • More extensive fixes for Lexical in iframes (#3578) Dominic Gannaway
    Source code(tar.gz)
    Source code(zip)
  • v0.7.2(Dec 17, 2022)

    • Use the actual node count rather than the dirty node count (#3569) Dominic Gannaway
    • Utilize getParentElement internally when traversing up the DOM tree (#3576) Dominic Gannaway
    • check read only flag during $setSelection (#3572) yf-yang
    • Fix iframe selection issues (#3573) Dominic Gannaway
    • Fix left arrow selection on list nodes (#3575) Dominic Gannaway
    • fix: deleting forward on the last decorate node (#3568) Oleksii Piatetskyi
    • Image gets stuck in resizing state fix (#3562) (#3565) Sharat Chandar M
    • Fix flow again (#3566) Acy Watson
    • Fix placeholder text for custom Paragraph Nodes (#3557) moy2010
    • Disable lint rule in composition test (#3552) Acy Watson
    • Add $wrapNodes back to flow (#3551) Acy Watson
    • [Playground] Support clicking on links with middle mouse button (#3547) zeitstein
    • Fix bug 3535 (#3537) lizhu68
    • docs: typo fix (#3544) Bryan Ricker
    • Don't throw if getPreviousSiblings can't find a parent (#3543) Acy Watson
    • Change mousedown event type to fix selection Chromium bug on Android (#3541) John Flockton
    • Various fixes in $wrapNodes (#3234) EgonBolton
    • Add missing changelog entry to 0.7 (#3533) Dominic Gannaway
    • Remove VERSION (#3531) John Flockton
    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Dec 11, 2022)

    Contains several small bug fixes from the Lexical 0.7.0 release.

    • Fix paste for LexicalLinkPlugin (#3528) Dominic Gannaway
    • RTL fix for checkbox (#3529) shiva-Aluri
    • Add demos section to the navbar (#3507) akmarzhan1
    • Fix lexical-offset (#3526) Dominic Gannaway
    • Add missing Flow type for indentation plugin (#3527) John Flockton
    • Docs: fix "node" type in "Node Overrides" example code (#3525) Chris Montrois
    • Fix small Flow error (#3523) John Flockton
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Dec 11, 2022)

    v0.7.0 (2022-12-09)

    Lexical 0.7 includes some breaking changes, including:

    • Removal of $cloneContents from @lexical/selection
    • Changes to PlainTextPlugin and RichTextPlugin with regards to how placeholders are handled
    • Pressing tab with the RichTextPlugin no longer indents by default, use the LexicalTabIndentationPlugin for this behavior.
    • The unstable helper function unstable_convertLegacyJSONEditorState has been removed. This was always meant to be a temporary work-around to allow developers to convert their formats to the new JSON format rather than using the actual editor state internals directly.

    Lexical 0.7 includes performance and usability improvements. Notably, Lexical has a new internal architecture that allows for much better performance with large documents of content. Lexical also now provides a way to handle selection between blocks of content by providing an emulated cursor (make sure you add a blockCursor theme to your editor config to use it).

    • Revert "Fix exportJSON return types for ParagraphNode and LineBreakNode" (#3521) John Flockton
    • Move default language setting to Tokenizer (#3368) mizuno
    • Improve LexicalTreeView around large EditorStates (#3515) Dominic Gannaway
    • Improve insertBefore, insertAfter, replace selection restoration logic (#3516) Dominic Gannaway
    • ⏸ [0.7] Switch the internal architecture to utilize doubly linked lists (#3480) Dominic Gannaway
    • Add missing annotation to internal field of Textnode (#3514) John Flockton
    • ⏸ [0.7] Remove indentation keyboard shortcuts in RTE set up (#2855) John Flockton
    • Fix dom-less reconciliation (#3506) Maksim Horbachevsky
    • ⏸ [0.7] Add block emulated cursors (#3434) Dominic Gannaway
    • ⏸ [0.7] Customize Placeholder visibility (#3379) Gerard Rovira
    • ⏸ [0.7] Remove IntentionallyMarkedAsDirtyElement from public API (#3422) John Flockton
    • ⏸ [0.7] Remove $cloneContents (#3483) Dominic Gannaway
    • Update Playwright (#3511) Dominic Gannaway
    • Improve Auto Embed (#3505) Tyler Bainbridge
    • Skip tab e2e test in webkit (#3512) Dominic Gannaway
    • Add poll and speech-to-text plugin examples (#3484) akmarzhan1
    • Fix typedef for wrapNodes (#3492) Maksim Horbachevsky
    Source code(tar.gz)
    Source code(zip)
  • v0.6.5(Dec 5, 2022)

    v0.6.5 (2022-12-05)

    • Fix mutation listener for when DOM moves occur (#3493) Dominic Gannaway
    • Fix decorator input selection (#3491) Dominic Gannaway
    • Inform users that they need to install headless (#3487) Phillip Burch
    • Revert changes (#3481) Dominic Gannaway
    • Improve selection performance on large updates (#3478) Dominic Gannaway
    • Support TypeScript language in code nodes (#3469) Jonas Bengtsson
    • Improve element splicing and node removal (#3454) Dominic Gannaway
    • Add start and end as format types (#3472) John Flockton
    • Fix test for collab (#3471) Dominic Gannaway
    • Add e2e test for text replacement (#3470) Dominic Gannaway
    • Markdown decorators export fallback to text content (#3464) Maksim Horbachevsky
    • Update conditional statement in LexicalAutoFocusPlugin to the same logic as in LexicalSelection (#3466) John Flockton
    • Add Node Replacement Docs (#3462) Acy Watson
    • Inherit headless flag from parent editor (#3459) Maksim Horbachevsky
    • Change heading to paragraph when heading is empty (#3455) John Flockton
    • Show caret while drag&drop (#3300) Gerard Rovira
    • Fix superscript & subscript not being converted from html string (#3453) Rajatava Mukherjee
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Oct 31, 2022)

    Happy halloween!

    108 commits! That's 66% more than 0.5.0. This release comes with many many fixes. But let's go over the highlights first:

    Nightly releases

    We just introduced a semi-automated release process for those of you who want to be at the cutting edge (looking at you Discord folks). New versions with the latest on the main branch will be pushed Monday through Friday.

    You can find on NPM tagged with next (npm i lexical@next)

    These will likely be more unstable, informal and might contain undocumented breaking changes. That said, that's what we do internally at Meta where we sync the Lexical GitHub repository onto Mercurial multiple times per week.

    Collapsible container

    The possibility to do spoiler containers has been a highly requested feature. We prototyped an efficient React-agnostic playground plugin that you can find on the playground (CollapsiblePlugin). It may eventually make it to @lexical/react

    https://user-images.githubusercontent.com/193447/199079683-a065cc72-f526-42d6-a8c2-2f4fe6640ba5.mov

    Drag, drop & paste

    Having seen many and very similar drag & drop implementations at Meta, we have come to the conclusion that dragging, dropping and pasting media is a fundamental piece of rich text. Hence, it is now built-in into the RichTextPlugin and you no longer have to implement your own event handling.

    https://user-images.githubusercontent.com/193447/199079730-c9e6182c-64bd-4329-b536-9524c2fb3e09.mov

    See the DragDropPaste playground plugin for an example on how to validate and insert your media nodes into the editor.

    Failsafe DecoratorNodes

    Safety first! React Decorators will now be independently wrapped with an ErrorBoundary and Suspense.

    We found that it is very easy to miss either of them when implementing custom DecoratorNodes, and when either is missed and the component either crashes or suspends this causes the editor to be unusable.

    https://user-images.githubusercontent.com/193447/199079773-f132645e-1822-497d-9768-b1694e688c7e.mov

    Breaking change: you now have to provide an ErrorBoundary to RichTextPlugin (you can use ours).

    import {LexicalErrorBoundary} from 'lexical/@react/LexicalErrorBoundary';
    <RichTextEditor ... ErrorBoundary={LexicalErrorBoundary} />
    

    Editor namespace on TreeView

    From internal and open-source feedback, TreeView has become an indispensable tool to work with Lexical. It gives you the ability to glance over the current state and understand how plugins work with each other.

    We added the namespace and the editable state, which we feel is important to complement the read-only mode version of Lexical.

    Screen Shot 2022-10-31 at 10 06 53 AM

    Note that, while you can convert to HTML for the read-only view, Lexical size and the possibility to have high-fidelity rendering at no cost makes it a perfect candidate for to place in a read-only mode.

    In any case, @im-adithya continues the work on the cross-browser extension, what will be the preferred and most complete approach for day-to-day development.

    And some more

    • Added the discrete property to editor.update to perform synchronous non-batched updates. Synchronous updates are often terrible performance-wise but there are concrete occasions where they can come useful. TL;DR be careful!
    • You can now have custom collaboration cursor color.
    • Copying a Node and Grid selection (like one or multiple images) now works with Firefox.
    • Various fixes for tables, remarkably mouse selection which was acting weird sometimes.

    Changelog

    • Update intro.md by @crisshaker in https://github.com/facebook/lexical/pull/3064
    • Update theming.md by @crisshaker in https://github.com/facebook/lexical/pull/3067
    • fix(lexical-clipboard): pasting from google docs by @LuciNyan in https://github.com/facebook/lexical/pull/3063
    • Update faq.md to fix error of clearing contents by @Mark-Fenng in https://github.com/facebook/lexical/pull/3070
    • chore(lexical-playground): add resizability back to regular tables by @Dattaya in https://github.com/facebook/lexical/pull/3068
    • Add oncall annotation by @thegreatercurve in https://github.com/facebook/lexical/pull/3071
    • Fix oncall annotation issue missing from some files by @thegreatercurve in https://github.com/facebook/lexical/pull/3075
    • Fix Resize and Scroll Positioning on Typeahead/Node Menu by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3079
    • fix(lexical-playground): read-only mode by @LuciNyan in https://github.com/facebook/lexical/pull/3081
    • Removed extra 'is' in line 9 by @Boye95 in https://github.com/facebook/lexical/pull/3083
    • Add some inline documentation by @acywatson in https://github.com/facebook/lexical/pull/3076
    • Merge markdown E2E tests into one file by @thegreatercurve in https://github.com/facebook/lexical/pull/3086
    • Add open/close callbacks to menu plugins by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3087
    • Add logic to catch separators by @thegreatercurve in https://github.com/facebook/lexical/pull/3084
    • Tweet fallback to text on copy by @zurfyx in https://github.com/facebook/lexical/pull/3088
    • Double-trigger hack for high-fidelity Node/Grid selection by @zurfyx in https://github.com/facebook/lexical/pull/3080
    • Add collapsible container plugin by @fantactuka in https://github.com/facebook/lexical/pull/3082
    • Make onClose optional on Flow Types. by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3091
    • Fix flow for $insertGeneratedNodes by @zurfyx in https://github.com/facebook/lexical/pull/3101
    • chore: add e2e test for draggable-block-plugin by @LuciNyan in https://github.com/facebook/lexical/pull/3090
    • copyToClipboard to return success by @zurfyx in https://github.com/facebook/lexical/pull/3105
    • Fix DOM availability check by @fantactuka in https://github.com/facebook/lexical/pull/3102
    • Lower key navigation command priority for Tables by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3107
    • Typeaheads: Add scroll command and increase priority by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3106
    • Typeaheads: Remove hard-coded "bottom" alignment (Breaking change) by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3104
    • fix(lexical-playground): draggable blockplugin uses unexposed apis by @LuciNyan in https://github.com/facebook/lexical/pull/3109
    • Update createHeadlessEditor to match createEditor typedef by @fantactuka in https://github.com/facebook/lexical/pull/3111
    • Fix npm install on M1 macs by @Timebutt in https://github.com/facebook/lexical/pull/3114
    • Fix typeahead import by @fantactuka in https://github.com/facebook/lexical/pull/3117
    • [0.6] More Typeahead Changes by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3112
    • Fix GridSelection comparison by @zurfyx in https://github.com/facebook/lexical/pull/3118
    • Fix table paste by @zurfyx in https://github.com/facebook/lexical/pull/3129
    • Add className prop to typeahead plugin by @acywatson in https://github.com/facebook/lexical/pull/3124
    • Fix typeahead ref typedef by @fantactuka in https://github.com/facebook/lexical/pull/3131
    • Fix Dynamic Table Options on Playground Component Picker by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3132
    • Support multiple classes by @acywatson in https://github.com/facebook/lexical/pull/3134
    • Typeahead Menu Flow types by @acywatson in https://github.com/facebook/lexical/pull/3133
    • Ignore mutations which do not have target node by @Piliuta in https://github.com/facebook/lexical/pull/3120
    • Add Emoji Picker to Playground by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3122
    • feat: add icons to extension and change build by @im-adithya in https://github.com/facebook/lexical/pull/3140
    • FF Node/Grid copy-paste support by @zurfyx in https://github.com/facebook/lexical/pull/3147
    • remove repeated comments by @Zuckjet in https://github.com/facebook/lexical/pull/3154
    • Ignore empty class names in addClassNamesToElement by @acywatson in https://github.com/facebook/lexical/pull/3159
    • ref(selection): separate @lexical/selection/index into multiple files by @tranqhuy46 in https://github.com/facebook/lexical/pull/3145
    • Check if DOM is accessible when calling getSelection by @yongdamsh in https://github.com/facebook/lexical/pull/3162
    • Fix linting error in EmojiPicker by @thegreatercurve in https://github.com/facebook/lexical/pull/3165
    • Fix flow types for root.select() by @fantactuka in https://github.com/facebook/lexical/pull/3168
    • Remove development notice by @trueadm in https://github.com/facebook/lexical/pull/3171
    • TreeView editor basics by @zurfyx in https://github.com/facebook/lexical/pull/3153
    • Fix copy-paste CodeBlock with BR by @zurfyx in https://github.com/facebook/lexical/pull/3174
    • Fix nested editor cut by @fantactuka in https://github.com/facebook/lexical/pull/3177
    • Fix insertNodes when replacing content adjacent to an inline element by @birtles in https://github.com/facebook/lexical/pull/3137
    • docs: Fixed broken link by @SimonProper in https://github.com/facebook/lexical/pull/3190
    • Make the ComponentPicker independent of the Toolbar by @EgonBolton in https://github.com/facebook/lexical/pull/3142
    • Nightly and Dev releases by @acywatson in https://github.com/facebook/lexical/pull/3192
    • Add flushSync option to update() by @fantactuka in https://github.com/facebook/lexical/pull/3119
    • Built-in Error/SuspenseBoundaries for React DecoratorNodes by @zurfyx in https://github.com/facebook/lexical/pull/3178
    • Add type to commands for logging by @thegreatercurve in https://github.com/facebook/lexical/pull/2942
    • fix: play time travel after reaching maximum range by @shanpriyan in https://github.com/facebook/lexical/pull/3197
    • v0.5.1-next.0 by @acywatson in https://github.com/facebook/lexical/pull/3201
    • Change release workflows by @acywatson in https://github.com/facebook/lexical/pull/3203
    • Fix when the selection is anchored to the end of a text node followed by a non-text node by @birtles in https://github.com/facebook/lexical/pull/3116
    • chore: optimize svg by @harish-sethuraman in https://github.com/facebook/lexical/pull/3199
    • Fix sample code (lexical-react) by @shinshin86 in https://github.com/facebook/lexical/pull/3206
    • fix: draggable block icon is invisible in read-only mode by @karam-qaoud in https://github.com/facebook/lexical/pull/3198
    • Fix frozen selection by @acywatson in https://github.com/facebook/lexical/pull/3204
    • v0.5.1-next.1 by @acywatson in https://github.com/facebook/lexical/pull/3205
    • Allow Block change with GridSelection by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3212
    • Refine backspace handling in Tables by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3213
    • fix: fixed dual text appearance problem and removed outline scrollbar by @karam-qaoud in https://github.com/facebook/lexical/pull/3207
    • Don't apply element based offsets to text nodes in $patchStyleText by @birtles in https://github.com/facebook/lexical/pull/3126
    • Fix TableSelection Mouse Up Propagation Bug by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3223
    • Memoize ErrorBoundary by @zurfyx in https://github.com/facebook/lexical/pull/3225
    • Handle bad list item children gracefully by @zurfyx in https://github.com/facebook/lexical/pull/3226
    • Add SerializedMarkNode flow type by @acywatson in https://github.com/facebook/lexical/pull/3228
    • Allow overriding mark node create function by @acywatson in https://github.com/facebook/lexical/pull/3229
    • Fix typos in Markdown documentation by @miktirr in https://github.com/facebook/lexical/pull/3236
    • Fix list paste issue by @acywatson in https://github.com/facebook/lexical/pull/3239
    • Expose Tokenizer interface to accept custom tokenizer other than Prism at @lexical/code by @saint1991 in https://github.com/facebook/lexical/pull/3243
    • Handle left part of match by @Neewd in https://github.com/facebook/lexical/pull/3245
    • chore: add new eslint-plugin with rule no-optional-chaining locally by @shanpriyan in https://github.com/facebook/lexical/pull/3233
    • pref(lexical-playground): reduce rendering consumption by creating compositing layers by @LuciNyan in https://github.com/facebook/lexical/pull/3069
    • Allow skipping auto-scroll action on selection change by @Piliuta in https://github.com/facebook/lexical/pull/3220
    • Fix error boundary fallback by @fantactuka in https://github.com/facebook/lexical/pull/3249
    • Improve logistics around table/grid selection by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3251
    • Allow clearing styles with $patchStyleText by @birtles in https://github.com/facebook/lexical/pull/3247
    • Refactor isHighlighting flag into object literal by @thegreatercurve in https://github.com/facebook/lexical/pull/3256
    • Select end if root has no children in focus logic by @thegreatercurve in https://github.com/facebook/lexical/pull/3254
    • Add inline plugin example for images by @akmarzhan1 in https://github.com/facebook/lexical/pull/3216
    • v0.5.1-next.2 by @acywatson in https://github.com/facebook/lexical/pull/3269
    • Revert "v0.5.1-next.2" by @acywatson in https://github.com/facebook/lexical/pull/3272
    • Do not reconcile terminating linebreak for inline elements by @fantactuka in https://github.com/facebook/lexical/pull/3268
    • Use set for highlighting cache by @thegreatercurve in https://github.com/facebook/lexical/pull/3258
    • Fix paste CodeNode leak and and empty links by @zurfyx in https://github.com/facebook/lexical/pull/3194
    • Revert "Select end if root has no children in focus logic" by @acywatson in https://github.com/facebook/lexical/pull/3276
    • Copy styles to new object when patching by @acywatson in https://github.com/facebook/lexical/pull/3273
    • Fix nodesOfType return type by @acywatson in https://github.com/facebook/lexical/pull/3262
    • Improve Collab cursor, add custom cursorColor by @strdr4605 in https://github.com/facebook/lexical/pull/3248
    • Add root theme class by @fantactuka in https://github.com/facebook/lexical/pull/3277
    • selection.modify to respect ShadowRoot by @zurfyx in https://github.com/facebook/lexical/pull/3279
    • Fix initial content tables initialization by @fantactuka in https://github.com/facebook/lexical/pull/3281
    • Drag & drop & paste with precision by @zurfyx in https://github.com/facebook/lexical/pull/3274
    • Release on matching tag push to main by @acywatson in https://github.com/facebook/lexical/pull/3284
    • filter by branch by @acywatson in https://github.com/facebook/lexical/pull/3285
    • v0.5.1-next.2 by @acywatson in https://github.com/facebook/lexical/pull/3286
    • Handle quotes in increment-version changelog by @zurfyx in https://github.com/facebook/lexical/pull/3291
    • Preserve selection for pending state by @fantactuka in https://github.com/facebook/lexical/pull/3293
    • Keep selection if state was not cloned by @fantactuka in https://github.com/facebook/lexical/pull/3294
    • Optional decorator nodes selection with keyboard navigation by @Piliuta in https://github.com/facebook/lexical/pull/3292
    • [0.6] Make RichTextPlugin ErrorBoundary mandatory by @zurfyx in https://github.com/facebook/lexical/pull/3295
    • Release on push to main when ref contains pre-release identifier by @acywatson in https://github.com/facebook/lexical/pull/3297
    • 0.6.0 by @zurfyx in https://github.com/facebook/lexical/pull/3296

    New Contributors

    • @crisshaker made their first contribution in https://github.com/facebook/lexical/pull/3064
    • @Mark-Fenng made their first contribution in https://github.com/facebook/lexical/pull/3070
    • @Boye95 made their first contribution in https://github.com/facebook/lexical/pull/3083
    • @Timebutt made their first contribution in https://github.com/facebook/lexical/pull/3114
    • @Piliuta made their first contribution in https://github.com/facebook/lexical/pull/3120
    • @Zuckjet made their first contribution in https://github.com/facebook/lexical/pull/3154
    • @tranqhuy46 made their first contribution in https://github.com/facebook/lexical/pull/3145
    • @yongdamsh made their first contribution in https://github.com/facebook/lexical/pull/3162
    • @birtles made their first contribution in https://github.com/facebook/lexical/pull/3137
    • @SimonProper made their first contribution in https://github.com/facebook/lexical/pull/3190
    • @EgonBolton made their first contribution in https://github.com/facebook/lexical/pull/3142
    • @shinshin86 made their first contribution in https://github.com/facebook/lexical/pull/3206
    • @miktirr made their first contribution in https://github.com/facebook/lexical/pull/3236
    • @saint1991 made their first contribution in https://github.com/facebook/lexical/pull/3243
    • @Neewd made their first contribution in https://github.com/facebook/lexical/pull/3245
    • @akmarzhan1 made their first contribution in https://github.com/facebook/lexical/pull/3216

    Full Changelog: https://github.com/facebook/lexical/compare/v0.5.0...v0.6.0


    Thank you open-source community for helping us shape yet another version! Happy halloween and back to coding 👨‍💻

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Sep 23, 2022)

    v0.5.0 (20 days after v0.4.0) comes with a meaty set of features, API refinements and bugfixes.

    Draggable blocks

    One of the most beloved features of Notion is the ability to seamlessly move blocks within the same document. @LuciNyan has ported this behavior to Lexical under the DraggableBlockPlugin name. You can check it out in our playground!

    https://user-images.githubusercontent.com/22126563/190201193-3784dc18-7214-4b48-afba-ade0b5aa288d.mov

    LexicalTablePlugin makes its way to Meta production

    We started our tables (@lexical/react/LexicalTablePlugin) development at the start of the year, one of the most ambitious and complex plugins we have built for rich text. We have blocked a good amount of time during this past month to work with multiple internal teams to identify and squash most of these (10+) high-pri bugs that make the experience unideal and we believe they are now in a good shape to meet their first internal users.

    Screen Shot 2022-09-23 at 3 08 54 pm

    Shadow Root

    We have introduced a new advanced concept for Lexical ElementNodes: [Shadow Root](https://lexical.dev/docs/api/classes/lexical.ElementNode#isshadowroot). A Shadow Root is a Node that behaves like a root (we stole the name from Shadow DOM). This method enables you to have complex deep rich text hierarchies where children node shouldn't see beyond the parent. For example, the cell node content.

    $insertNodes with NodeSelection and GridSelection support

    We introduced a seamless way to handle node insertion. We bundled {rangeSelection/nodeSelection/gridSelection}.insertNode into just one method: $insertNodes. We also added insertNodes support for NodeSelection and GridSelection that was previously not supported.

    https://user-images.githubusercontent.com/193447/178761488-d39987f7-2a90-4604-b4fc-dfbf57178f35.mov

    Various API changes

    1. PlainTextPlugin and RichTextPlugin will no longer take an initialEditorState. We found that this is unintuitive to handle nested editors and harder to control SSR-enabled pages. Instead, MLCComposer will take and apply the initialEditorState on editor creation
    2. We killed INERT nodes. We found them cumbersome to use, not accessible and they didn't meet the requirements for our one and only use case (AutocompletePlugin) where private node data is required. Instead, the recommended approach for now is to use a DecoratorNode.
    3. We deprecated the Grid API. The future of the Grid API is uncertain but if there's something we know is that it isn't a good fit in the lexical package, it serves a very specific use case and it's redundant for plain text.
    4. Killed isTopElement in favor for isInline on ElementNodes to reflect what they do better.
    5. And some more (see [0.5] prefixed in the list below).

    Lots of bugfixes

    • Formatting, composition, MD, etc. (see changelog below for a complete list).

    Release automation: nightly releases

    We listened to your (mostly Discord) feedback, you want to have the latest, more frequently, especially when some of you are heavily involved into the development and growth of the Lexical framework.

    The reality is, we didn't choose to postpone releases for 2 weeks. It has mostly been a lack of automation and making sure we bundle breaking API changes to avoid developer churn.

    We know that there's no one-size-fits-all when it comes to developers, and that's why we want to offer different ways to play with the library, what we have now, a slow-ish but less time-consuming (for you) release cycle but also offer nightly releases that would happen automatically once per day and would include the very latest of the development.

    The work is still under development but we plan to start this soon, stay tuned!

    Changelog

    • Fix bug where transforms are inherited by nested editors by @trueadm in https://github.com/facebook/lexical/pull/2947
    • Add an experimental Table component in React by @trueadm in https://github.com/facebook/lexical/pull/2929
    • Fix Changelog by @acywatson in https://github.com/facebook/lexical/pull/2956
    • Add table cell menu back by @tylerjbainbridge in https://github.com/facebook/lexical/pull/2958
    • Fix Flow Type by @acywatson in https://github.com/facebook/lexical/pull/2957
    • fix typo on read-mode / edit-mode page by @digitalgopnik in https://github.com/facebook/lexical/pull/2962
    • Fix link breaking when formatting on by @pgmccullough in https://github.com/facebook/lexical/pull/2954
    • feat: allow escaped markdown within TextFormatTransformer by @digitalgopnik in https://github.com/facebook/lexical/pull/2964
    • Fix bugs with isEditable by @trueadm in https://github.com/facebook/lexical/pull/2967
    • Add empty comment in front of 'export' in a bundled file by @fantactuka in https://github.com/facebook/lexical/pull/2970
    • Automated releases by @acywatson in https://github.com/facebook/lexical/pull/2949
    • Update collab errors, related cleanup by @fantactuka in https://github.com/facebook/lexical/pull/2971
    • Add npm install step by @acywatson in https://github.com/facebook/lexical/pull/2972
    • Improve docs around the React plugins page by @trueadm in https://github.com/facebook/lexical/pull/2976
    • Set up Git config by @acywatson in https://github.com/facebook/lexical/pull/2977
    • Clean up redundant newlines during pasting by @fantactuka in https://github.com/facebook/lexical/pull/2969
    • Push config by @acywatson in https://github.com/facebook/lexical/pull/2979
    • Fix versioning for ff merge by @acywatson in https://github.com/facebook/lexical/pull/2983
    • Remove ff merge from release by @acywatson in https://github.com/facebook/lexical/pull/2984
    • Fixed exportDOM for paragraph node by @zifahm in https://github.com/facebook/lexical/pull/2981
    • docs: Fix URL of rich-text and plain-text by @kimulaco in https://github.com/facebook/lexical/pull/2985
    • docs: loadContent clarification by @ly3xqhl8g9 in https://github.com/facebook/lexical/pull/2989
    • Fix Insert Column Header Bug by @tylerjbainbridge in https://github.com/facebook/lexical/pull/2995
    • Fix WWW import rewrite for React by @zurfyx in https://github.com/facebook/lexical/pull/2996
    • Fix www exports by @fantactuka in https://github.com/facebook/lexical/pull/2994
    • [Automated Releases] Add logging and dry run to release script by @acywatson in https://github.com/facebook/lexical/pull/2986
    • [0.5] Add DEPRECATED prefix to Grid APIs by @trueadm in https://github.com/facebook/lexical/pull/2966
    • Rm unused helpers from older markdown code by @fantactuka in https://github.com/facebook/lexical/pull/2998
    • ElementNode -> isTopLevel() by @zurfyx in https://github.com/facebook/lexical/pull/3001
    • Capture pendingDecorators after garbage collecting detached decorators by @adri1wald in https://github.com/facebook/lexical/pull/2999
    • Fix bad TypeaheadMenuPlugin prod build by @zurfyx in https://github.com/facebook/lexical/pull/3003
    • Fix $insertTableColumn flow type by @zurfyx in https://github.com/facebook/lexical/pull/3005
    • Trim content for newlines only by @fantactuka in https://github.com/facebook/lexical/pull/3006
    • Strengthen RangeSelection dirty toggle by @trueadm in https://github.com/facebook/lexical/pull/3007
    • add install step to release workflow by @acywatson in https://github.com/facebook/lexical/pull/3008
    • Revert md changes from #3001 by @fantactuka in https://github.com/facebook/lexical/pull/3015
    • [0.5] Correct definition of isTopLevel; introduce DecoratorNode->isInline, ElementNode->isShadowRoot by @zurfyx in https://github.com/facebook/lexical/pull/3009
    • [0.5] Remove INERT mode by @zurfyx in https://github.com/facebook/lexical/pull/2421
    • Add FAQ re: clearing editor by @acywatson in https://github.com/facebook/lexical/pull/3019
    • $insertNodes: Selection-agnostic node insertion with Grid/Node selection support by @zurfyx in https://github.com/facebook/lexical/pull/2638
    • Fix code highlighter race condition on transform by @zurfyx in https://github.com/facebook/lexical/pull/3014
    • [0.5] Revise usage of root node vs shadow by @zurfyx in https://github.com/facebook/lexical/pull/3022
    • getStyleObjectFromCSS to compute when cache miss by @zurfyx in https://github.com/facebook/lexical/pull/3024
    • [0.5] $wrapLeafNodesInElements -> $wrapNodes by @zurfyx in https://github.com/facebook/lexical/pull/3020
    • [0.5] Treat undefined selection the same as null in $generateNodesFromHtml by @acywatson in https://github.com/facebook/lexical/pull/2948
    • Add optional cursors container prop for a better positioning in scrollable layouts by @fantactuka in https://github.com/facebook/lexical/pull/3025
    • [0.5] Make $canShowPlaceholder isEditable mandatory by @zurfyx in https://github.com/facebook/lexical/pull/3030
    • [0.5] Remove initialEditorState from Plain/RichTextPlugin by @zurfyx in https://github.com/facebook/lexical/pull/3032
    • [0.5] Remove deprecated initialEditorState from OnChangePlugin by @zurfyx in https://github.com/facebook/lexical/pull/3031
    • feat(lexical-react): add initialEditorState for LexicalCollaborationPlugin by @strdr4605 in https://github.com/facebook/lexical/pull/3011
    • Update collab docs by @fantactuka in https://github.com/facebook/lexical/pull/3033
    • Add position property to menus & disable floating link toolbar for autolink nodes by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3035
    • Fix nested mark creation when wrapping forward selection by @knpwrs in https://github.com/facebook/lexical/pull/3027
    • Fix composition text boundary for canInsertTextAfter by @zurfyx in https://github.com/facebook/lexical/pull/3045
    • Revise Vite compression by @zurfyx in https://github.com/facebook/lexical/pull/3036
    • Fix (Known) Table Bugs by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3000
    • Add Selection View in DevTools by @noi5e in https://github.com/facebook/lexical/pull/2955
    • Fix initialEditorState flow by @zurfyx in https://github.com/facebook/lexical/pull/3048
    • Improve table selection handling when there are no siblings by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3051
    • Refine Typeahead isOpen logic. by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3052
    • Fix Table Deletion by @tylerjbainbridge in https://github.com/facebook/lexical/pull/3053
    • Dispatch CAN_{REDO,UNDO}_COMMAND after clearing history by @wilbertom in https://github.com/facebook/lexical/pull/3056
    • feat(lexical-playground): draggable block by @LuciNyan in https://github.com/facebook/lexical/pull/2860
    • feat: add export/import DOM for horizontal rule node by @samuelmartineau in https://github.com/facebook/lexical/pull/3057
    • v0.5.0 by @zurfyx in https://github.com/facebook/lexical/pull/3059

    New Contributors

    • @pgmccullough made their first contribution in https://github.com/facebook/lexical/pull/2954
    • @zifahm made their first contribution in https://github.com/facebook/lexical/pull/2981
    • @kimulaco made their first contribution in https://github.com/facebook/lexical/pull/2985
    • @ly3xqhl8g9 made their first contribution in https://github.com/facebook/lexical/pull/2989
    • @adri1wald made their first contribution in https://github.com/facebook/lexical/pull/2999
    • @strdr4605 made their first contribution in https://github.com/facebook/lexical/pull/3011
    • @knpwrs made their first contribution in https://github.com/facebook/lexical/pull/3027
    • @wilbertom made their first contribution in https://github.com/facebook/lexical/pull/3056

    Full Changelog: https://github.com/facebook/lexical/compare/v0.4.1...v0.5.0


    Thank you open-source community for your help shaping this brand new release, either via direct PR contributions, feedback or bug reports!

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Sep 4, 2022)

    Breaking Changes

    Renamed isReadOnly API to isEditable

    editor.isReadyOnly -> editor.isEditable() editor.setReadyOnly -> editor.setEditable() editor.registerReadOnlyListener -> editor.registerEditableListener() editor config { readOnly: true } -> { editable: boolean }

    https://github.com/facebook/lexical/pull/2912

    Markdown Transformers Require Dependencies

    The "dependencies" property is now required for custom markdown Element and TextMatch Transformers. It takes an array of LexicalNode subclasses and asserts that they're available in the editor when transforms are registered.

    https://github.com/facebook/lexical/pull/2910

    Selection Updates when isEditable is false (previous ReadOnly mode)

    Lexical will now track and update selection in response to DOM selectionchange events when editor.isEditable is false. This is necessary for enabling some behavior such as commenting via marks, but may cause other indirect changes such as update listeners firing when they didn't previously.

    • Ensure editor states are cloned if read only (#2936) Dominic Gannaway
    • Prevent nested editor event duplication (#2935) Dominic Gannaway
    • Avoid preventing default for copy events when there is no selection (#2930) Dominic Gannaway
    • Non-Editable Mode Playground Improvements (#2927) Acy Watson
    • fix: do not import LexicalTypeaheadMenuPlugin from src folder (#2928) Eric Charles
    • Change read only mode API to editable mode (#2912) Dominic Gannaway
    • Fix typo (#2925) Tjaart van der Walt
    • Remove redundant readonly checks. (#2921) Acy Watson
    • allow selection in readonly mode (#2920) Acy Watson
    • Remove $getEditor (#2919) Dominic Gannaway
    • Use window of current default view (#2918) Dominic Gannaway
    • Fix bad CSS on content editable container (#2917) Dominic Gannaway
    • Ensure we only mutate a non-readonly editor state (#2915) Dominic Gannaway
    • Fix failing build (#2916) John Flockton
    • Read only validation server (#2899) Dominic Gannaway
    • Add serialized node type exports (#2914) Matthew Lin
    • Provide markdown plugin node dependencies (#2910) Dominic Gannaway
    • Fixed typo (#2908) Heesung Jang
    • Add Flow Types for AutoEmbedPlugin and TypeaheadPlugin (#2904) Tyler Bainbridge
    • Fix link pasting (#2903) Maksim Horbachevsky
    • Attempt transform of NodeSelection to RangeSelection on mouseDown (#2901) Gerard Rovira
    • chore: add e2e tests for maxlength plugin (#2478) Adithya Vardhan
    • Added sanitizer to FloatingLinkEditor (#2900) Heesung Jang
    • Rename website folder (#2902) John Flockton
    • remove unnecessary text append (#2898) John Flockton
    • Fix Lexical package main entry points (#2897) Dominic Gannaway
    • Fix overriding keyboard controls on internal decorator (#2895) Dominic Gannaway
    • Allow code highlighting to run without active selection (#2891) Maksim Horbachevsky
    • Fix editor content clipping bug (#2890) Dominic Gannaway
    • LexicalTypeaheadMenuPlugin - Increase priority for keyboard commands (#2885) Theo Tillberg
    • Remove redundant css property (#2888) Adam Kona
    • Playground: Fix collab connect/disconnect toggling (#2887) Maksim Horbachevsky
    • Improve heuristics around node selection and keyboard navigation (#2884) Dominic Gannaway
    • Don't merge history entries from different editors (#2873) Acy Watson
    • Exported DEFAULT_TRANSFORMERS array in react LexicalMarkdownShortcutPlugin (#2878) Kevin Ansfield
    • Replaced addTransform with registerNodeTransform in transforms doc (#2882) Kevin Ansfield
    • add example for additional nodes in plugin (#2879) Stefan Huber
    • add the corresponding import to react doc (#2881) Stefan Huber
    • Fix playground visual styling (#2876) Dominic Gannaway
    • chore(deps): bump minimist in /packages/lexical-website-new (#2744) dependabot[bot]
    • chore(deps): bump terser from 5.14.1 to 5.14.2 (#2869) dependabot[bot]
    • Change linebreak node handling in insertNodes (#2857) Acy Watson
    • Add some React Docs (#2858) Acy Watson
    • fix delete backward bug (#2870) Dominic Gannaway
    • add watch mode for auto-gen doc comments in dev (#2859) Acy Watson
    • Update package-lock.json (#2866) ANDRI H.U
    • Update package-lock.json (#2865) ANDRI H.U
    • Fix issue with emoji (#2853) John Flockton
    • Adjust Typeahead Styles (#2846) Tyler Bainbridge
    • revert inadvertent change (#2849) Acy Watson
    • Fix small type issue (#2847) John Flockton
    • Wider (#2848) John Flockton
    • Add autogenerated TypeDoc docs (#2837) Acy Watson
    • fix: set cursor grab when image can be dragged (#2831) 子瞻 Luci
    • fix(lexical-playground): two issues with scrolling-related scenarios (#2724) 子瞻 Luci
    • fix: add fallback for code formatting (#2833) Adithya Vardhan
    • rename local variables (#2840) Acy Watson
    • fix broken links in docs (#2839) Reid Barber
    • Fixing grammar on RootNode documentation (#2838) Aaron Freeland
    • fix: transfer format and indent info on wrap (#2832) Adithya Vardhan
    • fixed getStyleObjectFromRawCSS to handle css values with a colon (#2814) Hayden Warmington
    • Add Panel to Display Props for DevTools Nodes (#2803) Will

    New Contributors (THANK YOU!)

    • @dosatross made their first contribution in https://github.com/facebook/lexical/pull/2814
    • @afreeland made their first contribution in https://github.com/facebook/lexical/pull/2838
    • @reidbarber made their first contribution in https://github.com/facebook/lexical/pull/2839
    • @imhunterand made their first contribution in https://github.com/facebook/lexical/pull/2865
    • @dependabot made their first contribution in https://github.com/facebook/lexical/pull/2869
    • @signalwerk made their first contribution in https://github.com/facebook/lexical/pull/2881
    • @kevinansfield made their first contribution in https://github.com/facebook/lexical/pull/2882
    • @adamkona made their first contribution in https://github.com/facebook/lexical/pull/2888
    • @ttillberg made their first contribution in https://github.com/facebook/lexical/pull/2885
    • @heesungjang made their first contribution in https://github.com/facebook/lexical/pull/2900
    • @matthew-plusprogramming made their first contribution in https://github.com/facebook/lexical/pull/2914
    • @tjaartvanderWalt made their first contribution in https://github.com/facebook/lexical/pull/2925

    Full Changelog: https://github.com/facebook/lexical/compare/v0.3.9...v0.4.0

    Source code(tar.gz)
    Source code(zip)
  • v0.3.9(Aug 11, 2022)

    0.3.9 (August 11, 2022)

    Most notably:

    • Added playground Figma embed and AutoEmbed plugin
    • LinkNode target and rel support
    • Many bugfixes

    Commits:

    • No nullish LinkNode props (#2818) Gerard Rovira
    • Fix collapsed selection on links (#2817) Gerard Rovira
    • prevent button from submitting forms (#2811) Gerard Delmàs
    • Fixed flow return type for TableOfContents plugin (#2802) Karam Qaoud
    • Update editor-state.md (#2808) William Cary
    • Fix nested editors in collab (#2781) Dominic Gannaway
    • chore: add some declare global (#2804) 子瞻 Luci
    • Fix selection adjustment after text match transformer (#2795) Maksim Horbachevsky
    • Inject DevTools Script in Browser Extension (#2778) Will
    • Fix inserting nodes next to top level decorators (#2796) Maksim Horbachevsky
    • chore(auto-link-plugin): fix invariant message for node registration check (#2790) Eric Charles
    • Fixing comments list scrolling issue (#2789) Ebad
    • Fix internal build error (#2787) John Flockton
    • fix: dropdown icon css (#2786) Adithya Vardhan
    • chore: Move useCollaborationContext to dedicated file (#2777) Thomas Sauques
    • chore(lexical-playground): typos, improved build (#2780) Yaroslav Kiliba
    • make importJSON static in test node (#2784) Acy Watson
    • fix(lexical): ts expect error (#2776) 子瞻 Luci
    • Fix documentation typos (#2774) Lyle Denman
    • fix: Single anchor element per LexicalTypeaheadMenuPlugin instance (#2768) Thomas Sauques
    • Node/GridSelection docs (#2773) Gerard Rovira
    • Add Figma Embed to Playground (#2705) Tyler Bainbridge
    • Selection#formatText to retain selection and handle all text nodes (#2770) Maksim Horbachevsky
    • Fixed scrolling bar view (#2772) Karam Qaoud
    • Add LexicalAutoEmbedPlugin and (Playground)AutoEmbedPlugin. (#2704) Tyler Bainbridge
    • Bug: Undo command after creating a Quote removes text after Quote element (https://github.com/facebook/lexical/issues/2750) (#2767) Alexandru Pavaloi
    • Handle insertTranspose for beforeinput event (#2764) Maksim Horbachevsky
    • Fix selection format for empty paragraphs (#2759) Maksim Horbachevsky
    • Remove unused keys from evens and utils (#2763) John Flockton
    • chore: fix aria-label typo (#2762) 子瞻 Luci
    • feat: Replace select with dropdown for code (#2761) 子瞻 Luci
    • Fix typo in community page (#2760) Joshua Chen
    • Add initial editor state for collab example (#2749) Maksim Horbachevsky
    • Table of contents style improvements (#2743) Karam Qaoud
    • Highlight DOM Nodes onHover of Lexical DevTools Node (#2728) Will
    • Tighten check on top level decorator nodes (#2746) John Flockton
    • Remove unused markdown functions (#2747) John Flockton
    • feat: Replace select with dropdown for font size and font family (#2441) Adithya Vardhan
    • fix: Verify if there are text nodes before continue (#2616) Nahuel Veron
    • Convert pasted Google Docs Title text into a Heading (#2729) Acy Watson
    • Remove isCollapsed from selection onClick (#2727) John Flockton
    • fix: cross button css in poll node (#2742) Adithya Vardhan
    • fix: getTopLevelElement for decoratorNode (#2741) Adithya Vardhan
    • fix: timeoutId type (#2735) Shanmughapriyan S
    • fix: some typo (#2737) 子瞻 Luci
    • docs: readme improvements (#2734) GJunior
    • Bug: typo in Documentation. It should be ReactNode instead of React (https://github.com/facebook/lexical/issues/2731) (#2732) Alexandru Pavaloi
    • Added table of contents documentation (#2720) Karam Qaoud
    • Fix: Minor Typo on Lexical Playground ActionsPlugin (#2717) Yamil García Hernández
    • Excalidraw fixes (#2711) John Flockton
    • Resolve selection for orphan selected children (#2677) Gerard Rovira
    • feat(lexical-playground): prettier code (#2688) 子瞻 Luci
    • Revert "Add E2E test for TableOfContentsPlugin (#2675)" (#2708) Gerard Rovira
    • Add E2E test for TableOfContentsPlugin (#2675) Karam Qaoud
    • OnChangePlugin ignoreInitialChange -> ignoreHistoryMergeTagChange (#2706) Gerard Rovira
    • feat: Link node with target and rel (#2687) Andriy Chemerynskiy
    • fix: check if options are empty (#2701) Adithya Vardhan
    • Remove coverage reports (#2699) John Flockton
    • Make includeHeaders a boolean (#2697) alinamusuroi
    • fix(playground): fix rendering Exclidraw (#2694) Bryan
    • Collapse and Expand DevTools Tree Nodes (#2679) Will
    • fix(lexical-playground): LexicalTypeaheadMenuPlugin import (#2689) Elvin Dzhavadov
    • Fix VALID_TWITTER_URL to allow underscores. (#2690) hiraoka
    • fix: path to icons (#2683) Adithya Vardhan
    • Fixed typo (#2678) SalvadorLekan
    • Separate @lexical/code into more atomic modules (#2673) John Flockton
    • fix(lexical-list): remove list breaks if selection in empty (#2672) 子瞻 Luci
    • Conditionally utilize startTransition if it's present (#2676) Jack Hanford
    • chore(lexical-playground): make directory clear (#2674) 子瞻 Luci
    Source code(tar.gz)
    Source code(zip)
  • v0.3.8(Jul 21, 2022)

    0.3.8 (July 20, 2022)

    Lots of bug fixes.

    Introduces TypeaheadPlugin and associated primitives, which consolidate the implementation of all such functionality (mentions and component picker) and create a base to build similar typeahead functionality from.

    Introduces TableOfContents plugin for easier navigation of long-form documents. Available in the playground in the settings menu (bottom-left corner).

    Introduces a "clipboard viewer" functionality in the local dev environment. When active, it shows the clipboard content the last time the paste event was fired with the editor focused.

    • Remove default styling imports on HTML paste (#2663) Acy Watson
    • fix(lexical-playground): code lang display (#2658) 子瞻 Luci
    • chore(lexical-playground): remove files that should not be submitted (#2662) 子瞻 Luci
    • Selection.extract fix (#2620) Acy Watson
    • Specify the return type of getNearestNodeOfType. (#2651) hiraoka
    • Autolink default protocol (#2654) Gerard Rovira
    • fix(doc): RichTextPlugin placeholder (#2655) unvalley
    • fix(lexical): calculate range selection formatting (#2643) 子瞻 Luci
    • Add TableOfContentsPlugin (#2634) Karam Qaoud
    • Port ASCII State Tree to Browser Extension (#2625) Will
    • Fix markdown text matchers during md import (#2644) Maksim Horbachevsky
    • fix(lexical): Japanese IME issue (#2623) 子瞻 Luci
    • Remove comment box from footer (#2639) John Flockton
    • Delete doc from ydocMap on unmount. Fixes init on re-mount (#2637) Maksim Horbachevsky
    • feat: new way to delete comments and threads (#2570) Adithya Vardhan
    • Lexical Typeaheads (#2534) Tyler Bainbridge
    • Add $insertBlockNode (#2633) Gerard Rovira
    • Add seperate flag for if script had loaded (#2628) John Flockton
    • Fix Chrome types in Lexical DevTools (#2627) John Flockton
    • Capture the expected payload type in commands (#2537) Patrik Åkerstrand
    • fix unit test warning (#2618) Acy Watson
    • fix(lexical-playground): fix toolbar-item button style bug in safari (#2621) 子瞻 Luci
    • add docs (#2611) Acy Watson
    • Add default value for undefined case in markdown transformers (#2453) Noah Cook
    • Add PasteLog Plugin (#2609) Acy Watson
    • Fix pasting inline code blocks (#2607) Maksim Horbachevsky
    Source code(tar.gz)
    Source code(zip)
  • v0.3.7(Jul 7, 2022)

    0.3.7 (July 6, 2022)

    Lots of bug fixes and polish. Notably, the full text of minifed Lexical error codes can now be accessed via the Lexical website.

    • Update Browser Extension's Vite Config (#2540) Will
    • fix: import color and vertical align info from html string (#2571) Adithya Vardhan
    • Update PollNode.css (#2602) VelociRaptor
    • Update package names (#2599) Acy Watson
    • Ensure to call existing listeners only (not newly added ones) (#2573) Maksim Horbachevsky
    • Added dragend to list of rootElementEvents (#2598) stuartrobinson3007
    • Reverse MarkdownExport loop order to take TextMatchTransformers into account first (#2582) Lukas
    • Fetch Lexical State Tree in DevTools App (#2510) Will
    • chore: use keyboard shortcuts (#2580) Adithya Vardhan
    • fix prettier Gerard Rovira
    • Replace background images with pseudo classes to display checkboxes in playground (#2567) VelociRaptor
    • Customize default focus position (#2591) Gerard Rovira
    • Add missing dependencies (#2585) John Flockton
    • Website error codes - lexical.dev/error/<code> (#2574) Gerard Rovira
    • Use Vite server for E2E tests in CI (Fix windows CI failures) (#2584) Acy Watson
    • feat(lexical-playground): copy button for @lexical/code (#2396) 子瞻 Luci
    • fix: commenting issue after ts migration (#2558) Adithya Vardhan
    • npm run changelog (#2561) Gerard Rovira
    • fix: typo edtior to editor (#2560) Florent DUVEAU
    Source code(tar.gz)
    Source code(zip)
  • v0.3.6(Jun 29, 2022)

    0.3.6 (June 29, 2022)

    lexical & @lexical/ packages:

    • fix(lexical): Text with underline format is stripped out on paste (#2555) 子瞻 Luci
    • Trigger readonly listener only when value has changed (#2550) Maksim Horbachevsky
    • fix(lexical): deselecting a decorator node by clicking (#2554) 子瞻 Luci
    • Remove wordwrap for tree view (#2551) John Flockton
    • add docs for headless package (#2539) Acy Watson
    • Normalize list children (#2509) Acy Watson
    • Add ability to set format and detail by string type (#2547) John Flockton
    • Pasting multi-line plain text into rich-text mode produces separate paragraphs (#2507) Maksim Horbachevsky
    • Revert "Revert "fix: insert text after delete next to inline node (#2530)" (#2544)" (#2549) Gerard Rovira
    • Revert "fix: insert text after delete next to inline node (#2530)" (#2544) Gerard Rovira
    • fix: insert text after delete next to inline node (#2530) Patrik Åkerstrand
    • Fix IME bug in lexical-history (#2501) John Flockton
    • Export Klass from Lexical root (#2533) John Flockton
    • Hide placeholder when readonly (#2511) Gerard Rovira
    • remove utility types from all packages (#2529) John Flockton
    • Improve markdown newline export/import (#2519) Maksim Horbachevsky
    • Revisit formatText node selection (#2524) Gerard Rovira
    • Fix $generateHtmlFromNodes to output whole editor contents if selection is null (#2504) yicrotkd
    • Remove unnecessary comments (#2505) John Flockton
    • fix(lexical): "selection.format" is not set correctly (#2502) 子瞻 Luci
    • Fixed getStyleObjectFromRawCSS function to work with unformatted css (#2515) Karam Qaoud
    • Fix image copy+paste (#2517) Dominic Gannaway
    • Migrate to TS strict mode 6/n (#2496) John Flockton
    • fix(lexical): caret at wrong place when paste (#2465) 子瞻 Luci
    • Fix infinite recursion in insertText in RangeSelection (#2490) Patrik Åkerstrand
    • Update error message and docs (#2492) John Flockton
    • Migrate to TS strict mode 5/n (#2488) John Flockton
    • Fix composition bugs affecting intern (#2487) John Flockton
    • Fix FF issue with composition (#2486) Dominic Gannaway
    • Migrate to TS strict mode 3/n (#2482) John Flockton
    • Fix Flow rewrite imports script (#2477) John Flockton
    • Migrate to TS strict mode 2/n (#2469) John Flockton
    • Inserting inline elements (#2474) Maksim Horbachevsky
    • Fix component/plugin names in get started section (#2472) Aleš Menzel
    • Revert "add e2e tests for MaxLength plugin (#2466)" (#2467) Gerard Rovira
    • add e2e tests for MaxLength plugin (#2466) Adithya Vardhan
    • Fix can format backwards when at first text node boundary (#2445) Gerard Rovira
    • Fix button--outline hover color dark mode (#2462) M. Zakiyuddin Munziri
    • Migrate to TS strict mode 1/n (#2458) John Flockton
    • renamed character styles popup plugin (#2456) Strek

    Playground:

    • Flower size (#2527) Gerard Rovira
    • fix(lexical-playground): Resizing is not consistent on mobile (#2518) 子瞻 Luci
    • fix(lexical-playground): Floating toolbar displayed on composition (#2506) 子瞻 Luci
    • chore(lexical-playground): remove redundant code (#2497) 子瞻 Luci

    Docs:

    • add docs for headless package (#2539) Acy Watson
    • tiny typo fix (#2514) Hadi El-Yakhni

    Infra:

    • Update e2e test docs and run-all script (#2522) yicrotkd
    • Fix Windows CI Runs (#2513) Acy Watson
    • Deploy Lexical prod build to Vercel (#2476) Gerard Rovira
    • CI check against prod bundle (#2460) Gerard Rovira
    • shared PKG to cleanup (#2463) Gerard Rovira
    Source code(tar.gz)
    Source code(zip)
  • v0.3.5(Jun 16, 2022)

  • v0.3.3(Jun 10, 2022)

    • Add stringified LexicalNodes to clipboard for lossless Lexical <-> Lexical copy and paste. (#2370)
    • Fix bad target issue for backspace/delete (#2375)
    • Improve nested editor propagation (#2367)
    • Fix scrolling issues due to browser rounding bugs (#2350)
    • Code cleanup, type definition and docs improvements

    Playground

    • Autocomplete v2 (#2343)
    • Add collaboration support for commenting (#2376)
    Source code(tar.gz)
    Source code(zip)
Owner
Meta
We are working to build community through open source technology. NB: members must have two-factor auth.
Meta
A jquery plugin that allows an html page to be converted and/or downloaded into a Microsoft Word Document with an emphasis on performance

googoose A jquery plugin that allows an html page to be converted and/or downloaded into a Microsoft Word Document with an emphasis on performance Abo

Aaron Adel 32 Jan 3, 2023
Functions and objects that make it easier to add fields to Portable Text editors for accessibility meta information, like language changes or abbreviations.

Porta11y Porta11y is a collection of accessibility-focused annotations, decorators and validators for Sanity’s Portable Text editor. Portable Text is

Hidde de Vries 21 Aug 25, 2022
A lexical analyzer based on DFA that made by JS and supports multi-language extension

lexer 一个基于DFA法的支持多语言扩展的JS版开源词法分析器,快速了解与体验请查看线上网站 It is a lexical analyzer based on DFA that made by JS and supports multi-language extension. For quic

null 273 Dec 21, 2022
Pintora is an extensible javascript text-to-diagrams library that works in both browser and Node.js.

Pintora Documentation | Live Editor Pintora is an extensible javascript text-to-diagrams library that works in both browser and Node.js. Expressing yo

hikerpig 652 Dec 30, 2022
Powerful rich text editor using Vue.js and Quill. About @quilljs editor component for @vuejs

quill-vuejs Quill editor component for Vue. 基于 Quill、适用于 Vue 的富文本编辑器,支持服务端渲染和单页应用。 Preview Example CDN example page Component example page Install NPM

Chi Zhang 10 Aug 10, 2022
A library that helps you write a static dropdown menu that follows the digital accessibility recommendations.

JSPanel A library that helps you write a static dropdown menu, a panel, that follows the digital accessibility recommendations. Get started First of a

CodoPixel 1 Apr 29, 2021
Meogic-tab-manager is an extensible, headless JavaScript tab manager framework.

MeogicTabManager English document MeogicTabManager是一个有可拓展性的、headless的JavaScript标签页管理框架。 MeogicTabManager旨在提供可自由组装页面框架、自定义页面组件、甚至覆盖框架自带事件响应的开发体验。 Meogi

meogic-tech 5 Oct 8, 2022
LogTure - A minimal designed, fully customizable, and extensible modern personal blogging framework, built with Nextjs.

LogTure - A minimal designed, fully customizable, and extensible modern personal blogging framework, built with Nextjs.

Sam Zhang 14 Aug 26, 2022
Simple and Extensible Markdown Parser for Svelte, however its simplicity can be extended to any framework.

svelte-simple-markdown This is a fork of Simple-Markdown, modified to target Svelte, however due to separating the parsing and outputting steps, it ca

Dave Caruso 3 May 22, 2022
A powerful, extensible, customizable & rapidly develop hacking framework.

YourN3xt(Beta) A powerful, extensible, customizable & rapidly develop hacking framework. Installations Github: https://github.com/OTAKKATO/YourN3xt N

OTAK 4 Nov 21, 2022
A simple web text editor which can export HTML

Rich Text Editor A simple web text editor which can export HTML Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About Th

JuSoft 1 Apr 8, 2022
writer.js is a simple text editor in the web

✍ writer.js writer.js is a simple text editor in the web ❓ About writer.js: This is a simple and lightweight editor for the web demo: https://alirezak

alireza kefayati 9 Sep 29, 2022
🚀 The web-based text editor for everyone built with Electron & React.

?? The web-based text editor for everyone built with Electron & React. Next release | Current release | Documentation (soon) ⬇️ Download: Windows (x64

Pablo Hdez 5 Sep 16, 2022
Complete, flexible, extensible and easy to use page transition library for your static web.

We're looking for maintainers! Complete, flexible, extensible and easy to use page transition library for your static web. Here's what's new in v2. Ch

null 3.7k Jan 2, 2023
A flexible and extensible javascript library for letters animation simulations.

LetterLoading LetterLoading js is a javascript library for making awesome letter simulations. It default simulation is a letter loading simulation. Co

kelvinsekx 5 Mar 22, 2022
Replaces the default Strapi WYSIWYG editor with a customized build of CKEditor 5 html editor packed with useful plugins.

CKEditor 5 for Strapi Replaces the default Strapi WYSIWYG editor with a customized build of CKEditor 5 packed with useful plugins. ?? Get Started Feat

null 39 Jan 2, 2023
Triumph Tech’s Magnus Editor is a full-featured remote editor for Rock RMS.

Magnus Visual Studio Code Editor for Rock RMS Triumph Tech’s Magnus Editor is a full-featured remote editor for Rock RMS. Rock RMS is an open source R

Triumph Tech 8 Nov 23, 2022
Obsidian plugin: Type text shortcuts that expand into javascript generated text.

Obsidian Plugin - Text Expander JS (open beta) This Obsidian plugin allows the user to type text shortcuts that are replaced by (or "expanded into") j

Jon Heard 79 Dec 27, 2022
A lightweight JavaScript library that renders text in a brilliant style by displaying strings of random characters before the actual text.

cryptoWriter.js A lightweight javascript library which creates brilliant text animation by rendering strings of random characters before the actual te

Keshav Bajaj 2 Sep 13, 2022