@tiptap/suggestion 2.6.2 → 3.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +266 -233
- package/dist/index.cjs.map +1 -1
- package/dist/{packages/suggestion/src/suggestion.d.ts → index.d.cts} +26 -9
- package/dist/index.d.ts +170 -0
- package/dist/index.js +239 -228
- package/dist/index.js.map +1 -1
- package/package.json +8 -10
- package/src/suggestion.ts +1 -1
- package/dist/index.umd.js +0 -246
- package/dist/index.umd.js.map +0 -1
- package/dist/packages/core/src/CommandManager.d.ts +0 -20
- package/dist/packages/core/src/Editor.d.ts +0 -163
- package/dist/packages/core/src/EventEmitter.d.ts +0 -11
- package/dist/packages/core/src/Extension.d.ts +0 -344
- package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
- package/dist/packages/core/src/InputRule.d.ts +0 -42
- package/dist/packages/core/src/Mark.d.ts +0 -452
- package/dist/packages/core/src/Node.d.ts +0 -612
- package/dist/packages/core/src/NodePos.d.ts +0 -44
- package/dist/packages/core/src/NodeView.d.ts +0 -31
- package/dist/packages/core/src/PasteRule.d.ts +0 -50
- package/dist/packages/core/src/Tracker.d.ts +0 -11
- package/dist/packages/core/src/commands/blur.d.ts +0 -13
- package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
- package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
- package/dist/packages/core/src/commands/command.d.ts +0 -18
- package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
- package/dist/packages/core/src/commands/cut.d.ts +0 -20
- package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
- package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
- package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
- package/dist/packages/core/src/commands/enter.d.ts +0 -13
- package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
- package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
- package/dist/packages/core/src/commands/first.d.ts +0 -14
- package/dist/packages/core/src/commands/focus.d.ts +0 -27
- package/dist/packages/core/src/commands/forEach.d.ts +0 -14
- package/dist/packages/core/src/commands/index.d.ts +0 -55
- package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
- package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
- package/dist/packages/core/src/commands/join.d.ts +0 -41
- package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
- package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
- package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
- package/dist/packages/core/src/commands/lift.d.ts +0 -17
- package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
- package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
- package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
- package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
- package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
- package/dist/packages/core/src/commands/setContent.d.ts +0 -40
- package/dist/packages/core/src/commands/setMark.d.ts +0 -15
- package/dist/packages/core/src/commands/setMeta.d.ts +0 -16
- package/dist/packages/core/src/commands/setNode.d.ts +0 -16
- package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
- package/dist/packages/core/src/commands/splitListItem.d.ts +0 -16
- package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
- package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
- package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
- package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
- package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
- package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
- package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
- package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
- package/dist/packages/core/src/extensions/commands.d.ts +0 -3
- package/dist/packages/core/src/extensions/editable.d.ts +0 -2
- package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
- package/dist/packages/core/src/extensions/index.d.ts +0 -6
- package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
- package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
- package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
- package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
- package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
- package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
- package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
- package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
- package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
- package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
- package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getText.d.ts +0 -15
- package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
- package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
- package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
- package/dist/packages/core/src/helpers/index.d.ts +0 -50
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
- package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
- package/dist/packages/core/src/helpers/isList.d.ts +0 -2
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -14
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
- package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
- package/dist/packages/core/src/index.d.ts +0 -24
- package/dist/packages/core/src/inputRules/index.d.ts +0 -5
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
- package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
- package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
- package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
- package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
- package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -14
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
- package/dist/packages/core/src/style.d.ts +0 -1
- package/dist/packages/core/src/types.d.ts +0 -253
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
- package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
- package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
- package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/index.d.ts +0 -20
- package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
- package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
- package/dist/packages/core/src/utilities/isString.d.ts +0 -1
- package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
- package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
- package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
- package/dist/packages/suggestion/src/findSuggestionMatch.d.ts +0 -15
- package/dist/packages/suggestion/src/index.d.ts +0 -4
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EditorState, Plugin
|
|
1
|
+
import { Range, Editor } from '@tiptap/core';
|
|
2
|
+
import { PluginKey, EditorState, Plugin } from '@tiptap/pm/state';
|
|
3
3
|
import { EditorView } from '@tiptap/pm/view';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { ResolvedPos } from '@tiptap/pm/model';
|
|
5
|
+
|
|
6
|
+
interface Trigger {
|
|
7
|
+
char: string;
|
|
8
|
+
allowSpaces: boolean;
|
|
9
|
+
allowedPrefixes: string[] | null;
|
|
10
|
+
startOfLine: boolean;
|
|
11
|
+
$position: ResolvedPos;
|
|
12
|
+
}
|
|
13
|
+
type SuggestionMatch = {
|
|
14
|
+
range: Range;
|
|
15
|
+
query: string;
|
|
16
|
+
text: string;
|
|
17
|
+
} | null;
|
|
18
|
+
declare function findSuggestionMatch(config: Trigger): SuggestionMatch;
|
|
19
|
+
|
|
20
|
+
interface SuggestionOptions<I = any, TSelected = any> {
|
|
6
21
|
/**
|
|
7
22
|
* The plugin key for the suggestion plugin.
|
|
8
23
|
* @default 'suggestion'
|
|
@@ -99,9 +114,9 @@ export interface SuggestionOptions<I = any, TSelected = any> {
|
|
|
99
114
|
range: Range;
|
|
100
115
|
isActive?: boolean;
|
|
101
116
|
}) => boolean;
|
|
102
|
-
findSuggestionMatch?: typeof
|
|
117
|
+
findSuggestionMatch?: typeof findSuggestionMatch;
|
|
103
118
|
}
|
|
104
|
-
|
|
119
|
+
interface SuggestionProps<I = any, TSelected = any> {
|
|
105
120
|
/**
|
|
106
121
|
* The editor instance.
|
|
107
122
|
*/
|
|
@@ -140,14 +155,16 @@ export interface SuggestionProps<I = any, TSelected = any> {
|
|
|
140
155
|
*/
|
|
141
156
|
clientRect?: (() => DOMRect | null) | null;
|
|
142
157
|
}
|
|
143
|
-
|
|
158
|
+
interface SuggestionKeyDownProps {
|
|
144
159
|
view: EditorView;
|
|
145
160
|
event: KeyboardEvent;
|
|
146
161
|
range: Range;
|
|
147
162
|
}
|
|
148
|
-
|
|
163
|
+
declare const SuggestionPluginKey: PluginKey<any>;
|
|
149
164
|
/**
|
|
150
165
|
* This utility allows you to create suggestions.
|
|
151
166
|
* @see https://tiptap.dev/api/utilities/suggestion
|
|
152
167
|
*/
|
|
153
|
-
|
|
168
|
+
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>;
|
|
169
|
+
|
|
170
|
+
export { Suggestion, type SuggestionKeyDownProps, type SuggestionMatch, type SuggestionOptions, SuggestionPluginKey, type SuggestionProps, type Trigger, Suggestion as default, findSuggestionMatch };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { Range, Editor } from '@tiptap/core';
|
|
2
|
+
import { PluginKey, EditorState, Plugin } from '@tiptap/pm/state';
|
|
3
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
4
|
+
import { ResolvedPos } from '@tiptap/pm/model';
|
|
5
|
+
|
|
6
|
+
interface Trigger {
|
|
7
|
+
char: string;
|
|
8
|
+
allowSpaces: boolean;
|
|
9
|
+
allowedPrefixes: string[] | null;
|
|
10
|
+
startOfLine: boolean;
|
|
11
|
+
$position: ResolvedPos;
|
|
12
|
+
}
|
|
13
|
+
type SuggestionMatch = {
|
|
14
|
+
range: Range;
|
|
15
|
+
query: string;
|
|
16
|
+
text: string;
|
|
17
|
+
} | null;
|
|
18
|
+
declare function findSuggestionMatch(config: Trigger): SuggestionMatch;
|
|
19
|
+
|
|
20
|
+
interface SuggestionOptions<I = any, TSelected = any> {
|
|
21
|
+
/**
|
|
22
|
+
* The plugin key for the suggestion plugin.
|
|
23
|
+
* @default 'suggestion'
|
|
24
|
+
* @example 'mention'
|
|
25
|
+
*/
|
|
26
|
+
pluginKey?: PluginKey;
|
|
27
|
+
/**
|
|
28
|
+
* The editor instance.
|
|
29
|
+
* @default null
|
|
30
|
+
*/
|
|
31
|
+
editor: Editor;
|
|
32
|
+
/**
|
|
33
|
+
* The character that triggers the suggestion.
|
|
34
|
+
* @default '@'
|
|
35
|
+
* @example '#'
|
|
36
|
+
*/
|
|
37
|
+
char?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Allow spaces in the suggestion query.
|
|
40
|
+
* @default false
|
|
41
|
+
* @example true
|
|
42
|
+
*/
|
|
43
|
+
allowSpaces?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Allow prefixes in the suggestion query.
|
|
46
|
+
* @default [' ']
|
|
47
|
+
* @example [' ', '@']
|
|
48
|
+
*/
|
|
49
|
+
allowedPrefixes?: string[] | null;
|
|
50
|
+
/**
|
|
51
|
+
* Only match suggestions at the start of the line.
|
|
52
|
+
* @default false
|
|
53
|
+
* @example true
|
|
54
|
+
*/
|
|
55
|
+
startOfLine?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The tag name of the decoration node.
|
|
58
|
+
* @default 'span'
|
|
59
|
+
* @example 'div'
|
|
60
|
+
*/
|
|
61
|
+
decorationTag?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The class name of the decoration node.
|
|
64
|
+
* @default 'suggestion'
|
|
65
|
+
* @example 'mention'
|
|
66
|
+
*/
|
|
67
|
+
decorationClass?: string;
|
|
68
|
+
/**
|
|
69
|
+
* A function that is called when a suggestion is selected.
|
|
70
|
+
* @param props The props object.
|
|
71
|
+
* @param props.editor The editor instance.
|
|
72
|
+
* @param props.range The range of the suggestion.
|
|
73
|
+
* @param props.props The props of the selected suggestion.
|
|
74
|
+
* @returns void
|
|
75
|
+
* @example ({ editor, range, props }) => { props.command(props.props) }
|
|
76
|
+
*/
|
|
77
|
+
command?: (props: {
|
|
78
|
+
editor: Editor;
|
|
79
|
+
range: Range;
|
|
80
|
+
props: TSelected;
|
|
81
|
+
}) => void;
|
|
82
|
+
/**
|
|
83
|
+
* A function that returns the suggestion items in form of an array.
|
|
84
|
+
* @param props The props object.
|
|
85
|
+
* @param props.editor The editor instance.
|
|
86
|
+
* @param props.query The current suggestion query.
|
|
87
|
+
* @returns An array of suggestion items.
|
|
88
|
+
* @example ({ editor, query }) => [{ id: 1, label: 'John Doe' }]
|
|
89
|
+
*/
|
|
90
|
+
items?: (props: {
|
|
91
|
+
query: string;
|
|
92
|
+
editor: Editor;
|
|
93
|
+
}) => I[] | Promise<I[]>;
|
|
94
|
+
/**
|
|
95
|
+
* The render function for the suggestion.
|
|
96
|
+
* @returns An object with render functions.
|
|
97
|
+
*/
|
|
98
|
+
render?: () => {
|
|
99
|
+
onBeforeStart?: (props: SuggestionProps<I, TSelected>) => void;
|
|
100
|
+
onStart?: (props: SuggestionProps<I, TSelected>) => void;
|
|
101
|
+
onBeforeUpdate?: (props: SuggestionProps<I, TSelected>) => void;
|
|
102
|
+
onUpdate?: (props: SuggestionProps<I, TSelected>) => void;
|
|
103
|
+
onExit?: (props: SuggestionProps<I, TSelected>) => void;
|
|
104
|
+
onKeyDown?: (props: SuggestionKeyDownProps) => boolean;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* A function that returns a boolean to indicate if the suggestion should be active.
|
|
108
|
+
* @param props The props object.
|
|
109
|
+
* @returns {boolean}
|
|
110
|
+
*/
|
|
111
|
+
allow?: (props: {
|
|
112
|
+
editor: Editor;
|
|
113
|
+
state: EditorState;
|
|
114
|
+
range: Range;
|
|
115
|
+
isActive?: boolean;
|
|
116
|
+
}) => boolean;
|
|
117
|
+
findSuggestionMatch?: typeof findSuggestionMatch;
|
|
118
|
+
}
|
|
119
|
+
interface SuggestionProps<I = any, TSelected = any> {
|
|
120
|
+
/**
|
|
121
|
+
* The editor instance.
|
|
122
|
+
*/
|
|
123
|
+
editor: Editor;
|
|
124
|
+
/**
|
|
125
|
+
* The range of the suggestion.
|
|
126
|
+
*/
|
|
127
|
+
range: Range;
|
|
128
|
+
/**
|
|
129
|
+
* The current suggestion query.
|
|
130
|
+
*/
|
|
131
|
+
query: string;
|
|
132
|
+
/**
|
|
133
|
+
* The current suggestion text.
|
|
134
|
+
*/
|
|
135
|
+
text: string;
|
|
136
|
+
/**
|
|
137
|
+
* The suggestion items array.
|
|
138
|
+
*/
|
|
139
|
+
items: I[];
|
|
140
|
+
/**
|
|
141
|
+
* A function that is called when a suggestion is selected.
|
|
142
|
+
* @param props The props object.
|
|
143
|
+
* @returns void
|
|
144
|
+
*/
|
|
145
|
+
command: (props: TSelected) => void;
|
|
146
|
+
/**
|
|
147
|
+
* The decoration node HTML element
|
|
148
|
+
* @default null
|
|
149
|
+
*/
|
|
150
|
+
decorationNode: Element | null;
|
|
151
|
+
/**
|
|
152
|
+
* The function that returns the client rect
|
|
153
|
+
* @default null
|
|
154
|
+
* @example () => new DOMRect(0, 0, 0, 0)
|
|
155
|
+
*/
|
|
156
|
+
clientRect?: (() => DOMRect | null) | null;
|
|
157
|
+
}
|
|
158
|
+
interface SuggestionKeyDownProps {
|
|
159
|
+
view: EditorView;
|
|
160
|
+
event: KeyboardEvent;
|
|
161
|
+
range: Range;
|
|
162
|
+
}
|
|
163
|
+
declare const SuggestionPluginKey: PluginKey<any>;
|
|
164
|
+
/**
|
|
165
|
+
* This utility allows you to create suggestions.
|
|
166
|
+
* @see https://tiptap.dev/api/utilities/suggestion
|
|
167
|
+
*/
|
|
168
|
+
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>;
|
|
169
|
+
|
|
170
|
+
export { Suggestion, type SuggestionKeyDownProps, type SuggestionMatch, type SuggestionOptions, SuggestionPluginKey, type SuggestionProps, type Trigger, Suggestion as default, findSuggestionMatch };
|