@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.esm.js
CHANGED
|
@@ -1179,7 +1179,7 @@ function getSplittedAttributes(extensionAttributes, typeName, attributes) {
|
|
|
1179
1179
|
}));
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
|
-
function defaultBlockAt(match) {
|
|
1182
|
+
function defaultBlockAt$1(match) {
|
|
1183
1183
|
for (let i = 0; i < match.edgeCount; i += 1) {
|
|
1184
1184
|
const { type } = match.edge(i);
|
|
1185
1185
|
if (type.isTextblock && !type.hasRequiredAttrs()) {
|
|
@@ -1223,7 +1223,7 @@ const splitBlock = ({ keepMarks = true } = {}) => ({ tr, state, dispatch, editor
|
|
|
1223
1223
|
}
|
|
1224
1224
|
const deflt = $from.depth === 0
|
|
1225
1225
|
? undefined
|
|
1226
|
-
: defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));
|
|
1226
|
+
: defaultBlockAt$1($from.node(-1).contentMatchAt($from.indexAfter(-1)));
|
|
1227
1227
|
let types = atEnd && deflt
|
|
1228
1228
|
? [{
|
|
1229
1229
|
type: deflt,
|
|
@@ -3960,6 +3960,16 @@ function textPasteRule(config) {
|
|
|
3960
3960
|
});
|
|
3961
3961
|
}
|
|
3962
3962
|
|
|
3963
|
+
function defaultBlockAt(match) {
|
|
3964
|
+
for (let i = 0; i < match.edgeCount; i += 1) {
|
|
3965
|
+
const { type } = match.edge(i);
|
|
3966
|
+
if (type.isTextblock && !type.hasRequiredAttrs()) {
|
|
3967
|
+
return type;
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
return null;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3963
3973
|
function findChildren(node, predicate) {
|
|
3964
3974
|
const nodesWithPos = [];
|
|
3965
3975
|
node.descendants((child, pos) => {
|
|
@@ -4099,5 +4109,5 @@ function posToDOMRect(view, from, to) {
|
|
|
4099
4109
|
};
|
|
4100
4110
|
}
|
|
4101
4111
|
|
|
4102
|
-
export { Editor, Extension, InputRule, Mark, Node, NodeView, PasteRule, Tracker, callOrReturn, extensions, findChildren, findChildrenInRange, findParentNode, findParentNodeClosestToPos, generateHTML, generateJSON, generateText, getAttributes, getDebugJSON, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAttributes, getNodeType, getSchema, getText, getTextBetween, inputRulesPlugin, isActive, isList, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isTextSelection, markInputRule, markPasteRule, mergeAttributes, nodeInputRule, pasteRulesPlugin, posToDOMRect, textInputRule, textPasteRule, textblockTypeInputRule, wrappingInputRule };
|
|
4112
|
+
export { Editor, Extension, InputRule, Mark, Node, NodeView, PasteRule, Tracker, callOrReturn, defaultBlockAt, extensions, findChildren, findChildrenInRange, findParentNode, findParentNodeClosestToPos, generateHTML, generateJSON, generateText, getAttributes, getDebugJSON, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAttributes, getNodeType, getSchema, getText, getTextBetween, inputRulesPlugin, isActive, isList, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isTextSelection, markInputRule, markPasteRule, mergeAttributes, nodeInputRule, pasteRulesPlugin, posToDOMRect, textInputRule, textPasteRule, textblockTypeInputRule, wrappingInputRule };
|
|
4103
4113
|
//# sourceMappingURL=tiptap-core.esm.js.map
|