@tiptap/suggestion
Advanced tools
Comparing version 2.4.0 to 2.5.0-beta.0
@@ -156,3 +156,3 @@ import { PluginKey, Plugin } from '@tiptap/pm/state'; | ||
// Apply changes to the plugin state from a view transaction. | ||
apply(transaction, prev, oldState, state) { | ||
apply(transaction, prev, _oldState, state) { | ||
const { isEditable } = editor; | ||
@@ -159,0 +159,0 @@ const { composing } = editor.view; |
@@ -158,3 +158,3 @@ (function (global, factory) { | ||
// Apply changes to the plugin state from a view transaction. | ||
apply(transaction, prev, oldState, state) { | ||
apply(transaction, prev, _oldState, state) { | ||
const { isEditable } = editor; | ||
@@ -161,0 +161,0 @@ const { composing } = editor.view; |
@@ -5,3 +5,3 @@ import { Editor, Range } from '@tiptap/core'; | ||
import { findSuggestionMatch as defaultFindSuggestionMatch } from './findSuggestionMatch.js'; | ||
export interface SuggestionOptions<I = any> { | ||
export interface SuggestionOptions<I = any, TSelected = any> { | ||
/** | ||
@@ -66,3 +66,3 @@ * The plugin key for the suggestion plugin. | ||
range: Range; | ||
props: I; | ||
props: TSelected; | ||
}) => void; | ||
@@ -86,7 +86,7 @@ /** | ||
render?: () => { | ||
onBeforeStart?: (props: SuggestionProps<I>) => void; | ||
onStart?: (props: SuggestionProps<I>) => void; | ||
onBeforeUpdate?: (props: SuggestionProps<I>) => void; | ||
onUpdate?: (props: SuggestionProps<I>) => void; | ||
onExit?: (props: SuggestionProps<I>) => void; | ||
onBeforeStart?: (props: SuggestionProps<I, TSelected>) => void; | ||
onStart?: (props: SuggestionProps<I, TSelected>) => void; | ||
onBeforeUpdate?: (props: SuggestionProps<I, TSelected>) => void; | ||
onUpdate?: (props: SuggestionProps<I, TSelected>) => void; | ||
onExit?: (props: SuggestionProps<I, TSelected>) => void; | ||
onKeyDown?: (props: SuggestionKeyDownProps) => boolean; | ||
@@ -106,3 +106,3 @@ }; | ||
} | ||
export interface SuggestionProps<I = any> { | ||
export interface SuggestionProps<I = any, TSelected = any> { | ||
/** | ||
@@ -133,3 +133,3 @@ * The editor instance. | ||
*/ | ||
command: (props: I) => void; | ||
command: (props: TSelected) => void; | ||
/** | ||
@@ -157,2 +157,2 @@ * The decoration node HTML element | ||
*/ | ||
export declare function Suggestion<I = any>({ pluginKey, editor, char, allowSpaces, allowedPrefixes, startOfLine, decorationTag, decorationClass, command, items, render, allow, findSuggestionMatch, }: SuggestionOptions<I>): Plugin<any>; | ||
export declare function Suggestion<I = any, TSelected = any>({ pluginKey, editor, char, allowSpaces, allowedPrefixes, startOfLine, decorationTag, decorationClass, command, items, render, allow, findSuggestionMatch, }: SuggestionOptions<I, TSelected>): Plugin<any>; |
{ | ||
"name": "@tiptap/suggestion", | ||
"description": "suggestion plugin for tiptap", | ||
"version": "2.4.0", | ||
"version": "2.5.0-beta.0", | ||
"homepage": "https://tiptap.dev", | ||
@@ -32,4 +32,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@tiptap/core": "^2.4.0", | ||
"@tiptap/pm": "^2.4.0" | ||
"@tiptap/core": "^2.5.0-beta.0", | ||
"@tiptap/pm": "^2.5.0-beta.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "peerDependencies": { |
@@ -7,3 +7,3 @@ import { Editor, Range } from '@tiptap/core' | ||
export interface SuggestionOptions<I = any> { | ||
export interface SuggestionOptions<I = any, TSelected = any> { | ||
/** | ||
@@ -73,3 +73,3 @@ * The plugin key for the suggestion plugin. | ||
*/ | ||
command?: (props: { editor: Editor; range: Range; props: I }) => void | ||
command?: (props: { editor: Editor; range: Range; props: TSelected }) => void | ||
@@ -91,8 +91,8 @@ /** | ||
render?: () => { | ||
onBeforeStart?: (props: SuggestionProps<I>) => void | ||
onStart?: (props: SuggestionProps<I>) => void | ||
onBeforeUpdate?: (props: SuggestionProps<I>) => void | ||
onUpdate?: (props: SuggestionProps<I>) => void | ||
onExit?: (props: SuggestionProps<I>) => void | ||
onKeyDown?: (props: SuggestionKeyDownProps) => boolean | ||
onBeforeStart?: (props: SuggestionProps<I, TSelected>) => void; | ||
onStart?: (props: SuggestionProps<I, TSelected>) => void; | ||
onBeforeUpdate?: (props: SuggestionProps<I, TSelected>) => void; | ||
onUpdate?: (props: SuggestionProps<I, TSelected>) => void; | ||
onExit?: (props: SuggestionProps<I, TSelected>) => void; | ||
onKeyDown?: (props: SuggestionKeyDownProps) => boolean; | ||
} | ||
@@ -109,3 +109,3 @@ | ||
export interface SuggestionProps<I = any> { | ||
export interface SuggestionProps<I = any, TSelected = any> { | ||
/** | ||
@@ -141,3 +141,3 @@ * The editor instance. | ||
*/ | ||
command: (props: I) => void | ||
command: (props: TSelected) => void | ||
@@ -170,3 +170,3 @@ /** | ||
*/ | ||
export function Suggestion<I = any>({ | ||
export function Suggestion<I = any, TSelected = any>({ | ||
pluginKey = SuggestionPluginKey, | ||
@@ -185,4 +185,4 @@ editor, | ||
findSuggestionMatch = defaultFindSuggestionMatch, | ||
}: SuggestionOptions<I>) { | ||
let props: SuggestionProps<I> | undefined | ||
}: SuggestionOptions<I, TSelected>) { | ||
let props: SuggestionProps<I, TSelected> | undefined | ||
const renderer = render?.() | ||
@@ -310,3 +310,3 @@ | ||
// Apply changes to the plugin state from a view transaction. | ||
apply(transaction, prev, oldState, state) { | ||
apply(transaction, prev, _oldState, state) { | ||
const { isEditable } = editor | ||
@@ -313,0 +313,0 @@ const { composing } = editor.view |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124966
1