@lexical/react 0.1.11 → 0.1.12

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.
Files changed (48) hide show
  1. package/DEPRECATED_useLexical.dev.js +3 -7
  2. package/DEPRECATED_useLexical.prod.js +1 -1
  3. package/DEPRECATED_useLexicalAutoFormatter.dev.js +14 -9
  4. package/DEPRECATED_useLexicalAutoFormatter.prod.js +18 -18
  5. package/DEPRECATED_useLexicalPlainText.dev.js +33 -27
  6. package/DEPRECATED_useLexicalPlainText.prod.js +12 -12
  7. package/DEPRECATED_useLexicalRichText.dev.js +43 -388
  8. package/DEPRECATED_useLexicalRichText.prod.js +17 -25
  9. package/LexicalAutoFormatterPlugin.d.ts +9 -0
  10. package/LexicalAutoFormatterPlugin.dev.js +14 -9
  11. package/LexicalAutoFormatterPlugin.prod.js +18 -18
  12. package/LexicalAutoLinkPlugin.d.ts +20 -0
  13. package/LexicalCharacterLimitPlugin.d.ts +11 -0
  14. package/LexicalClearEditorPlugin.d.ts +14 -0
  15. package/LexicalClearEditorPlugin.dev.js +22 -1
  16. package/LexicalClearEditorPlugin.prod.js +2 -1
  17. package/LexicalCollaborationPlugin.d.ts +49 -0
  18. package/LexicalCollaborationPlugin.js.flow +1 -1
  19. package/LexicalComposer.d.ts +22 -0
  20. package/LexicalComposer.dev.js +27 -5
  21. package/LexicalComposer.js.flow +2 -1
  22. package/LexicalComposer.prod.js +3 -3
  23. package/LexicalComposerContext.d.ts +24 -0
  24. package/LexicalComposerContext.js.flow +1 -1
  25. package/LexicalContentEditable.d.ts +32 -0
  26. package/LexicalContentEditable.dev.js +22 -1
  27. package/LexicalContentEditable.prod.js +3 -3
  28. package/LexicalHashtagPlugin.d.ts +9 -0
  29. package/LexicalHashtagPlugin.js.flow +0 -10
  30. package/LexicalHistoryPlugin.d.ts +29 -0
  31. package/LexicalHorizontalRuleNode.d.ts +23 -0
  32. package/LexicalLinkPlugin.d.ts +9 -0
  33. package/LexicalListPlugin.d.ts +9 -0
  34. package/LexicalNestedComposer.d.ts +20 -0
  35. package/LexicalOnChangePlugin.d.ts +12 -0
  36. package/LexicalPlainTextPlugin.d.ts +15 -0
  37. package/LexicalPlainTextPlugin.dev.js +11 -26
  38. package/LexicalPlainTextPlugin.prod.js +8 -8
  39. package/LexicalRichTextPlugin.d.ts +15 -0
  40. package/LexicalRichTextPlugin.dev.js +24 -390
  41. package/LexicalRichTextPlugin.prod.js +13 -21
  42. package/LexicalTablePlugin.d.ts +9 -0
  43. package/LexicalTreeView.d.ts +17 -0
  44. package/package.json +6 -5
  45. package/useLexicalDecoratorMap.d.ts +14 -0
  46. package/useLexicalIsTextContentEmpty.d.ts +13 -0
  47. package/useLexicalNodeSelection.d.ts +12 -0
  48. package/withSubscriptions.d.ts +12 -0
