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:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user