Add a different pluginKey
This commit is contained in:
parent
f21d0c6ecf
commit
5d3290600b
|
@ -255,7 +255,10 @@ export function RichContent(props: {
|
||||||
smallImage ? DisplayImage : Image,
|
smallImage ? DisplayImage : Image,
|
||||||
DisplayLink.configure({ openOnClick: false }), // stop link opening twice (browser still opens)
|
DisplayLink.configure({ openOnClick: false }), // stop link opening twice (browser still opens)
|
||||||
DisplayMention,
|
DisplayMention,
|
||||||
DisplayContractMention,
|
DisplayContractMention.configure({
|
||||||
|
// Needed to set a different PluginKey for Prosemirror
|
||||||
|
suggestion: contractMentionSuggestion,
|
||||||
|
}),
|
||||||
Iframe,
|
Iframe,
|
||||||
TiptapTweet,
|
TiptapTweet,
|
||||||
],
|
],
|
||||||
|
|
|
@ -4,8 +4,8 @@ import { searchInAny } from 'common/util/parse'
|
||||||
import { orderBy } from 'lodash'
|
import { orderBy } from 'lodash'
|
||||||
import tippy from 'tippy.js'
|
import tippy from 'tippy.js'
|
||||||
import { getCachedContracts } from 'web/hooks/use-contracts'
|
import { getCachedContracts } from 'web/hooks/use-contracts'
|
||||||
// import { getCachedUsers } from 'web/hooks/use-users'
|
|
||||||
import { MentionList } from './contract-mention-list'
|
import { MentionList } from './contract-mention-list'
|
||||||
|
import { PluginKey } from 'prosemirror-state'
|
||||||
|
|
||||||
type Suggestion = MentionOptions['suggestion']
|
type Suggestion = MentionOptions['suggestion']
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ const beginsWith = (text: string, query: string) =>
|
||||||
export const contractMentionSuggestion: Suggestion = {
|
export const contractMentionSuggestion: Suggestion = {
|
||||||
char: '%',
|
char: '%',
|
||||||
allowSpaces: true,
|
allowSpaces: true,
|
||||||
|
pluginKey: new PluginKey('contract-mention'),
|
||||||
items: async ({ query }) =>
|
items: async ({ query }) =>
|
||||||
orderBy(
|
orderBy(
|
||||||
(await getCachedContracts()).filter((c) =>
|
(await getCachedContracts()).filter((c) =>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user