@lexical/selection 0.2.2 → 0.2.3
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/LexicalSelection.dev.js
CHANGED
package/LexicalSelection.prod.js
CHANGED
|
@@ -10,7 +10,7 @@ e.__children.indexOf(a.getKey()):a.getIndexWithinParent();a=c}}
|
|
|
10
10
|
function x(a){if(l.$isRangeSelection(a)){var c=a.anchor,b=a.focus,g=c.getCharacterOffset();const n=b.getCharacterOffset();var h=c.getNode(),e=b.getNode(),d=h.getParentOrThrow();if(h===e&&l.$isTextNode(h)&&(d.canBeEmpty()||1<d.getChildrenSize()))return a=u(h),h=n>g,a.__text=a.__text.slice(h?g:n,h?n:g),g=a.getKey(),{nodeMap:[[g,a]],range:[g]};a=a.getNodes();if(0===a.length)return{nodeMap:[],range:[]};h=a.length;e=a[0];d=e.getParent();if(null!==d&&(!d.canBeEmpty()||l.$isRootNode(d))){var f=d.__children;
|
|
11
11
|
if(f.length===h){var k=!0;for(var m=0;m<f.length;m++)if(f[m]!==a[m].__key){k=!1;break}k&&(h++,a.push(d))}}d=a[h-1];c=c.isBefore(b);b=new Map;f=[];w(e,c?g:n,!0,f,b);for(e=0;e<h;e++)if(k=a[e],m=k.getKey(),!(b.has(m)||l.$isElementNode(k)&&k.excludeFromCopy())){const r=u(k);l.$isRootNode(k.getParent())&&f.push(k.getKey());b.set(m,r)}w(d,c?n:g,!1,f,b);return{nodeMap:Array.from(b.entries()),range:f}}if(l.$isGridSelection(a))return{nodeMap:a.getNodes().map(n=>{const r=n.getKey();n=u(n);return[r,n]}),range:[a.gridKey]};
|
|
12
12
|
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.");}function y(a){return t.get(a)||null}function z(a,c){var b=y(a.getStyle());c=b?{...b,...c}:c;b="";for(g in c)g&&(b+=`${g}: ${c[g]};`);var g=b;a.setStyle(g);t.set(g,c)}function A(a,c,b,g){a.modify(c?"extend":"move",b,g)}function B(a){a=a.anchor.getNode();return"rtl"===(l.$isRootNode(a)?a:a.getParentOrThrow()).getDirection()}
|
|
13
|
-
function C(a){for(;null!==a&&!l.$isRootNode(a);){const c=a.getLatest(),b=a.getParent();0===c.__children.length&&a.remove();a=b}}exports.$cloneContents=function(a){return x(a)};
|
|
13
|
+
function C(a){for(;null!==a&&!l.$isRootNode(a);){const c=a.getLatest(),b=a.getParent();0===c.__children.length&&a.remove(!0);a=b}}exports.$cloneContents=function(a){return x(a)};
|
|
14
14
|
exports.$getSelectionStyleValueForProperty=function(a,c,b=""){let g=null;const h=a.getNodes();var e=a.anchor,d=a.focus,f=a.isBackward();a=f?d.offset:e.offset;e=f?d.getNode():e.getNode();for(d=0;d<h.length;d++){var k=h[d];if((0===d||0!==a||!k.is(e))&&l.$isTextNode(k)){f=c;var m=b;k=k.getStyle();k=y(k);f=null!==k?k[f]||m:m;if(null===g)g=f;else if(g!==f){g="";break}}}return null===g?b:g};exports.$isAtNodeEnd=function(a){return"text"===a.type?a.offset===a.getNode().getTextContentSize():a.offset===a.getNode().getChildrenSize()};
|
|
15
15
|
exports.$isParentElementRTL=B;exports.$moveCaretSelection=A;exports.$moveCharacter=function(a,c,b){const g=B(a);A(a,c,b?!g:g,"character")};
|
|
16
16
|
exports.$patchStyleText=function(a,c){var b=a.getNodes();const g=b.length-1;let h=b[0],e=b[g];if(!a.isCollapsed()){var d=a.anchor,f=a.focus;a=h.getTextContent().length;var k=f.offset,m=d.offset;d=(f=d.isBefore(f))?m:k;f=f?k:m;if(d===h.getTextContentSize()){const n=h.getNextSibling();l.$isTextNode(n)&&(d=m=0,h=n)}if(h.is(e))l.$isTextNode(h)&&(d=m>k?k:m,f=m>k?m:k,d!==f&&(0===d&&f===a?(z(h,c),h.select(d,f)):(b=h.splitText(d,f),b=0===d?b[0]:b[1],z(b,c),b.select(0,f-d))));else for(l.$isTextNode(h)&&(0!==
|
package/package.json
CHANGED