@lexical/text 0.7.0 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -96,7 +96,7 @@ function $canShowPlaceholder(isComposing) {
96
96
  const topBlock = children[i];
97
97
 
98
98
  if (lexical.$isElementNode(topBlock)) {
99
- if (topBlock.__type !== 'paragraph') {
99
+ if (!lexical.$isParagraphNode(topBlock)) {
100
100
  return false;
101
101
  }
102
102
 
@@ -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
- 'use strict';var h=require("lexical");function r(c,g=!0){if(c)return!1;c=t();g&&(c=c.trim());return""===c}function t(){return h.$getRoot().getTextContent()}function u(c){if(!r(c,!1))return!1;c=h.$getRoot().getChildren();let g=c.length;if(1<g)return!1;for(let e=0;e<g;e++){var b=c[e];if(h.$isElementNode(b)){if("paragraph"!==b.__type||0!==b.__indent)return!1;b=b.getChildren();let n=b.length;for(let p=0;p<n;p++)if(!h.$isTextNode(b[e]))return!1}}return!0}exports.$canShowPlaceholder=u;
7
+ 'use strict';var h=require("lexical");function r(c,g=!0){if(c)return!1;c=t();g&&(c=c.trim());return""===c}function t(){return h.$getRoot().getTextContent()}function u(c){if(!r(c,!1))return!1;c=h.$getRoot().getChildren();let g=c.length;if(1<g)return!1;for(let e=0;e<g;e++){var b=c[e];if(h.$isElementNode(b)){if(!h.$isParagraphNode(b)||0!==b.__indent)return!1;b=b.getChildren();let n=b.length;for(let p=0;p<n;p++)if(!h.$isTextNode(b[e]))return!1}}return!0}exports.$canShowPlaceholder=u;
8
8
  exports.$canShowPlaceholderCurry=function(c){return()=>u(c)};exports.$findTextIntersectionFromCharacters=function(c,g){var b=c.getFirstChild();c=0;a:for(;null!==b;){if(h.$isElementNode(b)){var e=b.getFirstChild();if(null!==e){b=e;continue}}else if(h.$isTextNode(b)){e=b.getTextContentSize();if(c+e>g)return{node:b,offset:g-c};c+=e}e=b.getNextSibling();if(null!==e)b=e;else{for(b=b.getParent();null!==b;){e=b.getNextSibling();if(null!==e){b=e;continue a}b=b.getParent()}break}}return null};
9
9
  exports.$isRootTextContentEmpty=r;exports.$isRootTextContentEmptyCurry=function(c,g){return()=>r(c,g)};exports.$rootTextContent=t;
10
10
  exports.registerLexicalTextEntity=function(c,g,b,e){let n=a=>{const d=h.$createTextNode(a.getTextContent());d.setFormat(a.getFormat());a.replace(d)},p=c.registerNodeTransform(h.TextNode,a=>{if(a.isSimpleText()){var d=a.getPreviousSibling(),l=a.getTextContent(),m=a;if(h.$isTextNode(d)){var k=d.getTextContent(),f=g(k+l);if(d instanceof b){if(null===f||0!==d.getLatest().__mode){n(d);return}f=f.end-k.length;if(0<f){m=l.slice(0,f);m=k+m;d.select();d.setTextContent(m);f===l.length?a.remove():(d=l.slice(f),
package/package.json CHANGED
@@ -9,10 +9,10 @@
9
9
  "text"
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "0.7.0",
12
+ "version": "0.7.2",
13
13
  "main": "LexicalText.js",
14
14
  "peerDependencies": {
15
- "lexical": "0.7.0"
15
+ "lexical": "0.7.2"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",