docs: update content

This commit is contained in:
Philipp Kühn
2021-05-05 19:42:47 +02:00
parent 55d430ef8f
commit 0030f083b0
7 changed files with 15 additions and 18 deletions

View File

@@ -11,7 +11,7 @@ declare module '@tiptap/core' {
interface Commands {
insertContentAt: {
/**
* Insert a node or string of HTML at the current position.
* Insert a node or string of HTML at a specific position.
*/
insertContentAt: (range: Range, value: Content) => Command,
}

View File

@@ -13,6 +13,8 @@ declare module '@tiptap/core' {
}
export const replace: RawCommands['replace'] = (typeOrName, attributes = {}) => ({ state, commands }) => {
console.warn('[tiptap warn]: replace() is deprecated. please use insertContent() instead.')
const { from, to } = state.selection
const range = { from, to }

View File

@@ -14,6 +14,8 @@ declare module '@tiptap/core' {
}
export const replaceRange: RawCommands['replaceRange'] = (range, typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
console.warn('[tiptap warn]: replaceRange() is deprecated. please use insertContent() instead.')
const type = getNodeType(typeOrName, state.schema)
const { from, to } = range
// const $from = tr.doc.resolve(from)