@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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/core",
|
|
3
3
|
"description": "headless rich text editor",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.142",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
45
45
|
"directory": "packages/core"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "7c5223fc926e27a231190e0c8ad1b8351768375c"
|
|
48
48
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContentMatch, NodeType } from 'prosemirror-model'
|
|
2
|
+
|
|
3
|
+
export default function defaultBlockAt(match: ContentMatch): NodeType | null {
|
|
4
|
+
for (let i = 0; i < match.edgeCount; i += 1) {
|
|
5
|
+
const { type } = match.edge(i)
|
|
6
|
+
|
|
7
|
+
if (type.isTextblock && !type.hasRequiredAttrs()) {
|
|
8
|
+
return type
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return null
|
|
13
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { default as textPasteRule } from './pasteRules/textPasteRule'
|
|
|
23
23
|
export { default as callOrReturn } from './utilities/callOrReturn'
|
|
24
24
|
export { default as mergeAttributes } from './utilities/mergeAttributes'
|
|
25
25
|
|
|
26
|
+
export { default as defaultBlockAt } from './helpers/defaultBlockAt'
|
|
26
27
|
export { default as getExtensionField } from './helpers/getExtensionField'
|
|
27
28
|
export { default as findChildren } from './helpers/findChildren'
|
|
28
29
|
export { default as findChildrenInRange } from './helpers/findChildrenInRange'
|