add decorationTag and decorationClass option
This commit is contained in:
@@ -8,7 +8,8 @@ export interface SuggestionOptions {
|
|||||||
char?: string,
|
char?: string,
|
||||||
allowSpaces?: boolean,
|
allowSpaces?: boolean,
|
||||||
startOfLine?: boolean,
|
startOfLine?: boolean,
|
||||||
suggestionClass?: string,
|
decorationTag?: string,
|
||||||
|
decorationClass?: string,
|
||||||
command?: (props: {
|
command?: (props: {
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
range: Range,
|
range: Range,
|
||||||
@@ -45,7 +46,8 @@ export function Suggestion({
|
|||||||
char = '@',
|
char = '@',
|
||||||
allowSpaces = false,
|
allowSpaces = false,
|
||||||
startOfLine = false,
|
startOfLine = false,
|
||||||
suggestionClass = 'suggestion',
|
decorationTag = 'span',
|
||||||
|
decorationClass = 'suggestion',
|
||||||
command = () => null,
|
command = () => null,
|
||||||
items = () => [],
|
items = () => [],
|
||||||
render = () => ({}),
|
render = () => ({}),
|
||||||
@@ -194,8 +196,8 @@ export function Suggestion({
|
|||||||
|
|
||||||
return DecorationSet.create(state.doc, [
|
return DecorationSet.create(state.doc, [
|
||||||
Decoration.inline(range.from, range.to, {
|
Decoration.inline(range.from, range.to, {
|
||||||
nodeName: 'span',
|
nodeName: decorationTag,
|
||||||
class: suggestionClass,
|
class: decorationClass,
|
||||||
'data-decoration-id': decorationId,
|
'data-decoration-id': decorationId,
|
||||||
}),
|
}),
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user