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

@@ -14,8 +14,8 @@
"remixicon": "^2.5.0", "remixicon": "^2.5.0",
"shiki": "^0.10.0", "shiki": "^0.10.0",
"simplify-js": "^1.2.4", "simplify-js": "^1.2.4",
"y-webrtc": "^10.2.2", "y-webrtc": "10.2.2",
"yjs": "^13.5.26", "yjs": "13.5.26",
"y-prosemirror": "1.0.20", "y-prosemirror": "1.0.20",
"lowlight": "^1.20.0" "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" "dist"
], ],
"dependencies": { "dependencies": {
"prosemirror-commands": "^1.3.0", "prosemirror-commands": "1.3.0",
"prosemirror-keymap": "^1.2.0", "prosemirror-keymap": "1.2.0",
"prosemirror-model": "^1.17.0", "prosemirror-model": "1.18.1",
"prosemirror-schema-list": "^1.2.0", "prosemirror-schema-list": "1.2.0",
"prosemirror-state": "^1.4.0", "prosemirror-state": "1.4.0",
"prosemirror-transform": "^1.6.0", "prosemirror-transform": "1.6.0",
"prosemirror-view": "^1.25.0" "prosemirror-view": "1.26.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

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

View File

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

View File

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

View File

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

View File

@@ -27,10 +27,9 @@
"dependencies": { "dependencies": {
"@tiptap/extension-code-block": "^2.0.0-beta.41", "@tiptap/extension-code-block": "^2.0.0-beta.41",
"@types/lowlight": "^0.0.3", "@types/lowlight": "^0.0.3",
"lowlight": "^1.20.0", "prosemirror-model": "1.18.1",
"prosemirror-model": "^1.17.0", "prosemirror-state": "1.4.0",
"prosemirror-state": "^1.4.0", "prosemirror-view": "1.26.1"
"prosemirror-view": "^1.25.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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