UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

32 lines (26 loc) 788 B
import { Plugin, PluginKey } from '../../../prosemirror'; import { EditorPlugin } from '../../types'; import { confluenceJiraIssue } from '../../../schema/nodes/confluence-jira-issue'; import { nodeViewFactory, ReactJIRAIssueNode } from '../../../nodeviews'; export const pluginKey = new PluginKey('jiraIssuePlugin'); export const jiraIssue = new Plugin({ key: pluginKey, props: { nodeViews: { jiraIssue: nodeViewFactory(this.providerFactory, { jiraIssue: ReactJIRAIssueNode }) } } }); const jiraIssuePlugin: EditorPlugin = { nodes() { return [ { rank: 1400, name: 'confluenceJiraIssue', node: confluenceJiraIssue }, ]; }, pmPlugins() { return [ { rank: 1410, plugin: () => jiraIssue } ]; } }; export default jiraIssuePlugin;