@@ -4,24 +4,16 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- var g=require("@lexical/react/LexicalComposerContext"),u=require("react"),y=require("lexical"),z=require("react-dom");function A(a,e=!0){if(a)return!1;a=y.$getRoot().getTextContent();e&&(a=a.trim());return""===a}
8
- function B(a){if(!A(a,!1))return!1;a=y.$getRoot().getChildren();const e=a.length;if(1<e)return!1;for(let c=0;c<e;c++){var f=a[c];if(y.$isElementNode(f)){if("paragraph"!==f.__type||0!==f.__indent)return!1;f=f.getChildren();const d=f.length;for(let b=0;b<d;b++)if(!y.$isTextNode(f[c]))return!1}}return!0}function C(a){return()=>B(a)}var D="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?u.useLayoutEffect:u.useEffect;
9
- function E(a){const [e,f]=u.useState(a.getEditorState().read(C(a.isComposing())));D(()=>a.addListener("update",({editorState:c})=>{const d=a.isComposing();c=c.read(C(d));f(c)}),[a]);return e}function F(a){const [e,f]=u.useState(()=>a.getDecorators());D(()=>a.addListener("decorator",c=>{z.flushSync(()=>{f(c)})}),[a]);return u.useMemo(()=>{const c=[],d=Object.keys(e);for(let k=0;k<d.length;k++){var b=d[k];const h=e[b];b=a.getElementByKey(b);null!==b&&c.push(z.createPortal(h,b))}return c},[e,a])}
10
- function G(a){a=a.getLatest();const e=a.constructor.clone(a);e.__parent=a.__parent;y.$isElementNode(a)&&y.$isElementNode(e)?(e.__children=Array.from(a.__children),e.__format=a.__format,e.__indent=a.__indent,e.__dir=a.__dir):y.$isTextNode(a)&&y.$isTextNode(e)?(e.__format=a.__format,e.__style=a.__style,e.__mode=a.__mode,e.__detail=a.__detail):y.$isDecoratorNode(a)&&y.$isDecoratorNode(e)&&(e.__state=a.__state);return e}
11
- function H(a,e,f,c,d){for(var b=e;null!==a;){for(e=a.getParent();null!==e&&e.excludeFromCopy();)e=e.getParent();if(null===e)break;if(!y.$isElementNode(a)||!a.excludeFromCopy()){const k=a.getKey();let h=d.get(k);const l=void 0===h;l&&(h=G(a),d.set(k,h));!y.$isTextNode(h)||h.isSegmented()||h.isToken()?y.$isElementNode(h)&&(h.__children=h.__children.slice(f?b:0,f?void 0:b+1)):h.__text=h.__text.slice(f?b:0,f?void 0:b);if(y.$isRootNode(e)){l&&c.push(k);break}}b=d.get(e.getKey());b=y.$isElementNode(b)?
12
- b.__children.indexOf(a.getKey()):a.getIndexWithinParent();a=e}}function I(a){a=a.anchor.getNode();return"rtl"===(y.$isRootNode(a)?a:a.getParentOrThrow()).getDirection()}function J(a,e){const {nodeName:f}=a;e=e._htmlConversions.get(f.toLowerCase());let c=null;void 0!==e&&e.forEach(d=>{d=d(a);null!==d&&(null===c||c.priority<d.priority)&&(c=d)});return null!==c?c.conversion:null}
13
- function K(a,e,f=new Map){let c=[],d=null;var b=J(a,e),k=b?b(a):null;b=null;if(null!==k){b=k.after;d=k.node;if(null!==d){c.push(d);var h=Array.from(f.values());for(let l=0;l<h.length;l++)h[l](d)}null!=k.forChild&&f.set(a.nodeName,k.forChild)}a=a.childNodes;k=[];for(h=0;h<a.length;h++)k.push(...K(a[h],e,f));null!=b&&(k=b(k));null==d?c=c.concat(k):y.$isElementNode(d)&&d.append(...k);return c}
14
- function L(a,e,f){var c=a.getData("application/x-lexical-editor");if(c){var d=f._config.namespace;try{const l=JSON.parse(c);if(l.namespace===d){const {range:t,nodeMap:m}=l.state;var b=new Map(m);c=[];for(d=0;d<t.length;d++){var k=b.get(t[d]);if(void 0!==k){var h=y.$createNodeFromParse(k,b);c.push(h)}}e.insertNodes(c);return}}catch(l){}}if(b=a.getData("text/html")){b=(new DOMParser).parseFromString(b,"text/html");a=[];b=b.body?Array.from(b.body.childNodes):[];k=b.length;for(h=0;h<k;h++)c=K(b[h],f),
15
- null!==c&&(a=a.concat(c));f=a;a=[];b=null;for(k=0;k<f.length;k++)h=f[k],!y.$isElementNode(h)||h.isInline()?(null===b&&(b=y.$createParagraphNode(),a.push(b)),null!==b&&b.append(h)):(a.push(h),b=null);e.insertNodes(a)}else f=a.getData("text/plain"),null!=f&&e.insertRawText(f)}function M(a,e){a=y.$getDecoratorNode(a.focus,e);return y.$isDecoratorNode(a)&&!a.isIsolated()}
16
- function N(a,e){a.preventDefault();e.update(()=>{const f=y.$getSelection(),c=a.clipboardData;null!=c&&y.$isRangeSelection(f)&&L(c,f,e)})}function O(a,e){P(a,e);e.update(()=>{const f=y.$getSelection();y.$isRangeSelection(f)&&f.removeText()})}
17
- function P(a,e){a.preventDefault();e.update(()=>{const f=a.clipboardData;var c=y.$getSelection();if(null!==c&&null!=f){var d=window.getSelection();if(!d.isCollapsed){var b=d.getRangeAt(0);b&&(d=document.createElement("div"),b=b.cloneContents(),d.appendChild(b),f.setData("text/html",d.innerHTML));f.setData("text/plain",c.getTextContent());d=e._config.namespace;b=f.setData;var k=JSON,h=k.stringify;{if(!y.$isRangeSelection(c))throw Error("Minified Lexical error #68; see codes.json for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");
18
- var l=c.anchor,t=c.focus;var m=l.getCharacterOffset();const x=t.getCharacterOffset();var n=l.getNode(),q=t.getNode(),p=n.getParentOrThrow();if(n===q&&y.$isTextNode(n)&&(p.canBeEmpty()||1<p.getChildrenSize()))c=G(n),n=x>m,c.__text=c.__text.slice(n?m:x,n?x:m),m=c.getKey(),m={nodeMap:[[m,c]],range:[m]};else if(c=c.getNodes(),0===c.length)m={nodeMap:[],range:[]};else{n=c.length;q=c[0];p=q.getParent();if(null!==p&&(!p.canBeEmpty()||y.$isRootNode(p))){var r=p.__children;if(r.length===n){var v=!0;for(var w=
19
- 0;w<r.length;w++)if(r[w]!==c[w].__key){v=!1;break}v&&(n++,c.push(p))}}p=c[n-1];l=l.isBefore(t);t=new Map;r=[];H(q,l?m:x,!0,r,t);for(q=0;q<n;q++)if(v=c[q],w=v.getKey(),!(t.has(w)||y.$isElementNode(v)&&v.excludeFromCopy())){const R=G(v);y.$isRootNode(v.getParent())&&r.push(v.getKey());t.set(w,R)}H(p,l?x:m,!1,r,t);m={nodeMap:Array.from(t.entries()),range:r}}}b.call(f,"application/x-lexical-editor",h.call(k,{namespace:d,state:m}))}}})}const Q={tag:"history-merge"};
20
- function S(a,e){if(null!==e)if(void 0===e)a.update(()=>{var f=y.$getRoot();if(null===f.getFirstChild()){const c=y.$createParagraphNode();f.append(c);f=document.activeElement;(null!==y.$getSelection()||null!==f&&f===a.getRootElement())&&c.select()}},Q);else if(null!==e)switch(typeof e){case "string":e=a.parseEditorState(e);a.setEditorState(e,Q);break;case "object":a.setEditorState(e,Q);break;case "function":a.update(e,Q)}}
21
- function T(a){u.useEffect(()=>{const e=f=>{var c=a.getRootElement();if(document.activeElement===c&&(c=f.data,"string"===typeof c)){try{var d=JSON.parse(c)}catch(b){return}if(d&&"nuanria_messaging"===d.protocol&&"request"===d.type&&(d=d.payload)&&"makeChanges"===d.functionId&&(d=d.args)){const [b,k,h,l,t]=d;a.update(()=>{const m=y.$getSelection();if(y.$isRangeSelection(m)){var n=m.anchor;let q=n.getNode(),p=0,r=0;y.$isTextNode(q)&&0<=b&&0<=k&&(p=b,r=b+k,m.setTextNodeRange(q,p,q,r));if(p!==r||""!==
22
- h)m.insertRawText(h),q=n.getNode();y.$isTextNode(q)&&(p=l,r=l+t,n=q.getTextContentSize(),p=p>n?n:p,r=r>n?n:r,m.setTextNodeRange(q,p,q,r));f.stopImmediatePropagation()}})}}};window.addEventListener("message",e,!0);return()=>{window.removeEventListener("message",e,!0)}},[a])}
23
- function U(a,e){u.useLayoutEffect(()=>{const f=a.addListener("command",(c,d)=>{var b=y.$getSelection();if("click"===c&&y.$isNodeSelection(b))return b.clear(),!0;if(!y.$isRangeSelection(b))return!1;switch(c){case "deleteCharacter":return b.deleteCharacter(d),!0;case "deleteWord":return b.deleteWord(d),!0;case "deleteLine":return b.deleteLine(d),!0;case "insertText":return"string"===typeof d?b.insertText(d):(c=d.dataTransfer,null!=c?L(c,b,a):(d=d.data)&&b.insertText(d)),!0;case "removeText":return b.removeText(),
24
- !0;case "formatText":return b.formatText(d),!0;case "formatElement":return b=b.anchor.getNode(),(y.$isElementNode(b)?b:b.getParentOrThrow()).setFormat(d),!0;case "insertLineBreak":return b.insertLineBreak(d),!0;case "insertParagraph":return b.insertParagraph(),!0;case "indentContent":return b=b.anchor,b="element"===b.type?b.getNode():b.getNode().getParentOrThrow(),b.canInsertTab()?a.execCommand("insertText","\t"):10!==b.getIndent()&&b.setIndent(b.getIndent()+1),!0;case "outdentContent":return b=b.anchor,
25
- d=b.getNode(),c="element"===b.type?b.getNode():b.getNode().getParentOrThrow(),c.canInsertTab()?"\t"===d.getTextContent()[b.offset-1]&&a.execCommand("deleteCharacter",!0):0!==c.getIndent()&&c.setIndent(c.getIndent()-1),!0;case "keyArrowLeft":c=d.shiftKey;if(M(b,!0))return d.preventDefault(),d=c,c=I(b),b.modify(d?"extend":"move",!c,"character"),!0;break;case "keyArrowRight":c=d.shiftKey;if(M(b,!1))return d.preventDefault(),d=c,c=I(b),b.modify(d?"extend":"move",c,"character"),!0;break;case "keyBackspace":return d.preventDefault(),
26
- {anchor:d}=b,b.isCollapsed()&&0===d.offset&&0<("element"===d.type?d.getNode():d.getNode().getParentOrThrow()).getIndent()?a.execCommand("outdentContent"):a.execCommand("deleteCharacter",!0);case "keyDelete":return d.preventDefault(),a.execCommand("deleteCharacter",!1);case "keyEnter":return d.preventDefault(),d.shiftKey?a.execCommand("insertLineBreak"):a.execCommand("insertParagraph");case "keyTab":return d.preventDefault(),a.execCommand(d.shiftKey?"outdentContent":"indentContent");case "keyEscape":return a.blur(),
27
- !0;case "copy":return P(d,a),!0;case "cut":return O(d,a),!0;case "paste":return N(d,a),!0;case "drop":case "dragstart":return d.preventDefault(),!0}return!1},0);S(a,e);return f},[a]);T(a)}module.exports=function({contentEditable:a,placeholder:e,initialEditorState:f}){const [c]=g.useLexicalComposerContext(),d=E(c);U(c,f);f=F(c);return u.createElement(u.Fragment,null,a,d&&e,f)};
7
+ var g=require("@lexical/react/LexicalComposerContext"),h=require("react"),r=require("lexical"),u=require("react-dom"),v=require("@lexical/clipboard");function w(a,e=!0){if(a)return!1;a=r.$getRoot().getTextContent();e&&(a=a.trim());return""===a}
8
+ function x(a){if(!w(a,!1))return!1;a=r.$getRoot().getChildren();const e=a.length;if(1<e)return!1;for(let d=0;d<e;d++){var f=a[d];if(r.$isElementNode(f)){if("paragraph"!==f.__type||0!==f.__indent)return!1;f=f.getChildren();const c=f.length;for(let b=0;b<c;b++)if(!r.$isTextNode(f[d]))return!1}}return!0}function y(a){return()=>x(a)}var z="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?h.useLayoutEffect:h.useEffect;
9
+ function A(a){const [e,f]=h.useState(a.getEditorState().read(y(a.isComposing())));z(()=>a.addListener("update",({editorState:d})=>{const c=a.isComposing();d=d.read(y(c));f(d)}),[a]);return e}function C(a){const [e,f]=h.useState(()=>a.getDecorators());z(()=>a.addListener("decorator",d=>{u.flushSync(()=>{f(d)})}),[a]);return h.useMemo(()=>{const d=[],c=Object.keys(e);for(let p=0;p<c.length;p++){var b=c[p];const t=e[b];b=a.getElementByKey(b);null!==b&&d.push(u.createPortal(t,b))}return d},[e,a])}
10
+ function D(a){a=a.anchor.getNode();return"rtl"===(r.$isRootNode(a)?a:a.getParentOrThrow()).getDirection()}function E(a,e){a=r.$getDecoratorNode(a.focus,e);return r.$isDecoratorNode(a)&&!a.isIsolated()}function F(a,e){G(a,e);e.update(()=>{const f=r.$getSelection();r.$isRangeSelection(f)&&f.removeText()})}
11
+ function G(a,e){a.preventDefault();e.update(()=>{const f=a.clipboardData,d=r.$getSelection();if(null!==d&&null!=f){const c=v.getHtmlContent(e),b=v.$getLexicalContent(e);null!==c&&f.setData("text/html",c);null!==b&&f.setData("application/x-lexical-editor",b);f.setData("text/plain",d.getTextContent())}})}function H(a,e){a.preventDefault();e.update(()=>{const f=r.$getSelection(),d=a.clipboardData;null!=d&&r.$isRangeSelection(f)&&v.$insertDataTransferForRichText(d,f,e)})}const I={tag:"history-merge"};
12
+ function J(a,e){if(null!==e)if(void 0===e)a.update(()=>{var f=r.$getRoot();if(null===f.getFirstChild()){const d=r.$createParagraphNode();f.append(d);f=document.activeElement;(null!==r.$getSelection()||null!==f&&f===a.getRootElement())&&d.select()}},I);else if(null!==e)switch(typeof e){case "string":e=a.parseEditorState(e);a.setEditorState(e,I);break;case "object":a.setEditorState(e,I);break;case "function":a.update(e,I)}}
13
+ function K(a){h.useEffect(()=>{const e=f=>{var d=a.getRootElement();if(document.activeElement===d&&(d=f.data,"string"===typeof d)){try{var c=JSON.parse(d)}catch(b){return}if(c&&"nuanria_messaging"===c.protocol&&"request"===c.type&&(c=c.payload)&&"makeChanges"===c.functionId&&(c=c.args)){const [b,p,t,B,L]=c;a.update(()=>{const q=r.$getSelection();if(r.$isRangeSelection(q)){var n=q.anchor;let k=n.getNode(),l=0,m=0;r.$isTextNode(k)&&0<=b&&0<=p&&(l=b,m=b+p,q.setTextNodeRange(k,l,k,m));if(l!==m||""!==
14
+ t)q.insertRawText(t),k=n.getNode();r.$isTextNode(k)&&(l=B,m=B+L,n=k.getTextContentSize(),l=l>n?n:l,m=m>n?n:m,q.setTextNodeRange(k,l,k,m));f.stopImmediatePropagation()}})}}};window.addEventListener("message",e,!0);return()=>{window.removeEventListener("message",e,!0)}},[a])}
15
+ function M(a,e){z(()=>{const f=a.addListener("command",(d,c)=>{var b=r.$getSelection();if("click"===d&&r.$isNodeSelection(b))return b.clear(),!0;if(!r.$isRangeSelection(b))return!1;switch(d){case "deleteCharacter":return b.deleteCharacter(c),!0;case "deleteWord":return b.deleteWord(c),!0;case "deleteLine":return b.deleteLine(c),!0;case "insertText":return"string"===typeof c?b.insertText(c):(d=c.dataTransfer,null!=d?v.$insertDataTransferForRichText(d,b,a):(c=c.data)&&b.insertText(c)),!0;case "removeText":return b.removeText(),
16
+ !0;case "formatText":return b.formatText(c),!0;case "formatElement":return b=b.anchor.getNode(),(r.$isElementNode(b)?b:b.getParentOrThrow()).setFormat(c),!0;case "insertLineBreak":return b.insertLineBreak(c),!0;case "insertParagraph":return b.insertParagraph(),!0;case "indentContent":return b=b.anchor,b="element"===b.type?b.getNode():b.getNode().getParentOrThrow(),b.canInsertTab()?a.execCommand("insertText","\t"):10!==b.getIndent()&&b.setIndent(b.getIndent()+1),!0;case "outdentContent":return b=b.anchor,
17
+ c=b.getNode(),d="element"===b.type?b.getNode():b.getNode().getParentOrThrow(),d.canInsertTab()?"\t"===c.getTextContent()[b.offset-1]&&a.execCommand("deleteCharacter",!0):0!==d.getIndent()&&d.setIndent(d.getIndent()-1),!0;case "keyArrowLeft":d=c.shiftKey;if(E(b,!0))return c.preventDefault(),c=d,d=D(b),b.modify(c?"extend":"move",!d,"character"),!0;break;case "keyArrowRight":d=c.shiftKey;if(E(b,!1))return c.preventDefault(),c=d,d=D(b),b.modify(c?"extend":"move",d,"character"),!0;break;case "keyBackspace":return c.preventDefault(),
18
+ {anchor:c}=b,b.isCollapsed()&&0===c.offset&&0<("element"===c.type?c.getNode():c.getNode().getParentOrThrow()).getIndent()?a.execCommand("outdentContent"):a.execCommand("deleteCharacter",!0);case "keyDelete":return c.preventDefault(),a.execCommand("deleteCharacter",!1);case "keyEnter":return c.preventDefault(),c.shiftKey?a.execCommand("insertLineBreak"):a.execCommand("insertParagraph");case "keyTab":return c.preventDefault(),a.execCommand(c.shiftKey?"outdentContent":"indentContent");case "keyEscape":return a.blur(),
19
+ !0;case "copy":return G(c,a),!0;case "cut":return F(c,a),!0;case "paste":return H(c,a),!0;case "drop":case "dragstart":return c.preventDefault(),!0}return!1},0);J(a,e);return f},[a]);K(a)}module.exports=function({contentEditable:a,placeholder:e,initialEditorState:f}){const [d]=g.useLexicalComposerContext(),c=A(d);M(d,f);f=C(d);return h.createElement(h.Fragment,null,a,c&&e,f)};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ export default function LexicalTablePlugin(): null;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {LexicalEditor} from 'lexical';
10
+ export default function TreeView(props: {
11
+ timeTravelPanelClassName: string;
12
+ timeTravelPanelSliderClassName: string;
13
+ timeTravelPanelButtonClassName: string;
14
+ timeTravelButtonClassName: string;
15
+ viewClassName: string;
16
+ editor: LexicalEditor;
17
+ }): React.ReactNode;
package/package.json CHANGED
@@ -12,12 +12,13 @@
12
12
  "rich-text"
