Home

Awesome

tiptap-extension-jira

Version Build Status

A collection of Tiptap extensions that enable bidirectional sync with Jira. It works by introducing a series of Nodes and Marks unique to the Atlassian Document Format (ADF) that can be used to render Jira content in a TipTap document.

Features

ExtensionTypeADF Node
DateNodeUndocumented
ExpandNodeUndocumented
Inline CardNodehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/inlineCard/
MediaNodehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/media/
Media GroupNodehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/mediaGroup/
Media SingleNodehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/mediaSingle/
MentionNodehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/mention/
PanelNodehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/panel/
RuleNodehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/rule/
StatusNodeUndocumented
UndefinedNodeUndocumented
Background ColorMarkhttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/backgroundColor/
emMarkhttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/em/
strongMarkhttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/strong/
subSupMarkhttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/subsup/
textColorMarkhttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/textColor/

You'll also need the following extensions from Tiptap to use this package:

ExtensionTypeTiptap ExtensionADF Node
BlockquoteNodehttps://tiptap.dev/docs/editor/extensions/nodes/blockquotehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/blockquote/
Bullet ListNodehttps://tiptap.dev/docs/editor/extensions/nodes/bullet-listhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/bulletList/
Code BlockNodehttps://tiptap.dev/docs/editor/extensions/nodes/code-blockhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/codeBlock/
EmojiNodehttps://tiptap.dev/docs/editor/extensions/nodes/emojihttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/emoji/
Hard BreakNodehttps://tiptap.dev/docs/editor/extensions/nodes/hard-breakhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/hardBreak/
HeadingNodehttps://tiptap.dev/docs/editor/extensions/nodes/headinghttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/heading/
List ItemNodehttps://tiptap.dev/docs/editor/extensions/nodes/list-itemhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/listItem/
Ordered ListNodehttps://tiptap.dev/docs/editor/extensions/nodes/ordered-listhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/orderedList/
ParagraphNodehttps://tiptap.dev/docs/editor/extensions/nodes/paragraphhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/paragraph/
TableNodehttps://tiptap.dev/docs/editor/extensions/nodes/tablehttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/table/
Table CellNodehttps://tiptap.dev/docs/editor/extensions/nodes/table-cellhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/table_cell/
Table HeaderNodehttps://tiptap.dev/docs/editor/extensions/nodes/table-headerhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/table_header/
Table RowNodehttps://tiptap.dev/docs/editor/extensions/nodes/table-rowhttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/table_row/
TextNodehttps://tiptap.dev/docs/editor/extensions/nodes/texthttps://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/text/
CodeMarkhttps://tiptap.dev/docs/editor/extensions/marks/codehttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/code/
LinkMarkhttps://tiptap.dev/docs/editor/extensions/marks/linkhttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/link/
StrikeMarkhttps://tiptap.dev/docs/editor/extensions/marks/strikehttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/strike/
UnderlineMarkhttps://tiptap.dev/docs/editor/extensions/marks/underlinehttps://developer.atlassian.com/cloud/jira/platform/apis/document/marks/underline/

Installation

pnpm add tiptap-extension-jira

Usage

Client

import { Jira } from 'tiptap-extension-jira';

const editor = new Editor({
  extensions: [...Object.values(Jira)],
});

You can modify any of the extensions, for example:

import { Jira } from 'tiptap-extension-jira';

const { Mention, ...rest } = Jira;

const mention = Jira.Mention.configure({
  suggestion: createMentionSuggestions([
    'Hayden',
    'Gavin',
    'Anna',
  ]),
});

const editor = new Editor({
  extensions: [mention, ...Object.values(rest)],
});

I also recommend adding the following Tailwind CSS to your project:

/* Panel */
div[data-panel-type] {
  @apply p-4 bg-muted rounded-md my-4;
}

div[data-panel-type] > *:last-child {
  @apply mb-0;
}

div[data-panel-type="info"] {
  @apply bg-sky-50 text-sky-800;
}

div[data-panel-type="note"] {
  @apply bg-indigo-50 text-indigo-800;
}

div[data-panel-type="success"] {
  @apply bg-emerald-50 text-emerald-800;
}

div[data-panel-type="warning"] {
  @apply bg-amber-50 text-amber-800;
}

div[data-panel-type="error"] {
  @apply bg-rose-50 text-rose-800;
}

Server

If you are running this in a headless environment, you can use the Server extension instead:

import { Jira } from 'tiptap-extension-jira/server';

const editor = new Editor({
  extensions: [...Object.values(Jira)],
});