@tiptap/core 2.5.3 → 2.5.5
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/dist/index.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +6 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/packages/core/src/Editor.d.ts +2 -4
- package/dist/packages/core/src/types.d.ts +5 -0
- package/package.json +3 -3
- package/src/Editor.ts +8 -5
- package/src/helpers/getTextContentFromNodes.ts +1 -1
- package/src/types.ts +1 -0
package/dist/index.cjs
CHANGED
|
@@ -579,7 +579,7 @@ const getTextContentFromNodes = ($from, maxMatch = 500) => {
|
|
|
579
579
|
}))
|
|
580
580
|
|| node.textContent
|
|
581
581
|
|| '%leaf%';
|
|
582
|
-
textBefore += chunk.slice(0, Math.max(0, sliceEndPos - pos));
|
|
582
|
+
textBefore += node.isAtom ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos));
|
|
583
583
|
});
|
|
584
584
|
return textBefore;
|
|
585
585
|
};
|
|
@@ -4208,6 +4208,11 @@ class Editor extends EventEmitter {
|
|
|
4208
4208
|
}
|
|
4209
4209
|
const state = this.state.apply(transaction);
|
|
4210
4210
|
const selectionHasChanged = !this.state.selection.eq(state.selection);
|
|
4211
|
+
this.emit('beforeTransaction', {
|
|
4212
|
+
editor: this,
|
|
4213
|
+
transaction,
|
|
4214
|
+
nextState: state,
|
|
4215
|
+
});
|
|
4211
4216
|
this.view.updateState(state);
|
|
4212
4217
|
this.emit('transaction', {
|
|
4213
4218
|
editor: this,
|