lexical 0.1.15 → 0.1.16

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/Lexical.dev.js CHANGED
@@ -8220,7 +8220,7 @@ class BaseLexicalEditor {
8220
8220
  const style = nextRootElement.style;
8221
8221
  style.userSelect = 'text';
8222
8222
  style.whiteSpace = 'pre-wrap';
8223
- style.overflowWrap = 'break-word';
8223
+ style.wordBreak = 'break-word';
8224
8224
  nextRootElement.setAttribute('data-lexical-editor', 'true');
8225
8225
  this._dirtyType = FULL_RECONCILE;
8226
8226
  initMutationObserver(getSelf(this));
@@ -8350,7 +8350,7 @@ class BaseLexicalEditor {
8350
8350
  *
8351
8351
  *
8352
8352
  */
8353
- const VERSION = '0.1.15';
8353
+ const VERSION = '0.1.16';
8354
8354
 
8355
8355
  /**
8356
8356
  * Copyright (c) Meta Platforms, Inc. and affiliates.
package/Lexical.prod.js CHANGED
@@ -157,12 +157,12 @@ class pd{constructor(a,b,c,d,e,f){this._parentEditor=b;this._rootElement=null;th
157
157
  new Set;this._dirtyLeaves=new Set;this._dirtyElements=new Map;this._normalizedNodes=new Set;this._updateTags=new Set;this._observer=null;this._key=""+na++;this._onError=e;this._htmlConversions=f;this._readOnly=!1}isComposing(){return null!=this._compositionKey}addListener(a,b,c){const d=this._listeners[a];if("command"===a){void 0===c&&q(56);const f=d[c];f.add(b);return()=>{f.delete(b)}}if("mutation"===a){void 0===this._nodes.get(b.getType())&&q(57,b.name);const f=this._listeners.mutation;f.set(c,
158
158
  b);return()=>{f.delete(c)}}d.add(b);const e="root"===a;e&&b(this._rootElement,null);return()=>{d.delete(b);e&&b(null,this._rootElement)}}addNodeTransform(a,b){const c=a.getType(),d=this._nodes.get(c);void 0===d&&q(57,a.name);const e=d.transforms;e.add(b);Ca(this,c);return()=>{e.delete(b)}}hasNodes(a){for(let b=0;b<a.length;b++){const c=a[b].getType();if(!this._nodes.has(c))return!1}return!0}execCommand(a,b){return Xb(this,a,b)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}setRootElement(a){const b=
159
159
  this._rootElement;if(a!==b){var c=this._pendingEditorState||this._editorState;this._rootElement=a;Tb(this,b,a,c);if(null!==b&&!this._config.disableEvents){0!==Uc&&(Uc--,0===Uc&&b.ownerDocument.removeEventListener("selectionchange",$c));c=b.__lexicalEditor;if(null!=c){if(null!==c._parentEditor){var d=Ga(c);d=d[d.length-1]._key;Zc.get(d)===c&&Zc.delete(d)}else Zc.delete(c._key);b.__lexicalEditor=null}c=Yc(b);for(d=0;d<c.length;d++)c[d]();b.__lexicalEventHandles=[]}null!==a&&(c=a.style,c.userSelect=
160
- "text",c.whiteSpace="pre-wrap",c.overflowWrap="break-word",a.setAttribute("data-lexical-editor","true"),this._dirtyType=2,Ub(this),this._updateTags.add("history-merge"),X(this),this._config.disableEvents||ad(a,this));Vb("root",this,!1,a,b)}}getElementByKey(a){return this._keyToDOMMap.get(a)||null}getEditorState(){return this._editorState}setEditorState(a,b){a.isEmpty()&&q(19);oc(this);const c=this._pendingEditorState,d=this._updateTags;b=void 0!==b?b.tag:null;null===c||c.isEmpty()||(null!=b&&d.add(b),
160
+ "text",c.whiteSpace="pre-wrap",c.wordBreak="break-word",a.setAttribute("data-lexical-editor","true"),this._dirtyType=2,Ub(this),this._updateTags.add("history-merge"),X(this),this._config.disableEvents||ad(a,this));Vb("root",this,!1,a,b)}}getElementByKey(a){return this._keyToDOMMap.get(a)||null}getEditorState(){return this._editorState}setEditorState(a,b){a.isEmpty()&&q(19);oc(this);const c=this._pendingEditorState,d=this._updateTags;b=void 0!==b?b.tag:null;null===c||c.isEmpty()||(null!=b&&d.add(b),
161
161
  X(this));this._pendingEditorState=a;this._dirtyType=2;this._compositionKey=null;null!=b&&d.add(b);X(this)}parseEditorState(a){a=JSON.parse(a);var b=new Map;b=new Zb(b);const c={originalSelection:a._selection},d=W,e=U;T=b;W=!1;U=this;try{const f=new Map(a._nodeMap),g=f.get("root");nb(g,f,this,null,c)}finally{T=b,W=d,U=e}b._selection=Fc(c.remappedSelection||c.originalSelection);return b}update(a,b){Da(this,a,b)}focus(a){const b=this._rootElement;null!==b&&(b.setAttribute("autocapitalize","off"),Da(this,
162
162
  ()=>{const c=L(),d=Ba();null!==c?c.dirty=!0:0!==d.getChildrenSize()&&d.selectEnd()},{onUpdate:()=>{b.removeAttribute("autocapitalize");a&&a()}}))}blur(){var a=this._rootElement;null!==a&&a.blur();a=window.getSelection();null!==a&&a.removeAllRanges()}isReadOnly(){return this._readOnly}setReadOnly(a){this._readOnly=a;Vb("readonly",this,!0,a)}}class qd extends Ic{constructor(a,b){super(b)}}function zc(a){return a instanceof qd}class rd extends Ic{}function xc(a){return a instanceof rd}
163
163
  class sd extends Ic{}function yc(a){return a instanceof sd}exports.$createGridSelection=function(){return new vc("root","root","root")};exports.$createLineBreakNode=Bc;exports.$createNodeFromParse=function(a,b){I();const c=C();return nb(a,b,c,null)};exports.$createNodeSelection=function(){return new tc(new Set)};exports.$createParagraphNode=sc;exports.$createRangeSelection=function(){const a=Y("root",0,"element"),b=Y("root",0,"element");return new uc(a,b,0)};exports.$createTextNode=M;
164
164
  exports.$getDecoratorNode=Sa;exports.$getNearestNodeFromDOMNode=qa;exports.$getNodeByKey=J;exports.$getPreviousSelection=Ka;exports.$getRoot=Ba;exports.$getSelection=L;exports.$isDecoratorNode=u;exports.$isElementNode=D;exports.$isGridCellNode=zc;exports.$isGridNode=xc;exports.$isGridRowNode=yc;exports.$isGridSelection=wc;exports.$isLeafNode=va;exports.$isLineBreakNode=wa;exports.$isNodeSelection=bc;exports.$isParagraphNode=function(a){return a instanceof md};exports.$isRangeSelection=K;
165
165
  exports.$isRootNode=N;exports.$isTextNode=z;exports.$nodesOfType=function(a){var b=B();const c=b._readOnly,d=a.getType();b=Array.from(b._nodeMap.values());const e=b.length,f=[];for(let g=0;g<e;g++){const h=b[g];h instanceof a&&h.__type===d&&(c||h.isAttached())&&f.push(h)}return f};exports.$setCompositionKey=H;exports.$setSelection=Ea;exports.DecoratorNode=kb;exports.ElementNode=Ic;exports.GridCellNode=qd;exports.GridNode=rd;exports.GridRowNode=sd;exports.ParagraphNode=md;exports.TextNode=gd;
166
- exports.VERSION="0.1.15";exports.createDecoratorArray=jb;exports.createDecoratorEditor=fb;exports.createDecoratorMap=hb;
166
+ exports.VERSION="0.1.16";exports.createDecoratorArray=jb;exports.createDecoratorEditor=fb;exports.createDecoratorMap=hb;
167
167
  exports.createEditor=function(a){var b=a||{},c=b.namespace||Ha();const d=b.theme||{},e=b.context||{},f=b.parentEditor||null,g=b.disableEvents||!1,h=Kc();a=b.editorState;const l=[Jc,gd,bd,md,...(b.nodes||[])],k=b.onError;b=b.readOnly||!1;const m=new Map;for(let p=0;p<l.length;p++){const n=l[p],t=n.getType();m.set(t,{klass:n,transforms:new Set})}c=new pd(h,f,m,{context:e,disableEvents:g,namespace:c,theme:d},k,od(m),b);void 0!==a&&(c._pendingEditorState=a,c._dirtyType=2);return c};
168
168
  exports.isDecoratorArray=function(a){return a instanceof ib};exports.isDecoratorEditor=function(a){return a instanceof eb};exports.isDecoratorMap=function(a){return a instanceof gb};
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "rich-text"
14
14
  ],
15
15
  "license": "MIT",
16
- "version": "0.1.15",
16
+ "version": "0.1.16",
17
17
  "main": "Lexical.js",
18
18
  "typings": "Lexical.d.ts",
19
19
  "repository": {