lexical 0.32.2-nightly.20250627.0 → 0.32.2-nightly.20250630.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.
- package/Lexical.dev.js +21 -11
- package/Lexical.dev.mjs +21 -11
- package/Lexical.prod.js +1 -1
- package/Lexical.prod.mjs +1 -1
- package/LexicalEditor.d.ts +1 -1
- package/package.json +1 -1
package/Lexical.dev.js
CHANGED
|
@@ -8402,14 +8402,16 @@ function triggerMutationListeners(editor, mutatedNodes, updateTags, dirtyLeaves,
|
|
|
8402
8402
|
const listeners = Array.from(editor._listeners.mutation);
|
|
8403
8403
|
const listenersLength = listeners.length;
|
|
8404
8404
|
for (let i = 0; i < listenersLength; i++) {
|
|
8405
|
-
const [listener,
|
|
8406
|
-
const
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8405
|
+
const [listener, klassSet] = listeners[i];
|
|
8406
|
+
for (const klass of klassSet) {
|
|
8407
|
+
const mutatedNodesByType = mutatedNodes.get(klass);
|
|
8408
|
+
if (mutatedNodesByType !== undefined) {
|
|
8409
|
+
listener(mutatedNodesByType, {
|
|
8410
|
+
dirtyLeaves,
|
|
8411
|
+
prevEditorState,
|
|
8412
|
+
updateTags
|
|
8413
|
+
});
|
|
8414
|
+
}
|
|
8413
8415
|
}
|
|
8414
8416
|
}
|
|
8415
8417
|
}
|
|
@@ -10333,13 +10335,21 @@ class LexicalEditor {
|
|
|
10333
10335
|
registerMutationListener(klass, listener, options) {
|
|
10334
10336
|
const klassToMutate = this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(klass)).klass;
|
|
10335
10337
|
const mutations = this._listeners.mutation;
|
|
10336
|
-
mutations.
|
|
10338
|
+
let klassSet = mutations.get(listener);
|
|
10339
|
+
if (klassSet === undefined) {
|
|
10340
|
+
klassSet = new Set();
|
|
10341
|
+
mutations.set(listener, klassSet);
|
|
10342
|
+
}
|
|
10343
|
+
klassSet.add(klassToMutate);
|
|
10337
10344
|
const skipInitialization = options && options.skipInitialization;
|
|
10338
10345
|
if (!(skipInitialization === undefined ? DEFAULT_SKIP_INITIALIZATION : skipInitialization)) {
|
|
10339
10346
|
this.initializeMutationListener(listener, klassToMutate);
|
|
10340
10347
|
}
|
|
10341
10348
|
return () => {
|
|
10342
|
-
|
|
10349
|
+
klassSet.delete(klassToMutate);
|
|
10350
|
+
if (klassSet.size === 0) {
|
|
10351
|
+
mutations.delete(listener);
|
|
10352
|
+
}
|
|
10343
10353
|
};
|
|
10344
10354
|
}
|
|
10345
10355
|
|
|
@@ -10723,7 +10733,7 @@ class LexicalEditor {
|
|
|
10723
10733
|
};
|
|
10724
10734
|
}
|
|
10725
10735
|
}
|
|
10726
|
-
LexicalEditor.version = "0.32.2-nightly.
|
|
10736
|
+
LexicalEditor.version = "0.32.2-nightly.20250630.0+dev.cjs";
|
|
10727
10737
|
|
|
10728
10738
|
let pendingNodeToClone = null;
|
|
10729
10739
|
function setPendingNodeToClone(pendingNode) {
|
package/Lexical.dev.mjs
CHANGED
|
@@ -8400,14 +8400,16 @@ function triggerMutationListeners(editor, mutatedNodes, updateTags, dirtyLeaves,
|
|
|
8400
8400
|
const listeners = Array.from(editor._listeners.mutation);
|
|
8401
8401
|
const listenersLength = listeners.length;
|
|
8402
8402
|
for (let i = 0; i < listenersLength; i++) {
|
|
8403
|
-
const [listener,
|
|
8404
|
-
const
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8403
|
+
const [listener, klassSet] = listeners[i];
|
|
8404
|
+
for (const klass of klassSet) {
|
|
8405
|
+
const mutatedNodesByType = mutatedNodes.get(klass);
|
|
8406
|
+
if (mutatedNodesByType !== undefined) {
|
|
8407
|
+
listener(mutatedNodesByType, {
|
|
8408
|
+
dirtyLeaves,
|
|
8409
|
+
prevEditorState,
|
|
8410
|
+
updateTags
|
|
8411
|
+
});
|
|
8412
|
+
}
|
|
8411
8413
|
}
|
|
8412
8414
|
}
|
|
8413
8415
|
}
|
|
@@ -10331,13 +10333,21 @@ class LexicalEditor {
|
|
|
10331
10333
|
registerMutationListener(klass, listener, options) {
|
|
10332
10334
|
const klassToMutate = this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(klass)).klass;
|
|
10333
10335
|
const mutations = this._listeners.mutation;
|
|
10334
|
-
mutations.
|
|
10336
|
+
let klassSet = mutations.get(listener);
|
|
10337
|
+
if (klassSet === undefined) {
|
|
10338
|
+
klassSet = new Set();
|
|
10339
|
+
mutations.set(listener, klassSet);
|
|
10340
|
+
}
|
|
10341
|
+
klassSet.add(klassToMutate);
|
|
10335
10342
|
const skipInitialization = options && options.skipInitialization;
|
|
10336
10343
|
if (!(skipInitialization === undefined ? DEFAULT_SKIP_INITIALIZATION : skipInitialization)) {
|
|
10337
10344
|
this.initializeMutationListener(listener, klassToMutate);
|
|
10338
10345
|
}
|
|
10339
10346
|
return () => {
|
|
10340
|
-
|
|
10347
|
+
klassSet.delete(klassToMutate);
|
|
10348
|
+
if (klassSet.size === 0) {
|
|
10349
|
+
mutations.delete(listener);
|
|
10350
|
+
}
|
|
10341
10351
|
};
|
|
10342
10352
|
}
|
|
10343
10353
|
|
|
@@ -10721,7 +10731,7 @@ class LexicalEditor {
|
|
|
10721
10731
|
};
|
|
10722
10732
|
}
|
|
10723
10733
|
}
|
|
10724
|
-
LexicalEditor.version = "0.32.2-nightly.
|
|
10734
|
+
LexicalEditor.version = "0.32.2-nightly.20250630.0+dev.esm";
|
|
10725
10735
|
|
|
10726
10736
|
let pendingNodeToClone = null;
|
|
10727
10737
|
function setPendingNodeToClone(pendingNode) {
|