Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lexical/react

Package Overview
Dependencies
Maintainers
5
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/react - npm Package Compare versions

Comparing version 0.17.1-nightly.20240813.0 to 0.17.1-nightly.20240814.0

1

LexicalComposer.d.ts

@@ -12,3 +12,2 @@ /**

export type InitialConfigType = Readonly<{
editor__DEPRECATED?: LexicalEditor | null;
namespace: string;

@@ -15,0 +14,0 @@ nodes?: ReadonlyArray<Klass<LexicalNode> | LexicalNodeReplacement>;

23

LexicalComposer.dev.js

@@ -59,3 +59,2 @@ /**

namespace,
editor__DEPRECATED: initialEditor,
nodes,

@@ -67,15 +66,11 @@ onError,

const context = LexicalComposerContext.createLexicalComposerContext(null, theme);
let editor = initialEditor || null;
if (editor === null) {
const newEditor = lexical.createEditor({
editable: initialConfig.editable,
html,
namespace,
nodes,
onError: error => onError(error, newEditor),
theme
});
initializeEditor(newEditor, initialEditorState);
editor = newEditor;
}
const editor = lexical.createEditor({
editable: initialConfig.editable,
html,
namespace,
nodes,
onError: error => onError(error, editor),
theme
});
initializeEditor(editor, initialEditorState);
return [editor, context];

@@ -82,0 +77,0 @@ },

@@ -9,4 +9,4 @@ /**

'use strict';var e=require("@lexical/react/LexicalComposerContext"),f=require("lexical"),g=require("react"),m=require("react/jsx-runtime");let n="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,p=n?g.useLayoutEffect:g.useEffect,q={tag:"history-merge"};
function r(a,c){if(null!==c)if(void 0===c)a.update(()=>{var b=f.$getRoot();if(b.isEmpty()){let d=f.$createParagraphNode();b.append(d);b=n?document.activeElement:null;(null!==f.$getSelection()||null!==b&&b===a.getRootElement())&&d.select()}},q);else if(null!==c)switch(typeof c){case "string":let b=a.parseEditorState(c);a.setEditorState(b,q);break;case "object":a.setEditorState(c,q);break;case "function":a.update(()=>{f.$getRoot().isEmpty()&&c(a)},q)}}
exports.LexicalComposer=function({initialConfig:a,children:c}){let b=g.useMemo(()=>{const {theme:d,namespace:h,editor__DEPRECATED:t,nodes:u,onError:v,editorState:w,html:x}=a,y=e.createLexicalComposerContext(null,d);let k=t||null;if(null===k){const l=f.createEditor({editable:a.editable,html:x,namespace:h,nodes:u,onError:z=>v(z,l),theme:d});r(l,w);k=l}return[k,y]},[]);p(()=>{let d=a.editable,[h]=b;h.setEditable(void 0!==d?d:!0)},[]);return m.jsx(e.LexicalComposerContext.Provider,{value:b,children:c})}
'use strict';var e=require("@lexical/react/LexicalComposerContext"),f=require("lexical"),g=require("react"),l=require("react/jsx-runtime");let m="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,n=m?g.useLayoutEffect:g.useEffect,p={tag:"history-merge"};
function q(a,c){if(null!==c)if(void 0===c)a.update(()=>{var b=f.$getRoot();if(b.isEmpty()){let d=f.$createParagraphNode();b.append(d);b=m?document.activeElement:null;(null!==f.$getSelection()||null!==b&&b===a.getRootElement())&&d.select()}},p);else if(null!==c)switch(typeof c){case "string":let b=a.parseEditorState(c);a.setEditorState(b,p);break;case "object":a.setEditorState(c,p);break;case "function":a.update(()=>{f.$getRoot().isEmpty()&&c(a)},p)}}
exports.LexicalComposer=function({initialConfig:a,children:c}){let b=g.useMemo(()=>{const {theme:d,namespace:h,nodes:r,onError:t,editorState:u,html:v}=a,w=e.createLexicalComposerContext(null,d),k=f.createEditor({editable:a.editable,html:v,namespace:h,nodes:r,onError:x=>t(x,k),theme:d});q(k,u);return[k,w]},[]);n(()=>{let d=a.editable,[h]=b;h.setEditable(void 0!==d?d:!0)},[]);return l.jsx(e.LexicalComposerContext.Provider,{value:b,children:c})}

@@ -10,6 +10,3 @@ /**

import type { Props as ElementProps } from './shared/LexicalContentEditableElement';
import type { LexicalEditor } from 'lexical';
export type Props = Omit<ElementProps, 'editor'> & {
editor__DEPRECATED?: LexicalEditor;
} & ({
export type Props = Omit<ElementProps, 'editor'> & ({
'aria-placeholder'?: void;

@@ -16,0 +13,0 @@ placeholder?: null;

@@ -177,8 +177,5 @@ /**

placeholder,
editor__DEPRECATED,
...rest
} = props;
// editor__DEPRECATED will always be defined for non MLC surfaces
// eslint-disable-next-line react-hooks/rules-of-hooks
const editor = editor__DEPRECATED || LexicalComposerContext.useLexicalComposerContext()[0];
const [editor] = LexicalComposerContext.useLexicalComposerContext();
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {

@@ -185,0 +182,0 @@ children: [/*#__PURE__*/jsxRuntime.jsx(ContentEditableElement, {

@@ -9,7 +9,6 @@ /**

'use strict';var d=require("@lexical/react/LexicalComposerContext"),h=require("react"),m=require("react/jsx-runtime"),t=require("@lexical/text"),u=require("@lexical/utils");let v="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?h.useLayoutEffect:h.useEffect;function w(...a){return c=>{a.forEach(b=>{"function"===typeof b?b(c):null!=b&&(b.current=c)})}}
let x=h.forwardRef(function({editor:a,ariaActiveDescendant:c,ariaAutoComplete:b,ariaControls:e,ariaDescribedBy:f,ariaExpanded:l,ariaLabel:y,ariaLabelledBy:z,ariaMultiline:A,ariaOwns:B,ariaRequired:C,autoCapitalize:D,className:E,id:F,role:n="textbox",spellCheck:G=!0,style:H,tabIndex:I,"data-testid":J,...K},p){let [g,q]=h.useState(a.isEditable()),r=h.useCallback(k=>{k&&k.ownerDocument&&k.ownerDocument.defaultView?a.setRootElement(k):a.setRootElement(null)},[a]),L=h.useMemo(()=>w(p,r),[r,p]);v(()=>{q(a.isEditable());
return a.registerEditableListener(k=>{q(k)})},[a]);return m.jsx("div",{...K,"aria-activedescendant":g?c:void 0,"aria-autocomplete":g?b:"none","aria-controls":g?e:void 0,"aria-describedby":f,"aria-expanded":g&&"combobox"===n?!!l:void 0,"aria-label":y,"aria-labelledby":z,"aria-multiline":A,"aria-owns":g?B:void 0,"aria-readonly":g?void 0:!0,"aria-required":C,autoCapitalize:D,className:E,contentEditable:g,"data-testid":J,id:F,ref:L,role:g?n:void 0,spellCheck:G,style:H,tabIndex:I})});
function M(a){return a.getEditorState().read(t.$canShowPlaceholderCurry(a.isComposing()))}function N(a){let [c,b]=h.useState(()=>M(a));v(()=>{function e(){let f=M(a);b(f)}e();return u.mergeRegister(a.registerUpdateListener(()=>{e()}),a.registerEditableListener(()=>{e()}))},[a]);return c}let P=h.forwardRef(O);
function O(a,c){let {placeholder:b,editor__DEPRECATED:e,...f}=a;a=e||d.useLexicalComposerContext()[0];return m.jsxs(m.Fragment,{children:[m.jsx(x,{editor:a,...f,ref:c}),null!=b&&m.jsx(Q,{editor:a,content:b})]})}
function Q({content:a,editor:c}){var b=N(c);let [e,f]=h.useState(c.isEditable());h.useLayoutEffect(()=>{f(c.isEditable());return c.registerEditableListener(l=>{f(l)})},[c]);if(!b)return null;b=null;"function"===typeof a?b=a(e):null!==a&&(b=a);return null===b?null:m.jsx("div",{"aria-hidden":!0,children:b})}exports.ContentEditable=P
'use strict';var d=require("@lexical/react/LexicalComposerContext"),g=require("react"),m=require("react/jsx-runtime"),t=require("@lexical/text"),u=require("@lexical/utils");let v="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?g.useLayoutEffect:g.useEffect;function w(...a){return c=>{a.forEach(b=>{"function"===typeof b?b(c):null!=b&&(b.current=c)})}}
let x=g.forwardRef(function({editor:a,ariaActiveDescendant:c,ariaAutoComplete:b,ariaControls:e,ariaDescribedBy:h,ariaExpanded:l,ariaLabel:y,ariaLabelledBy:z,ariaMultiline:A,ariaOwns:B,ariaRequired:C,autoCapitalize:D,className:E,id:F,role:n="textbox",spellCheck:G=!0,style:H,tabIndex:I,"data-testid":J,...K},p){let [f,q]=g.useState(a.isEditable()),r=g.useCallback(k=>{k&&k.ownerDocument&&k.ownerDocument.defaultView?a.setRootElement(k):a.setRootElement(null)},[a]),L=g.useMemo(()=>w(p,r),[r,p]);v(()=>{q(a.isEditable());
return a.registerEditableListener(k=>{q(k)})},[a]);return m.jsx("div",{...K,"aria-activedescendant":f?c:void 0,"aria-autocomplete":f?b:"none","aria-controls":f?e:void 0,"aria-describedby":h,"aria-expanded":f&&"combobox"===n?!!l:void 0,"aria-label":y,"aria-labelledby":z,"aria-multiline":A,"aria-owns":f?B:void 0,"aria-readonly":f?void 0:!0,"aria-required":C,autoCapitalize:D,className:E,contentEditable:f,"data-testid":J,id:F,ref:L,role:f?n:void 0,spellCheck:G,style:H,tabIndex:I})});
function M(a){return a.getEditorState().read(t.$canShowPlaceholderCurry(a.isComposing()))}function N(a){let [c,b]=g.useState(()=>M(a));v(()=>{function e(){let h=M(a);b(h)}e();return u.mergeRegister(a.registerUpdateListener(()=>{e()}),a.registerEditableListener(()=>{e()}))},[a]);return c}let P=g.forwardRef(O);function O(a,c){let {placeholder:b,...e}=a;[a]=d.useLexicalComposerContext();return m.jsxs(m.Fragment,{children:[m.jsx(x,{editor:a,...e,ref:c}),null!=b&&m.jsx(Q,{editor:a,content:b})]})}
function Q({content:a,editor:c}){var b=N(c);let [e,h]=g.useState(c.isEditable());g.useLayoutEffect(()=>{h(c.isEditable());return c.registerEditableListener(l=>{h(l)})},[c]);if(!b)return null;b=null;"function"===typeof a?b=a(e):null!==a&&(b=a);return null===b?null:m.jsx("div",{"aria-hidden":!0,children:b})}exports.ContentEditable=P

@@ -11,23 +11,23 @@ {

"license": "MIT",
"version": "0.17.1-nightly.20240813.0",
"version": "0.17.1-nightly.20240814.0",
"dependencies": {
"@lexical/clipboard": "0.17.1-nightly.20240813.0",
"@lexical/code": "0.17.1-nightly.20240813.0",
"@lexical/devtools-core": "0.17.1-nightly.20240813.0",
"@lexical/dragon": "0.17.1-nightly.20240813.0",
"@lexical/hashtag": "0.17.1-nightly.20240813.0",
"@lexical/history": "0.17.1-nightly.20240813.0",
"@lexical/link": "0.17.1-nightly.20240813.0",
"@lexical/list": "0.17.1-nightly.20240813.0",
"@lexical/mark": "0.17.1-nightly.20240813.0",
"@lexical/markdown": "0.17.1-nightly.20240813.0",
"@lexical/overflow": "0.17.1-nightly.20240813.0",
"@lexical/plain-text": "0.17.1-nightly.20240813.0",
"@lexical/rich-text": "0.17.1-nightly.20240813.0",
"@lexical/selection": "0.17.1-nightly.20240813.0",
"@lexical/table": "0.17.1-nightly.20240813.0",
"@lexical/text": "0.17.1-nightly.20240813.0",
"@lexical/utils": "0.17.1-nightly.20240813.0",
"@lexical/yjs": "0.17.1-nightly.20240813.0",
"lexical": "0.17.1-nightly.20240813.0",
"@lexical/clipboard": "0.17.1-nightly.20240814.0",
"@lexical/code": "0.17.1-nightly.20240814.0",
"@lexical/devtools-core": "0.17.1-nightly.20240814.0",
"@lexical/dragon": "0.17.1-nightly.20240814.0",
"@lexical/hashtag": "0.17.1-nightly.20240814.0",
"@lexical/history": "0.17.1-nightly.20240814.0",
"@lexical/link": "0.17.1-nightly.20240814.0",
"@lexical/list": "0.17.1-nightly.20240814.0",
"@lexical/mark": "0.17.1-nightly.20240814.0",
"@lexical/markdown": "0.17.1-nightly.20240814.0",
"@lexical/overflow": "0.17.1-nightly.20240814.0",
"@lexical/plain-text": "0.17.1-nightly.20240814.0",
"@lexical/rich-text": "0.17.1-nightly.20240814.0",
"@lexical/selection": "0.17.1-nightly.20240814.0",
"@lexical/table": "0.17.1-nightly.20240814.0",
"@lexical/text": "0.17.1-nightly.20240814.0",
"@lexical/utils": "0.17.1-nightly.20240814.0",
"@lexical/yjs": "0.17.1-nightly.20240814.0",
"lexical": "0.17.1-nightly.20240814.0",
"react-error-boundary": "^3.1.4"

@@ -34,0 +34,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc