@tiptap/starter-kit 3.0.0-next.6 → 3.0.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +24 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +26 -36
- package/dist/index.js.map +1 -1
- package/package.json +25 -25
- package/src/starter-kit.ts +50 -53
package/dist/index.cjs
CHANGED
|
@@ -46,73 +46,73 @@ var import_extensions = require("@tiptap/extensions");
|
|
|
46
46
|
var StarterKit = import_core.Extension.create({
|
|
47
47
|
name: "starterKit",
|
|
48
48
|
addExtensions() {
|
|
49
|
-
var _a, _b, _c, _d
|
|
49
|
+
var _a, _b, _c, _d;
|
|
50
50
|
const extensions = [];
|
|
51
51
|
if (this.options.bold !== false) {
|
|
52
|
-
extensions.push(import_extension_bold.Bold.configure(
|
|
52
|
+
extensions.push(import_extension_bold.Bold.configure(this.options.bold));
|
|
53
53
|
}
|
|
54
54
|
if (this.options.blockquote !== false) {
|
|
55
|
-
extensions.push(import_extension_blockquote.Blockquote.configure(
|
|
55
|
+
extensions.push(import_extension_blockquote.Blockquote.configure(this.options.blockquote));
|
|
56
56
|
}
|
|
57
57
|
if (this.options.bulletList !== false) {
|
|
58
|
-
extensions.push(import_extension_list.BulletList.configure(
|
|
58
|
+
extensions.push(import_extension_list.BulletList.configure(this.options.bulletList));
|
|
59
59
|
}
|
|
60
60
|
if (this.options.code !== false) {
|
|
61
|
-
extensions.push(import_extension_code.Code.configure(
|
|
61
|
+
extensions.push(import_extension_code.Code.configure(this.options.code));
|
|
62
62
|
}
|
|
63
63
|
if (this.options.codeBlock !== false) {
|
|
64
|
-
extensions.push(import_extension_code_block.CodeBlock.configure(
|
|
64
|
+
extensions.push(import_extension_code_block.CodeBlock.configure(this.options.codeBlock));
|
|
65
65
|
}
|
|
66
66
|
if (this.options.document !== false) {
|
|
67
|
-
extensions.push(import_extension_document.Document.configure(
|
|
67
|
+
extensions.push(import_extension_document.Document.configure(this.options.document));
|
|
68
68
|
}
|
|
69
69
|
if (this.options.dropcursor !== false) {
|
|
70
|
-
extensions.push(import_extensions.Dropcursor.configure(
|
|
70
|
+
extensions.push(import_extensions.Dropcursor.configure(this.options.dropcursor));
|
|
71
71
|
}
|
|
72
72
|
if (this.options.gapcursor !== false) {
|
|
73
|
-
extensions.push(import_extensions.Gapcursor.configure(
|
|
73
|
+
extensions.push(import_extensions.Gapcursor.configure(this.options.gapcursor));
|
|
74
74
|
}
|
|
75
75
|
if (this.options.hardBreak !== false) {
|
|
76
|
-
extensions.push(import_extension_hard_break.HardBreak.configure(
|
|
76
|
+
extensions.push(import_extension_hard_break.HardBreak.configure(this.options.hardBreak));
|
|
77
77
|
}
|
|
78
78
|
if (this.options.heading !== false) {
|
|
79
|
-
extensions.push(import_extension_heading.Heading.configure(
|
|
79
|
+
extensions.push(import_extension_heading.Heading.configure(this.options.heading));
|
|
80
80
|
}
|
|
81
|
-
if (this.options.
|
|
82
|
-
extensions.push(import_extensions.
|
|
81
|
+
if (this.options.undoRedo !== false) {
|
|
82
|
+
extensions.push(import_extensions.UndoRedo.configure(this.options.undoRedo));
|
|
83
83
|
}
|
|
84
84
|
if (this.options.horizontalRule !== false) {
|
|
85
|
-
extensions.push(import_extension_horizontal_rule.HorizontalRule.configure(
|
|
85
|
+
extensions.push(import_extension_horizontal_rule.HorizontalRule.configure(this.options.horizontalRule));
|
|
86
86
|
}
|
|
87
87
|
if (this.options.italic !== false) {
|
|
88
|
-
extensions.push(import_extension_italic.Italic.configure(
|
|
88
|
+
extensions.push(import_extension_italic.Italic.configure(this.options.italic));
|
|
89
89
|
}
|
|
90
90
|
if (this.options.listItem !== false) {
|
|
91
|
-
extensions.push(import_extension_list.ListItem.configure(
|
|
91
|
+
extensions.push(import_extension_list.ListItem.configure(this.options.listItem));
|
|
92
92
|
}
|
|
93
93
|
if (this.options.listKeymap !== false) {
|
|
94
|
-
extensions.push(import_extension_list.ListKeymap.configure((
|
|
94
|
+
extensions.push(import_extension_list.ListKeymap.configure((_a = this.options) == null ? void 0 : _a.listKeymap));
|
|
95
95
|
}
|
|
96
96
|
if (this.options.link !== false) {
|
|
97
|
-
extensions.push(import_extension_link.Link.configure((
|
|
97
|
+
extensions.push(import_extension_link.Link.configure((_b = this.options) == null ? void 0 : _b.link));
|
|
98
98
|
}
|
|
99
99
|
if (this.options.orderedList !== false) {
|
|
100
|
-
extensions.push(import_extension_list.OrderedList.configure(
|
|
100
|
+
extensions.push(import_extension_list.OrderedList.configure(this.options.orderedList));
|
|
101
101
|
}
|
|
102
102
|
if (this.options.paragraph !== false) {
|
|
103
|
-
extensions.push(import_extension_paragraph.Paragraph.configure(
|
|
103
|
+
extensions.push(import_extension_paragraph.Paragraph.configure(this.options.paragraph));
|
|
104
104
|
}
|
|
105
105
|
if (this.options.strike !== false) {
|
|
106
|
-
extensions.push(import_extension_strike.Strike.configure(
|
|
106
|
+
extensions.push(import_extension_strike.Strike.configure(this.options.strike));
|
|
107
107
|
}
|
|
108
108
|
if (this.options.text !== false) {
|
|
109
|
-
extensions.push(import_extension_text.Text.configure(
|
|
109
|
+
extensions.push(import_extension_text.Text.configure(this.options.text));
|
|
110
110
|
}
|
|
111
111
|
if (this.options.underline !== false) {
|
|
112
|
-
extensions.push(import_extension_underline.Underline.configure((
|
|
112
|
+
extensions.push(import_extension_underline.Underline.configure((_c = this.options) == null ? void 0 : _c.underline));
|
|
113
113
|
}
|
|
114
114
|
if (this.options.trailingNode !== false) {
|
|
115
|
-
extensions.push(import_extensions.TrailingNode.configure((
|
|
115
|
+
extensions.push(import_extensions.TrailingNode.configure((_d = this.options) == null ? void 0 : _d.trailingNode));
|
|
116
116
|
}
|
|
117
117
|
return extensions;
|
|
118
118
|
}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/starter-kit.ts"],"sourcesContent":["import { StarterKit } from './starter-kit.js'\n\nexport type { StarterKitOptions } from './starter-kit.js'\nexport * from './starter-kit.js'\n\nexport default StarterKit\n","import { Extension } from '@tiptap/core'\nimport { Blockquote, BlockquoteOptions } from '@tiptap/extension-blockquote'\nimport { Bold, BoldOptions } from '@tiptap/extension-bold'\nimport { Code, CodeOptions } from '@tiptap/extension-code'\nimport { CodeBlock, CodeBlockOptions } from '@tiptap/extension-code-block'\nimport { Document } from '@tiptap/extension-document'\nimport { HardBreak, HardBreakOptions } from '@tiptap/extension-hard-break'\nimport { Heading, HeadingOptions } from '@tiptap/extension-heading'\nimport { HorizontalRule, HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'\nimport { Italic, ItalicOptions } from '@tiptap/extension-italic'\nimport { Link, LinkOptions } from '@tiptap/extension-link'\nimport {\n BulletList,\n BulletListOptions,\n ListItem,\n ListItemOptions,\n ListKeymap,\n ListKeymapOptions,\n OrderedList,\n OrderedListOptions,\n} from '@tiptap/extension-list'\nimport { Paragraph, ParagraphOptions } from '@tiptap/extension-paragraph'\nimport { Strike, StrikeOptions } from '@tiptap/extension-strike'\nimport { Text } from '@tiptap/extension-text'\nimport { Underline, UnderlineOptions } from '@tiptap/extension-underline'\nimport {\n Dropcursor,\n DropcursorOptions,\n Gapcursor,\n History,\n HistoryOptions,\n TrailingNode,\n TrailingNodeOptions,\n} from '@tiptap/extensions'\n\nexport interface StarterKitOptions {\n /**\n * If set to false, the blockquote extension will not be registered\n * @example blockquote: false\n */\n blockquote: Partial<BlockquoteOptions> | false\n\n /**\n * If set to false, the bold extension will not be registered\n * @example bold: false\n */\n bold: Partial<BoldOptions> | false\n\n /**\n * If set to false, the bulletList extension will not be registered\n * @example bulletList: false\n */\n bulletList: Partial<BulletListOptions> | false\n\n /**\n * If set to false, the code extension will not be registered\n * @example code: false\n */\n code: Partial<CodeOptions> | false\n\n /**\n * If set to false, the codeBlock extension will not be registered\n * @example codeBlock: false\n */\n codeBlock: Partial<CodeBlockOptions> | false\n\n /**\n * If set to false, the document extension will not be registered\n * @example document: false\n */\n document: false\n\n /**\n * If set to false, the dropcursor extension will not be registered\n * @example dropcursor: false\n */\n dropcursor: Partial<DropcursorOptions> | false\n\n /**\n * If set to false, the gapcursor extension will not be registered\n * @example gapcursor: false\n */\n gapcursor: false\n\n /**\n * If set to false, the hardBreak extension will not be registered\n * @example hardBreak: false\n */\n hardBreak: Partial<HardBreakOptions> | false\n\n /**\n * If set to false, the heading extension will not be registered\n * @example heading: false\n */\n heading: Partial<HeadingOptions> | false\n\n /**\n * If set to false, the history extension will not be registered\n * @example history: false\n */\n history: Partial<HistoryOptions> | false\n\n /**\n * If set to false, the horizontalRule extension will not be registered\n * @example horizontalRule: false\n */\n horizontalRule: Partial<HorizontalRuleOptions> | false\n\n /**\n * If set to false, the italic extension will not be registered\n * @example italic: false\n */\n italic: Partial<ItalicOptions> | false\n\n /**\n * If set to false, the listItem extension will not be registered\n * @example listItem: false\n */\n listItem: Partial<ListItemOptions> | false\n\n /**\n * If set to false, the listItemKeymap extension will not be registered\n * @example listKeymap: false\n */\n listKeymap: Partial<ListKeymapOptions> | false\n\n /**\n * If set to false, the link extension will not be registered\n * @example link: false\n */\n link: Partial<LinkOptions> | false\n\n /**\n * If set to false, the orderedList extension will not be registered\n * @example orderedList: false\n */\n orderedList: Partial<OrderedListOptions> | false\n\n /**\n * If set to false, the paragraph extension will not be registered\n * @example paragraph: false\n */\n paragraph: Partial<ParagraphOptions> | false\n\n /**\n * If set to false, the strike extension will not be registered\n * @example strike: false\n */\n strike: Partial<StrikeOptions> | false\n\n /**\n * If set to false, the text extension will not be registered\n * @example text: false\n */\n text: false\n\n /**\n * If set to false, the underline extension will not be registered\n * @example underline: false\n */\n underline: Partial<UnderlineOptions> | false\n\n /**\n * If set to false, the trailingNode extension will not be registered\n * @example trailingNode: false\n */\n trailingNode: Partial<TrailingNodeOptions> | false\n}\n\n/**\n * The starter kit is a collection of essential editor extensions.\n *\n * It’s a good starting point for building your own editor.\n */\nexport const StarterKit = Extension.create<StarterKitOptions>({\n name: 'starterKit',\n\n addExtensions() {\n const extensions = []\n\n if (this.options.bold !== false) {\n extensions.push(Bold.configure(this.options?.bold))\n }\n\n if (this.options.blockquote !== false) {\n extensions.push(Blockquote.configure(this.options?.blockquote))\n }\n\n if (this.options.bulletList !== false) {\n extensions.push(BulletList.configure(this.options?.bulletList))\n }\n\n if (this.options.code !== false) {\n extensions.push(Code.configure(this.options?.code))\n }\n\n if (this.options.codeBlock !== false) {\n extensions.push(CodeBlock.configure(this.options?.codeBlock))\n }\n\n if (this.options.document !== false) {\n extensions.push(Document.configure(this.options?.document))\n }\n\n if (this.options.dropcursor !== false) {\n extensions.push(Dropcursor.configure(this.options?.dropcursor))\n }\n\n if (this.options.gapcursor !== false) {\n extensions.push(Gapcursor.configure(this.options?.gapcursor))\n }\n\n if (this.options.hardBreak !== false) {\n extensions.push(HardBreak.configure(this.options?.hardBreak))\n }\n\n if (this.options.heading !== false) {\n extensions.push(Heading.configure(this.options?.heading))\n }\n\n if (this.options.history !== false) {\n extensions.push(History.configure(this.options?.history))\n }\n\n if (this.options.horizontalRule !== false) {\n extensions.push(HorizontalRule.configure(this.options?.horizontalRule))\n }\n\n if (this.options.italic !== false) {\n extensions.push(Italic.configure(this.options?.italic))\n }\n\n if (this.options.listItem !== false) {\n extensions.push(ListItem.configure(this.options?.listItem))\n }\n\n if (this.options.listKeymap !== false) {\n extensions.push(ListKeymap.configure(this.options?.listKeymap))\n }\n\n if (this.options.link !== false) {\n extensions.push(Link.configure(this.options?.link))\n }\n\n if (this.options.orderedList !== false) {\n extensions.push(OrderedList.configure(this.options?.orderedList))\n }\n\n if (this.options.paragraph !== false) {\n extensions.push(Paragraph.configure(this.options?.paragraph))\n }\n\n if (this.options.strike !== false) {\n extensions.push(Strike.configure(this.options?.strike))\n }\n\n if (this.options.text !== false) {\n extensions.push(Text.configure(this.options?.text))\n }\n\n if (this.options.underline !== false) {\n extensions.push(Underline.configure(this.options?.underline))\n }\n\n if (this.options.trailingNode !== false) {\n extensions.push(TrailingNode.configure(this.options?.trailingNode))\n }\n\n return extensions\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA0B;AAC1B,kCAA8C;AAC9C,4BAAkC;AAClC,4BAAkC;AAClC,kCAA4C;AAC5C,gCAAyB;AACzB,kCAA4C;AAC5C,+BAAwC;AACxC,uCAAsD;AACtD,8BAAsC;AACtC,4BAAkC;AAClC,4BASO;AACP,iCAA4C;AAC5C,8BAAsC;AACtC,4BAAqB;AACrB,iCAA4C;AAC5C,wBAQO;AA6IA,IAAM,aAAa,sBAAU,OAA0B;AAAA,EAC5D,MAAM;AAAA,EAEN,gBAAgB;AAjLlB;AAkLI,UAAM,aAAa,CAAC;AAEpB,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,2BAAK,WAAU,UAAK,YAAL,mBAAc,IAAI,CAAC;AAAA,IACpD;AAEA,QAAI,KAAK,QAAQ,eAAe,OAAO;AACrC,iBAAW,KAAK,uCAAW,WAAU,UAAK,YAAL,mBAAc,UAAU,CAAC;AAAA,IAChE;AAEA,QAAI,KAAK,QAAQ,eAAe,OAAO;AACrC,iBAAW,KAAK,iCAAW,WAAU,UAAK,YAAL,mBAAc,UAAU,CAAC;AAAA,IAChE;AAEA,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,2BAAK,WAAU,UAAK,YAAL,mBAAc,IAAI,CAAC;AAAA,IACpD;AAEA,QAAI,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,sCAAU,WAAU,UAAK,YAAL,mBAAc,SAAS,CAAC;AAAA,IAC9D;AAEA,QAAI,KAAK,QAAQ,aAAa,OAAO;AACnC,iBAAW,KAAK,mCAAS,WAAU,UAAK,YAAL,mBAAc,QAAQ,CAAC;AAAA,IAC5D;AAEA,QAAI,KAAK,QAAQ,eAAe,OAAO;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I,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,qCAAU,WAAU,UAAK,YAAL,mBAAc,SAAS,CAAC;AAAA,IAC9D;AAEA,QAAI,KAAK,QAAQ,WAAW,OAAO;AACjC,iBAAW,KAAK,+BAAO,WAAU,UAAK,YAAL,mBAAc,MAAM,CAAC;AAAA,IACxD;AAEA,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,2BAAK,WAAU,UAAK,YAAL,mBAAc,IAAI,CAAC;AAAA,IACpD;AAEA,QAAI,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,qCAAU,WAAU,UAAK,YAAL,mBAAc,SAAS,CAAC;AAAA,IAC9D;AAEA,QAAI,KAAK,QAAQ,iBAAiB,OAAO;AACvC,iBAAW,KAAK,+BAAa,WAAU,UAAK,YAAL,mBAAc,YAAY,CAAC;AAAA,IACpE;AAEA,WAAO;AAAA,EACT;AACF,CAAC;;;ADzQD,IAAO,gBAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/starter-kit.ts"],"sourcesContent":["import { StarterKit } from './starter-kit.js'\n\nexport type { StarterKitOptions } from './starter-kit.js'\nexport * from './starter-kit.js'\n\nexport default StarterKit\n","import { Extension } from '@tiptap/core'\nimport type { BlockquoteOptions } from '@tiptap/extension-blockquote'\nimport { Blockquote } from '@tiptap/extension-blockquote'\nimport type { BoldOptions } from '@tiptap/extension-bold'\nimport { Bold } from '@tiptap/extension-bold'\nimport type { CodeOptions } from '@tiptap/extension-code'\nimport { Code } from '@tiptap/extension-code'\nimport type { CodeBlockOptions } from '@tiptap/extension-code-block'\nimport { CodeBlock } from '@tiptap/extension-code-block'\nimport { Document } from '@tiptap/extension-document'\nimport type { HardBreakOptions } from '@tiptap/extension-hard-break'\nimport { HardBreak } from '@tiptap/extension-hard-break'\nimport type { HeadingOptions } from '@tiptap/extension-heading'\nimport { Heading } from '@tiptap/extension-heading'\nimport type { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'\nimport { HorizontalRule } from '@tiptap/extension-horizontal-rule'\nimport type { ItalicOptions } from '@tiptap/extension-italic'\nimport { Italic } from '@tiptap/extension-italic'\nimport type { LinkOptions } from '@tiptap/extension-link'\nimport { Link } from '@tiptap/extension-link'\nimport type { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from '@tiptap/extension-list'\nimport { BulletList, ListItem, ListKeymap, OrderedList } from '@tiptap/extension-list'\nimport type { ParagraphOptions } from '@tiptap/extension-paragraph'\nimport { Paragraph } from '@tiptap/extension-paragraph'\nimport type { StrikeOptions } from '@tiptap/extension-strike'\nimport { Strike } from '@tiptap/extension-strike'\nimport { Text } from '@tiptap/extension-text'\nimport type { UnderlineOptions } from '@tiptap/extension-underline'\nimport { Underline } from '@tiptap/extension-underline'\nimport type { DropcursorOptions, TrailingNodeOptions, UndoRedoOptions } from '@tiptap/extensions'\nimport { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from '@tiptap/extensions'\n\nexport interface StarterKitOptions {\n /**\n * If set to false, the blockquote extension will not be registered\n * @example blockquote: false\n */\n blockquote: Partial<BlockquoteOptions> | false\n\n /**\n * If set to false, the bold extension will not be registered\n * @example bold: false\n */\n bold: Partial<BoldOptions> | false\n\n /**\n * If set to false, the bulletList extension will not be registered\n * @example bulletList: false\n */\n bulletList: Partial<BulletListOptions> | false\n\n /**\n * If set to false, the code extension will not be registered\n * @example code: false\n */\n code: Partial<CodeOptions> | false\n\n /**\n * If set to false, the codeBlock extension will not be registered\n * @example codeBlock: false\n */\n codeBlock: Partial<CodeBlockOptions> | false\n\n /**\n * If set to false, the document extension will not be registered\n * @example document: false\n */\n document: false\n\n /**\n * If set to false, the dropcursor extension will not be registered\n * @example dropcursor: false\n */\n dropcursor: Partial<DropcursorOptions> | false\n\n /**\n * If set to false, the gapcursor extension will not be registered\n * @example gapcursor: false\n */\n gapcursor: false\n\n /**\n * If set to false, the hardBreak extension will not be registered\n * @example hardBreak: false\n */\n hardBreak: Partial<HardBreakOptions> | false\n\n /**\n * If set to false, the heading extension will not be registered\n * @example heading: false\n */\n heading: Partial<HeadingOptions> | false\n\n /**\n * If set to false, the undo-redo extension will not be registered\n * @example undoRedo: false\n */\n undoRedo: Partial<UndoRedoOptions> | false\n\n /**\n * If set to false, the horizontalRule extension will not be registered\n * @example horizontalRule: false\n */\n horizontalRule: Partial<HorizontalRuleOptions> | false\n\n /**\n * If set to false, the italic extension will not be registered\n * @example italic: false\n */\n italic: Partial<ItalicOptions> | false\n\n /**\n * If set to false, the listItem extension will not be registered\n * @example listItem: false\n */\n listItem: Partial<ListItemOptions> | false\n\n /**\n * If set to false, the listItemKeymap extension will not be registered\n * @example listKeymap: false\n */\n listKeymap: Partial<ListKeymapOptions> | false\n\n /**\n * If set to false, the link extension will not be registered\n * @example link: false\n */\n link: Partial<LinkOptions> | false\n\n /**\n * If set to false, the orderedList extension will not be registered\n * @example orderedList: false\n */\n orderedList: Partial<OrderedListOptions> | false\n\n /**\n * If set to false, the paragraph extension will not be registered\n * @example paragraph: false\n */\n paragraph: Partial<ParagraphOptions> | false\n\n /**\n * If set to false, the strike extension will not be registered\n * @example strike: false\n */\n strike: Partial<StrikeOptions> | false\n\n /**\n * If set to false, the text extension will not be registered\n * @example text: false\n */\n text: false\n\n /**\n * If set to false, the underline extension will not be registered\n * @example underline: false\n */\n underline: Partial<UnderlineOptions> | false\n\n /**\n * If set to false, the trailingNode extension will not be registered\n * @example trailingNode: false\n */\n trailingNode: Partial<TrailingNodeOptions> | false\n}\n\n/**\n * The starter kit is a collection of essential editor extensions.\n *\n * It’s a good starting point for building your own editor.\n */\nexport const StarterKit = Extension.create<StarterKitOptions>({\n name: 'starterKit',\n\n addExtensions() {\n const extensions = []\n\n if (this.options.bold !== false) {\n extensions.push(Bold.configure(this.options.bold))\n }\n\n if (this.options.blockquote !== false) {\n extensions.push(Blockquote.configure(this.options.blockquote))\n }\n\n if (this.options.bulletList !== false) {\n extensions.push(BulletList.configure(this.options.bulletList))\n }\n\n if (this.options.code !== false) {\n extensions.push(Code.configure(this.options.code))\n }\n\n if (this.options.codeBlock !== false) {\n extensions.push(CodeBlock.configure(this.options.codeBlock))\n }\n\n if (this.options.document !== false) {\n extensions.push(Document.configure(this.options.document))\n }\n\n if (this.options.dropcursor !== false) {\n extensions.push(Dropcursor.configure(this.options.dropcursor))\n }\n\n if (this.options.gapcursor !== false) {\n extensions.push(Gapcursor.configure(this.options.gapcursor))\n }\n\n if (this.options.hardBreak !== false) {\n extensions.push(HardBreak.configure(this.options.hardBreak))\n }\n\n if (this.options.heading !== false) {\n extensions.push(Heading.configure(this.options.heading))\n }\n\n if (this.options.undoRedo !== false) {\n extensions.push(UndoRedo.configure(this.options.undoRedo))\n }\n\n if (this.options.horizontalRule !== false) {\n extensions.push(HorizontalRule.configure(this.options.horizontalRule))\n }\n\n if (this.options.italic !== false) {\n extensions.push(Italic.configure(this.options.italic))\n }\n\n if (this.options.listItem !== false) {\n extensions.push(ListItem.configure(this.options.listItem))\n }\n\n if (this.options.listKeymap !== false) {\n extensions.push(ListKeymap.configure(this.options?.listKeymap))\n }\n\n if (this.options.link !== false) {\n extensions.push(Link.configure(this.options?.link))\n }\n\n if (this.options.orderedList !== false) {\n extensions.push(OrderedList.configure(this.options.orderedList))\n }\n\n if (this.options.paragraph !== false) {\n extensions.push(Paragraph.configure(this.options.paragraph))\n }\n\n if (this.options.strike !== false) {\n extensions.push(Strike.configure(this.options.strike))\n }\n\n if (this.options.text !== false) {\n extensions.push(Text.configure(this.options.text))\n }\n\n if (this.options.underline !== false) {\n extensions.push(Underline.configure(this.options?.underline))\n }\n\n if (this.options.trailingNode !== false) {\n extensions.push(TrailingNode.configure(this.options?.trailingNode))\n }\n\n return extensions\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA0B;AAE1B,kCAA2B;AAE3B,4BAAqB;AAErB,4BAAqB;AAErB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CAAC;AAAA,IACnD;AAEA,QAAI,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,qCAAU,WAAU,UAAK,YAAL,mBAAc,SAAS,CAAC;AAAA,IAC9D;AAEA,QAAI,KAAK,QAAQ,iBAAiB,OAAO;AACvC,iBAAW,KAAK,+BAAa,WAAU,UAAK,YAAL,mBAAc,YAAY,CAAC;AAAA,IACpE;AAEA,WAAO;AAAA,EACT;AACF,CAAC;;;ADtQD,IAAO,gBAAQ;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -12,7 +12,7 @@ import { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptio
|
|
|
12
12
|
import { ParagraphOptions } from '@tiptap/extension-paragraph';
|
|
13
13
|
import { StrikeOptions } from '@tiptap/extension-strike';
|
|
14
14
|
import { UnderlineOptions } from '@tiptap/extension-underline';
|
|
15
|
-
import { DropcursorOptions,
|
|
15
|
+
import { DropcursorOptions, UndoRedoOptions, TrailingNodeOptions } from '@tiptap/extensions';
|
|
16
16
|
|
|
17
17
|
interface StarterKitOptions {
|
|
18
18
|
/**
|
|
@@ -66,10 +66,10 @@ interface StarterKitOptions {
|
|
|
66
66
|
*/
|
|
67
67
|
heading: Partial<HeadingOptions> | false;
|
|
68
68
|
/**
|
|
69
|
-
* If set to false, the
|
|
70
|
-
* @example
|
|
69
|
+
* If set to false, the undo-redo extension will not be registered
|
|
70
|
+
* @example undoRedo: false
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
undoRedo: Partial<UndoRedoOptions> | false;
|
|
73
73
|
/**
|
|
74
74
|
* If set to false, the horizontalRule extension will not be registered
|
|
75
75
|
* @example horizontalRule: false
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptio
|
|
|
12
12
|
import { ParagraphOptions } from '@tiptap/extension-paragraph';
|
|
13
13
|
import { StrikeOptions } from '@tiptap/extension-strike';
|
|
14
14
|
import { UnderlineOptions } from '@tiptap/extension-underline';
|
|
15
|
-
import { DropcursorOptions,
|
|
15
|
+
import { DropcursorOptions, UndoRedoOptions, TrailingNodeOptions } from '@tiptap/extensions';
|
|
16
16
|
|
|
17
17
|
interface StarterKitOptions {
|
|
18
18
|
/**
|
|
@@ -66,10 +66,10 @@ interface StarterKitOptions {
|
|
|
66
66
|
*/
|
|
67
67
|
heading: Partial<HeadingOptions> | false;
|
|
68
68
|
/**
|
|
69
|
-
* If set to false, the
|
|
70
|
-
* @example
|
|
69
|
+
* If set to false, the undo-redo extension will not be registered
|
|
70
|
+
* @example undoRedo: false
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
undoRedo: Partial<UndoRedoOptions> | false;
|
|
73
73
|
/**
|
|
74
74
|
* If set to false, the horizontalRule extension will not be registered
|
|
75
75
|
* @example horizontalRule: false
|
package/dist/index.js
CHANGED
|
@@ -10,92 +10,82 @@ import { Heading } from "@tiptap/extension-heading";
|
|
|
10
10
|
import { HorizontalRule } from "@tiptap/extension-horizontal-rule";
|
|
11
11
|
import { Italic } from "@tiptap/extension-italic";
|
|
12
12
|
import { Link } from "@tiptap/extension-link";
|
|
13
|
-
import {
|
|
14
|
-
BulletList,
|
|
15
|
-
ListItem,
|
|
16
|
-
ListKeymap,
|
|
17
|
-
OrderedList
|
|
18
|
-
} from "@tiptap/extension-list";
|
|
13
|
+
import { BulletList, ListItem, ListKeymap, OrderedList } from "@tiptap/extension-list";
|
|
19
14
|
import { Paragraph } from "@tiptap/extension-paragraph";
|
|
20
15
|
import { Strike } from "@tiptap/extension-strike";
|
|
21
16
|
import { Text } from "@tiptap/extension-text";
|
|
22
17
|
import { Underline } from "@tiptap/extension-underline";
|
|
23
|
-
import {
|
|
24
|
-
Dropcursor,
|
|
25
|
-
Gapcursor,
|
|
26
|
-
History,
|
|
27
|
-
TrailingNode
|
|
28
|
-
} from "@tiptap/extensions";
|
|
18
|
+
import { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from "@tiptap/extensions";
|
|
29
19
|
var StarterKit = Extension.create({
|
|
30
20
|
name: "starterKit",
|
|
31
21
|
addExtensions() {
|
|
32
|
-
var _a, _b, _c, _d
|
|
22
|
+
var _a, _b, _c, _d;
|
|
33
23
|
const extensions = [];
|
|
34
24
|
if (this.options.bold !== false) {
|
|
35
|
-
extensions.push(Bold.configure(
|
|
25
|
+
extensions.push(Bold.configure(this.options.bold));
|
|
36
26
|
}
|
|
37
27
|
if (this.options.blockquote !== false) {
|
|
38
|
-
extensions.push(Blockquote.configure(
|
|
28
|
+
extensions.push(Blockquote.configure(this.options.blockquote));
|
|
39
29
|
}
|
|
40
30
|
if (this.options.bulletList !== false) {
|
|
41
|
-
extensions.push(BulletList.configure(
|
|
31
|
+
extensions.push(BulletList.configure(this.options.bulletList));
|
|
42
32
|
}
|
|
43
33
|
if (this.options.code !== false) {
|
|
44
|
-
extensions.push(Code.configure(
|
|
34
|
+
extensions.push(Code.configure(this.options.code));
|
|
45
35
|
}
|
|
46
36
|
if (this.options.codeBlock !== false) {
|
|
47
|
-
extensions.push(CodeBlock.configure(
|
|
37
|
+
extensions.push(CodeBlock.configure(this.options.codeBlock));
|
|
48
38
|
}
|
|
49
39
|
if (this.options.document !== false) {
|
|
50
|
-
extensions.push(Document.configure(
|
|
40
|
+
extensions.push(Document.configure(this.options.document));
|
|
51
41
|
}
|
|
52
42
|
if (this.options.dropcursor !== false) {
|
|
53
|
-
extensions.push(Dropcursor.configure(
|
|
43
|
+
extensions.push(Dropcursor.configure(this.options.dropcursor));
|
|
54
44
|
}
|
|
55
45
|
if (this.options.gapcursor !== false) {
|
|
56
|
-
extensions.push(Gapcursor.configure(
|
|
46
|
+
extensions.push(Gapcursor.configure(this.options.gapcursor));
|
|
57
47
|
}
|
|
58
48
|
if (this.options.hardBreak !== false) {
|
|
59
|
-
extensions.push(HardBreak.configure(
|
|
49
|
+
extensions.push(HardBreak.configure(this.options.hardBreak));
|
|
60
50
|
}
|
|
61
51
|
if (this.options.heading !== false) {
|
|
62
|
-
extensions.push(Heading.configure(
|
|
52
|
+
extensions.push(Heading.configure(this.options.heading));
|
|
63
53
|
}
|
|
64
|
-
if (this.options.
|
|
65
|
-
extensions.push(
|
|
54
|
+
if (this.options.undoRedo !== false) {
|
|
55
|
+
extensions.push(UndoRedo.configure(this.options.undoRedo));
|
|
66
56
|
}
|
|
67
57
|
if (this.options.horizontalRule !== false) {
|
|
68
|
-
extensions.push(HorizontalRule.configure(
|
|
58
|
+
extensions.push(HorizontalRule.configure(this.options.horizontalRule));
|
|
69
59
|
}
|
|
70
60
|
if (this.options.italic !== false) {
|
|
71
|
-
extensions.push(Italic.configure(
|
|
61
|
+
extensions.push(Italic.configure(this.options.italic));
|
|
72
62
|
}
|
|
73
63
|
if (this.options.listItem !== false) {
|
|
74
|
-
extensions.push(ListItem.configure(
|
|
64
|
+
extensions.push(ListItem.configure(this.options.listItem));
|
|
75
65
|
}
|
|
76
66
|
if (this.options.listKeymap !== false) {
|
|
77
|
-
extensions.push(ListKeymap.configure((
|
|
67
|
+
extensions.push(ListKeymap.configure((_a = this.options) == null ? void 0 : _a.listKeymap));
|
|
78
68
|
}
|
|
79
69
|
if (this.options.link !== false) {
|
|
80
|
-
extensions.push(Link.configure((
|
|
70
|
+
extensions.push(Link.configure((_b = this.options) == null ? void 0 : _b.link));
|
|
81
71
|
}
|
|
82
72
|
if (this.options.orderedList !== false) {
|
|
83
|
-
extensions.push(OrderedList.configure(
|
|
73
|
+
extensions.push(OrderedList.configure(this.options.orderedList));
|
|
84
74
|
}
|
|
85
75
|
if (this.options.paragraph !== false) {
|
|
86
|
-
extensions.push(Paragraph.configure(
|
|
76
|
+
extensions.push(Paragraph.configure(this.options.paragraph));
|
|
87
77
|
}
|
|
88
78
|
if (this.options.strike !== false) {
|
|
89
|
-
extensions.push(Strike.configure(
|
|
79
|
+
extensions.push(Strike.configure(this.options.strike));
|
|
90
80
|
}
|
|
91
81
|
if (this.options.text !== false) {
|
|
92
|
-
extensions.push(Text.configure(
|
|
82
|
+
extensions.push(Text.configure(this.options.text));
|
|
93
83
|
}
|
|
94
84
|
if (this.options.underline !== false) {
|
|
95
|
-
extensions.push(Underline.configure((
|
|
85
|
+
extensions.push(Underline.configure((_c = this.options) == null ? void 0 : _c.underline));
|
|
96
86
|
}
|
|
97
87
|
if (this.options.trailingNode !== false) {
|
|
98
|
-
extensions.push(TrailingNode.configure((
|
|
88
|
+
extensions.push(TrailingNode.configure((_d = this.options) == null ? void 0 : _d.trailingNode));
|
|
99
89
|
}
|
|
100
90
|
return extensions;
|
|
101
91
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/starter-kit.ts","../src/index.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport { Blockquote, BlockquoteOptions } from '@tiptap/extension-blockquote'\nimport { Bold, BoldOptions } from '@tiptap/extension-bold'\nimport { Code, CodeOptions } from '@tiptap/extension-code'\nimport { CodeBlock, CodeBlockOptions } from '@tiptap/extension-code-block'\nimport { Document } from '@tiptap/extension-document'\nimport { HardBreak, HardBreakOptions } from '@tiptap/extension-hard-break'\nimport { Heading, HeadingOptions } from '@tiptap/extension-heading'\nimport { HorizontalRule, HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'\nimport { Italic, ItalicOptions } from '@tiptap/extension-italic'\nimport { Link, LinkOptions } from '@tiptap/extension-link'\nimport {\n BulletList,\n BulletListOptions,\n ListItem,\n ListItemOptions,\n ListKeymap,\n ListKeymapOptions,\n OrderedList,\n OrderedListOptions,\n} from '@tiptap/extension-list'\nimport { Paragraph, ParagraphOptions } from '@tiptap/extension-paragraph'\nimport { Strike, StrikeOptions } from '@tiptap/extension-strike'\nimport { Text } from '@tiptap/extension-text'\nimport { Underline, UnderlineOptions } from '@tiptap/extension-underline'\nimport {\n Dropcursor,\n DropcursorOptions,\n Gapcursor,\n History,\n HistoryOptions,\n TrailingNode,\n TrailingNodeOptions,\n} from '@tiptap/extensions'\n\nexport interface StarterKitOptions {\n /**\n * If set to false, the blockquote extension will not be registered\n * @example blockquote: false\n */\n blockquote: Partial<BlockquoteOptions> | false\n\n /**\n * If set to false, the bold extension will not be registered\n * @example bold: false\n */\n bold: Partial<BoldOptions> | false\n\n /**\n * If set to false, the bulletList extension will not be registered\n * @example bulletList: false\n */\n bulletList: Partial<BulletListOptions> | false\n\n /**\n * If set to false, the code extension will not be registered\n * @example code: false\n */\n code: Partial<CodeOptions> | false\n\n /**\n * If set to false, the codeBlock extension will not be registered\n * @example codeBlock: false\n */\n codeBlock: Partial<CodeBlockOptions> | false\n\n /**\n * If set to false, the document extension will not be registered\n * @example document: false\n */\n document: false\n\n /**\n * If set to false, the dropcursor extension will not be registered\n * @example dropcursor: false\n */\n dropcursor: Partial<DropcursorOptions> | false\n\n /**\n * If set to false, the gapcursor extension will not be registered\n * @example gapcursor: false\n */\n gapcursor: false\n\n /**\n * If set to false, the hardBreak extension will not be registered\n * @example hardBreak: false\n */\n hardBreak: Partial<HardBreakOptions> | false\n\n /**\n * If set to false, the heading extension will not be registered\n * @example heading: false\n */\n heading: Partial<HeadingOptions> | false\n\n /**\n * If set to false, the history extension will not be registered\n * @example history: false\n */\n history: Partial<HistoryOptions> | false\n\n /**\n * If set to false, the horizontalRule extension will not be registered\n * @example horizontalRule: false\n */\n horizontalRule: Partial<HorizontalRuleOptions> | false\n\n /**\n * If set to false, the italic extension will not be registered\n * @example italic: false\n */\n italic: Partial<ItalicOptions> | false\n\n /**\n * If set to false, the listItem extension will not be registered\n * @example listItem: false\n */\n listItem: Partial<ListItemOptions> | false\n\n /**\n * If set to false, the listItemKeymap extension will not be registered\n * @example listKeymap: false\n */\n listKeymap: Partial<ListKeymapOptions> | false\n\n /**\n * If set to false, the link extension will not be registered\n * @example link: false\n */\n link: Partial<LinkOptions> | false\n\n /**\n * If set to false, the orderedList extension will not be registered\n * @example orderedList: false\n */\n orderedList: Partial<OrderedListOptions> | false\n\n /**\n * If set to false, the paragraph extension will not be registered\n * @example paragraph: false\n */\n paragraph: Partial<ParagraphOptions> | false\n\n /**\n * If set to false, the strike extension will not be registered\n * @example strike: false\n */\n strike: Partial<StrikeOptions> | false\n\n /**\n * If set to false, the text extension will not be registered\n * @example text: false\n */\n text: false\n\n /**\n * If set to false, the underline extension will not be registered\n * @example underline: false\n */\n underline: Partial<UnderlineOptions> | false\n\n /**\n * If set to false, the trailingNode extension will not be registered\n * @example trailingNode: false\n */\n trailingNode: Partial<TrailingNodeOptions> | false\n}\n\n/**\n * The starter kit is a collection of essential editor extensions.\n *\n * It’s a good starting point for building your own editor.\n */\nexport const StarterKit = Extension.create<StarterKitOptions>({\n name: 'starterKit',\n\n addExtensions() {\n const extensions = []\n\n if (this.options.bold !== false) {\n extensions.push(Bold.configure(this.options?.bold))\n }\n\n if (this.options.blockquote !== false) {\n extensions.push(Blockquote.configure(this.options?.blockquote))\n }\n\n if (this.options.bulletList !== false) {\n extensions.push(BulletList.configure(this.options?.bulletList))\n }\n\n if (this.options.code !== false) {\n extensions.push(Code.configure(this.options?.code))\n }\n\n if (this.options.codeBlock !== false) {\n extensions.push(CodeBlock.configure(this.options?.codeBlock))\n }\n\n if (this.options.document !== false) {\n extensions.push(Document.configure(this.options?.document))\n }\n\n if (this.options.dropcursor !== false) {\n extensions.push(Dropcursor.configure(this.options?.dropcursor))\n }\n\n if (this.options.gapcursor !== false) {\n extensions.push(Gapcursor.configure(this.options?.gapcursor))\n }\n\n if (this.options.hardBreak !== false) {\n extensions.push(HardBreak.configure(this.options?.hardBreak))\n }\n\n if (this.options.heading !== false) {\n extensions.push(Heading.configure(this.options?.heading))\n }\n\n if (this.options.history !== false) {\n extensions.push(History.configure(this.options?.history))\n }\n\n if (this.options.horizontalRule !== false) {\n extensions.push(HorizontalRule.configure(this.options?.horizontalRule))\n }\n\n if (this.options.italic !== false) {\n extensions.push(Italic.configure(this.options?.italic))\n }\n\n if (this.options.listItem !== false) {\n extensions.push(ListItem.configure(this.options?.listItem))\n }\n\n if (this.options.listKeymap !== false) {\n extensions.push(ListKeymap.configure(this.options?.listKeymap))\n }\n\n if (this.options.link !== false) {\n extensions.push(Link.configure(this.options?.link))\n }\n\n if (this.options.orderedList !== false) {\n extensions.push(OrderedList.configure(this.options?.orderedList))\n }\n\n if (this.options.paragraph !== false) {\n extensions.push(Paragraph.configure(this.options?.paragraph))\n }\n\n if (this.options.strike !== false) {\n extensions.push(Strike.configure(this.options?.strike))\n }\n\n if (this.options.text !== false) {\n extensions.push(Text.configure(this.options?.text))\n }\n\n if (this.options.underline !== false) {\n extensions.push(Underline.configure(this.options?.underline))\n }\n\n if (this.options.trailingNode !== false) {\n extensions.push(TrailingNode.configure(this.options?.trailingNode))\n }\n\n return extensions\n },\n})\n","import { StarterKit } from './starter-kit.js'\n\nexport type { StarterKitOptions } from './starter-kit.js'\nexport * from './starter-kit.js'\n\nexport default StarterKit\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,kBAAqC;AAC9C,SAAS,YAAyB;AAClC,SAAS,YAAyB;AAClC,SAAS,iBAAmC;AAC5C,SAAS,gBAAgB;AACzB,SAAS,iBAAmC;AAC5C,SAAS,eAA+B;AACxC,SAAS,sBAA6C;AACtD,SAAS,cAA6B;AACtC,SAAS,YAAyB;AAClC;AAAA,EACE;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,iBAAmC;AAC5C,SAAS,cAA6B;AACtC,SAAS,YAAY;AACrB,SAAS,iBAAmC;AAC5C;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EAEA;AAAA,OAEK;AA6IA,IAAM,aAAa,UAAU,OAA0B;AAAA,EAC5D,MAAM;AAAA,EAEN,gBAAgB;AAjLlB;AAkLI,UAAM,aAAa,CAAC;AAEpB,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,KAAK,WAAU,UAAK,YAAL,mBAAc,IAAI,CAAC;AAAA,IACpD;AAEA,QAAI,KAAK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","../src/index.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport type { BlockquoteOptions } from '@tiptap/extension-blockquote'\nimport { Blockquote } from '@tiptap/extension-blockquote'\nimport type { BoldOptions } from '@tiptap/extension-bold'\nimport { Bold } from '@tiptap/extension-bold'\nimport type { CodeOptions } from '@tiptap/extension-code'\nimport { Code } from '@tiptap/extension-code'\nimport type { CodeBlockOptions } from '@tiptap/extension-code-block'\nimport { CodeBlock } from '@tiptap/extension-code-block'\nimport { Document } from '@tiptap/extension-document'\nimport type { HardBreakOptions } from '@tiptap/extension-hard-break'\nimport { HardBreak } from '@tiptap/extension-hard-break'\nimport type { HeadingOptions } from '@tiptap/extension-heading'\nimport { Heading } from '@tiptap/extension-heading'\nimport type { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'\nimport { HorizontalRule } from '@tiptap/extension-horizontal-rule'\nimport type { ItalicOptions } from '@tiptap/extension-italic'\nimport { Italic } from '@tiptap/extension-italic'\nimport type { LinkOptions } from '@tiptap/extension-link'\nimport { Link } from '@tiptap/extension-link'\nimport type { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from '@tiptap/extension-list'\nimport { BulletList, ListItem, ListKeymap, OrderedList } from '@tiptap/extension-list'\nimport type { ParagraphOptions } from '@tiptap/extension-paragraph'\nimport { Paragraph } from '@tiptap/extension-paragraph'\nimport type { StrikeOptions } from '@tiptap/extension-strike'\nimport { Strike } from '@tiptap/extension-strike'\nimport { Text } from '@tiptap/extension-text'\nimport type { UnderlineOptions } from '@tiptap/extension-underline'\nimport { Underline } from '@tiptap/extension-underline'\nimport type { DropcursorOptions, TrailingNodeOptions, UndoRedoOptions } from '@tiptap/extensions'\nimport { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from '@tiptap/extensions'\n\nexport interface StarterKitOptions {\n /**\n * If set to false, the blockquote extension will not be registered\n * @example blockquote: false\n */\n blockquote: Partial<BlockquoteOptions> | false\n\n /**\n * If set to false, the bold extension will not be registered\n * @example bold: false\n */\n bold: Partial<BoldOptions> | false\n\n /**\n * If set to false, the bulletList extension will not be registered\n * @example bulletList: false\n */\n bulletList: Partial<BulletListOptions> | false\n\n /**\n * If set to false, the code extension will not be registered\n * @example code: false\n */\n code: Partial<CodeOptions> | false\n\n /**\n * If set to false, the codeBlock extension will not be registered\n * @example codeBlock: false\n */\n codeBlock: Partial<CodeBlockOptions> | false\n\n /**\n * If set to false, the document extension will not be registered\n * @example document: false\n */\n document: false\n\n /**\n * If set to false, the dropcursor extension will not be registered\n * @example dropcursor: false\n */\n dropcursor: Partial<DropcursorOptions> | false\n\n /**\n * If set to false, the gapcursor extension will not be registered\n * @example gapcursor: false\n */\n gapcursor: false\n\n /**\n * If set to false, the hardBreak extension will not be registered\n * @example hardBreak: false\n */\n hardBreak: Partial<HardBreakOptions> | false\n\n /**\n * If set to false, the heading extension will not be registered\n * @example heading: false\n */\n heading: Partial<HeadingOptions> | false\n\n /**\n * If set to false, the undo-redo extension will not be registered\n * @example undoRedo: false\n */\n undoRedo: Partial<UndoRedoOptions> | false\n\n /**\n * If set to false, the horizontalRule extension will not be registered\n * @example horizontalRule: false\n */\n horizontalRule: Partial<HorizontalRuleOptions> | false\n\n /**\n * If set to false, the italic extension will not be registered\n * @example italic: false\n */\n italic: Partial<ItalicOptions> | false\n\n /**\n * If set to false, the listItem extension will not be registered\n * @example listItem: false\n */\n listItem: Partial<ListItemOptions> | false\n\n /**\n * If set to false, the listItemKeymap extension will not be registered\n * @example listKeymap: false\n */\n listKeymap: Partial<ListKeymapOptions> | false\n\n /**\n * If set to false, the link extension will not be registered\n * @example link: false\n */\n link: Partial<LinkOptions> | false\n\n /**\n * If set to false, the orderedList extension will not be registered\n * @example orderedList: false\n */\n orderedList: Partial<OrderedListOptions> | false\n\n /**\n * If set to false, the paragraph extension will not be registered\n * @example paragraph: false\n */\n paragraph: Partial<ParagraphOptions> | false\n\n /**\n * If set to false, the strike extension will not be registered\n * @example strike: false\n */\n strike: Partial<StrikeOptions> | false\n\n /**\n * If set to false, the text extension will not be registered\n * @example text: false\n */\n text: false\n\n /**\n * If set to false, the underline extension will not be registered\n * @example underline: false\n */\n underline: Partial<UnderlineOptions> | false\n\n /**\n * If set to false, the trailingNode extension will not be registered\n * @example trailingNode: false\n */\n trailingNode: Partial<TrailingNodeOptions> | false\n}\n\n/**\n * The starter kit is a collection of essential editor extensions.\n *\n * It’s a good starting point for building your own editor.\n */\nexport const StarterKit = Extension.create<StarterKitOptions>({\n name: 'starterKit',\n\n addExtensions() {\n const extensions = []\n\n if (this.options.bold !== false) {\n extensions.push(Bold.configure(this.options.bold))\n }\n\n if (this.options.blockquote !== false) {\n extensions.push(Blockquote.configure(this.options.blockquote))\n }\n\n if (this.options.bulletList !== false) {\n extensions.push(BulletList.configure(this.options.bulletList))\n }\n\n if (this.options.code !== false) {\n extensions.push(Code.configure(this.options.code))\n }\n\n if (this.options.codeBlock !== false) {\n extensions.push(CodeBlock.configure(this.options.codeBlock))\n }\n\n if (this.options.document !== false) {\n extensions.push(Document.configure(this.options.document))\n }\n\n if (this.options.dropcursor !== false) {\n extensions.push(Dropcursor.configure(this.options.dropcursor))\n }\n\n if (this.options.gapcursor !== false) {\n extensions.push(Gapcursor.configure(this.options.gapcursor))\n }\n\n if (this.options.hardBreak !== false) {\n extensions.push(HardBreak.configure(this.options.hardBreak))\n }\n\n if (this.options.heading !== false) {\n extensions.push(Heading.configure(this.options.heading))\n }\n\n if (this.options.undoRedo !== false) {\n extensions.push(UndoRedo.configure(this.options.undoRedo))\n }\n\n if (this.options.horizontalRule !== false) {\n extensions.push(HorizontalRule.configure(this.options.horizontalRule))\n }\n\n if (this.options.italic !== false) {\n extensions.push(Italic.configure(this.options.italic))\n }\n\n if (this.options.listItem !== false) {\n extensions.push(ListItem.configure(this.options.listItem))\n }\n\n if (this.options.listKeymap !== false) {\n extensions.push(ListKeymap.configure(this.options?.listKeymap))\n }\n\n if (this.options.link !== false) {\n extensions.push(Link.configure(this.options?.link))\n }\n\n if (this.options.orderedList !== false) {\n extensions.push(OrderedList.configure(this.options.orderedList))\n }\n\n if (this.options.paragraph !== false) {\n extensions.push(Paragraph.configure(this.options.paragraph))\n }\n\n if (this.options.strike !== false) {\n extensions.push(Strike.configure(this.options.strike))\n }\n\n if (this.options.text !== false) {\n extensions.push(Text.configure(this.options.text))\n }\n\n if (this.options.underline !== false) {\n extensions.push(Underline.configure(this.options?.underline))\n }\n\n if (this.options.trailingNode !== false) {\n extensions.push(TrailingNode.configure(this.options?.trailingNode))\n }\n\n return extensions\n },\n})\n","import { StarterKit } from './starter-kit.js'\n\nexport type { StarterKitOptions } from './starter-kit.js'\nexport * from './starter-kit.js'\n\nexport default StarterKit\n"],"mappings":";AAAA,SAAS,iBAAiB;AAE1B,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AAErB,SAAS,YAAY;AAErB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;AAE1B,SAAS,eAAe;AAExB,SAAS,sBAAsB;AAE/B,SAAS,cAAc;AAEvB,SAAS,YAAY;AAErB,SAAS,YAAY,UAAU,YAAY,mBAAmB;AAE9D,SAAS,iBAAiB;AAE1B,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,SAAS,iBAAiB;AAE1B,SAAS,YAAY,WAAW,cAAc,gBAAgB;AA6IvD,IAAM,aAAa,UAAU,OAA0B;AAAA,EAC5D,MAAM;AAAA,EAEN,gBAAgB;AA9KlB;AA+KI,UAAM,aAAa,CAAC;AAEpB,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,KAAK,UAAU,KAAK,QAAQ,IAAI,CAAC;AAAA,IACnD;AAEA,QAAI,KAAK,QAAQ,eAAe,OAAO;AACrC,iBAAW,KAAK,WAAW,UAAU,KAAK,QAAQ,UAAU,CAAC;AAAA,IAC/D;AAEA,QAAI,KAAK,QAAQ,eAAe,OAAO;AACrC,iBAAW,KAAK,WAAW,UAAU,KAAK,QAAQ,UAAU,CAA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O;AACrC,iBAAW,KAAK,WAAW,WAAU,UAAK,YAAL,mBAAc,UAAU,CAAC;AAAA,IAChE;AAEA,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,KAAK,WAAU,UAAK,YAAL,mBAAc,IAAI,CAAC;AAAA,IACpD;AAEA,QAAI,KAAK,QAAQ,gBAAgB,OAAO;AACtC,iBAAW,KAAK,YAAY,UAAU,KAAK,QAAQ,WAAW,CAAC;AAAA,IACjE;AAEA,QAAI,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,UAAU,UAAU,KAAK,QAAQ,SAAS,CAAC;AAAA,IAC7D;AAEA,QAAI,KAAK,QAAQ,WAAW,OAAO;AACjC,iBAAW,KAAK,OAAO,UAAU,KAAK,QAAQ,MAAM,CAAC;AAAA,IACvD;AAEA,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,KAAK,UAAU,KAAK,QAAQ,IAAI,CAAC;AAAA,IACnD;AAEA,QAAI,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,UAAU,WAAU,UAAK,YAAL,mBAAc,SAAS,CAAC;AAAA,IAC9D;AAEA,QAAI,KAAK,QAAQ,iBAAiB,OAAO;AACvC,iBAAW,KAAK,aAAa,WAAU,UAAK,YAAL,mBAAc,YAAY,CAAC;AAAA,IACpE;AAEA,WAAO;AAAA,EACT;AACF,CAAC;;;ACtQD,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/starter-kit",
|
|
3
3
|
"description": "starter kit for tiptap",
|
|
4
|
-
"version": "3.0.0-next.
|
|
4
|
+
"version": "3.0.0-next.8",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -31,30 +31,30 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tiptap/core": "^3.0.0-next.
|
|
35
|
-
"@tiptap/extension-blockquote": "^3.0.0-next.
|
|
36
|
-
"@tiptap/extension-bold": "^3.0.0-next.
|
|
37
|
-
"@tiptap/extension-bullet-list": "^3.0.0-next.
|
|
38
|
-
"@tiptap/extension-code": "^3.0.0-next.
|
|
39
|
-
"@tiptap/extension-code-block": "^3.0.0-next.
|
|
40
|
-
"@tiptap/extension-document": "^3.0.0-next.
|
|
41
|
-
"@tiptap/extension-dropcursor": "^3.0.0-next.
|
|
42
|
-
"@tiptap/extension-gapcursor": "^3.0.0-next.
|
|
43
|
-
"@tiptap/extension-hard-break": "^3.0.0-next.
|
|
44
|
-
"@tiptap/extension-heading": "^3.0.0-next.
|
|
45
|
-
"@tiptap/extension-
|
|
46
|
-
"@tiptap/extension-
|
|
47
|
-
"@tiptap/extension-
|
|
48
|
-
"@tiptap/extension-
|
|
49
|
-
"@tiptap/extension-list-item": "^3.0.0-next.
|
|
50
|
-
"@tiptap/extension-list-keymap": "^3.0.0-next.
|
|
51
|
-
"@tiptap/extension-ordered-list": "^3.0.0-next.
|
|
52
|
-
"@tiptap/extension-paragraph": "^3.0.0-next.
|
|
53
|
-
"@tiptap/extension-strike": "^3.0.0-next.
|
|
54
|
-
"@tiptap/extension-text": "^3.0.0-next.
|
|
55
|
-
"@tiptap/extension-underline": "^3.0.0-next.
|
|
56
|
-
"@tiptap/extensions": "^3.0.0-next.
|
|
57
|
-
"@tiptap/pm": "^3.0.0-next.
|
|
34
|
+
"@tiptap/core": "^3.0.0-next.8",
|
|
35
|
+
"@tiptap/extension-blockquote": "^3.0.0-next.8",
|
|
36
|
+
"@tiptap/extension-bold": "^3.0.0-next.8",
|
|
37
|
+
"@tiptap/extension-bullet-list": "^3.0.0-next.8",
|
|
38
|
+
"@tiptap/extension-code": "^3.0.0-next.8",
|
|
39
|
+
"@tiptap/extension-code-block": "^3.0.0-next.8",
|
|
40
|
+
"@tiptap/extension-document": "^3.0.0-next.8",
|
|
41
|
+
"@tiptap/extension-dropcursor": "^3.0.0-next.8",
|
|
42
|
+
"@tiptap/extension-gapcursor": "^3.0.0-next.8",
|
|
43
|
+
"@tiptap/extension-hard-break": "^3.0.0-next.8",
|
|
44
|
+
"@tiptap/extension-heading": "^3.0.0-next.8",
|
|
45
|
+
"@tiptap/extension-horizontal-rule": "^3.0.0-next.8",
|
|
46
|
+
"@tiptap/extension-italic": "^3.0.0-next.8",
|
|
47
|
+
"@tiptap/extension-link": "^3.0.0-next.8",
|
|
48
|
+
"@tiptap/extension-list": "^3.0.0-next.8",
|
|
49
|
+
"@tiptap/extension-list-item": "^3.0.0-next.8",
|
|
50
|
+
"@tiptap/extension-list-keymap": "^3.0.0-next.8",
|
|
51
|
+
"@tiptap/extension-ordered-list": "^3.0.0-next.8",
|
|
52
|
+
"@tiptap/extension-paragraph": "^3.0.0-next.8",
|
|
53
|
+
"@tiptap/extension-strike": "^3.0.0-next.8",
|
|
54
|
+
"@tiptap/extension-text": "^3.0.0-next.8",
|
|
55
|
+
"@tiptap/extension-underline": "^3.0.0-next.8",
|
|
56
|
+
"@tiptap/extensions": "^3.0.0-next.8",
|
|
57
|
+
"@tiptap/pm": "^3.0.0-next.8"
|
|
58
58
|
},
|
|
59
59
|
"repository": {
|
|
60
60
|
"type": "git",
|
package/src/starter-kit.ts
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import type { BlockquoteOptions } from '@tiptap/extension-blockquote'
|
|
3
|
+
import { Blockquote } from '@tiptap/extension-blockquote'
|
|
4
|
+
import type { BoldOptions } from '@tiptap/extension-bold'
|
|
5
|
+
import { Bold } from '@tiptap/extension-bold'
|
|
6
|
+
import type { CodeOptions } from '@tiptap/extension-code'
|
|
7
|
+
import { Code } from '@tiptap/extension-code'
|
|
8
|
+
import type { CodeBlockOptions } from '@tiptap/extension-code-block'
|
|
9
|
+
import { CodeBlock } from '@tiptap/extension-code-block'
|
|
6
10
|
import { Document } from '@tiptap/extension-document'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} from '@tiptap/extension-
|
|
22
|
-
import {
|
|
23
|
-
import { Strike, StrikeOptions } from '@tiptap/extension-strike'
|
|
11
|
+
import type { HardBreakOptions } from '@tiptap/extension-hard-break'
|
|
12
|
+
import { HardBreak } from '@tiptap/extension-hard-break'
|
|
13
|
+
import type { HeadingOptions } from '@tiptap/extension-heading'
|
|
14
|
+
import { Heading } from '@tiptap/extension-heading'
|
|
15
|
+
import type { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'
|
|
16
|
+
import { HorizontalRule } from '@tiptap/extension-horizontal-rule'
|
|
17
|
+
import type { ItalicOptions } from '@tiptap/extension-italic'
|
|
18
|
+
import { Italic } from '@tiptap/extension-italic'
|
|
19
|
+
import type { LinkOptions } from '@tiptap/extension-link'
|
|
20
|
+
import { Link } from '@tiptap/extension-link'
|
|
21
|
+
import type { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from '@tiptap/extension-list'
|
|
22
|
+
import { BulletList, ListItem, ListKeymap, OrderedList } from '@tiptap/extension-list'
|
|
23
|
+
import type { ParagraphOptions } from '@tiptap/extension-paragraph'
|
|
24
|
+
import { Paragraph } from '@tiptap/extension-paragraph'
|
|
25
|
+
import type { StrikeOptions } from '@tiptap/extension-strike'
|
|
26
|
+
import { Strike } from '@tiptap/extension-strike'
|
|
24
27
|
import { Text } from '@tiptap/extension-text'
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Gapcursor,
|
|
30
|
-
History,
|
|
31
|
-
HistoryOptions,
|
|
32
|
-
TrailingNode,
|
|
33
|
-
TrailingNodeOptions,
|
|
34
|
-
} from '@tiptap/extensions'
|
|
28
|
+
import type { UnderlineOptions } from '@tiptap/extension-underline'
|
|
29
|
+
import { Underline } from '@tiptap/extension-underline'
|
|
30
|
+
import type { DropcursorOptions, TrailingNodeOptions, UndoRedoOptions } from '@tiptap/extensions'
|
|
31
|
+
import { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from '@tiptap/extensions'
|
|
35
32
|
|
|
36
33
|
export interface StarterKitOptions {
|
|
37
34
|
/**
|
|
@@ -95,10 +92,10 @@ export interface StarterKitOptions {
|
|
|
95
92
|
heading: Partial<HeadingOptions> | false
|
|
96
93
|
|
|
97
94
|
/**
|
|
98
|
-
* If set to false, the
|
|
99
|
-
* @example
|
|
95
|
+
* If set to false, the undo-redo extension will not be registered
|
|
96
|
+
* @example undoRedo: false
|
|
100
97
|
*/
|
|
101
|
-
|
|
98
|
+
undoRedo: Partial<UndoRedoOptions> | false
|
|
102
99
|
|
|
103
100
|
/**
|
|
104
101
|
* If set to false, the horizontalRule extension will not be registered
|
|
@@ -179,59 +176,59 @@ export const StarterKit = Extension.create<StarterKitOptions>({
|
|
|
179
176
|
const extensions = []
|
|
180
177
|
|
|
181
178
|
if (this.options.bold !== false) {
|
|
182
|
-
extensions.push(Bold.configure(this.options
|
|
179
|
+
extensions.push(Bold.configure(this.options.bold))
|
|
183
180
|
}
|
|
184
181
|
|
|
185
182
|
if (this.options.blockquote !== false) {
|
|
186
|
-
extensions.push(Blockquote.configure(this.options
|
|
183
|
+
extensions.push(Blockquote.configure(this.options.blockquote))
|
|
187
184
|
}
|
|
188
185
|
|
|
189
186
|
if (this.options.bulletList !== false) {
|
|
190
|
-
extensions.push(BulletList.configure(this.options
|
|
187
|
+
extensions.push(BulletList.configure(this.options.bulletList))
|
|
191
188
|
}
|
|
192
189
|
|
|
193
190
|
if (this.options.code !== false) {
|
|
194
|
-
extensions.push(Code.configure(this.options
|
|
191
|
+
extensions.push(Code.configure(this.options.code))
|
|
195
192
|
}
|
|
196
193
|
|
|
197
194
|
if (this.options.codeBlock !== false) {
|
|
198
|
-
extensions.push(CodeBlock.configure(this.options
|
|
195
|
+
extensions.push(CodeBlock.configure(this.options.codeBlock))
|
|
199
196
|
}
|
|
200
197
|
|
|
201
198
|
if (this.options.document !== false) {
|
|
202
|
-
extensions.push(Document.configure(this.options
|
|
199
|
+
extensions.push(Document.configure(this.options.document))
|
|
203
200
|
}
|
|
204
201
|
|
|
205
202
|
if (this.options.dropcursor !== false) {
|
|
206
|
-
extensions.push(Dropcursor.configure(this.options
|
|
203
|
+
extensions.push(Dropcursor.configure(this.options.dropcursor))
|
|
207
204
|
}
|
|
208
205
|
|
|
209
206
|
if (this.options.gapcursor !== false) {
|
|
210
|
-
extensions.push(Gapcursor.configure(this.options
|
|
207
|
+
extensions.push(Gapcursor.configure(this.options.gapcursor))
|
|
211
208
|
}
|
|
212
209
|
|
|
213
210
|
if (this.options.hardBreak !== false) {
|
|
214
|
-
extensions.push(HardBreak.configure(this.options
|
|
211
|
+
extensions.push(HardBreak.configure(this.options.hardBreak))
|
|
215
212
|
}
|
|
216
213
|
|
|
217
214
|
if (this.options.heading !== false) {
|
|
218
|
-
extensions.push(Heading.configure(this.options
|
|
215
|
+
extensions.push(Heading.configure(this.options.heading))
|
|
219
216
|
}
|
|
220
217
|
|
|
221
|
-
if (this.options.
|
|
222
|
-
extensions.push(
|
|
218
|
+
if (this.options.undoRedo !== false) {
|
|
219
|
+
extensions.push(UndoRedo.configure(this.options.undoRedo))
|
|
223
220
|
}
|
|
224
221
|
|
|
225
222
|
if (this.options.horizontalRule !== false) {
|
|
226
|
-
extensions.push(HorizontalRule.configure(this.options
|
|
223
|
+
extensions.push(HorizontalRule.configure(this.options.horizontalRule))
|
|
227
224
|
}
|
|
228
225
|
|
|
229
226
|
if (this.options.italic !== false) {
|
|
230
|
-
extensions.push(Italic.configure(this.options
|
|
227
|
+
extensions.push(Italic.configure(this.options.italic))
|
|
231
228
|
}
|
|
232
229
|
|
|
233
230
|
if (this.options.listItem !== false) {
|
|
234
|
-
extensions.push(ListItem.configure(this.options
|
|
231
|
+
extensions.push(ListItem.configure(this.options.listItem))
|
|
235
232
|
}
|
|
236
233
|
|
|
237
234
|
if (this.options.listKeymap !== false) {
|
|
@@ -243,19 +240,19 @@ export const StarterKit = Extension.create<StarterKitOptions>({
|
|
|
243
240
|
}
|
|
244
241
|
|
|
245
242
|
if (this.options.orderedList !== false) {
|
|
246
|
-
extensions.push(OrderedList.configure(this.options
|
|
243
|
+
extensions.push(OrderedList.configure(this.options.orderedList))
|
|
247
244
|
}
|
|
248
245
|
|
|
249
246
|
if (this.options.paragraph !== false) {
|
|
250
|
-
extensions.push(Paragraph.configure(this.options
|
|
247
|
+
extensions.push(Paragraph.configure(this.options.paragraph))
|
|
251
248
|
}
|
|
252
249
|
|
|
253
250
|
if (this.options.strike !== false) {
|
|
254
|
-
extensions.push(Strike.configure(this.options
|
|
251
|
+
extensions.push(Strike.configure(this.options.strike))
|
|
255
252
|
}
|
|
256
253
|
|
|
257
254
|
if (this.options.text !== false) {
|
|
258
|
-
extensions.push(Text.configure(this.options
|
|
255
|
+
extensions.push(Text.configure(this.options.text))
|
|
259
256
|
}
|
|
260
257
|
|
|
261
258
|
if (this.options.underline !== false) {
|