docs: update content
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user