@tiptap/suggestion
Advanced tools
Comparing version 2.0.0-beta.88 to 2.0.0-beta.89
import { Editor, Range } from '@tiptap/core'; | ||
import { Plugin, PluginKey } from 'prosemirror-state'; | ||
import { EditorState, Plugin, PluginKey } from 'prosemirror-state'; | ||
import { EditorView } from 'prosemirror-view'; | ||
@@ -30,2 +30,3 @@ export interface SuggestionOptions { | ||
editor: Editor; | ||
state: EditorState; | ||
range: Range; | ||
@@ -32,0 +33,0 @@ }) => boolean; |
@@ -148,3 +148,3 @@ 'use strict'; | ||
// Apply changes to the plugin state from a view transaction. | ||
apply(transaction, prev) { | ||
apply(transaction, prev, oldState, state) { | ||
const { composing } = editor.view; | ||
@@ -174,3 +174,3 @@ const { selection } = transaction; | ||
// If we found a match, update the current state to show it | ||
if (match && allow({ editor, range: match.range })) { | ||
if (match && allow({ editor, state, range: match.range })) { | ||
next.active = true; | ||
@@ -177,0 +177,0 @@ next.decorationId = prev.decorationId ? prev.decorationId : decorationId; |
@@ -144,3 +144,3 @@ import { PluginKey, Plugin } from 'prosemirror-state'; | ||
// Apply changes to the plugin state from a view transaction. | ||
apply(transaction, prev) { | ||
apply(transaction, prev, oldState, state) { | ||
const { composing } = editor.view; | ||
@@ -170,3 +170,3 @@ const { selection } = transaction; | ||
// If we found a match, update the current state to show it | ||
if (match && allow({ editor, range: match.range })) { | ||
if (match && allow({ editor, state, range: match.range })) { | ||
next.active = true; | ||
@@ -173,0 +173,0 @@ next.decorationId = prev.decorationId ? prev.decorationId : decorationId; |
@@ -146,3 +146,3 @@ (function (global, factory) { | ||
// Apply changes to the plugin state from a view transaction. | ||
apply(transaction, prev) { | ||
apply(transaction, prev, oldState, state) { | ||
const { composing } = editor.view; | ||
@@ -172,3 +172,3 @@ const { selection } = transaction; | ||
// If we found a match, update the current state to show it | ||
if (match && allow({ editor, range: match.range })) { | ||
if (match && allow({ editor, state, range: match.range })) { | ||
next.active = true; | ||
@@ -175,0 +175,0 @@ next.decorationId = prev.decorationId ? prev.decorationId : decorationId; |
{ | ||
"name": "@tiptap/suggestion", | ||
"description": "suggestion plugin for tiptap", | ||
"version": "2.0.0-beta.88", | ||
"version": "2.0.0-beta.89", | ||
"homepage": "https://tiptap.dev", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "9e48f8c23960198b166b23804c094f2ddccc3927" | ||
"gitHead": "84fa6fb85e98d8e56ae15ecb477f60d5993216e5" | ||
} |
import { Editor, Range } from '@tiptap/core' | ||
import { Plugin, PluginKey } from 'prosemirror-state' | ||
import { EditorState, Plugin, PluginKey } from 'prosemirror-state' | ||
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view' | ||
@@ -32,2 +32,3 @@ import { findSuggestionMatch } from './findSuggestionMatch' | ||
editor: Editor, | ||
state: EditorState, | ||
range: Range, | ||
@@ -171,3 +172,3 @@ }) => boolean, | ||
// Apply changes to the plugin state from a view transaction. | ||
apply(transaction, prev) { | ||
apply(transaction, prev, oldState, state) { | ||
const { composing } = editor.view | ||
@@ -203,3 +204,3 @@ const { selection } = transaction | ||
// If we found a match, update the current state to show it | ||
if (match && allow({ editor, range: match.range })) { | ||
if (match && allow({ editor, state, range: match.range })) { | ||
next.active = true | ||
@@ -206,0 +207,0 @@ next.decorationId = prev.decorationId ? prev.decorationId : decorationId |
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
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
97891
1034