13
13
  ],
14
14
  "license": "MIT",
15
- "version": "0.1.11",
15
+ "version": "0.1.12",
16
16
  "peerDependencies": {
17
- "lexical": "0.1.11",
18
- "@lexical/helpers": "0.1.11",
19
- "@lexical/table": "0.1.11",
20
- "@lexical/yjs": "0.1.11",
17
+ "lexical": "0.1.12",
18
+ "@lexical/helpers": "0.1.12",
19
+ "@lexical/table": "0.1.12",
20
+ "@lexical/yjs": "0.1.12",
21
+ "@lexical/clipboard": "0.1.12",
21
22
  "react": ">=17.x",
22
23
  "react-dom": ">=17.x"
23
24
  },
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {DecoratorMap, DecoratorStateValue} from 'lexical';
10
+ export default function useLexicalDecoratorMap<V extends DecoratorStateValue>(
11
+ decoratorMap: DecoratorMap,
12
+ key: string,
13
+ initialValue: (() => V) | V,
14
+ ): [V, (arg0: DecoratorStateValue) => void];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {LexicalEditor} from 'lexical';
10
+ export default function useLexicalIsTextContentEmpty(
11
+ editor: LexicalEditor,
12
+ trim?: boolean,
13
+ ): boolean;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {NodeKey} from 'lexical';
10
+ export default function useLexicalNodeSelection(
11
+ key: NodeKey,
12
+ ): [boolean, (arg0: boolean) => void, () => void];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ type UnsubscribeFn = () => void;
10
+ export default function withSubscriptions(
11
+ ...unsubscribe: Array<UnsubscribeFn>
12
+ ): () => void;