Releases: facebook/lexical
v0.38.2
v0.38.2 is a patch release to fix a regression in yjs cursor position awareness (#7960). It also includes another fix for a Markdown issue.
Highlights
React:
- ✅ #7960 Fix: update cursor positions on awareness update in collab v1
Markdown:
- ✅ #7958 Fix markdown formatting when a backslash is before or after a closing backtick
What's Changed
- v0.38.1 by @etrepum in #7951
- Update examples for v0.38.1 by @etrepum in #7952
- Update codeowners by @zurfyx in #7957
- [lexical-markdown] Code backslash fix by @MarekKuncik in #7958
- [lexical-react] Fix: update cursor positions on awareness update in collab v1 by @james-atticus in #7960
Full Changelog: v0.38.1...v0.38.2
v0.38.1
v0.38.1 is an monthly release with a lot of fixes and a few potentially breaking changes (this is a re-publish of v0.38.0, which had problems during initial npm publish).
Breaking Changes
#7926 Static transforms from superclasses are always applied
Before $config there was a limited amount of "automatic" re-use of the static transform by subclasses, because class inheritance also inherits static methods, so you get the implementation of whatever static transform method was in the superclass if it wasn't overridden.
Now the application of these static transforms (whether by method or $config) is implicit. There is no need to call super if adding an additional transform. The implementation walks up the inheritance tree by $config extends or Object.getPrototypeOf and will register all transforms it finds.
#7936 Extension configuration for CodeHighlighterShikiExtension has been flattened
If you are using CodeHighlighterShikiExtension the configuration has changed.
Before:
configExtension(CodeHighlighterShikiExtension, {tokenizer: {...ShikiTokenizer, defaultTheme: …})After:
configExtension(CodeHighlighterShikiExtension, {defaultTheme: …})#7933 LexicalTableSelectionHelpers listener priorities lowered to HIGH from CRITICAL
This is unlikely to break most applications but the priority of these command listeners has been lowered to allow them to be overridden.
Highlights
Core:
- ✅ #7926 Apply static transform and $config $transform from all superclasses (fixes ListNode/ListItemNode subclassing)
- ✅ #7941 Retain lexical selection during updates on unfocused editors
- ✅ #7947 Update block cursor if selection has changed
Extension:
- 🆕 #7930 Allow nodes config to be deferred for circular dependency reasons
⚠️ #7936 Implement mergeConfig for LinkExtension and flatten config for CodeHighlighterShikiExtension
List:
- 🆕 #7946 importDOM support for joplin checklists
Table:
⚠️ #7933 Lower table handler command priority
Clipboard:
- ✅ #7942 Log exceptions in clipboard paste handlers
Link:
- 🆕 #7944 Enable Selective Removal Within Linked Text
React:
- ✅ #7935 Add getServerSnapshot for improved RSC compatibility
Collab v2:
- ✅ #7922 Skip elements that were added and removed between snapshots
Code:
- ✅ #7921 Respect RTL when moving to line start/end in code blocks
Markdown:
- ✅ #7812 Fix bugs in normalizeMarkdown when using shouldMergeAdjacentLines
- ✅ #7923 Prevent markdown links with empty strings from being automatically removed
- ✅ #7928 Fix implicit checklist marker export regression
Playground:
- ✅ #7920 Fix image caption overflow
Examples:
- 🧹 #7939 Remove workaround from svelte example
Documentation:
- 🧹 #7931 Update docusaurus and contributing docs
What's Changed
- v0.37.0 by @etrepum in #7910
- Update examples for v0.37.0 by @etrepum in #7911
- [Documentation] Chore: Update bounty program link in CONTRIBUTING.md by @mustkem in #7915
- [lexical-yjs] Fix: skip elements that were added and removed between snapshots by @james-atticus in #7922
- [lexical-code] Bug Fix: Respect RTL when moving to line start/end in code blocks by @ashmod in #7921
- [lexical-markdown] Fix: bugs in normalizeMarkdown by @GermanJablo in #7812
- [lexical-playground] Bug Fix: Fix image caption overflow issue by @ritoban23 in #7920
- [lexical-markdown] Bug Fix: Prevent Markdown links with empty string link text from being automatically removed by @adambolcsfoldi in #7923
- [lexical-website] Chore: Update docusuarus and add contributing docs by @etrepum in #7931
- [lexical-markdown] Bug Fix: Fix implicit checklist marker export regression by @etrepum in #7928
- [lexical][lexical-list] Bug Fix: Apply static transform and $config $transform from all superclasses by @etrepum in #7926
- [lexical-extension] Feature: Allow nodes config to be deferred for circular dependency reasons by @etrepum in #7930
- [lexical-website] Documentation Update: change setText to setTextContent by @bbertold in #7932
- [lexical-react] Bug Fix: Add getServerSnapshot for RSC compatibility by @nestarz in #7935
- [lexical-link][lexical-code-shiki][examples] Feature: Implement mergeConfig for LinkExtension and flatten config for CodeHighlighterShikiExtension by @etrepum in #7936
- [lexical-table] Chore: Lower table handler command priority by @patrick-atticus in #7933
- [lexical] Bug Fix: retain selection during updates on unfocused editor by @fantactuka in #7941
- [lexical-clipboard] Bug Fix: Log exceptions in clipboard paste handler by @niikkhilsharma in #7942
- [lexical-link] Feature: Enable Selective Removal Within Linked Text by @normtronics in #7944
- [lexical] Bug Fix: update block cursor if selection has changed by @fantactuka in #7947
- [lexical-list] Bug Fix: fix pasting checklist from joplin by @antsgar in #7946
- [examples] Chore: Remove #7859 workaround from svelte example by @etrepum in #7939
New Contributors
- @mustkem made their first contribution in #7915
- @ashmod made their first contribution in #7921
- @ritoban23 made their first contribution in #7920
- @adambolcsfoldi made their first contribution in #7923
- @bbertold made their first contribution in #7932
- @nestarz made their first contribution in #7935
- @normtronics made their first contribution in #7944
- @antsgar made their first contribution in #7946
Full Changelog: v0.37.0...v0.38.1
v0.37.0
v0.37.0 is an ad-hoc release, primarily to update the happy-dom dependency to address a CVE (#7909 - lexical's usage of this package was not susceptible) but also includes several bug fixes. This was marked as a minor release because it includes an experimental collab v2 implementation which is not yet ready for use (see #7616 #7903)
Highlights
Core:
- #7900 ✅ Fix
$cloneWithPropertiesso that it doesn't throw an exception when used in read-only mode - #7904 🆕 Add new (internal) ephemeral node concept for situations where a cloned node is intentionally decoupled from the editor state for mutations that will only have a local effect
Examples:
- 🆕 #7879 New sveltekit ssr example demonstrating the use of @lexical/headless/dom
React:
- ✅ #7899 LexicalMenu guard against undefined option when list shrinks
Collab:
List
- 🆕 #7892 Keep list marker for markdown round-trip
Rich Text:
- ✅ #7902 Fix up/down arrows for node selection
Clipboard/Playground:
- ✅ #7900 ImageNode caption support for exportDOM and importDOM
- ✅ #7906 Export ParagraphNode as div role="paragraph" when it contains block DOM (such as the
<figure>from ImageNode captions)
Headless
- 🧹 #7909 Update to happy-dom v20 to address CVE reports (lexical's usage was not susceptible)
What's Changed
- v0.36.2 by @etrepum in #7894
- Update examples for v0.36.2 by @etrepum in #7896
- [examples] Feature: sveltekit ssr example by @etrepum in #7879
- [lexical-react] Bug Fix: LexicalMenu guard against undefined option when list shrinks by @MRADULTRIPATHI in #7899
- [lexical-yjs][lexical-react] Feature: initial implementation of collab v2 by @james-atticus in #7616
- [lexical-list][lexical-markdown] Feature: Keep list marker for markdown round-trip by @lytion in #7892
- [lexical-rich-text] Bug fix: up/down arrows for node selection by @fantactuka in #7902
- [lexical][lexical-clipboard][lexical-playground] Feature: ImageNode caption support for exportDOM and importDOM by @Kepron in #7900
- [lexical-yjs][lexical-react] Feature: commands for diffing two yjs snapshots in collab v2 by @james-atticus in #7903
- [lexical][lexical-clipboard][lexical-html][lexical-selection] Feature: Add an internal ephemeral node concept by @etrepum in #7904
- [lexical-playground] Bug Fix: Export ParagraphNode as div role="paragraph" when it contains block DOM by @etrepum in #7906
- [lexical-react] Chore: make __shouldBootstrapUnsafe prop optional by @james-atticus in #7907
- [lexical-yjs] Chore: fix imports of Yjs XML types by @james-atticus in #7908
- [lexical-headless] Chore: Update to happy-dom v20 by @etrepum in #7909
New Contributors
- @MRADULTRIPATHI made their first contribution in #7899
- @Kepron made their first contribution in #7900
Full Changelog: v0.36.2...v0.37.0
v0.36.2
v0.36.2 is a bug fix release, primarily to fix a problem with the @lexical/headless package.json that prevented the new @lexical/headless/dom from being used as designed. It also includes several improvements and bug fixes such as the new SKIP_SELECTION_FOCUS_TAG.
Highlights
Core:
- 🆕 #7804 New
SKIP_SELECTION_FOCUS_TAGto allow the update to set the DOM selection but not automatically ensure that the root element is focused - 🧹 #7870 devInvariant should warn in prod even if not in codes.json (only relevant for unreleased versions, npm releases, even nightly ones, have an up to date codes.json)
Clipboard:
- ✅ #7880 Copying from a collapsed selection no longer updates the clipboard (consistent with the browser's default behavior and other applications)
Markdown:
- ✅ #7890 Ensure First Match is Used in
importTextMatchTransformer
Table: - ✅ #7864 Handle accessing table selection following table deletion
Playground: - ✅ #7804 Improve focus management in toolbar DOM
- ✅ #7847 Table add-row button no longer hides horizontal scroll
React:
- ✅ #7843 Ensure selection listeners cleaned up from original owner document
HTML:
- 🆕 #7859
$generateNodesFromDOMnow accepts anyParentNode(not justDocument) as input
Headless:
Docs:
- 🆕 #7830 Add example for how to bootstrap collab ydoc on the server
- 🆕 #7893 Export DOMConversion* types so that they are in the docs
- 🧹 #7881 Update to docusaurus v3.9.1
What's Changed
- v0.36.1 by @etrepum in #7871
- [*] Bug Fix: devInvariant should warn in prod even if not in codes.json by @etrepum in #7870
- [lexical-website] Chore: add example for how to bootstrap collab ydoc on the server by @james-atticus in #7830
- [lexical-playground] Bug Fix: Table add-row button no longer hides horizontal scroll by @niikkhilsharma in #7847
- Update examples for v0.36.1 by @etrepum in #7872
- [lexical-headless] Bug Fix: Fix types for @lexical/headless/dom and simplify npmToWwwName workaround by @etrepum in #7873
- [lexical-table] Bug Fix: Handle accessing table selection following table deletion by @patrick-atticus in #7864
- [lexical-headless][lexical-html] Bug Fix: Fix entrypoint for @lexical/headless/dom and generalize $generateNodesFromDOM by @etrepum in #7859
- [lexical-website] Chore: Update to docusaurus v3.9.1 by @etrepum in #7881
- [lexical-clipboard] Preventing copying empty string by @niikkhilsharma in #7880
- [lexical-react] Fix: ensure selection listeners cleaned up from original owner document by @james-atticus in #7843
- [lexical-markdown] Bug Fix: Ensure First Match is Used in
importTextMatchTransformerby @jkjk822 in #7890 - [docs] Chore: Export DOMConversion* types so that they are in the docs by @etrepum in #7893
- [lexical][lexical-playground] Feature: Improve focus management in Toolbar and adds SKIP_SELECTION_FOCUS_TAG by @KaiPrince in #7804
New Contributors
- @niikkhilsharma made their first contribution in #7847
- @KaiPrince made their first contribution in #7804
Full Changelog: v0.36.1...v0.36.2
v0.36.1
v0.36.1 is a major feature release with a new Lexical Extension API (#7706), some needed breaking changes to @lexical/yjs (#7816, #7818) and a bunch of bug fixes. We've also moved to React 19 (#7802) for all examples, tests, etc. although it should all still remain compatible with React 18 for now.
Breaking Changes
#7706 DecoratorNode
- Removed type requirement & warning for
DecoratorNodeto implementdecorate() - Widens type for
decorate(): Tto bedecorate(): null | Tas that's always how it worked in practice - the generic type here is unsafe and wrong anyway (e.g.$isDecoratorNodeis a cast to any typeT)
#7818 useCollaborationContext now requires that a context provider is used
Users of the CollaborationPlugin or useCollaborationContext must wrap the top-level LexicalComposer with a LexicalCollaboration component. For example:
<LexicalCollaboration>
<LexicalComposer initialConfig={initialConfig}>
<RichTextPlugin ... />
<CollaborationPlugin id="lexical-editor" ... />
</LexicalComposer>
<LexicalCollaboration>The collaboration context is shared for nested editors, so the provider must only be used on the top-level editor.
#7818 useCollaborationContext no longer has clientID
clientID has been removed from the collaboration context. This ID was unreliable as it could be updated by nested collab editors. Consumers should retrieve the client ID by looking up the correct document in the context's yjsDocMap, or switch to using a different ID.
Highlights
Extension:
- 🧪 #7706 New Lexical Extension API - what plugins should've been
Core:
- ✅ #7836 Fix cache coherency issue with
RangeSelection#extract - ✅ #7854 Account for Apple WebView in
setManagedLineBreak - 🧹 #7855
TabNode.setTextContentusesdevInvariantinstead ofinvariantfor a warning in prod - 🧹 #7821 Improve error message when a node is registered from a foreign lexical module
- 🧹 #7814 Consolidate ancestor lookup via findMatchingParent
Clipboard:
- ✅ #7835 Update Lexical Clipboard with Empty Selection
- ✅ #7822 Copy correct selection when editor in different window/document
List:
- ✅ #7805 Clear li checklist attributes when inserting nested list
Markdown:
- 🧹 #7832 Remove
MarkdownShortcuts.tsdependency onindex.ts
React:
⚠️ #7816 Breaking change: remove clientID from collab context⚠️ #7818 Breaking change: enforce use of collab context provider- ✅ #7844 Add visibility margin to isTriggerVisibleInNearestScrollContainer to prevent popover from wrongfully closing
- 🧹 #7802 #7803 Update from React 18 to React 19
Headless:
- 🧪 #7833
@lexical/headless/dommodule featuringwithDOMfunction to make SSR easier
Playground:
- ✅ #7786 DatetimeNode DOM updates
- 🗑️ #7839 Remove mostly redundant
InlineImageNodeandInlineImageNodePlugin
Internal:
- 🧹 #7766 #7810 Updated docusaurus and added local search index
- 🧹 #7834 Relocate internal eslint plugin to packages/lexical-eslint-plugin-internal
- 🧹 #7807 Port scripts unit tests to vitest and fix test include match pattern
What's Changed
- v0.35.0 by @etrepum in #7797
- [lexical-website] Chore: Update docusaurus-plugin-typedoc by @etrepum in #7766
- [examples] Chore: Update examples for v0.35.0 by @etrepum in #7799
- [lexical-playground] DatetimeNode DOM updates by @ivailop7 in #7786
- [lexical-list] Fix: updating list type to/from check type updates child DOM elements by @james-atticus in #7800
- [lexical-react] Fix: Use explicit key attr in NodeContextMenuPlugin by @etrepum in #7803
- [lexical-list] Fix: clear li checklist attributes when inserting nested list by @james-atticus in #7805
- [*] Chore: Port scripts unit tests to vitest and fix test include match pattern by @etrepum in #7807
- [lexical-website] Bug Fix: Replace broken algolia search with @easyops-cn/docusaurus-search-local by @etrepum in #7810
- [lexical-markdown] Update Flow types to match TypeScript by @takuyakanbr in #7813
- [lexical][lexical-selection][lexical-utils] Refactor: Consolidate ancestor lookup via findMatchingParent by @cnaples79 in #7814
- [lexical] Chore: Improve error message when a node is registered from a foreign lexical module by @etrepum in #7821
- [lexical-clipboard] Fix: copy correct selection when editor in different window/document by @james-atticus in #7822
- [lexical-yjs][lexical-playground] Breaking change: remove clientID from collab context by @james-atticus in #7816
- [lexical-react] Breaking change: enforce use of collab context provider by @james-atticus in #7818
- [lexical-markdown] Refactor: Remove MarkdownShortcuts.ts Dependency on index.ts by @jkjk822 in #7832
- [lexical-clipboard] Bug Fix: Update Lexical Clipboard with Empty Selection by @jkjk822 in #7835
- [*] Bug Fix: Relocate internal eslint plugin to packages/lexical-eslint-plugin-internal by @etrepum in #7834
- [lexical] Bug Fix: Fix cache coherency issue with
RangeSelection#extractby @jkjk822 in #7836 - [lexical-playground] Chore: remove InlineImageNode and InlineImagePlugun by @etrepum in #7839
- [lexical][lexical-react][lexical-playground] Chore: Update from React 18 to React 19 by @etrepum in #7802
- [lexical-react] Bug Fix: Add visibility margin to
isTriggerVisibleInNearestScrollContainerto prevent popover from wrongfully closing by @dwrth in #7844 - [lexical-react] Bug Fix: Include react-error-boundary and @floating-ui/react in WWW bundle by @etrepum in #7852
- [lexical][lexical-extension][*] Feature: Lexical Extension by @etrepum in #7706
- [lexical-extension][docs] Chore: Add @experimental to extension functions by @etrepum in #7853
- [lexical] Chore: Change TabNode.setTextContent invariant to devInvariant by @amanharwara in #7855
- [lexical-headless] Feature: @lexical/headless/dom module for easier SSR by @etrepum in #7833
- [*] Bug Fix: npmToWwwName ensures lexical prefix by @etrepum in #7857
- [lexical-headless] Bug Fix: Replace happy-dom with jsdom in www and map react-dom/client by @etrepum in #7858
- [lexical] Bug Fix: account for Apple WebView in
setManagedLineBreakby @elpnt in #7854 - v0.36.0 by @etrepum in #7861
- Make ref optional in ContentEditable flow by @zurfyx in #7866
- [*] Bug Fix: Update examples and fix package.json for v0.36.0 (will need a patch release) by @etrepum in #7867
- Expose LexicalCollaboration Context to flow by @zurfyx in #7868
New Contributors
- @cnaples79 made their first contribution in #7814
- @dwrth made their first contribution in #7844
- @elpnt made their first contribution in #7854
Full Changelog: v0.35.0...v0.36.1
v0.35.0
v0.35.0 is a monthly release with much improved RTL bidirectional text support (#7727) and several bug fixes
Breaking Changes
All of the breaking changes in this release are related to the improved RTL bidirectional text support in #7727
ltr and rtl theme CSS classes removed
ltr and rtl theme CSS classes are no longer added to DOM elements. If you have custom CSS to set text-align (or any other properties) for bidirectional text, this can be removed. You can target elements that have customized their dir by targeting the attr in CSS, for example:
[dir=rtl] { text-align: right; }$isParentElementRTL requires an active editor
$isParentElementRTL now relies on accessing the DOM to determine element direction, meaning there must be an active editor when calling the function. If you have code that calls $isParentElementRTL inside editorState.read(), you will need to pass in an editor argument. For example:
const isRTL = editorState.read(
() => {
const selection = $getSelection();
return $isRangeSelection(selection) && $isParentElementRTL(selection);
},
{editor}
);__dir property is synced to/from Yjs (again)
Prior to #7330, the text direction of nodes (as determined by the reconciler) was synced to Yjs, even though this value was ignored on other clients. This property is now used for any manually-set direction attribute on ElementNode.
If you have documents that were created prior to v0.30.0, the previously-reconciled direction will now be read and applied to nodes in the editor. This may lead to unexpected behaviour if, for example, your document contains a paragraph that contained RTL text but content changed to LTR in >= v0.30.0.
Highlights
Core:
- 🆕 #7727 Allow ElementNode direction to be overridden (RTL)
- ✅ #7772 Correct exit direction from decorator nodes in RTL
- ✅ #7794 Fix insert into existing paragraph node if selection is on parent element
Markdown:
React:
- ✅ #7757 Add $config $transform inheritance to LexicalNestedComposer
- ✅ #7778 Fix the context menu event listener element
Internal:
- 🧹 #7770 Update flow suppressions to use error code
- 🧹 #7785 flow-bin updated to 0.280.0
- 🧹 #7796 Replace jest with vitest for unit tests
What's Changed
- v0.34.0 monthly release by @etrepum in #7746
- Update examples for v0.34.0 by @etrepum in #7747
- [lexical-playground][examples] Refactor: remove redundant fragment by @noritaka1166 in #7755
- [lexical-react] Bug Fix: Add $config $transform inheritance to LexicalNestedComposer by @etrepum in #7757
- [lexical-playground] Refactor: remove unnecessary await in e2e test by @noritaka1166 in #7759
- [lexical-code-shiki] Refactor: remove unnecessary assertion by @noritaka1166 in #7762
- [lexical-playground][lexical-react][lexical-table] Refactor: remove unnecessary assertion by @noritaka1166 in #7761
- [lexical][lexical-code] Refactor: remove unnecessary assertion by @noritaka1166 in #7760
- [lexical] Feature: allow ElementNode direction to be overridden by @james-atticus in #7727
- [lexical-markdown] Formatted textmatch fix by @MarekKuncik in #7769
- [Chore] Update flow suppressions to use error code by @SamChou19815 in #7770
- [lexical-react] Fix the context menu event listener element by @ivailop7 in #7778
- [lexical] Bug Fix: Correct exit direction from decorator nodes in RTL by @noamzaks in #7772
- [lexical] Chore: Update flow-bin to 0.280.0 by @takuyakanbr in #7785
- [lexical] Fix: insert into existing paragraph node if selection is on parent element by @james-atticus in #7794
- [lexical-markdown] Bug Fix: Allow any characters in markdown link text by @lytion in #7735
- [lexical-history] Add Missing Argument for DispatchCommand in Undo/Redo Docs Example by @lithika-damnod in #7795
- [*] Chore: Replace jest with vitest for unit tests by @etrepum in #7796
New Contributors
- @MarekKuncik made their first contribution in #7769
- @lithika-damnod made their first contribution in #7795
Full Changelog: v0.34.0...v0.35.0
v0.34.0
v0.34.0 is a monthly release with several bug fixes and a new experimental Shiki based code highlighter engine for @lexical/code (the existing prismjs highlighter is still the default)
Highlights
Core:
- ✅ #7724 Fix trigger of reconciliation on nested editor.read
- ✅ #7725 Clamp DOM selection offsets to valid lexical TextNode offsets in
$internalResolveSelectionPoint
Code:
- 🆕 #7662 Experimental Shiki support for code highlighting
Selection:
- ✅ #7686 Correct backward inversion for RTL
Utils:
- ✅ #7737 Backwards selection was not being retained
React:
- ✅ #7705 Clean up old mouseup events from context menu
- 🆕 #7697 Context Menu icons
- ✅ #7723 Prevent race condition in CollaborationPlugin during rapid mount/unmount cycles
Playground:
- ✅ #7693 Image links lose link state when dragged
- 🆕 #7719 Parse font sizes in pt as well as px in
parseAllowedFontSize - ✅ #7707 DateTime plugin
What's Changed
- v0.33.1 by @etrepum in #7684
- [lexical-selection] Bug Fix: Correct backward inversion for RTL by @noamzaks in #7686
- [lexical-code][lexical-code-shiki][lexical-markdown][lexical-playground][lexical-devtools] Feature: Experimental Shiki support for code highlighting by @jeromew in #7662
- [lexical-react] Clean up old mouseup events from context menu by @ivailop7 in #7705
- [lexical-react] feat: Context Menu icons by @ivailop7 in #7697
- [lexical-website][docs] Documentation Update: Fix typo by @JTRNS in #7713
- [lexical-playground]Bug Fix: Image links lose link state when dragged by @lilshady in #7693
- Fix trigger reconcilation on nested read by @zurfyx in #7724
- [lexical] Bug Fix: Clamp DOM selection offsets to valid lexical TextNode offsets in $internalResolveSelectionPoint by @etrepum in #7725
- [lexical-react] Bug Fix: prevent race condition in CollaborationPlugin during rapid mount/unmount cycles by @tobiasandersen in #7723
- [lexical-playground] Bug Fix: include font sizes in pt as well in parseAllowedFontSize by @harshmetkel24 in #7719
- Fix Key Arrow Down Documentation by @zamorai in #7733
- [lexical-utils] fix: Backward selection was not being retained by @jvithlani in #7737
- [lexical-playground] DateTime Plugin by @ivailop7 in #7707
- [lexical-examples] Bug Fix: missing dependency @lexical/utils at examples/react-rich-collab by @debuggingfuture in #7743
- [*] Chore: Add a post-release action to update the examples by @etrepum in #7744
- Update examples for v0.33.1 by @etrepum in #7745
New Contributors
- @JTRNS made their first contribution in #7713
- @tobiasandersen made their first contribution in #7723
- @zamorai made their first contribution in #7733
- @debuggingfuture made their first contribution in #7743
Full Changelog: v0.33.1...v0.34.0
v0.33.1
This is a patch release with a fix for the new $config flat NodeState API
Highlights
Core
- ✅ #7683 Implement missing
updateJSONsupport for$configflatNodeState - 🆕 #5829
RangeSelection.setFormatsetter
What's Changed
- v0.33.0 by @etrepum in #7672
- [lexical-link] Chore: Fix test names by @noamzaks in #7666
- Add a setter for the format property on RangeSelection by @HyperVS in #5829
- [lexical] Bug Fix: Implement missing deserialization for flat $config NodeState by @etrepum in #7683
New Contributors
Full Changelog: v0.33.0...v0.33.1
v0.33.0
This is a monthly release with some major new features and lots of bug fixes
Breaking Changes
$copyNode(prevNode) now calls node.afterCloneFrom(prevNode) #7609
If you have code that assumes that newNode.afterCloneFrom(prevNode) will not be called as a result of $copyNode(prevNode), and would no longer work if it was, then it will need some refactoring. This is a very unlikely scenario.
role no longer removed from readonly LexicalContentEditableElement #7647
The role attribute is no longer removed from readonly LexicalContentEditableElement for better accessibility compliance. This may require application and/or CSS changes in rare cases.
New APIs
$config protocol #7258
There's a new protocol for creating new node classes, that's more concise, automatically generates the boilerplate for the static methods (getType, clone, importJSON) and has additional features for NodeState.
See the Creating custom nodes with $config and NodeState documentation.
Highlights
Core
- 🆕 #7258
$configprotocol + NodeState registration/flattening (also #7659 #7661 #7667 #7671) - ✅ #7641 Copy NodeState in
TextNode.splitText - ✅ #7654 Allow the same mutation listener function to be registered to multiple nodes
Clipboard
- 🆕 #7657 Inherit the style of the last pasted TextNode in the block after pasting rich text
Code
- 🆕 #7613 Code diff highlighting
Devtools
- 🆕 #7642 Add NodeState to TreeView
List
- 🆕 #7638 Add a command to change an ordered list's start number
- ✅ #7655 Make tap target for checklists bugger for touch input
React
- ✅ #7633 Make ref types mutable
- ✅ #7644 Handle DraggableBlockPlugin in scrollable editors
- ✅ #7647 Do not remove role from read-only LexicalContentEditableElement
- ✅ #7669 Fix an issue with dangling div portals with non-empty style in LexicalMenu (regressed in v0.25)
Table
- ✅ #7637 Ignore
SELECTION_INSERT_CLIPBOARD_NODES_COMMANDdispatched from child editors - ✅ #7656 Table selection now only occurs when dragging on touch devices
Playground
- ✅ #7627 Update alignment state for image selection
- ✅ #7636 Allow deleting an empty column layout via backspace
- ✅ #7670 Close FloatingLinkEditor popup when user clicks out of it
What's Changed
- v0.32.1 by @etrepum in #7605
- [lexical][Breaking Change] Bug Fix: Change $copyNode to use afterCloneFrom by @etrepum in #7609
- [lexical-react] Chore: Remove confusing return value by @eliottvincent in #7607
- [lexical-code][lexical-markdown][lexical-playground] Feature: Add code diff highlighting by @jeromew in #7613
- [lexical-devtools-core] Bug Fix: Allow CustomPrintNodeFn to return undefined by @achaljhawar in #7619
- [lexical-playground] Bug Fix: Update alignment state for image selection by @kirandash in #7627
- Add in favor for to deprecated tag by @sofiane-dj in #7634
- [lexical-react] Chore: make ref types mutable by @findoo in #7633
- [lexical-headless-test] Enhance navigator environment check with object type and structure validation by @0xobedient in #7626
- Feature: $config protocol + NodeState registration/flattening by @etrepum in #7258
- [Lexical]Refactor: Change UnionToIntersection flow type by @lilshady in #7643
- [lexical-table] Bug Fix: Ignore SELECTION_INSERT_CLIPBOARD_NODES_COMMAND dispatched from child editors by @etrepum in #7637
- [lexical] Bug Fix: copy NodeState when splitting text nodes by @randal-atticus in #7641
- [lexical-devtools-core] Chore: add NodeState to TreeView by @randal-atticus in #7642
- [lexical-react] Bug Fix: handle DraggableBlockPlugin in scrollable editors by @randal-atticus in #7644
- [lexical-playground] Bug Fix: Allow deleting empty column layouts via backspace by @Lakshmanshankar in #7636
- [lexical] Bug Fix: allow same mutation listener fn to be registered to multiple nodes by @james-atticus in #7654
- [lexical-playground] [lexical-list] add ability to change ordered list start number by @achaljhawar in #7638
- [lexical] Bug Fix: Workarounds in $config protocol for loose inheritance by @etrepum in #7659
- [lexical-react] Bug Fix: aria-prohibited-attr violation on LexicalContentEditableElement by @so99ynoodles in #7647
- [lexical-website] Documentation Update: Update some doc links by @lilshady in #7660
- [lexical] Bug Fix: Workarounds for import json by @lilshady in #7661
- [lexical-website] Chore: Fix typo in transforms by @noamzaks in #7664
- [lexical-list] Bug Fix: Make tap target for checklists bigger so touch inputs register by @circlingthesun in #7655
- [lexical-clipboard] Inherit style when typing after pasting rich text by @achaljhawar in #7657
- [lexical-table] Bug Fix: Fix table selection for touch devices by @circlingthesun in #7656
- [lexical-playground] Chore: Fix AutocompleteNode importDOM warning by @etrepum in #7667
- [lexical-react] Bug Fix: LexicalMenu position menu immediately regression by @etrepum in #7669
- [lexical-playground] fix: close link popup when user clicks out of it by @achaljhawar in #7670
- [lexical] Bug Fix: LexicalNode.getType() fallback to $config protocol by @etrepum in #7671
New Contributors
- @achaljhawar made their first contribution in #7619
- @sofiane-dj made their first contribution in #7634
- @findoo made their first contribution in #7633
- @0xobedient made their first contribution in #7626
- @randal-atticus made their first contribution in #7641
- @Lakshmanshankar made their first contribution in #7636
- @so99ynoodles made their first contribution in #7647
- @noamzaks made their first contribution in #7664
Full Changelog: v0.32.1...v0.33.0
v0.32.1
This is an ad-hoc patch release to include #7602 - which fixes an issue that could corrupt a document if a TabNode was at the anchor or focus of a selection when text is inserted under certain circumstances.
Highlights
Core
- ✅ #7602 Treat all TabNode as if they are in token mode
- ✅ #7579 Firefox now handles Select All (Ctrl+A) the same way as other browsers
What's Changed
- [Monthly Release] v0.32.0 by @lilshady in #7599
- [lexical][lexical-selection] Bug Fix: Treat all TabNode as if they are in token mode by @etrepum in #7602
- [scripts] update next version in lexical-esm-nextjs by @lilshady in #7604
- [tests] Chore: Update table test to use locator API instead of page.evaluate by @etrepum in #7603
- [lexical] Fix: ctrl+a doesn't work well in plain text mode on Firefox by @wataru-chocola in #7579
New Contributors
- @wataru-chocola made their first contribution in #7579
Full Changelog: v0.32.0...v0.32.1