@tiptap/core 2.0.0-beta.141 → 2.0.0-beta.142
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/packages/core/src/helpers/defaultBlockAt.d.ts +2 -0
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/tiptap-core.cjs.js +13 -2
- package/dist/tiptap-core.cjs.js.map +1 -1
- package/dist/tiptap-core.esm.js +13 -3
- package/dist/tiptap-core.esm.js.map +1 -1
- package/dist/tiptap-core.umd.js +13 -2
- package/dist/tiptap-core.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/helpers/defaultBlockAt.ts +13 -0
- package/src/index.ts +1 -0
package/dist/tiptap-core.umd.js
CHANGED
|
@@ -1177,7 +1177,7 @@
|
|
|
1177
1177
|
}));
|
|
1178
1178
|
}
|
|
1179
1179
|
|
|
1180
|
-
function defaultBlockAt(match) {
|
|
1180
|
+
function defaultBlockAt$1(match) {
|
|
1181
1181
|
for (let i = 0; i < match.edgeCount; i += 1) {
|
|
1182
1182
|
const { type } = match.edge(i);
|
|
1183
1183
|
if (type.isTextblock && !type.hasRequiredAttrs()) {
|
|
@@ -1221,7 +1221,7 @@
|
|
|
1221
1221
|
}
|
|
1222
1222
|
const deflt = $from.depth === 0
|
|
1223
1223
|
? undefined
|
|
1224
|
-
: defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));
|
|
1224
|
+
: defaultBlockAt$1($from.node(-1).contentMatchAt($from.indexAfter(-1)));
|
|
1225
1225
|
let types = atEnd && deflt
|
|
1226
1226
|
? [{
|
|
1227
1227
|
type: deflt,
|
|
@@ -3958,6 +3958,16 @@ img.ProseMirror-separator {
|
|
|
3958
3958
|
});
|
|
3959
3959
|
}
|
|
3960
3960
|
|
|
3961
|
+
function defaultBlockAt(match) {
|
|
3962
|
+
for (let i = 0; i < match.edgeCount; i += 1) {
|
|
3963
|
+
const { type } = match.edge(i);
|
|
3964
|
+
if (type.isTextblock && !type.hasRequiredAttrs()) {
|
|
3965
|
+
return type;
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
3968
|
+
return null;
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3961
3971
|
function findChildren(node, predicate) {
|
|
3962
3972
|
const nodesWithPos = [];
|
|
3963
3973
|
node.descendants((child, pos) => {
|
|
@@ -4106,6 +4116,7 @@ img.ProseMirror-separator {
|
|
|
4106
4116
|
exports.PasteRule = PasteRule;
|
|
4107
4117
|
exports.Tracker = Tracker;
|
|
4108
4118
|
exports.callOrReturn = callOrReturn;
|
|
4119
|
+
exports.defaultBlockAt = defaultBlockAt;
|
|
4109
4120
|
exports.extensions = extensions;
|
|
4110
4121
|
exports.findChildren = findChildren;
|
|
4111
4122
|
exports.findChildrenInRange = findChildrenInRange;
|