prosemirror-model
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -0,1 +1,7 @@ | ||
## 1.4.0 (2018-03-22) | ||
### New features | ||
[`ContentMatch.defaultType`](https://prosemirror.net/docs/ref/#model.ContentMatch.defaultType), a way to get a matching node type at a content match position, is now public. | ||
## 1.3.0 (2018-03-22) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-model", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "ProseMirror's document model", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -50,4 +50,10 @@ import {Fragment} from "./fragment" | ||
// :: ?NodeType | ||
// Get the first matching node type at this match position that can | ||
// be generated. | ||
get defaultType() { | ||
return this.next[0] | ||
for (let i = 0; i < this.next.length; i += 2) { | ||
let type = this.next[i] | ||
if (!(type.isText || type.hasRequiredAttrs())) return type | ||
} | ||
} | ||
@@ -54,0 +60,0 @@ |
@@ -651,3 +651,3 @@ import {Fragment} from "./fragment" | ||
if ($context) for (let d = $context.depth; d >= 0; d--) { | ||
let deflt = $context.node(d).defaultContentType($context.indexAfter(d)) | ||
let deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType | ||
if (deflt && deflt.isTextblock && deflt.defaultAttrs) return deflt | ||
@@ -654,0 +654,0 @@ } |
@@ -321,2 +321,3 @@ import {Fragment} from "./fragment" | ||
// Unused. Left for backwards compatibility. | ||
defaultContentType(at) { | ||
@@ -323,0 +324,0 @@ return this.contentMatchAt(at).defaultType |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
484982
5878