-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce tiptap mime type based modes with default extensions.…
… DRAFT /1 NOTE: this would contradict the current mode where only what is defined in the toolbar is actually allowed as HTML. this is limiting! better, we define a default set of extension per mime type. this can then also be imported in the tiptap collaboration server to construct a valid representation of the content and be able to store that from there back to the backend.
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import ExtBlockquote from "@tiptap/extension-blockquote"; | ||
import ExtBold from "@tiptap/extension-bold"; | ||
import ExtBulletList from "@tiptap/extension-bullet-list"; | ||
import ExtCode from "@tiptap/extension-code"; | ||
import ExtCodeBlock from "@tiptap/extension-code-block"; | ||
import ExtDocument from "@tiptap/extension-document"; | ||
import ExtEmbed from "./extensions/embed"; | ||
import ExtFigcaption from "./extensions/figcaption"; | ||
import ExtFigure from "./extensions/figure"; | ||
import ExtHardBreak from "@tiptap/extension-hard-break"; | ||
import ExtHeading from "./extensions/heading"; | ||
import ExtHorizontalRule from "@tiptap/extension-horizontal-rule"; | ||
import ExtImageFigure from "./extensions/image-figure"; | ||
import ExtImageInline from "./extensions/image-inline"; | ||
import ExtItalic from "@tiptap/extension-italic"; | ||
import ExtLink from "./extensions/link"; | ||
import ExtListItem from "@tiptap/extension-list-item"; | ||
import ExtOrderedList from "@tiptap/extension-ordered-list"; | ||
import ExtParagraph from "@tiptap/extension-paragraph"; | ||
import ExtStrike from "@tiptap/extension-strike"; | ||
import ExtTable from "@tiptap/extension-table"; | ||
import ExtTableCell from "@tiptap/extension-table-cell"; | ||
import ExtTableHeader from "@tiptap/extension-table-header"; | ||
import ExtTableRow from "@tiptap/extension-table-row"; | ||
import ExtText from "@tiptap/extension-text"; | ||
|
||
// source extension? | ||
|
||
export const modes = { | ||
"text/html": [ | ||
ExtBlockquote, | ||
ExtBold, | ||
ExtBulletList, | ||
ExtCode, | ||
ExtCodeBlock, | ||
ExtDocument, | ||
ExtEmbed, | ||
ExtFigcaption, | ||
ExtFigure, | ||
ExtHardBreak, | ||
ExtHeading, | ||
ExtHorizontalRule, | ||
ExtImageFigure, | ||
ExtImageInline, | ||
ExtItalic, | ||
ExtLink, | ||
ExtListItem, | ||
ExtOrderedList, | ||
ExtParagraph, | ||
ExtStrike, | ||
ExtTable, | ||
ExtTableCell, | ||
ExtTableHeader, | ||
ExtTableRow, | ||
ExtText, | ||
], | ||
"text/plain": [ExtDocument], | ||
"text/markdown": [ExtDocument], | ||
}; | ||
|
||
export default { modes }; |