chore: migrate to new versions of prosemirror packages (#2854)

* refactor: upgrade prosemirror packages to new typescript versions

* refactor: migrate to new typings from prosemirror

* style: fix linting issues

* style: fix linting issues

* style: fix linting issues

* fix(ci): fix build process by reimplement filterTransaction

* fix(extension-test): fix broken build because of wrong output file names

* fix: fix prosemirror-tables not being bundled correctly for ES6

* fix: move to prosemirror-tables-contently until es6 build is working

* fix: fix tests for youtube

* fix: fix youtube test

* fix(demos): fix demos build
This commit is contained in:
Dominik
2022-06-20 11:45:37 +02:00
committed by GitHub
parent 2fa2c22e6f
commit 1ebc8f8e14
56 changed files with 2440 additions and 6727 deletions

View File

@@ -11,10 +11,11 @@ export function createChainableState(config: {
return {
...state,
schema: state.schema,
plugins: state.plugins,
apply: state.apply.bind(state),
applyTransaction: state.applyTransaction.bind(state),
filterTransaction: state.filterTransaction,
plugins: state.plugins,
schema: state.schema,
reconfigure: state.reconfigure.bind(state),
toJSON: state.toJSON.bind(state),
get storedMarks() {

View File

@@ -40,7 +40,7 @@ export function getMarkRange(
return
}
const mark = findMarkInSet(start.node.marks, type, attributes)
const mark = findMarkInSet([...start.node.marks], type, attributes)
if (!mark) {
return
@@ -51,7 +51,7 @@ export function getMarkRange(
let endIndex = startIndex + 1
let endPos = startPos + start.node.nodeSize
findMarkInSet(start.node.marks, type, attributes)
findMarkInSet([...start.node.marks], type, attributes)
while (startIndex > 0 && mark.isInSet($pos.parent.child(startIndex - 1).marks)) {
startIndex -= 1
@@ -60,7 +60,7 @@ export function getMarkRange(
while (
endIndex < $pos.parent.childCount
&& isMarkInSet($pos.parent.child(endIndex).marks, type, attributes)
&& isMarkInSet([...$pos.parent.child(endIndex).marks], type, attributes)
) {
endPos += $pos.parent.child(endIndex).nodeSize
endIndex += 1

View File

@@ -27,13 +27,15 @@ export function getTextBetween(
separated = true
}
text += textSerializer({
node,
pos,
parent,
index,
range,
})
if (parent) {
text += textSerializer({
node,
pos,
parent,
index,
range,
})
}
} else if (node.isText) {
text += node?.text?.slice(Math.max(from, pos) - pos, to - pos) // eslint-disable-line
separated = false

View File

@@ -1,6 +1,6 @@
import { ResolvedPos } from 'prosemirror-model'
export const getTextContentFromNodes = ($from: ResolvedPos<any>, maxMatch = 500) => {
export const getTextContentFromNodes = ($from: ResolvedPos, maxMatch = 500) => {
let textBefore = ''
$from.parent.nodesBetween(