@tiptap/core 2.4.0 → 2.5.0-beta.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/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/packages/core/src/EventEmitter.d.ts +2 -2
- package/package.json +2 -2
- package/src/EventEmitter.ts +2 -2
- package/src/commands/joinItemBackward.ts +4 -2
- package/src/inputRules/nodeInputRule.ts +3 -1
package/dist/index.cjs
CHANGED
|
@@ -1900,7 +1900,7 @@ const joinForward = () => ({ state, dispatch }) => {
|
|
|
1900
1900
|
return commands$1.joinForward(state, dispatch);
|
|
1901
1901
|
};
|
|
1902
1902
|
|
|
1903
|
-
const joinItemBackward = () => ({
|
|
1903
|
+
const joinItemBackward = () => ({ state, dispatch, tr, }) => {
|
|
1904
1904
|
try {
|
|
1905
1905
|
const point = transform.joinPoint(state.doc, state.selection.$from.pos, -1);
|
|
1906
1906
|
if (point === null || point === undefined) {
|
|
@@ -1912,7 +1912,7 @@ const joinItemBackward = () => ({ tr, state, dispatch, }) => {
|
|
|
1912
1912
|
}
|
|
1913
1913
|
return true;
|
|
1914
1914
|
}
|
|
1915
|
-
catch {
|
|
1915
|
+
catch (e) {
|
|
1916
1916
|
return false;
|
|
1917
1917
|
}
|
|
1918
1918
|
};
|
|
@@ -4320,7 +4320,8 @@ function nodeInputRule(config) {
|
|
|
4320
4320
|
tr.replaceWith(matchStart, end, newNode);
|
|
4321
4321
|
}
|
|
4322
4322
|
else if (match[0]) {
|
|
4323
|
-
|
|
4323
|
+
const insertionStart = config.type.isInline ? start : start - 1;
|
|
4324
|
+
tr.insert(insertionStart, config.type.create(attributes)).delete(tr.mapping.map(start), tr.mapping.map(end));
|
|
4324
4325
|
}
|
|
4325
4326
|
tr.scrollIntoView();
|
|
4326
4327
|
},
|