100 lines
3.9 KiB
JavaScript
100 lines
3.9 KiB
JavaScript
// src/starter-kit.ts
|
|
import { Extension } from "@tiptap/core";
|
|
import { Blockquote } from "@tiptap/extension-blockquote";
|
|
import { Bold } from "@tiptap/extension-bold";
|
|
import { Code } from "@tiptap/extension-code";
|
|
import { CodeBlock } from "@tiptap/extension-code-block";
|
|
import { Document } from "@tiptap/extension-document";
|
|
import { HardBreak } from "@tiptap/extension-hard-break";
|
|
import { Heading } from "@tiptap/extension-heading";
|
|
import { HorizontalRule } from "@tiptap/extension-horizontal-rule";
|
|
import { Italic } from "@tiptap/extension-italic";
|
|
import { Link } from "@tiptap/extension-link";
|
|
import { BulletList, ListItem, ListKeymap, OrderedList } from "@tiptap/extension-list";
|
|
import { Paragraph } from "@tiptap/extension-paragraph";
|
|
import { Strike } from "@tiptap/extension-strike";
|
|
import { Text } from "@tiptap/extension-text";
|
|
import { Underline } from "@tiptap/extension-underline";
|
|
import { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from "@tiptap/extensions";
|
|
var StarterKit = Extension.create({
|
|
name: "starterKit",
|
|
addExtensions() {
|
|
var _a, _b, _c, _d;
|
|
const extensions = [];
|
|
if (this.options.bold !== false) {
|
|
extensions.push(Bold.configure(this.options.bold));
|
|
}
|
|
if (this.options.blockquote !== false) {
|
|
extensions.push(Blockquote.configure(this.options.blockquote));
|
|
}
|
|
if (this.options.bulletList !== false) {
|
|
extensions.push(BulletList.configure(this.options.bulletList));
|
|
}
|
|
if (this.options.code !== false) {
|
|
extensions.push(Code.configure(this.options.code));
|
|
}
|
|
if (this.options.codeBlock !== false) {
|
|
extensions.push(CodeBlock.configure(this.options.codeBlock));
|
|
}
|
|
if (this.options.document !== false) {
|
|
extensions.push(Document.configure(this.options.document));
|
|
}
|
|
if (this.options.dropcursor !== false) {
|
|
extensions.push(Dropcursor.configure(this.options.dropcursor));
|
|
}
|
|
if (this.options.gapcursor !== false) {
|
|
extensions.push(Gapcursor.configure(this.options.gapcursor));
|
|
}
|
|
if (this.options.hardBreak !== false) {
|
|
extensions.push(HardBreak.configure(this.options.hardBreak));
|
|
}
|
|
if (this.options.heading !== false) {
|
|
extensions.push(Heading.configure(this.options.heading));
|
|
}
|
|
if (this.options.undoRedo !== false) {
|
|
extensions.push(UndoRedo.configure(this.options.undoRedo));
|
|
}
|
|
if (this.options.horizontalRule !== false) {
|
|
extensions.push(HorizontalRule.configure(this.options.horizontalRule));
|
|
}
|
|
if (this.options.italic !== false) {
|
|
extensions.push(Italic.configure(this.options.italic));
|
|
}
|
|
if (this.options.listItem !== false) {
|
|
extensions.push(ListItem.configure(this.options.listItem));
|
|
}
|
|
if (this.options.listKeymap !== false) {
|
|
extensions.push(ListKeymap.configure((_a = this.options) == null ? void 0 : _a.listKeymap));
|
|
}
|
|
if (this.options.link !== false) {
|
|
extensions.push(Link.configure((_b = this.options) == null ? void 0 : _b.link));
|
|
}
|
|
if (this.options.orderedList !== false) {
|
|
extensions.push(OrderedList.configure(this.options.orderedList));
|
|
}
|
|
if (this.options.paragraph !== false) {
|
|
extensions.push(Paragraph.configure(this.options.paragraph));
|
|
}
|
|
if (this.options.strike !== false) {
|
|
extensions.push(Strike.configure(this.options.strike));
|
|
}
|
|
if (this.options.text !== false) {
|
|
extensions.push(Text.configure(this.options.text));
|
|
}
|
|
if (this.options.underline !== false) {
|
|
extensions.push(Underline.configure((_c = this.options) == null ? void 0 : _c.underline));
|
|
}
|
|
if (this.options.trailingNode !== false) {
|
|
extensions.push(TrailingNode.configure((_d = this.options) == null ? void 0 : _d.trailingNode));
|
|
}
|
|
return extensions;
|
|
}
|
|
});
|
|
|
|
// src/index.ts
|
|
var index_default = StarterKit;
|
|
export {
|
|
StarterKit,
|
|
index_default as default
|
|
};
|
|
//# sourceMappingURL=index.js.map
|