@lexical/react 0.2.4 → 0.2.5

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.
@@ -22,20 +22,10 @@ var react = require('react');
22
22
  function useList(editor) {
23
23
  react.useEffect(() => {
24
24
  return utils.mergeRegister(editor.registerCommand(lexical.INDENT_CONTENT_COMMAND, () => {
25
- const hasHandledIndention = list.indentList();
26
-
27
- if (hasHandledIndention) {
28
- return true;
29
- }
30
-
25
+ list.indentList();
31
26
  return false;
32
27
  }, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical.OUTDENT_CONTENT_COMMAND, () => {
33
- const hasHandledIndention = list.outdentList();
34
-
35
- if (hasHandledIndention) {
36
- return true;
37
- }
38
-
28
+ list.outdentList();
39
29
  return false;
40
30
  }, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(list.INSERT_ORDERED_LIST_COMMAND, () => {
41
31
  list.insertList(editor, 'ol');
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  var b=require("@lexical/list"),c=require("@lexical/utils"),d=require("lexical"),e=require("react");
8
- function f(a){e.useEffect(()=>c.mergeRegister(a.registerCommand(d.INDENT_CONTENT_COMMAND,()=>b.indentList()?!0:!1,d.COMMAND_PRIORITY_LOW),a.registerCommand(d.OUTDENT_CONTENT_COMMAND,()=>b.outdentList()?!0:!1,d.COMMAND_PRIORITY_LOW),a.registerCommand(b.INSERT_ORDERED_LIST_COMMAND,()=>{b.insertList(a,"ol");return!0},d.COMMAND_PRIORITY_LOW),a.registerCommand(b.INSERT_UNORDERED_LIST_COMMAND,()=>{b.insertList(a,"ul");return!0},d.COMMAND_PRIORITY_LOW),a.registerCommand(b.REMOVE_LIST_COMMAND,()=>{b.removeList(a);
9
- return!0},d.COMMAND_PRIORITY_LOW),a.registerCommand(d.INSERT_PARAGRAPH_COMMAND,()=>b.$handleListInsertParagraph()?!0:!1,d.COMMAND_PRIORITY_LOW)),[a])}module.exports=function(a){f(a)};
8
+ function f(a){e.useEffect(()=>c.mergeRegister(a.registerCommand(d.INDENT_CONTENT_COMMAND,()=>{b.indentList();return!1},d.COMMAND_PRIORITY_LOW),a.registerCommand(d.OUTDENT_CONTENT_COMMAND,()=>{b.outdentList();return!1},d.COMMAND_PRIORITY_LOW),a.registerCommand(b.INSERT_ORDERED_LIST_COMMAND,()=>{b.insertList(a,"ol");return!0},d.COMMAND_PRIORITY_LOW),a.registerCommand(b.INSERT_UNORDERED_LIST_COMMAND,()=>{b.insertList(a,"ul");return!0},d.COMMAND_PRIORITY_LOW),a.registerCommand(b.REMOVE_LIST_COMMAND,()=>
9
+ {b.removeList(a);return!0},d.COMMAND_PRIORITY_LOW),a.registerCommand(d.INSERT_PARAGRAPH_COMMAND,()=>b.$handleListInsertParagraph()?!0:!1,d.COMMAND_PRIORITY_LOW)),[a])}module.exports=function(a){f(a)};
@@ -56,7 +56,6 @@ function LexicalComposer({
56
56
 
57
57
  if (editor === null) {
58
58
  const newEditor = lexical.createEditor({
59
- context,
60
59
  namespace,
61
60
  nodes,
62
61
  onError: error => onError(error, newEditor),
@@ -4,5 +4,5 @@
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 a=require("@lexical/react/LexicalComposerContext"),e=require("lexical"),l=require("react"),m="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?l.useLayoutEffect:l.useEffect;
8
- module.exports=function({initialConfig:f,children:n}){const k=l.useMemo(()=>{const {theme:b,namespace:c,editor__DEPRECATED:p,nodes:q,onError:r}=f,g=a.createLexicalComposerContext(null,b);let d=p||null;if(null===d){const h=e.createEditor({context:g,namespace:c,nodes:q,onError:t=>r(t,h),readOnly:!0,theme:b});d=h}return[d,g]},[]);m(()=>{const b=f.readOnly,[c]=k;c.setReadOnly(b||!1)},[]);return l.createElement(a.LexicalComposerContext.Provider,{value:k},n)};
7
+ var a=require("@lexical/react/LexicalComposerContext"),e=require("lexical"),k=require("react"),l="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?k.useLayoutEffect:k.useEffect;
8
+ module.exports=function({initialConfig:f,children:m}){const h=k.useMemo(()=>{const {theme:b,namespace:c,editor__DEPRECATED:n,nodes:p,onError:q}=f,r=a.createLexicalComposerContext(null,b);let d=n||null;if(null===d){const g=e.createEditor({namespace:c,nodes:p,onError:t=>q(t,g),readOnly:!0,theme:b});d=g}return[d,r]},[]);l(()=>{const b=f.readOnly,[c]=h;c.setReadOnly(b||!1)},[]);return k.createElement(a.LexicalComposerContext.Provider,{value:h},m)};
@@ -17,6 +17,11 @@ var lexical = require('lexical');
17
17
  *
18
18
  */
19
19
  class DecoratorBlockNode extends lexical.DecoratorNode {
20
+ constructor(format, key) {
21
+ super(key);
22
+ this.__format = format;
23
+ }
24
+
20
25
  createDOM() {
21
26
  return document.createElement('div');
22
27
  }
@@ -31,13 +36,9 @@ class DecoratorBlockNode extends lexical.DecoratorNode {
31
36
  }
32
37
 
33
38
  }
34
- function $createDecoratorBlockNode() {
35
- return new DecoratorBlockNode();
36
- }
37
39
  function $isDecoratorBlockNode(node) {
38
40
  return node instanceof DecoratorBlockNode;
39
41
  }
40
42
 
41
- exports.$createDecoratorBlockNode = $createDecoratorBlockNode;
42
43
  exports.$isDecoratorBlockNode = $isDecoratorBlockNode;
43
44
  exports.DecoratorBlockNode = DecoratorBlockNode;
@@ -7,17 +7,22 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
- import type {ElementFormatType, LexicalNode, LexicalCommand} from 'lexical';
10
+ import type {
11
+ ElementFormatType,
12
+ LexicalNode,
13
+ LexicalCommand,
14
+ NodeKey,
15
+ } from 'lexical';
11
16
 
12
17
  import {DecoratorNode} from 'lexical';
13
18
 
14
19
  declare export class DecoratorBlockNode<T> extends DecoratorNode<T> {
15
20
  __format: ?ElementFormatType;
21
+ constructor(format?: ?ElementFormatType, key?: NodeKey): void;
16
22
  createDOM(): HTMLElement;
17
23
  setFormat(format: ElementFormatType): void;
18
24
  }
19
25
 
20
- declare export function $createDecoratorBlockNode<T>(): DecoratorBlockNode<T>;
21
26
  declare export function $isDecoratorBlockNode(
22
27
  node: ?LexicalNode,
23
28
  ): boolean %checks(node instanceof DecoratorBlockNode);
@@ -4,4 +4,4 @@
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 a=require("lexical");class c extends a.DecoratorNode{createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(b){this.getWritable().__format=b}}exports.$createDecoratorBlockNode=function(){return new c};exports.$isDecoratorBlockNode=function(b){return b instanceof c};exports.DecoratorBlockNode=c;
7
+ var b=require("lexical");class c extends b.DecoratorNode{constructor(a,d){super(d);this.__format=a}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(a){this.getWritable().__format=a}}exports.$isDecoratorBlockNode=function(a){return a instanceof c};exports.DecoratorBlockNode=c;
@@ -78,6 +78,12 @@ function toggleLink(url) {
78
78
  return;
79
79
  }
80
80
 
81
+ if (link.$isLinkNode(parent)) {
82
+ linkNode = parent;
83
+ parent.setURL(url);
84
+ return;
85
+ }
86
+
81
87
  if (!parent.is(prevParent)) {
82
88
  prevParent = parent;
83
89
  linkNode = link.$createLinkNode(url);
@@ -4,7 +4,7 @@
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/link"),k=require("@lexical/react/LexicalComposerContext"),m=require("lexical"),n=require("react");
8
- function p(e){var b=m.$getSelection();null!==b&&m.$setSelection(b);b=m.$getSelection();if(null!==b)if(b=b.extract(),null===e)b.forEach(f=>{f=f.getParent();if(g.$isLinkNode(f)){const c=f.getChildren();for(let a=0;a<c.length;a++)f.insertBefore(c[a]);f.remove()}});else{if(1===b.length){var h=b[0];if(g.$isLinkNode(h)){h.setURL(e);return}h=h.getParent();if(g.$isLinkNode(h)){h.setURL(e);return}}let f=null,c=null;b.forEach(a=>{var d=a.getParent();if(d!==c&&null!==d&&(!m.$isElementNode(a)||a.isInline()))if(d.is(f)||
9
- (f=d,c=g.$createLinkNode(e),g.$isLinkNode(d)?null===a.getPreviousSibling()?d.insertBefore(c):d.insertAfter(c):a.insertBefore(c)),g.$isLinkNode(a)){if(null!==c){d=a.getChildren();for(let l=0;l<d.length;l++)c.append(d[l])}a.remove()}else null!==c&&c.append(a)})}}
10
- module.exports=function(){const [e]=k.useLexicalComposerContext();n.useEffect(()=>{if(!e.hasNodes([g.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");},[e]);n.useEffect(()=>e.registerCommand(g.TOGGLE_LINK_COMMAND,b=>{p(b);return!0},m.COMMAND_PRIORITY_EDITOR),[e]);return null};
7
+ var f=require("@lexical/link"),k=require("@lexical/react/LexicalComposerContext"),m=require("lexical"),n=require("react");
8
+ function p(e){var d=m.$getSelection();null!==d&&m.$setSelection(d);d=m.$getSelection();if(null!==d)if(d=d.extract(),null===e)d.forEach(g=>{g=g.getParent();if(f.$isLinkNode(g)){const a=g.getChildren();for(let b=0;b<a.length;b++)g.insertBefore(a[b]);g.remove()}});else{if(1===d.length){var h=d[0];if(f.$isLinkNode(h)){h.setURL(e);return}h=h.getParent();if(f.$isLinkNode(h)){h.setURL(e);return}}let g=null,a=null;d.forEach(b=>{var c=b.getParent();if(c!==a&&null!==c&&(!m.$isElementNode(b)||b.isInline()))if(f.$isLinkNode(c))a=
9
+ c,c.setURL(e);else if(c.is(g)||(g=c,a=f.$createLinkNode(e),f.$isLinkNode(c)?null===b.getPreviousSibling()?c.insertBefore(a):c.insertAfter(a):b.insertBefore(a)),f.$isLinkNode(b)){if(null!==a){c=b.getChildren();for(let l=0;l<c.length;l++)a.append(c[l])}b.remove()}else null!==a&&a.append(b)})}}
10
+ module.exports=function(){const [e]=k.useLexicalComposerContext();n.useEffect(()=>{if(!e.hasNodes([f.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");},[e]);n.useEffect(()=>e.registerCommand(f.TOGGLE_LINK_COMMAND,d=>{p(d);return!0},m.COMMAND_PRIORITY_EDITOR),[e]);return null};
@@ -23,20 +23,10 @@ var react = require('react');
23
23
  function useList(editor) {
24
24
  react.useEffect(() => {
25
25
  return utils.mergeRegister(editor.registerCommand(lexical.INDENT_CONTENT_COMMAND, () => {
26
- const hasHandledIndention = list.indentList();
27
-
28
- if (hasHandledIndention) {
29
- return true;
30
- }
31
-
26
+ list.indentList();
32
27
  return false;
33
28
  }, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical.OUTDENT_CONTENT_COMMAND, () => {
34
- const hasHandledIndention = list.outdentList();
35
-
36
- if (hasHandledIndention) {
37
- return true;
38
- }
39
-
29
+ list.outdentList();
40
30
  return false;
41
31
  }, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(list.INSERT_ORDERED_LIST_COMMAND, () => {
42
32
  list.insertList(editor, 'ol');
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  var b=require("@lexical/react/LexicalComposerContext"),c=require("@lexical/list"),d=require("@lexical/utils"),e=require("lexical"),f=require("react");
8
- function g(a){f.useEffect(()=>d.mergeRegister(a.registerCommand(e.INDENT_CONTENT_COMMAND,()=>c.indentList()?!0:!1,e.COMMAND_PRIORITY_LOW),a.registerCommand(e.OUTDENT_CONTENT_COMMAND,()=>c.outdentList()?!0:!1,e.COMMAND_PRIORITY_LOW),a.registerCommand(c.INSERT_ORDERED_LIST_COMMAND,()=>{c.insertList(a,"ol");return!0},e.COMMAND_PRIORITY_LOW),a.registerCommand(c.INSERT_UNORDERED_LIST_COMMAND,()=>{c.insertList(a,"ul");return!0},e.COMMAND_PRIORITY_LOW),a.registerCommand(c.REMOVE_LIST_COMMAND,()=>{c.removeList(a);
9
- return!0},e.COMMAND_PRIORITY_LOW),a.registerCommand(e.INSERT_PARAGRAPH_COMMAND,()=>c.$handleListInsertParagraph()?!0:!1,e.COMMAND_PRIORITY_LOW)),[a])}module.exports=function(){const [a]=b.useLexicalComposerContext();g(a);return null};
8
+ function g(a){f.useEffect(()=>d.mergeRegister(a.registerCommand(e.INDENT_CONTENT_COMMAND,()=>{c.indentList();return!1},e.COMMAND_PRIORITY_LOW),a.registerCommand(e.OUTDENT_CONTENT_COMMAND,()=>{c.outdentList();return!1},e.COMMAND_PRIORITY_LOW),a.registerCommand(c.INSERT_ORDERED_LIST_COMMAND,()=>{c.insertList(a,"ol");return!0},e.COMMAND_PRIORITY_LOW),a.registerCommand(c.INSERT_UNORDERED_LIST_COMMAND,()=>{c.insertList(a,"ul");return!0},e.COMMAND_PRIORITY_LOW),a.registerCommand(c.REMOVE_LIST_COMMAND,()=>
9
+ {c.removeList(a);return!0},e.COMMAND_PRIORITY_LOW),a.registerCommand(e.INSERT_PARAGRAPH_COMMAND,()=>c.$handleListInsertParagraph()?!0:!1,e.COMMAND_PRIORITY_LOW)),[a])}module.exports=function(){const [a]=b.useLexicalComposerContext();g(a);return null};
@@ -8,5 +8,7 @@
8
8
 
9
9
  import type {EditorState, LexicalEditor} from 'lexical';
10
10
  export default function OnChangePlugin(arg0: {
11
+ ignoreInitialChange?: boolean;
12
+ ignoreSelectionChange?: boolean;
11
13
  onChange: (editorState: EditorState, editor: LexicalEditor) => void;
12
14
  }): null;
@@ -10,5 +10,7 @@
10
10
  import type {EditorState, LexicalEditor} from 'lexical';
11
11
 
12
12
  declare export default function OnChangePlugin({
13
+ ignoreInitialChange?: boolean,
14
+ ignoreSelectionChange?: boolean,
13
15
  onChange: (editorState: EditorState, editor: LexicalEditor) => void,
14
16
  }): null;
@@ -186,7 +186,7 @@ function printObjectSelection(selection) {
186
186
  }
187
187
 
188
188
  function printGridSelection(selection) {
189
- return `: grid\n └ { grid: ${selection.gridKey}, anchorCell: ${selection.anchorCellKey}, focusCell: ${selection.focusCellKey} }`;
189
+ return `: grid\n └ { grid: ${selection.gridKey}, anchorCell: ${selection.anchor.key}, focusCell: ${selection.focus.key} }`;
190
190
  }
191
191
 
192
192
  function generateContent(editorState) {
@@ -240,7 +240,7 @@ function printNode(node) {
240
240
  return '';
241
241
  }
242
242
 
243
- const FORMAT_PREDICATES = [node => node.hasFormat('bold') && 'Bold', node => node.hasFormat('code') && 'Code', node => node.hasFormat('italic') && 'Italic', node => node.hasFormat('strikethrough') && 'Strikethrough', node => node.hasFormat('underline') && 'Underline'];
243
+ const FORMAT_PREDICATES = [node => node.hasFormat('bold') && 'Bold', node => node.hasFormat('code') && 'Code', node => node.hasFormat('italic') && 'Italic', node => node.hasFormat('strikethrough') && 'Strikethrough', node => node.hasFormat('subscript') && 'Subscript', node => node.hasFormat('superscript') && 'Superscript', node => node.hasFormat('underline') && 'Underline'];
244
244
  const DETAIL_PREDICATES = [node => node.isDirectionless() && 'Directionless', node => node.isUnmergeable() && 'Unmergeable'];
245
245
  const MODE_PREDICATES = [node => node.isToken() && 'Token', node => node.isSegmented() && 'Segmented', node => node.isInert() && 'Inert'];
246
246
 
@@ -7,10 +7,10 @@
7
7
  var k=require("lexical"),q=require("react");const t=Object.freeze({"\t":"\\t","\n":"\\n"}),D=new RegExp(Object.keys(t).join("|"),"g"),E=Object.freeze({ancestorHasNextSibling:"|",ancestorIsLastChild:" ",hasNextSibling:"\u251c",isLastChild:"\u2514",selectedChar:"^",selectedLine:">"});
8
8
  function F(a){let b="";const c=G(a),e=a.anchor;a=a.focus;const d=e.offset,f=a.offset;b=b+`: range ${""!==c?`{ ${c} }`:""}`+`\n \u251c anchor { key: ${e.key}, offset: ${null===d?"null":d}, type: ${e.type} }`;return b+=`\n \u2514 focus { key: ${a.key}, offset: ${null===f?"null":f}, type: ${a.type} }`}
9
9
  function H(a){let b=" root\n";a=a.read(()=>{const c=k.$getSelection();J(k.$getRoot(),(e,d)=>{const f=`(${e.getKey()})`,g=e.getType()||"",m=e.isSelected();var v=b,u=m?E.selectedLine:" ",r=d.join(" ");if(k.$isTextNode(e)){var l=e.getTextContent(!0);const n=0===l.length?"(empty)":`"${K(l)}"`;l=[G(e),L(e),M(e)].filter(Boolean).join(", ");l=[n,0!==l.length?`{ ${l} }`:null].filter(Boolean).join(" ").trim()}else l="";b=v+`${u} ${r} ${f} ${g} ${l}\n`;b+=N({indent:d,isSelected:m,node:e,nodeKeyDisplay:f,selection:c,
10
- typeDisplay:g})});return null===c?": null":k.$isRangeSelection(c)?F(c):k.$isGridSelection(c)?`: grid\n \u2514 { grid: ${c.gridKey}, anchorCell: ${c.anchorCellKey}, focusCell: ${c.focusCellKey} }`:`: node\n \u2514 [${Array.from(c._nodes).join(", ")}]`});return b+"\n selection"+a}
11
- function J(a,b,c=[]){a=a.getChildren();const e=a.length;a.forEach((d,f)=>{b(d,c.concat(f===e-1?E.isLastChild:E.hasNextSibling));k.$isElementNode(d)&&J(d,b,c.concat(f===e-1?E.ancestorIsLastChild:E.ancestorHasNextSibling))})}function K(a){return Object.entries(t).reduce((b,[c,e])=>b.replace(new RegExp(c,"g"),String(e)),a)}
12
- const O=[a=>a.hasFormat("bold")&&"Bold",a=>a.hasFormat("code")&&"Code",a=>a.hasFormat("italic")&&"Italic",a=>a.hasFormat("strikethrough")&&"Strikethrough",a=>a.hasFormat("underline")&&"Underline"],P=[a=>a.isDirectionless()&&"Directionless",a=>a.isUnmergeable()&&"Unmergeable"],Q=[a=>a.isToken()&&"Token",a=>a.isSegmented()&&"Segmented",a=>a.isInert()&&"Inert"];function L(a){let b=P.map(c=>c(a)).filter(Boolean).join(", ").toLocaleLowerCase();""!==b&&(b="detail: "+b);return b}
13
- function M(a){let b=Q.map(c=>c(a)).filter(Boolean).join(", ").toLocaleLowerCase();""!==b&&(b="mode: "+b);return b}function G(a){let b=O.map(c=>c(a)).filter(Boolean).join(", ").toLocaleLowerCase();""!==b&&(b="format: "+b);return b}
10
+ typeDisplay:g})});return null===c?": null":k.$isRangeSelection(c)?F(c):k.$isGridSelection(c)?`: grid\n \u2514 { grid: ${c.gridKey}, anchorCell: ${c.anchor.key}, focusCell: ${c.focus.key} }`:`: node\n \u2514 [${Array.from(c._nodes).join(", ")}]`});return b+"\n selection"+a}function J(a,b,c=[]){a=a.getChildren();const e=a.length;a.forEach((d,f)=>{b(d,c.concat(f===e-1?E.isLastChild:E.hasNextSibling));k.$isElementNode(d)&&J(d,b,c.concat(f===e-1?E.ancestorIsLastChild:E.ancestorHasNextSibling))})}
11
+ function K(a){return Object.entries(t).reduce((b,[c,e])=>b.replace(new RegExp(c,"g"),String(e)),a)}
12
+ const O=[a=>a.hasFormat("bold")&&"Bold",a=>a.hasFormat("code")&&"Code",a=>a.hasFormat("italic")&&"Italic",a=>a.hasFormat("strikethrough")&&"Strikethrough",a=>a.hasFormat("subscript")&&"Subscript",a=>a.hasFormat("superscript")&&"Superscript",a=>a.hasFormat("underline")&&"Underline"],P=[a=>a.isDirectionless()&&"Directionless",a=>a.isUnmergeable()&&"Unmergeable"],Q=[a=>a.isToken()&&"Token",a=>a.isSegmented()&&"Segmented",a=>a.isInert()&&"Inert"];
13
+ function L(a){let b=P.map(c=>c(a)).filter(Boolean).join(", ").toLocaleLowerCase();""!==b&&(b="detail: "+b);return b}function M(a){let b=Q.map(c=>c(a)).filter(Boolean).join(", ").toLocaleLowerCase();""!==b&&(b="mode: "+b);return b}function G(a){let b=O.map(c=>c(a)).filter(Boolean).join(", ").toLocaleLowerCase();""!==b&&(b="format: "+b);return b}
14
14
  function N({indent:a,isSelected:b,node:c,nodeKeyDisplay:e,selection:d,typeDisplay:f}){if(!k.$isTextNode(c)||!k.$isRangeSelection(d)||!b||k.$isElementNode(c))return"";b=d.anchor;var g=d.focus;if(""===c.getTextContent()||b.getNode()===d.focus.getNode()&&b.offset===g.offset)return"";g=d.anchor;const m=d.focus,v=c.getTextContent(!0),u=v.length;b=d=-1;if("text"===g.type&&"text"===m.type){const n=g.getNode(),w=m.getNode();n===w&&c===n&&g.offset!==m.offset?[d,b]=g.offset<m.offset?[g.offset,m.offset]:[m.offset,
15
15
  g.offset]:c===n?[d,b]=n.isBefore(w)?[g.offset,u]:[0,g.offset]:c===w?[d,b]=w.isBefore(n)?[m.offset,u]:[0,m.offset]:[d,b]=[0,u]}c=(v.slice(0,d).match(D)||[]).length;g=(v.slice(d,b).match(D)||[]).length;const [r,l]=[d+c,b+c+g];if(r===l)return"";c=a[a.length-1]===E.hasNextSibling?E.ancestorHasNextSibling:E.ancestorIsLastChild;a=[...a.slice(0,a.length-1),c];c=Array(r).fill(" ");d=Array(l-r).fill(E.selectedChar);e=Array(e.length+(f.length+3)).fill(" ");return[E.selectedLine,a.join(" "),[...e,...c,...d].join("")].join(" ")+
16
16
  "\n"}
package/package.json CHANGED
@@ -8,27 +8,27 @@
8
8
  "rich-text"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.2.4",
11
+ "version": "0.2.5",
12
12
  "dependencies": {
13
- "@lexical/clipboard": "0.2.4",
14
- "@lexical/list": "0.2.4",
15
- "@lexical/table": "0.2.4",
16
- "@lexical/yjs": "0.2.4",
17
- "@lexical/hashtag": "0.2.4",
18
- "@lexical/selection": "0.2.4",
19
- "@lexical/utils": "0.2.4",
20
- "@lexical/dragon": "0.2.4",
21
- "@lexical/plain-text": "0.2.4",
22
- "@lexical/rich-text": "0.2.4",
23
- "@lexical/code": "0.2.4",
24
- "@lexical/text": "0.2.4",
25
- "@lexical/link": "0.2.4",
26
- "@lexical/overflow": "0.2.4",
27
- "@lexical/history": "0.2.4",
28
- "@lexical/markdown": "0.2.4"
13
+ "@lexical/clipboard": "0.2.5",
14
+ "@lexical/list": "0.2.5",
15
+ "@lexical/table": "0.2.5",
16
+ "@lexical/yjs": "0.2.5",
17
+ "@lexical/hashtag": "0.2.5",
18
+ "@lexical/selection": "0.2.5",
19
+ "@lexical/utils": "0.2.5",
20
+ "@lexical/dragon": "0.2.5",
21
+ "@lexical/plain-text": "0.2.5",
22
+ "@lexical/rich-text": "0.2.5",
23
+ "@lexical/code": "0.2.5",
24
+ "@lexical/text": "0.2.5",
25
+ "@lexical/link": "0.2.5",
26
+ "@lexical/overflow": "0.2.5",
27
+ "@lexical/history": "0.2.5",
28
+ "@lexical/markdown": "0.2.5"
29
29
  },
30
30
  "peerDependencies": {
31
- "lexical": "0.2.4",
31
+ "lexical": "0.2.5",
32
32
  "react": ">=17.x",
33
33
  "react-dom": ">=17.x"
34
34
  },