@tiptap/core
Advanced tools
Comparing version 2.0.0-beta.17 to 2.0.0-beta.18
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.0.0-beta.18](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.17...@tiptap/core@2.0.0-beta.18) (2021-04-07) | ||
### Features | ||
* add priority option to extensions ([bb1ae65](https://github.com/ueberdosis/tiptap-next/commit/bb1ae659a463e97a7ada15af711347b5c004897a)) | ||
# [2.0.0-beta.17](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.16...@tiptap/core@2.0.0-beta.17) (2021-04-07) | ||
@@ -8,0 +19,0 @@ |
@@ -16,2 +16,6 @@ import { Plugin, Transaction } from 'prosemirror-state'; | ||
/** | ||
* Priority | ||
*/ | ||
priority?: number; | ||
/** | ||
* Default options | ||
@@ -18,0 +22,0 @@ */ |
@@ -12,2 +12,3 @@ import { Schema, Node as ProsemirrorNode } from 'prosemirror-model'; | ||
constructor(extensions: Extensions, editor: Editor); | ||
private sort; | ||
get commands(): RawCommands; | ||
@@ -14,0 +15,0 @@ get plugins(): Plugin[]; |
@@ -16,2 +16,6 @@ import { DOMOutputSpec, MarkSpec, Mark as ProseMirrorMark, MarkType } from 'prosemirror-model'; | ||
/** | ||
* Priority | ||
*/ | ||
priority?: number; | ||
/** | ||
* Default options | ||
@@ -18,0 +22,0 @@ */ |
@@ -16,2 +16,6 @@ import { DOMOutputSpec, NodeSpec, Node as ProseMirrorNode, NodeType } from 'prosemirror-model'; | ||
/** | ||
* Priority | ||
*/ | ||
priority?: number; | ||
/** | ||
* Default options | ||
@@ -18,0 +22,0 @@ */ |
{ | ||
"name": "@tiptap/core", | ||
"description": "headless rich text editor", | ||
"version": "2.0.0-beta.17", | ||
"version": "2.0.0-beta.18", | ||
"homepage": "https://tiptap.dev", | ||
@@ -44,3 +44,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "6d83bef97ddcd257e1a9ce997dc9cdbe00eaeb72" | ||
"gitHead": "ae2e496a7083186a9558dd0a4d337b9eb10d7a04" | ||
} |
@@ -20,2 +20,7 @@ import { Plugin, Transaction } from 'prosemirror-state' | ||
/** | ||
* Priority | ||
*/ | ||
priority?: number, | ||
/** | ||
* Default options | ||
@@ -184,2 +189,3 @@ */ | ||
name: 'extension', | ||
priority: 100, | ||
defaultOptions: {}, | ||
@@ -186,0 +192,0 @@ } |
@@ -28,3 +28,3 @@ import { keymap } from 'prosemirror-keymap' | ||
this.editor = editor | ||
this.extensions = extensions | ||
this.extensions = this.sort(extensions) | ||
this.schema = getSchema(this.extensions) | ||
@@ -81,2 +81,18 @@ | ||
private sort(extensions: Extensions) { | ||
const defaultPriority = 100 | ||
return extensions.sort((a, b) => { | ||
if ((a.config.priority || defaultPriority) > (b.config.priority || defaultPriority)) { | ||
return -1 | ||
} | ||
if ((a.config.priority || defaultPriority) < (b.config.priority || defaultPriority)) { | ||
return 1 | ||
} | ||
return 0 | ||
}) | ||
} | ||
get commands(): RawCommands { | ||
@@ -83,0 +99,0 @@ return this.extensions.reduce((commands, extension) => { |
@@ -25,2 +25,7 @@ import { | ||
/** | ||
* Priority | ||
*/ | ||
priority?: number, | ||
/** | ||
* Default options | ||
@@ -258,2 +263,3 @@ */ | ||
name: 'mark', | ||
priority: 100, | ||
defaultOptions: {}, | ||
@@ -260,0 +266,0 @@ } |
@@ -30,2 +30,7 @@ import { | ||
/** | ||
* Priority | ||
*/ | ||
priority?: number, | ||
/** | ||
* Default options | ||
@@ -316,2 +321,3 @@ */ | ||
name: 'node', | ||
priority: 100, | ||
defaultOptions: {}, | ||
@@ -318,0 +324,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
2388513
15462