@lexical/react 0.47.1-nightly.20260716.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LexicalComposerContext.dev.js +1 -1
- package/dist/LexicalComposerContext.dev.mjs +1 -1
- package/dist/LexicalComposerContext.prod.js +1 -1
- package/dist/LexicalComposerContext.prod.mjs +1 -1
- package/dist/LexicalContentEditable.dev.js +1 -1
- package/dist/LexicalContentEditable.dev.mjs +1 -1
- package/dist/LexicalContentEditable.prod.js +2 -2
- package/dist/LexicalContentEditable.prod.mjs +2 -2
- package/package.json +20 -20
- package/src/shared/LexicalContentEditableElement.tsx +1 -1
|
@@ -43,7 +43,7 @@ function formatDevErrorMessage(message) {
|
|
|
43
43
|
* Most code should read it through {@link useLexicalComposerContext} rather than
|
|
44
44
|
* consuming the context directly.
|
|
45
45
|
*/
|
|
46
|
-
const LexicalComposerContext =
|
|
46
|
+
const LexicalComposerContext = react.createContext(null);
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Creates a {@link LexicalComposerContextType} for a composer. Theme resolution
|
|
@@ -41,7 +41,7 @@ function formatDevErrorMessage(message) {
|
|
|
41
41
|
* Most code should read it through {@link useLexicalComposerContext} rather than
|
|
42
42
|
* consuming the context directly.
|
|
43
43
|
*/
|
|
44
|
-
const LexicalComposerContext =
|
|
44
|
+
const LexicalComposerContext = createContext(null);
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Creates a {@link LexicalComposerContextType} for a composer. Theme resolution
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
"use strict";var e=require("react");const n
|
|
9
|
+
"use strict";var e=require("react");const n=e.createContext(null);exports.LexicalComposerContext=n,exports.createLexicalComposerContext=function(e,n){let t=null;return null!=e&&(t=e[1]),{getTheme:function(){return null!=n?n:null!=t?t.getTheme():null}}},exports.useLexicalComposerContext=function(){const t=e.useContext(n);return null==t&&function(e,...n){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of n)r.append("v",e);throw t.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),t};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import{createContext as n,useContext as e}from"react";const r
|
|
9
|
+
import{createContext as n,useContext as e}from"react";const r=n(null);function t(n,e){let r=null;return null!=n&&(r=n[1]),{getTheme:function(){return null!=e?e:null!=r?r.getTheme():null}}}function o(){const n=e(r);return null==n&&function(n,...e){const r=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",n);for(const n of e)t.append("v",n);throw r.search=t.toString(),Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),n}export{r as LexicalComposerContext,t as createLexicalComposerContext,o as useLexicalComposerContext};
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
"use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("react"),a=require("lexical"),r=require("react/jsx-runtime"),i=require("@lexical/text");const n=a.CAN_USE_DOM?t.useLayoutEffect:t.useEffect;function
|
|
10
|
-
return r.jsxs(r.Fragment,{children:[/*#__PURE__*/r.jsx(
|
|
9
|
+
"use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("react"),a=require("lexical"),r=require("react/jsx-runtime"),i=require("@lexical/text");const n=a.CAN_USE_DOM?t.useLayoutEffect:t.useEffect;function o({editor:e,ariaActiveDescendant:a,ariaAutoComplete:i,ariaControls:o,ariaDescribedBy:l,ariaErrorMessage:s,ariaExpanded:d,ariaInvalid:u,ariaLabel:c,ariaLabelledBy:f,ariaMultiline:b,ariaOwns:x,ariaRequired:m,autoCapitalize:E,className:p,id:C,role:v="textbox",spellCheck:y=!0,style:g,tabIndex:L,"data-testid":h,...w},q){const[j,R]=t.useState(e.isEditable()),D=t.useCallback(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),S=t.useMemo(()=>function(...e){return t=>{for(const a of e)"function"==typeof a?a(t):null!=a&&(a.current=t)}}(q,D),[D,q]);return n(()=>(R(e.isEditable()),e.registerEditableListener(e=>{R(e)})),[e]),/*#__PURE__*/r.jsx("div",{"aria-activedescendant":j?a:void 0,"aria-autocomplete":j?i:"none","aria-controls":j?o:void 0,"aria-describedby":l,...null!=s?{"aria-errormessage":s}:{},"aria-expanded":j&&"combobox"===v?!!d:void 0,...null!=u?{"aria-invalid":u}:{},"aria-label":c,"aria-labelledby":f,"aria-multiline":b,"aria-owns":j?x:void 0,"aria-readonly":!j||void 0,"aria-required":m,autoCapitalize:E,className:p,contentEditable:j,"data-testid":h,id:C,ref:S,role:v,spellCheck:y,style:g,tabIndex:L??(j?void 0:-1),...w})}const l=/*#__PURE__*/t.forwardRef(o);function s(e){return e.read("latest",i.$canShowPlaceholderCurry(e.isComposing()))}const d=/*#__PURE__*/t.forwardRef(u);function u(t,a){const{placeholder:i,...n}=t,[o]=e.useLexicalComposerContext();
|
|
10
|
+
return r.jsxs(r.Fragment,{children:[/*#__PURE__*/r.jsx(l,{editor:o,...n,ref:a}),null!=i&&/*#__PURE__*/r.jsx(c,{editor:o,content:i})]})}function c({content:e,editor:i}){const o=function(e){const[r,i]=t.useState(()=>s(e));return n(()=>{function t(){const t=s(e);i(t)}return t(),a.mergeRegister(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),r}(i),[l,d]=t.useState(i.isEditable());if(t.useLayoutEffect(()=>(d(i.isEditable()),i.registerEditableListener(e=>{d(e)})),[i]),!o)return null;let u=null;return"function"==typeof e?u=e(l):null!==e&&(u=e),null===u?null:/*#__PURE__*/r.jsx("div",{"aria-hidden":!0,children:u})}exports.ContentEditable=d,exports.ContentEditableElement=l;
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{useLayoutEffect as t,useEffect as i,forwardRef as a,useState as r,useCallback as n,useMemo as o}from"react";import{CAN_USE_DOM as l,mergeRegister as d}from"lexical";import{jsx as s,jsxs as c,Fragment as u}from"react/jsx-runtime";import{$canShowPlaceholderCurry as m}from"@lexical/text";const f=l?t:i;function b({editor:e,ariaActiveDescendant:t,ariaAutoComplete:i,ariaControls:a,ariaDescribedBy:l,ariaErrorMessage:d,ariaExpanded:c,ariaInvalid:u,ariaLabel:m,ariaLabelledBy:b,ariaMultiline:p,ariaOwns:x,ariaRequired:
|
|
10
|
-
return c(u,{children:[/*#__PURE__*/s(p,{editor:n,...r,ref:i}),null!=a&&/*#__PURE__*/s(y,{editor:n,content:a})]})}function y({content:e,editor:i}){const a=function(e){const[t,i]=r(()=>x(e));return f(()=>{function t(){const t=x(e);i(t)}return t(),d(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(i),[n,o]=r(i.isEditable());if(t(()=>(o(i.isEditable()),i.registerEditableListener(e=>{o(e)})),[i]),!a)return null;let l=null;return"function"==typeof e?l=e(n):null!==e&&(l=e),null===l?null:/*#__PURE__*/s("div",{"aria-hidden":!0,children:l})}export{
|
|
9
|
+
import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{useLayoutEffect as t,useEffect as i,forwardRef as a,useState as r,useCallback as n,useMemo as o}from"react";import{CAN_USE_DOM as l,mergeRegister as d}from"lexical";import{jsx as s,jsxs as c,Fragment as u}from"react/jsx-runtime";import{$canShowPlaceholderCurry as m}from"@lexical/text";const f=l?t:i;function b({editor:e,ariaActiveDescendant:t,ariaAutoComplete:i,ariaControls:a,ariaDescribedBy:l,ariaErrorMessage:d,ariaExpanded:c,ariaInvalid:u,ariaLabel:m,ariaLabelledBy:b,ariaMultiline:p,ariaOwns:x,ariaRequired:v,autoCapitalize:E,className:y,id:C,role:g="textbox",spellCheck:L=!0,style:h,tabIndex:w,"data-testid":D,...I},R){const[k,q]=r(e.isEditable()),z=n(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),A=o(()=>function(...e){return t=>{for(const i of e)"function"==typeof i?i(t):null!=i&&(i.current=t)}}(R,z),[z,R]);return f(()=>(q(e.isEditable()),e.registerEditableListener(e=>{q(e)})),[e]),/*#__PURE__*/s("div",{"aria-activedescendant":k?t:void 0,"aria-autocomplete":k?i:"none","aria-controls":k?a:void 0,"aria-describedby":l,...null!=d?{"aria-errormessage":d}:{},"aria-expanded":k&&"combobox"===g?!!c:void 0,...null!=u?{"aria-invalid":u}:{},"aria-label":m,"aria-labelledby":b,"aria-multiline":p,"aria-owns":k?x:void 0,"aria-readonly":!k||void 0,"aria-required":v,autoCapitalize:E,className:y,contentEditable:k,"data-testid":D,id:C,ref:A,role:g,spellCheck:L,style:h,tabIndex:w??(k?void 0:-1),...I})}const p=/*#__PURE__*/a(b);function x(e){return e.read("latest",m(e.isComposing()))}const v=/*#__PURE__*/a(E);function E(t,i){const{placeholder:a,...r}=t,[n]=e();
|
|
10
|
+
return c(u,{children:[/*#__PURE__*/s(p,{editor:n,...r,ref:i}),null!=a&&/*#__PURE__*/s(y,{editor:n,content:a})]})}function y({content:e,editor:i}){const a=function(e){const[t,i]=r(()=>x(e));return f(()=>{function t(){const t=x(e);i(t)}return t(),d(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(i),[n,o]=r(i.isEditable());if(t(()=>(o(i.isEditable()),i.registerEditableListener(e=>{o(e)})),[i]),!a)return null;let l=null;return"function"==typeof e?l=e(n):null!==e&&(l=e),null===l?null:/*#__PURE__*/s("div",{"aria-hidden":!0,children:l})}export{v as ContentEditable,p as ContentEditableElement};
|
package/package.json
CHANGED
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
"rich-text"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.48.0",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@floating-ui/react": "^0.27.19",
|
|
14
|
-
"@lexical/a11y": "0.
|
|
15
|
-
"@lexical/
|
|
16
|
-
"@lexical/
|
|
17
|
-
"@lexical/
|
|
18
|
-
"@lexical/
|
|
19
|
-
"@lexical/history": "0.
|
|
20
|
-
"@lexical/
|
|
21
|
-
"@lexical/mark": "0.
|
|
22
|
-
"@lexical/
|
|
23
|
-
"@lexical/list": "0.
|
|
24
|
-
"@lexical/
|
|
25
|
-
"@lexical/
|
|
26
|
-
"@lexical/
|
|
27
|
-
"@lexical/
|
|
28
|
-
"@lexical/
|
|
29
|
-
"@lexical/
|
|
30
|
-
"lexical": "0.
|
|
31
|
-
"
|
|
32
|
-
"@lexical/
|
|
14
|
+
"@lexical/a11y": "0.48.0",
|
|
15
|
+
"@lexical/devtools-core": "0.48.0",
|
|
16
|
+
"@lexical/dragon": "0.48.0",
|
|
17
|
+
"@lexical/hashtag": "0.48.0",
|
|
18
|
+
"@lexical/extension": "0.48.0",
|
|
19
|
+
"@lexical/history": "0.48.0",
|
|
20
|
+
"@lexical/link": "0.48.0",
|
|
21
|
+
"@lexical/mark": "0.48.0",
|
|
22
|
+
"@lexical/internal": "0.48.0",
|
|
23
|
+
"@lexical/list": "0.48.0",
|
|
24
|
+
"@lexical/markdown": "0.48.0",
|
|
25
|
+
"@lexical/plain-text": "0.48.0",
|
|
26
|
+
"@lexical/rich-text": "0.48.0",
|
|
27
|
+
"@lexical/table": "0.48.0",
|
|
28
|
+
"@lexical/overflow": "0.48.0",
|
|
29
|
+
"@lexical/text": "0.48.0",
|
|
30
|
+
"@lexical/yjs": "0.48.0",
|
|
31
|
+
"lexical": "0.48.0",
|
|
32
|
+
"@lexical/utils": "0.48.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=18.x",
|