refactor(maintainment): set dependency versions for prosemirror and y… (#2904)

* refactor(maintainment): set dependency versions for prosemirror and yjs to fixed versions

* refactor(docs): fix dependency versions in demos

* chore: update package-lock.json

* chore: update latest prosemirror packages
This commit is contained in:
Dominik
2022-06-21 00:17:10 +02:00
committed by GitHub
parent 39a20123ab
commit 53e39d0c47
27 changed files with 6787 additions and 2266 deletions

View File

@@ -24,9 +24,9 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0"
"prosemirror-model": "1.18.1",
"prosemirror-state": "1.4.0",
"prosemirror-view": "1.26.1"
},
"repository": {
"type": "git",

View File

@@ -170,13 +170,25 @@ export function Suggestion<I = any>({
state: {
// Initialize the plugin's internal state.
init() {
return {
const state: {
active: boolean,
range: Range,
query: null | string
text: null | string
composing: boolean
decorationId?: string | null
} = {
active: false,
range: {},
range: {
from: 0,
to: 0,
},
query: null,
text: null,
composing: false,
}
return state
},
// Apply changes to the plugin state from a view transaction.
@@ -195,7 +207,7 @@ export function Suggestion<I = any>({
if (isEditable && (empty || editor.view.composing)) {
// Reset active state if we just left the previous suggestion range
if (
(from < prev.range.from || from > prev.range.to)
((from < prev.range.from) || from > prev.range.to)
&& !composing
&& !prev.composing
) {
@@ -229,7 +241,7 @@ export function Suggestion<I = any>({
// Make sure to empty the range if suggestion is inactive
if (!next.active) {
next.decorationId = null
next.range = {}
next.range = { from: 0, to: 0 }
next.query = null
next.text = null
}