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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 6787 additions and 2266 deletions

View File

@ -14,8 +14,8 @@
"remixicon": "^2.5.0",
"shiki": "^0.10.0",
"simplify-js": "^1.2.4",
"y-webrtc": "^10.2.2",
"yjs": "^13.5.26",
"y-webrtc": "10.2.2",
"yjs": "13.5.26",
"y-prosemirror": "1.0.20",
"lowlight": "^1.20.0"
},

8934
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,13 +24,13 @@
"dist"
],
"dependencies": {
"prosemirror-commands": "^1.3.0",
"prosemirror-keymap": "^1.2.0",
"prosemirror-model": "^1.17.0",
"prosemirror-schema-list": "^1.2.0",
"prosemirror-state": "^1.4.0",
"prosemirror-transform": "^1.6.0",
"prosemirror-view": "^1.25.0"
"prosemirror-commands": "1.3.0",
"prosemirror-keymap": "1.2.0",
"prosemirror-model": "1.18.1",
"prosemirror-schema-list": "1.2.0",
"prosemirror-state": "1.4.0",
"prosemirror-transform": "1.6.0",
"prosemirror-view": "1.26.1"
},
"repository": {
"type": "git",

View File

@ -190,7 +190,7 @@ export function pasteRulesPlugin(props: { editor: Editor, rules: PasteRule[] }):
return false
},
paste: (view, event) => {
paste: (view, event: Event) => {
const html = (event as ClipboardEvent).clipboardData?.getData('text/html')
isPastedFromProseMirror = !!html?.includes('data-pm-slice')

View File

@ -13,7 +13,7 @@ export const FocusEvents = Extension.create({
key: new PluginKey('focusEvents'),
props: {
handleDOMEvents: {
focus: (view, event) => {
focus: (view, event: Event) => {
editor.isFocused = true
const transaction = editor.state.tr
@ -24,7 +24,7 @@ export const FocusEvents = Extension.create({
return false
},
blur: (view, event) => {
blur: (view, event: Event) => {
editor.isFocused = false
const transaction = editor.state.tr

View File

@ -24,8 +24,8 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0",
"prosemirror-state": "1.4.0",
"prosemirror-view": "1.26.1",
"tippy.js": "^6.3.7"
},
"repository": {

View File

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

View File

@ -27,10 +27,9 @@
"dependencies": {
"@tiptap/extension-code-block": "^2.0.0-beta.41",
"@types/lowlight": "^0.0.3",
"lowlight": "^1.20.0",
"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

@ -24,7 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.4.0"
"prosemirror-state": "1.4.0"
},
"repository": {
"type": "git",

View File

@ -24,7 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.4.0",
"prosemirror-state": "1.4.0",
"y-prosemirror": "1.0.20"
},
"repository": {

View File

@ -24,7 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-dropcursor": "^1.5.0"
"prosemirror-dropcursor": "1.5.0"
},
"repository": {
"type": "git",

View File

@ -24,8 +24,8 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0",
"prosemirror-state": "1.4.0",
"prosemirror-view": "1.26.1",
"tippy.js": "^6.3.7"
},
"repository": {

View File

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

View File

@ -24,7 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-gapcursor": "^1.3.0"
"prosemirror-gapcursor": "1.3.0"
},
"repository": {
"type": "git",

View File

@ -24,7 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-history": "^1.3.0"
"prosemirror-history": "1.3.0"
},
"repository": {
"type": "git",

View File

@ -24,7 +24,7 @@
"@tiptap/core": "^2.0.0-beta.1"
},
"dependencies": {
"prosemirror-state": "^1.4.0"
"prosemirror-state": "1.4.0"
},
"repository": {
"type": "git",

View File

@ -25,8 +25,8 @@
},
"dependencies": {
"linkifyjs": "^3.0.5",
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0"
"prosemirror-model": "1.18.1",
"prosemirror-state": "1.4.0"
},
"repository": {
"type": "git",

View File

@ -25,8 +25,8 @@
},
"dependencies": {
"@tiptap/suggestion": "^2.0.0-beta.96",
"prosemirror-model": "^1.17.0",
"prosemirror-state": "^1.4.0"
"prosemirror-model": "1.18.1",
"prosemirror-state": "1.4.0"
},
"repository": {
"type": "git",

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

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

View File

@ -22,7 +22,7 @@
],
"peerDependencies": {
"@tiptap/core": "^2.0.0-beta.1",
"prosemirror-model": "^1.17.0"
"prosemirror-model": "1.18.1"
},
"repository": {
"type": "git",

View File

@ -22,7 +22,7 @@
],
"dependencies": {
"@tiptap/core": "^2.0.0-beta.180",
"prosemirror-model": "^1.17.0",
"prosemirror-model": "1.18.1",
"zeed-dom": "^0.9.19"
},
"repository": {

View File

@ -34,7 +34,7 @@
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.60",
"@tiptap/extension-floating-menu": "^2.0.0-beta.55",
"prosemirror-view": "^1.25.0"
"prosemirror-view": "1.26.1"
},
"repository": {
"type": "git",

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
}

View File

@ -30,7 +30,7 @@
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.60",
"@tiptap/extension-floating-menu": "^2.0.0-beta.55",
"prosemirror-view": "^1.25.0"
"prosemirror-view": "1.26.1"
},
"repository": {
"type": "git",

View File

@ -30,8 +30,8 @@
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.0.0-beta.60",
"@tiptap/extension-floating-menu": "^2.0.0-beta.55",
"prosemirror-state": "^1.4.0",
"prosemirror-view": "^1.25.0"
"prosemirror-state": "1.4.0",
"prosemirror-view": "1.26.1"
},
"repository": {
"type": "git",