@lexical/history 0.30.1-nightly.20250410.0 → 0.30.1-nightly.20250415.0

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.
@@ -126,7 +126,7 @@ function createMergeActionGetter(editor, delay) {
126
126
 
127
127
  // If applying changes from history stack there's no need
128
128
  // to run history logic again, as history entries already calculated
129
- if (tags.has('historic')) {
129
+ if (tags.has(lexical.HISTORIC_TAG)) {
130
130
  prevChangeType = OTHER;
131
131
  prevChangeTime = changeTime;
132
132
  return DISCARD_HISTORY_CANDIDATE;
@@ -134,8 +134,8 @@ function createMergeActionGetter(editor, delay) {
134
134
  const changeType = getChangeType(prevEditorState, nextEditorState, dirtyLeaves, dirtyElements, editor.isComposing());
135
135
  const mergeAction = (() => {
136
136
  const isSameEditor = currentHistoryEntry === null || currentHistoryEntry.editor === editor;
137
- const shouldPushHistory = tags.has('history-push');
138
- const shouldMergeHistory = !shouldPushHistory && isSameEditor && tags.has('history-merge');
137
+ const shouldPushHistory = tags.has(lexical.HISTORY_PUSH_TAG);
138
+ const shouldMergeHistory = !shouldPushHistory && isSameEditor && tags.has(lexical.HISTORY_MERGE_TAG);
139
139
  if (shouldMergeHistory) {
140
140
  return HISTORY_MERGE;
141
141
  }
@@ -185,7 +185,7 @@ function redo(editor, historyState) {
185
185
  historyState.current = historyStateEntry || null;
186
186
  if (historyStateEntry) {
187
187
  historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {
188
- tag: 'historic'
188
+ tag: lexical.HISTORIC_TAG
189
189
  });
190
190
  }
191
191
  }
@@ -207,7 +207,7 @@ function undo(editor, historyState) {
207
207
  historyState.current = historyStateEntry || null;
208
208
  if (historyStateEntry) {
209
209
  historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {
210
- tag: 'historic'
210
+ tag: lexical.HISTORIC_TAG
211
211
  });
212
212
  }
213
213
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { mergeRegister } from '@lexical/utils';
10
- import { UNDO_COMMAND, COMMAND_PRIORITY_EDITOR, REDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, $isRangeSelection, $isTextNode, $isRootNode } from 'lexical';
10
+ import { UNDO_COMMAND, COMMAND_PRIORITY_EDITOR, REDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, HISTORIC_TAG, HISTORY_PUSH_TAG, HISTORY_MERGE_TAG, $isRangeSelection, $isTextNode, $isRootNode } from 'lexical';
11
11
 
12
12
  /**
13
13
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -124,7 +124,7 @@ function createMergeActionGetter(editor, delay) {
124
124
 
125
125
  // If applying changes from history stack there's no need
126
126
  // to run history logic again, as history entries already calculated
127
- if (tags.has('historic')) {
127
+ if (tags.has(HISTORIC_TAG)) {
128
128
  prevChangeType = OTHER;
129
129
  prevChangeTime = changeTime;
130
130
  return DISCARD_HISTORY_CANDIDATE;
@@ -132,8 +132,8 @@ function createMergeActionGetter(editor, delay) {
132
132
  const changeType = getChangeType(prevEditorState, nextEditorState, dirtyLeaves, dirtyElements, editor.isComposing());
133
133
  const mergeAction = (() => {
134
134
  const isSameEditor = currentHistoryEntry === null || currentHistoryEntry.editor === editor;
135
- const shouldPushHistory = tags.has('history-push');
136
- const shouldMergeHistory = !shouldPushHistory && isSameEditor && tags.has('history-merge');
135
+ const shouldPushHistory = tags.has(HISTORY_PUSH_TAG);
136
+ const shouldMergeHistory = !shouldPushHistory && isSameEditor && tags.has(HISTORY_MERGE_TAG);
137
137
  if (shouldMergeHistory) {
138
138
  return HISTORY_MERGE;
139
139
  }
@@ -183,7 +183,7 @@ function redo(editor, historyState) {
183
183
  historyState.current = historyStateEntry || null;
184
184
  if (historyStateEntry) {
185
185
  historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {
186
- tag: 'historic'
186
+ tag: HISTORIC_TAG
187
187
  });
188
188
  }
189
189
  }
@@ -205,7 +205,7 @@ function undo(editor, historyState) {
205
205
  historyState.current = historyStateEntry || null;
206
206
  if (historyStateEntry) {
207
207
  historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {
208
- tag: 'historic'
208
+ tag: HISTORIC_TAG
209
209
  });
210
210
  }
211
211
  }
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var t=require("@lexical/utils"),e=require("lexical");const n=0,r=1,o=2,i=0,s=1,c=2,a=3,u=4;function d(t,n,r,o,d){if(null===t||0===r.size&&0===o.size&&!d)return i;const l=n._selection,_=t._selection;if(d)return s;if(!(e.$isRangeSelection(l)&&e.$isRangeSelection(_)&&_.isCollapsed()&&l.isCollapsed()))return i;const f=function(t,n,r){const o=t._nodeMap,i=[];for(const t of n){const e=o.get(t);void 0!==e&&i.push(e)}for(const[t,n]of r){if(!n)continue;const r=o.get(t);void 0===r||e.$isRootNode(r)||i.push(r)}return i}(n,r,o);if(0===f.length)return i;if(f.length>1){const r=n._nodeMap,o=r.get(l.anchor.key),s=r.get(_.anchor.key);return o&&s&&!t._nodeMap.has(o.__key)&&e.$isTextNode(o)&&1===o.__text.length&&1===l.anchor.offset?c:i}const p=f[0],C=t._nodeMap.get(p.__key);if(!e.$isTextNode(C)||!e.$isTextNode(p)||C.__mode!==p.__mode)return i;const h=C.__text,O=p.__text;if(h===O)return i;const N=l.anchor,M=_.anchor;if(N.key!==M.key||"text"!==N.type)return i;const g=N.offset,m=M.offset,D=O.length-h.length;return 1===D&&m===g-1?c:-1===D&&m===g+1?a:-1===D&&m===g?u:i}function l(t,s){let c=Date.now(),a=i;return(u,l,_,f,p,C)=>{const h=Date.now();if(C.has("historic"))return a=i,c=h,o;const O=d(u,l,f,p,t.isComposing()),N=(()=>{const d=null===_||_.editor===t,N=C.has("history-push");if(!N&&d&&C.has("history-merge"))return n;if(null===u)return r;const M=l._selection;if(!(f.size>0||p.size>0))return null!==M?n:o;if(!1===N&&O!==i&&O===a&&h<c+s&&d)return n;if(1===f.size){if(function(t,n,r){const o=n._nodeMap.get(t),i=r._nodeMap.get(t),s=n._selection,c=r._selection;return!(e.$isRangeSelection(s)&&e.$isRangeSelection(c)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===c.anchor.type&&"text"===c.focus.type||!e.$isTextNode(o)||!e.$isTextNode(i)||o.__parent!==i.__parent)&&JSON.stringify(n.read((()=>o.exportJSON())))===JSON.stringify(r.read((()=>i.exportJSON())))}(Array.from(f)[0],u,l))return n}return r})();return c=h,a=O,N}}function _(t){t.undoStack=[],t.redoStack=[],t.current=null}exports.createEmptyHistoryState=function(){return{current:null,redoStack:[],undoStack:[]}},exports.registerHistory=function(n,i,s){const c=l(n,s);return t.mergeRegister(n.registerCommand(e.UNDO_COMMAND,(()=>(function(t,n){const r=n.redoStack,o=n.undoStack;if(0!==o.length){const i=n.current,s=o.pop();null!==i&&(r.push(i),t.dispatchCommand(e.CAN_REDO_COMMAND,!0)),0===o.length&&t.dispatchCommand(e.CAN_UNDO_COMMAND,!1),n.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:"historic"})}}(n,i),!0)),e.COMMAND_PRIORITY_EDITOR),n.registerCommand(e.REDO_COMMAND,(()=>(function(t,n){const r=n.redoStack,o=n.undoStack;if(0!==r.length){const i=n.current;null!==i&&(o.push(i),t.dispatchCommand(e.CAN_UNDO_COMMAND,!0));const s=r.pop();0===r.length&&t.dispatchCommand(e.CAN_REDO_COMMAND,!1),n.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:"historic"})}}(n,i),!0)),e.COMMAND_PRIORITY_EDITOR),n.registerCommand(e.CLEAR_EDITOR_COMMAND,(()=>(_(i),!1)),e.COMMAND_PRIORITY_EDITOR),n.registerCommand(e.CLEAR_HISTORY_COMMAND,(()=>(_(i),n.dispatchCommand(e.CAN_REDO_COMMAND,!1),n.dispatchCommand(e.CAN_UNDO_COMMAND,!1),!0)),e.COMMAND_PRIORITY_EDITOR),n.registerUpdateListener((({editorState:t,prevEditorState:s,dirtyLeaves:a,dirtyElements:u,tags:d})=>{const l=i.current,_=i.redoStack,f=i.undoStack,p=null===l?null:l.editorState;if(null!==l&&t===p)return;const C=c(s,t,l,a,u,d);if(C===r)0!==_.length&&(i.redoStack=[],n.dispatchCommand(e.CAN_REDO_COMMAND,!1)),null!==l&&(f.push({...l}),n.dispatchCommand(e.CAN_UNDO_COMMAND,!0));else if(C===o)return;i.current={editor:n,editorState:t}})))};
9
+ "use strict";var t=require("@lexical/utils"),e=require("lexical");const n=0,r=1,o=2,i=0,s=1,c=2,a=3,u=4;function d(t,n,r,o,d){if(null===t||0===r.size&&0===o.size&&!d)return i;const _=n._selection,l=t._selection;if(d)return s;if(!(e.$isRangeSelection(_)&&e.$isRangeSelection(l)&&l.isCollapsed()&&_.isCollapsed()))return i;const f=function(t,n,r){const o=t._nodeMap,i=[];for(const t of n){const e=o.get(t);void 0!==e&&i.push(e)}for(const[t,n]of r){if(!n)continue;const r=o.get(t);void 0===r||e.$isRootNode(r)||i.push(r)}return i}(n,r,o);if(0===f.length)return i;if(f.length>1){const r=n._nodeMap,o=r.get(_.anchor.key),s=r.get(l.anchor.key);return o&&s&&!t._nodeMap.has(o.__key)&&e.$isTextNode(o)&&1===o.__text.length&&1===_.anchor.offset?c:i}const O=f[0],C=t._nodeMap.get(O.__key);if(!e.$isTextNode(C)||!e.$isTextNode(O)||C.__mode!==O.__mode)return i;const p=C.__text,M=O.__text;if(p===M)return i;const N=_.anchor,g=l.anchor;if(N.key!==g.key||"text"!==N.type)return i;const S=N.offset,h=g.offset,m=M.length-p.length;return 1===m&&h===S-1?c:-1===m&&h===S+1?a:-1===m&&h===S?u:i}function _(t,s){let c=Date.now(),a=i;return(u,_,l,f,O,C)=>{const p=Date.now();if(C.has(e.HISTORIC_TAG))return a=i,c=p,o;const M=d(u,_,f,O,t.isComposing()),N=(()=>{const d=null===l||l.editor===t,N=C.has(e.HISTORY_PUSH_TAG);if(!N&&d&&C.has(e.HISTORY_MERGE_TAG))return n;if(null===u)return r;const g=_._selection;if(!(f.size>0||O.size>0))return null!==g?n:o;if(!1===N&&M!==i&&M===a&&p<c+s&&d)return n;if(1===f.size){if(function(t,n,r){const o=n._nodeMap.get(t),i=r._nodeMap.get(t),s=n._selection,c=r._selection;return!(e.$isRangeSelection(s)&&e.$isRangeSelection(c)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===c.anchor.type&&"text"===c.focus.type||!e.$isTextNode(o)||!e.$isTextNode(i)||o.__parent!==i.__parent)&&JSON.stringify(n.read((()=>o.exportJSON())))===JSON.stringify(r.read((()=>i.exportJSON())))}(Array.from(f)[0],u,_))return n}return r})();return c=p,a=M,N}}function l(t){t.undoStack=[],t.redoStack=[],t.current=null}exports.createEmptyHistoryState=function(){return{current:null,redoStack:[],undoStack:[]}},exports.registerHistory=function(n,i,s){const c=_(n,s);return t.mergeRegister(n.registerCommand(e.UNDO_COMMAND,(()=>(function(t,n){const r=n.redoStack,o=n.undoStack;if(0!==o.length){const i=n.current,s=o.pop();null!==i&&(r.push(i),t.dispatchCommand(e.CAN_REDO_COMMAND,!0)),0===o.length&&t.dispatchCommand(e.CAN_UNDO_COMMAND,!1),n.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:e.HISTORIC_TAG})}}(n,i),!0)),e.COMMAND_PRIORITY_EDITOR),n.registerCommand(e.REDO_COMMAND,(()=>(function(t,n){const r=n.redoStack,o=n.undoStack;if(0!==r.length){const i=n.current;null!==i&&(o.push(i),t.dispatchCommand(e.CAN_UNDO_COMMAND,!0));const s=r.pop();0===r.length&&t.dispatchCommand(e.CAN_REDO_COMMAND,!1),n.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:e.HISTORIC_TAG})}}(n,i),!0)),e.COMMAND_PRIORITY_EDITOR),n.registerCommand(e.CLEAR_EDITOR_COMMAND,(()=>(l(i),!1)),e.COMMAND_PRIORITY_EDITOR),n.registerCommand(e.CLEAR_HISTORY_COMMAND,(()=>(l(i),n.dispatchCommand(e.CAN_REDO_COMMAND,!1),n.dispatchCommand(e.CAN_UNDO_COMMAND,!1),!0)),e.COMMAND_PRIORITY_EDITOR),n.registerUpdateListener((({editorState:t,prevEditorState:s,dirtyLeaves:a,dirtyElements:u,tags:d})=>{const _=i.current,l=i.redoStack,f=i.undoStack,O=null===_?null:_.editorState;if(null!==_&&t===O)return;const C=c(s,t,_,a,u,d);if(C===r)0!==l.length&&(i.redoStack=[],n.dispatchCommand(e.CAN_REDO_COMMAND,!1)),null!==_&&(f.push({..._}),n.dispatchCommand(e.CAN_UNDO_COMMAND,!0));else if(C===o)return;i.current={editor:n,editorState:t}})))};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{mergeRegister as t}from"@lexical/utils";import{UNDO_COMMAND as e,COMMAND_PRIORITY_EDITOR as n,REDO_COMMAND as r,CLEAR_EDITOR_COMMAND as o,CLEAR_HISTORY_COMMAND as i,CAN_REDO_COMMAND as s,CAN_UNDO_COMMAND as c,$isRangeSelection as a,$isTextNode as u,$isRootNode as d}from"lexical";const l=0,f=1,p=2,h=0,m=1,g=2,_=3,S=4;function y(t,e,n,r,o){if(null===t||0===n.size&&0===r.size&&!o)return h;const i=e._selection,s=t._selection;if(o)return m;if(!(a(i)&&a(s)&&s.isCollapsed()&&i.isCollapsed()))return h;const c=function(t,e,n){const r=t._nodeMap,o=[];for(const t of e){const e=r.get(t);void 0!==e&&o.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||d(n)||o.push(n)}return o}(e,n,r);if(0===c.length)return h;if(c.length>1){const n=e._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!t._nodeMap.has(r.__key)&&u(r)&&1===r.__text.length&&1===i.anchor.offset?g:h}const l=c[0],f=t._nodeMap.get(l.__key);if(!u(f)||!u(l)||f.__mode!==l.__mode)return h;const p=f.__text,y=l.__text;if(p===y)return h;const k=i.anchor,C=s.anchor;if(k.key!==C.key||"text"!==k.type)return h;const x=k.offset,M=C.offset,z=y.length-p.length;return 1===z&&M===x-1?g:-1===z&&M===x+1?_:-1===z&&M===x?S:h}function k(t,e){let n=Date.now(),r=h;return(o,i,s,c,d,m)=>{const g=Date.now();if(m.has("historic"))return r=h,n=g,p;const _=y(o,i,c,d,t.isComposing()),S=(()=>{const S=null===s||s.editor===t,y=m.has("history-push");if(!y&&S&&m.has("history-merge"))return l;if(null===o)return f;const k=i._selection;if(!(c.size>0||d.size>0))return null!==k?l:p;if(!1===y&&_!==h&&_===r&&g<n+e&&S)return l;if(1===c.size){if(function(t,e,n){const r=e._nodeMap.get(t),o=n._nodeMap.get(t),i=e._selection,s=n._selection;return!(a(i)&&a(s)&&"element"===i.anchor.type&&"element"===i.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!u(r)||!u(o)||r.__parent!==o.__parent)&&JSON.stringify(e.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(c)[0],o,i))return l}return f})();return n=g,r=_,S}}function C(t){t.undoStack=[],t.redoStack=[],t.current=null}function x(a,u,d){const l=k(a,d),h=t(a.registerCommand(e,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const o=e.current,i=r.pop();null!==o&&(n.push(o),t.dispatchCommand(s,!0)),0===r.length&&t.dispatchCommand(c,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(a,u),!0)),n),a.registerCommand(r,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const o=e.current;null!==o&&(r.push(o),t.dispatchCommand(c,!0));const i=n.pop();0===n.length&&t.dispatchCommand(s,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(a,u),!0)),n),a.registerCommand(o,(()=>(C(u),!1)),n),a.registerCommand(i,(()=>(C(u),a.dispatchCommand(s,!1),a.dispatchCommand(c,!1),!0)),n),a.registerUpdateListener((({editorState:t,prevEditorState:e,dirtyLeaves:n,dirtyElements:r,tags:o})=>{const i=u.current,d=u.redoStack,h=u.undoStack,m=null===i?null:i.editorState;if(null!==i&&t===m)return;const g=l(e,t,i,n,r,o);if(g===f)0!==d.length&&(u.redoStack=[],a.dispatchCommand(s,!1)),null!==i&&(h.push({...i}),a.dispatchCommand(c,!0));else if(g===p)return;u.current={editor:a,editorState:t}})));return h}function M(){return{current:null,redoStack:[],undoStack:[]}}export{M as createEmptyHistoryState,x as registerHistory};
9
+ import{mergeRegister as t}from"@lexical/utils";import{UNDO_COMMAND as e,COMMAND_PRIORITY_EDITOR as n,REDO_COMMAND as r,CLEAR_EDITOR_COMMAND as o,CLEAR_HISTORY_COMMAND as i,CAN_REDO_COMMAND as c,CAN_UNDO_COMMAND as s,HISTORIC_TAG as a,HISTORY_PUSH_TAG as u,HISTORY_MERGE_TAG as d,$isRangeSelection as l,$isTextNode as f,$isRootNode as p}from"lexical";const m=0,h=1,_=2,g=0,S=1,k=2,y=3,C=4;function x(t,e,n,r,o){if(null===t||0===n.size&&0===r.size&&!o)return g;const i=e._selection,c=t._selection;if(o)return S;if(!(l(i)&&l(c)&&c.isCollapsed()&&i.isCollapsed()))return g;const s=function(t,e,n){const r=t._nodeMap,o=[];for(const t of e){const e=r.get(t);void 0!==e&&o.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||p(n)||o.push(n)}return o}(e,n,r);if(0===s.length)return g;if(s.length>1){const n=e._nodeMap,r=n.get(i.anchor.key),o=n.get(c.anchor.key);return r&&o&&!t._nodeMap.has(r.__key)&&f(r)&&1===r.__text.length&&1===i.anchor.offset?k:g}const a=s[0],u=t._nodeMap.get(a.__key);if(!f(u)||!f(a)||u.__mode!==a.__mode)return g;const d=u.__text,m=a.__text;if(d===m)return g;const h=i.anchor,_=c.anchor;if(h.key!==_.key||"text"!==h.type)return g;const x=h.offset,M=_.offset,z=m.length-d.length;return 1===z&&M===x-1?k:-1===z&&M===x+1?y:-1===z&&M===x?C:g}function M(t,e){let n=Date.now(),r=g;return(o,i,c,s,p,S)=>{const k=Date.now();if(S.has(a))return r=g,n=k,_;const y=x(o,i,s,p,t.isComposing()),C=(()=>{const a=null===c||c.editor===t,C=S.has(u);if(!C&&a&&S.has(d))return m;if(null===o)return h;const x=i._selection;if(!(s.size>0||p.size>0))return null!==x?m:_;if(!1===C&&y!==g&&y===r&&k<n+e&&a)return m;if(1===s.size){if(function(t,e,n){const r=e._nodeMap.get(t),o=n._nodeMap.get(t),i=e._selection,c=n._selection;return!(l(i)&&l(c)&&"element"===i.anchor.type&&"element"===i.focus.type&&"text"===c.anchor.type&&"text"===c.focus.type||!f(r)||!f(o)||r.__parent!==o.__parent)&&JSON.stringify(e.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(s)[0],o,i))return m}return h})();return n=k,r=y,C}}function z(t){t.undoStack=[],t.redoStack=[],t.current=null}function v(u,d,l){const f=M(u,l),p=t(u.registerCommand(e,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const o=e.current,i=r.pop();null!==o&&(n.push(o),t.dispatchCommand(c,!0)),0===r.length&&t.dispatchCommand(s,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:a})}}(u,d),!0)),n),u.registerCommand(r,(()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const o=e.current;null!==o&&(r.push(o),t.dispatchCommand(s,!0));const i=n.pop();0===n.length&&t.dispatchCommand(c,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:a})}}(u,d),!0)),n),u.registerCommand(o,(()=>(z(d),!1)),n),u.registerCommand(i,(()=>(z(d),u.dispatchCommand(c,!1),u.dispatchCommand(s,!1),!0)),n),u.registerUpdateListener((({editorState:t,prevEditorState:e,dirtyLeaves:n,dirtyElements:r,tags:o})=>{const i=d.current,a=d.redoStack,l=d.undoStack,p=null===i?null:i.editorState;if(null!==i&&t===p)return;const m=f(e,t,i,n,r,o);if(m===h)0!==a.length&&(d.redoStack=[],u.dispatchCommand(c,!1)),null!==i&&(l.push({...i}),u.dispatchCommand(s,!0));else if(m===_)return;d.current={editor:u,editorState:t}})));return p}function E(){return{current:null,redoStack:[],undoStack:[]}}export{E as createEmptyHistoryState,v as registerHistory};
package/package.json CHANGED
@@ -8,12 +8,12 @@
8
8
  "history"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.30.1-nightly.20250410.0",
11
+ "version": "0.30.1-nightly.20250415.0",
12
12
  "main": "LexicalHistory.js",
13
13
  "types": "index.d.ts",
14
14
  "dependencies": {
15
- "@lexical/utils": "0.30.1-nightly.20250410.0",
16
- "lexical": "0.30.1-nightly.20250410.0"
15
+ "@lexical/utils": "0.30.1-nightly.20250415.0",
16
+ "lexical": "0.30.1-nightly.20250415.0"
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",