@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.js
CHANGED
|
@@ -577,7 +577,7 @@ const getTextContentFromNodes = ($from, maxMatch = 500) => {
|
|
|
577
577
|
}))
|
|
578
578
|
|| node.textContent
|
|
579
579
|
|| '%leaf%';
|
|
580
|
-
textBefore += chunk.slice(0, Math.max(0, sliceEndPos - pos));
|
|
580
|
+
textBefore += node.isAtom ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos));
|
|
581
581
|
});
|
|
582
582
|
return textBefore;
|
|
583
583
|
};
|
|
@@ -4206,6 +4206,11 @@ class Editor extends EventEmitter {
|
|
|
4206
4206
|
}
|
|
4207
4207
|
const state = this.state.apply(transaction);
|
|
4208
4208
|
const selectionHasChanged = !this.state.selection.eq(state.selection);
|
|
4209
|
+
this.emit('beforeTransaction', {
|
|
4210
|
+
editor: this,
|
|
4211
|
+
transaction,
|
|
4212
|
+
nextState: state,
|
|
4213
|
+
});
|
|
4209
4214
|
this.view.updateState(state);
|
|
4210
4215
|
this.emit('transaction', {
|
|
4211
4216
|
editor: this,
|