@tiptap/starter-kit 3.0.0-next.3 → 3.0.0-next.5
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/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +18 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +18 -10
- package/dist/index.js.map +1 -1
- package/package.json +32 -27
- package/src/starter-kit.ts +50 -28
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Tiptap GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# @tiptap/starter-kit
|
|
2
|
+
|
|
2
3
|
[](https://www.npmjs.com/package/@tiptap/starter-kit)
|
|
3
4
|
[](https://npmcharts.com/compare/tiptap?minimal=true)
|
|
4
5
|
[](https://www.npmjs.com/package/@tiptap/starter-kit)
|
|
5
6
|
[](https://github.com/sponsors/ueberdosis)
|
|
6
7
|
|
|
7
8
|
## Introduction
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
|
|
9
11
|
|
|
10
12
|
## Official Documentation
|
|
13
|
+
|
|
11
14
|
Documentation can be found on the [Tiptap website](https://tiptap.dev).
|
|
12
15
|
|
|
13
16
|
## License
|
|
17
|
+
|
|
14
18
|
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
package/dist/index.cjs
CHANGED
|
@@ -18,40 +18,35 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
StarterKit: () => StarterKit,
|
|
24
|
-
default: () =>
|
|
24
|
+
default: () => index_default
|
|
25
25
|
});
|
|
26
|
-
module.exports = __toCommonJS(
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
27
|
|
|
28
28
|
// src/starter-kit.ts
|
|
29
29
|
var import_core = require("@tiptap/core");
|
|
30
30
|
var import_extension_blockquote = require("@tiptap/extension-blockquote");
|
|
31
31
|
var import_extension_bold = require("@tiptap/extension-bold");
|
|
32
|
-
var import_extension_bullet_list = require("@tiptap/extension-bullet-list");
|
|
33
32
|
var import_extension_code = require("@tiptap/extension-code");
|
|
34
33
|
var import_extension_code_block = require("@tiptap/extension-code-block");
|
|
35
34
|
var import_extension_document = require("@tiptap/extension-document");
|
|
36
|
-
var import_extension_dropcursor = require("@tiptap/extension-dropcursor");
|
|
37
|
-
var import_extension_gapcursor = require("@tiptap/extension-gapcursor");
|
|
38
35
|
var import_extension_hard_break = require("@tiptap/extension-hard-break");
|
|
39
36
|
var import_extension_heading = require("@tiptap/extension-heading");
|
|
40
|
-
var import_extension_history = require("@tiptap/extension-history");
|
|
41
37
|
var import_extension_horizontal_rule = require("@tiptap/extension-horizontal-rule");
|
|
42
38
|
var import_extension_italic = require("@tiptap/extension-italic");
|
|
43
39
|
var import_extension_link = require("@tiptap/extension-link");
|
|
44
|
-
var
|
|
45
|
-
var import_extension_list_keymap = require("@tiptap/extension-list-keymap");
|
|
46
|
-
var import_extension_ordered_list = require("@tiptap/extension-ordered-list");
|
|
40
|
+
var import_extension_list = require("@tiptap/extension-list");
|
|
47
41
|
var import_extension_paragraph = require("@tiptap/extension-paragraph");
|
|
48
42
|
var import_extension_strike = require("@tiptap/extension-strike");
|
|
49
43
|
var import_extension_text = require("@tiptap/extension-text");
|
|
50
44
|
var import_extension_underline = require("@tiptap/extension-underline");
|
|
45
|
+
var import_extensions = require("@tiptap/extensions");
|
|
51
46
|
var StarterKit = import_core.Extension.create({
|
|
52
47
|
name: "starterKit",
|
|
53
48
|
addExtensions() {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
55
50
|
const extensions = [];
|
|
56
51
|
if (this.options.bold !== false) {
|
|
57
52
|
extensions.push(import_extension_bold.Bold.configure((_a = this.options) == null ? void 0 : _a.bold));
|
|
@@ -60,7 +55,7 @@ var StarterKit = import_core.Extension.create({
|
|
|
60
55
|
extensions.push(import_extension_blockquote.Blockquote.configure((_b = this.options) == null ? void 0 : _b.blockquote));
|
|
61
56
|
}
|
|
62
57
|
if (this.options.bulletList !== false) {
|
|
63
|
-
extensions.push(
|
|
58
|
+
extensions.push(import_extension_list.BulletList.configure((_c = this.options) == null ? void 0 : _c.bulletList));
|
|
64
59
|
}
|
|
65
60
|
if (this.options.code !== false) {
|
|
66
61
|
extensions.push(import_extension_code.Code.configure((_d = this.options) == null ? void 0 : _d.code));
|
|
@@ -72,10 +67,10 @@ var StarterKit = import_core.Extension.create({
|
|
|
72
67
|
extensions.push(import_extension_document.Document.configure((_f = this.options) == null ? void 0 : _f.document));
|
|
73
68
|
}
|
|
74
69
|
if (this.options.dropcursor !== false) {
|
|
75
|
-
extensions.push(
|
|
70
|
+
extensions.push(import_extensions.Dropcursor.configure((_g = this.options) == null ? void 0 : _g.dropcursor));
|
|
76
71
|
}
|
|
77
72
|
if (this.options.gapcursor !== false) {
|
|
78
|
-
extensions.push(
|
|
73
|
+
extensions.push(import_extensions.Gapcursor.configure((_h = this.options) == null ? void 0 : _h.gapcursor));
|
|
79
74
|
}
|
|
80
75
|
if (this.options.hardBreak !== false) {
|
|
81
76
|
extensions.push(import_extension_hard_break.HardBreak.configure((_i = this.options) == null ? void 0 : _i.hardBreak));
|
|
@@ -84,7 +79,7 @@ var StarterKit = import_core.Extension.create({
|
|
|
84
79
|
extensions.push(import_extension_heading.Heading.configure((_j = this.options) == null ? void 0 : _j.heading));
|
|
85
80
|
}
|
|
86
81
|
if (this.options.history !== false) {
|
|
87
|
-
extensions.push(
|
|
82
|
+
extensions.push(import_extensions.History.configure((_k = this.options) == null ? void 0 : _k.history));
|
|
88
83
|
}
|
|
89
84
|
if (this.options.horizontalRule !== false) {
|
|
90
85
|
extensions.push(import_extension_horizontal_rule.HorizontalRule.configure((_l = this.options) == null ? void 0 : _l.horizontalRule));
|
|
@@ -93,16 +88,16 @@ var StarterKit = import_core.Extension.create({
|
|
|
93
88
|
extensions.push(import_extension_italic.Italic.configure((_m = this.options) == null ? void 0 : _m.italic));
|
|
94
89
|
}
|
|
95
90
|
if (this.options.listItem !== false) {
|
|
96
|
-
extensions.push(
|
|
91
|
+
extensions.push(import_extension_list.ListItem.configure((_n = this.options) == null ? void 0 : _n.listItem));
|
|
97
92
|
}
|
|
98
93
|
if (this.options.listKeymap !== false) {
|
|
99
|
-
extensions.push(
|
|
94
|
+
extensions.push(import_extension_list.ListKeymap.configure((_o = this.options) == null ? void 0 : _o.listKeymap));
|
|
100
95
|
}
|
|
101
96
|
if (this.options.link !== false) {
|
|
102
97
|
extensions.push(import_extension_link.Link.configure((_p = this.options) == null ? void 0 : _p.link));
|
|
103
98
|
}
|
|
104
99
|
if (this.options.orderedList !== false) {
|
|
105
|
-
extensions.push(
|
|
100
|
+
extensions.push(import_extension_list.OrderedList.configure((_q = this.options) == null ? void 0 : _q.orderedList));
|
|
106
101
|
}
|
|
107
102
|
if (this.options.paragraph !== false) {
|
|
108
103
|
extensions.push(import_extension_paragraph.Paragraph.configure((_r = this.options) == null ? void 0 : _r.paragraph));
|
|
@@ -116,12 +111,15 @@ var StarterKit = import_core.Extension.create({
|
|
|
116
111
|
if (this.options.underline !== false) {
|
|
117
112
|
extensions.push(import_extension_underline.Underline.configure((_u = this.options) == null ? void 0 : _u.underline));
|
|
118
113
|
}
|
|
114
|
+
if (this.options.trailingNode !== false) {
|
|
115
|
+
extensions.push(import_extensions.TrailingNode.configure((_v = this.options) == null ? void 0 : _v.trailingNode));
|
|
116
|
+
}
|
|
119
117
|
return extensions;
|
|
120
118
|
}
|
|
121
119
|
});
|
|
122
120
|
|
|
123
121
|
// src/index.ts
|
|
124
|
-
var
|
|
122
|
+
var index_default = StarterKit;
|
|
125
123
|
// Annotate the CommonJS export names for ESM import in node:
|
|
126
124
|
0 && (module.exports = {
|
|
127
125
|
StarterKit
|
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 { BulletList, BulletListOptions } from '@tiptap/extension-bullet-list'\nimport { Code, CodeOptions } from '@tiptap/extension-code'\nimport { CodeBlock, CodeBlockOptions } from '@tiptap/extension-code-block'\nimport { Document } from '@tiptap/extension-document'\nimport { Dropcursor, DropcursorOptions } from '@tiptap/extension-dropcursor'\nimport { Gapcursor } from '@tiptap/extension-gapcursor'\nimport { HardBreak, HardBreakOptions } from '@tiptap/extension-hard-break'\nimport { Heading, HeadingOptions } from '@tiptap/extension-heading'\nimport { History, HistoryOptions } from '@tiptap/extension-history'\nimport { HorizontalRule, HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'\nimport { Italic, ItalicOptions } from '@tiptap/extension-italic'\nimport { Link, LinkOptions } from '@tiptap/extension-link'\nimport { ListItem, ListItemOptions } from '@tiptap/extension-list-item'\nimport { ListKeymap, ListKeymapOptions } from '@tiptap/extension-list-keymap'\nimport { OrderedList, OrderedListOptions } from '@tiptap/extension-ordered-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'\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/**\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 return extensions\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA0B;AAC1B,kCAA8C;AAC9C,4BAAkC;AAClC,mCAA8C;AAC9C,4BAAkC;AAClC,kCAA4C;AAC5C,gCAAyB;AACzB,kCAA8C;AAC9C,iCAA0B;AAC1B,kCAA4C;AAC5C,+BAAwC;AACxC,+BAAwC;AACxC,uCAAsD;AACtD,8BAAsC;AACtC,4BAAkC;AAClC,iCAA0C;AAC1C,mCAA8C;AAC9C,oCAAgD;AAChD,iCAA4C;AAC5C,8BAAsC;AACtC,4BAAqB;AACrB,iCAA4C;AAuIrC,IAAM,aAAa,sBAAU,OAA0B;AAAA,EAC5D,MAAM;AAAA,EAEN,gBAAgB;AA/JlB;AAgKI,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,wCAAW,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,KA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gBAAgB,OAAO;AACtC,iBAAW,KAAK,0CAAY,WAAU,UAAK,YAAL,mBAAc,WAAW,CAAC;AAAA,IAClE;AAEA,QAAI,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,WAAO;AAAA,EACT;AACF,CAAC;;;ADnPD,IAAO,cAAQ;","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 { 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,iB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ACpE;AAEA,WAAO;AAAA,EACT;AACF,CAAC;;;ADzQD,IAAO,gBAAQ;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
2
|
import { BlockquoteOptions } from '@tiptap/extension-blockquote';
|
|
3
3
|
import { BoldOptions } from '@tiptap/extension-bold';
|
|
4
|
-
import { BulletListOptions } from '@tiptap/extension-bullet-list';
|
|
5
4
|
import { CodeOptions } from '@tiptap/extension-code';
|
|
6
5
|
import { CodeBlockOptions } from '@tiptap/extension-code-block';
|
|
7
|
-
import { DropcursorOptions } from '@tiptap/extension-dropcursor';
|
|
8
6
|
import { HardBreakOptions } from '@tiptap/extension-hard-break';
|
|
9
7
|
import { HeadingOptions } from '@tiptap/extension-heading';
|
|
10
|
-
import { HistoryOptions } from '@tiptap/extension-history';
|
|
11
8
|
import { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule';
|
|
12
9
|
import { ItalicOptions } from '@tiptap/extension-italic';
|
|
13
10
|
import { LinkOptions } from '@tiptap/extension-link';
|
|
14
|
-
import { ListItemOptions } from '@tiptap/extension-list
|
|
15
|
-
import { ListKeymapOptions } from '@tiptap/extension-list-keymap';
|
|
16
|
-
import { OrderedListOptions } from '@tiptap/extension-ordered-list';
|
|
11
|
+
import { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from '@tiptap/extension-list';
|
|
17
12
|
import { ParagraphOptions } from '@tiptap/extension-paragraph';
|
|
18
13
|
import { StrikeOptions } from '@tiptap/extension-strike';
|
|
19
14
|
import { UnderlineOptions } from '@tiptap/extension-underline';
|
|
15
|
+
import { DropcursorOptions, HistoryOptions, TrailingNodeOptions } from '@tiptap/extensions';
|
|
20
16
|
|
|
21
17
|
interface StarterKitOptions {
|
|
22
18
|
/**
|
|
@@ -124,6 +120,11 @@ interface StarterKitOptions {
|
|
|
124
120
|
* @example underline: false
|
|
125
121
|
*/
|
|
126
122
|
underline: Partial<UnderlineOptions> | false;
|
|
123
|
+
/**
|
|
124
|
+
* If set to false, the trailingNode extension will not be registered
|
|
125
|
+
* @example trailingNode: false
|
|
126
|
+
*/
|
|
127
|
+
trailingNode: Partial<TrailingNodeOptions> | false;
|
|
127
128
|
}
|
|
128
129
|
/**
|
|
129
130
|
* The starter kit is a collection of essential editor extensions.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
2
|
import { BlockquoteOptions } from '@tiptap/extension-blockquote';
|
|
3
3
|
import { BoldOptions } from '@tiptap/extension-bold';
|
|
4
|
-
import { BulletListOptions } from '@tiptap/extension-bullet-list';
|
|
5
4
|
import { CodeOptions } from '@tiptap/extension-code';
|
|
6
5
|
import { CodeBlockOptions } from '@tiptap/extension-code-block';
|
|
7
|
-
import { DropcursorOptions } from '@tiptap/extension-dropcursor';
|
|
8
6
|
import { HardBreakOptions } from '@tiptap/extension-hard-break';
|
|
9
7
|
import { HeadingOptions } from '@tiptap/extension-heading';
|
|
10
|
-
import { HistoryOptions } from '@tiptap/extension-history';
|
|
11
8
|
import { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule';
|
|
12
9
|
import { ItalicOptions } from '@tiptap/extension-italic';
|
|
13
10
|
import { LinkOptions } from '@tiptap/extension-link';
|
|
14
|
-
import { ListItemOptions } from '@tiptap/extension-list
|
|
15
|
-
import { ListKeymapOptions } from '@tiptap/extension-list-keymap';
|
|
16
|
-
import { OrderedListOptions } from '@tiptap/extension-ordered-list';
|
|
11
|
+
import { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from '@tiptap/extension-list';
|
|
17
12
|
import { ParagraphOptions } from '@tiptap/extension-paragraph';
|
|
18
13
|
import { StrikeOptions } from '@tiptap/extension-strike';
|
|
19
14
|
import { UnderlineOptions } from '@tiptap/extension-underline';
|
|
15
|
+
import { DropcursorOptions, HistoryOptions, TrailingNodeOptions } from '@tiptap/extensions';
|
|
20
16
|
|
|
21
17
|
interface StarterKitOptions {
|
|
22
18
|
/**
|
|
@@ -124,6 +120,11 @@ interface StarterKitOptions {
|
|
|
124
120
|
* @example underline: false
|
|
125
121
|
*/
|
|
126
122
|
underline: Partial<UnderlineOptions> | false;
|
|
123
|
+
/**
|
|
124
|
+
* If set to false, the trailingNode extension will not be registered
|
|
125
|
+
* @example trailingNode: false
|
|
126
|
+
*/
|
|
127
|
+
trailingNode: Partial<TrailingNodeOptions> | false;
|
|
127
128
|
}
|
|
128
129
|
/**
|
|
129
130
|
* The starter kit is a collection of essential editor extensions.
|
package/dist/index.js
CHANGED
|
@@ -2,29 +2,34 @@
|
|
|
2
2
|
import { Extension } from "@tiptap/core";
|
|
3
3
|
import { Blockquote } from "@tiptap/extension-blockquote";
|
|
4
4
|
import { Bold } from "@tiptap/extension-bold";
|
|
5
|
-
import { BulletList } from "@tiptap/extension-bullet-list";
|
|
6
5
|
import { Code } from "@tiptap/extension-code";
|
|
7
6
|
import { CodeBlock } from "@tiptap/extension-code-block";
|
|
8
7
|
import { Document } from "@tiptap/extension-document";
|
|
9
|
-
import { Dropcursor } from "@tiptap/extension-dropcursor";
|
|
10
|
-
import { Gapcursor } from "@tiptap/extension-gapcursor";
|
|
11
8
|
import { HardBreak } from "@tiptap/extension-hard-break";
|
|
12
9
|
import { Heading } from "@tiptap/extension-heading";
|
|
13
|
-
import { History } from "@tiptap/extension-history";
|
|
14
10
|
import { HorizontalRule } from "@tiptap/extension-horizontal-rule";
|
|
15
11
|
import { Italic } from "@tiptap/extension-italic";
|
|
16
12
|
import { Link } from "@tiptap/extension-link";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
import {
|
|
14
|
+
BulletList,
|
|
15
|
+
ListItem,
|
|
16
|
+
ListKeymap,
|
|
17
|
+
OrderedList
|
|
18
|
+
} from "@tiptap/extension-list";
|
|
20
19
|
import { Paragraph } from "@tiptap/extension-paragraph";
|
|
21
20
|
import { Strike } from "@tiptap/extension-strike";
|
|
22
21
|
import { Text } from "@tiptap/extension-text";
|
|
23
22
|
import { Underline } from "@tiptap/extension-underline";
|
|
23
|
+
import {
|
|
24
|
+
Dropcursor,
|
|
25
|
+
Gapcursor,
|
|
26
|
+
History,
|
|
27
|
+
TrailingNode
|
|
28
|
+
} from "@tiptap/extensions";
|
|
24
29
|
var StarterKit = Extension.create({
|
|
25
30
|
name: "starterKit",
|
|
26
31
|
addExtensions() {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
28
33
|
const extensions = [];
|
|
29
34
|
if (this.options.bold !== false) {
|
|
30
35
|
extensions.push(Bold.configure((_a = this.options) == null ? void 0 : _a.bold));
|
|
@@ -89,14 +94,17 @@ var StarterKit = Extension.create({
|
|
|
89
94
|
if (this.options.underline !== false) {
|
|
90
95
|
extensions.push(Underline.configure((_u = this.options) == null ? void 0 : _u.underline));
|
|
91
96
|
}
|
|
97
|
+
if (this.options.trailingNode !== false) {
|
|
98
|
+
extensions.push(TrailingNode.configure((_v = this.options) == null ? void 0 : _v.trailingNode));
|
|
99
|
+
}
|
|
92
100
|
return extensions;
|
|
93
101
|
}
|
|
94
102
|
});
|
|
95
103
|
|
|
96
104
|
// src/index.ts
|
|
97
|
-
var
|
|
105
|
+
var index_default = StarterKit;
|
|
98
106
|
export {
|
|
99
107
|
StarterKit,
|
|
100
|
-
|
|
108
|
+
index_default as default
|
|
101
109
|
};
|
|
102
110
|
//# sourceMappingURL=index.js.map
|
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 { BulletList, BulletListOptions } from '@tiptap/extension-bullet-list'\nimport { Code, CodeOptions } from '@tiptap/extension-code'\nimport { CodeBlock, CodeBlockOptions } from '@tiptap/extension-code-block'\nimport { Document } from '@tiptap/extension-document'\nimport { Dropcursor, DropcursorOptions } from '@tiptap/extension-dropcursor'\nimport { Gapcursor } from '@tiptap/extension-gapcursor'\nimport { HardBreak, HardBreakOptions } from '@tiptap/extension-hard-break'\nimport { Heading, HeadingOptions } from '@tiptap/extension-heading'\nimport { History, HistoryOptions } from '@tiptap/extension-history'\nimport { HorizontalRule, HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'\nimport { Italic, ItalicOptions } from '@tiptap/extension-italic'\nimport { Link, LinkOptions } from '@tiptap/extension-link'\nimport { ListItem, ListItemOptions } from '@tiptap/extension-list-item'\nimport { ListKeymap, ListKeymapOptions } from '@tiptap/extension-list-keymap'\nimport { OrderedList, OrderedListOptions } from '@tiptap/extension-ordered-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'\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/**\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 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,iBA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ClE;AAEA,QAAI,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,UAAU,WAAU,UAAK,YAAL,mBAAc,SAAS,CAAC;AAAA,IAC9D;AAEA,QAAI,KAAK,QAAQ,WAAW,OAAO;AACjC,iBAAW,KAAK,OAAO,WAAU,UAAK,YAAL,mBAAc,MAAM,CAAC;AAAA,IACxD;AAEA,QAAI,KAAK,QAAQ,SAAS,OAAO;AAC/B,iBAAW,KAAK,KAAK,WAAU,UAAK,YAAL,mBAAc,IAAI,CAAC;AAAA,IACpD;AAEA,QAAI,KAAK,QAAQ,cAAc,OAAO;AACpC,iBAAW,KAAK,UAAU,WAAU,UAAK,YAAL,mBAAc,SAAS,CAAC;AAAA,IAC9D;AAEA,WAAO;AAAA,EACT;AACF,CAAC;;;ACnPD,IAAO,cAAQ;","names":[]}
|
|
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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A,IACpE;AAEA,WAAO;AAAA,EACT;AACF,CAAC;;;ACzQD,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.5",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"types":
|
|
17
|
+
"types": {
|
|
18
|
+
"import": "./dist/index.d.ts",
|
|
19
|
+
"require": "./dist/index.d.cts"
|
|
20
|
+
},
|
|
18
21
|
"import": "./dist/index.js",
|
|
19
22
|
"require": "./dist/index.cjs"
|
|
20
23
|
}
|
|
@@ -28,29 +31,30 @@
|
|
|
28
31
|
"dist"
|
|
29
32
|
],
|
|
30
33
|
"dependencies": {
|
|
31
|
-
"@tiptap/core": "^3.0.0-next.
|
|
32
|
-
"@tiptap/extension-blockquote": "^3.0.0-next.
|
|
33
|
-
"@tiptap/extension-bold": "^3.0.0-next.
|
|
34
|
-
"@tiptap/extension-bullet-list": "^3.0.0-next.
|
|
35
|
-
"@tiptap/extension-code": "^3.0.0-next.
|
|
36
|
-
"@tiptap/extension-code-block": "^3.0.0-next.
|
|
37
|
-
"@tiptap/extension-document": "^3.0.0-next.
|
|
38
|
-
"@tiptap/extension-dropcursor": "^3.0.0-next.
|
|
39
|
-
"@tiptap/extension-gapcursor": "^3.0.0-next.
|
|
40
|
-
"@tiptap/extension-hard-break": "^3.0.0-next.
|
|
41
|
-
"@tiptap/extension-heading": "^3.0.0-next.
|
|
42
|
-
"@tiptap/extension-history": "^3.0.0-next.
|
|
43
|
-
"@tiptap/extension-horizontal-rule": "^3.0.0-next.
|
|
44
|
-
"@tiptap/extension-italic": "^3.0.0-next.
|
|
45
|
-
"@tiptap/extension-
|
|
46
|
-
"@tiptap/extension-list-
|
|
47
|
-
"@tiptap/extension-
|
|
48
|
-
"@tiptap/extension-ordered-list": "^3.0.0-next.
|
|
49
|
-
"@tiptap/extension-paragraph": "^3.0.0-next.
|
|
50
|
-
"@tiptap/extension-strike": "^3.0.0-next.
|
|
51
|
-
"@tiptap/extension-
|
|
52
|
-
"@tiptap/extension-
|
|
53
|
-
"@tiptap/
|
|
34
|
+
"@tiptap/core": "^3.0.0-next.5",
|
|
35
|
+
"@tiptap/extension-blockquote": "^3.0.0-next.5",
|
|
36
|
+
"@tiptap/extension-bold": "^3.0.0-next.5",
|
|
37
|
+
"@tiptap/extension-bullet-list": "^3.0.0-next.5",
|
|
38
|
+
"@tiptap/extension-code": "^3.0.0-next.5",
|
|
39
|
+
"@tiptap/extension-code-block": "^3.0.0-next.5",
|
|
40
|
+
"@tiptap/extension-document": "^3.0.0-next.5",
|
|
41
|
+
"@tiptap/extension-dropcursor": "^3.0.0-next.5",
|
|
42
|
+
"@tiptap/extension-gapcursor": "^3.0.0-next.5",
|
|
43
|
+
"@tiptap/extension-hard-break": "^3.0.0-next.5",
|
|
44
|
+
"@tiptap/extension-heading": "^3.0.0-next.5",
|
|
45
|
+
"@tiptap/extension-history": "^3.0.0-next.5",
|
|
46
|
+
"@tiptap/extension-horizontal-rule": "^3.0.0-next.5",
|
|
47
|
+
"@tiptap/extension-italic": "^3.0.0-next.5",
|
|
48
|
+
"@tiptap/extension-link": "^3.0.0-next.5",
|
|
49
|
+
"@tiptap/extension-list-item": "^3.0.0-next.5",
|
|
50
|
+
"@tiptap/extension-list-keymap": "^3.0.0-next.5",
|
|
51
|
+
"@tiptap/extension-ordered-list": "^3.0.0-next.5",
|
|
52
|
+
"@tiptap/extension-paragraph": "^3.0.0-next.5",
|
|
53
|
+
"@tiptap/extension-strike": "^3.0.0-next.5",
|
|
54
|
+
"@tiptap/extension-text": "^3.0.0-next.5",
|
|
55
|
+
"@tiptap/extension-underline": "^3.0.0-next.5",
|
|
56
|
+
"@tiptap/extensions": "^3.0.0-next.5",
|
|
57
|
+
"@tiptap/pm": "^3.0.0-next.5"
|
|
54
58
|
},
|
|
55
59
|
"repository": {
|
|
56
60
|
"type": "git",
|
|
@@ -58,6 +62,7 @@
|
|
|
58
62
|
"directory": "packages/starter-kit"
|
|
59
63
|
},
|
|
60
64
|
"scripts": {
|
|
61
|
-
"build": "tsup"
|
|
65
|
+
"build": "tsup",
|
|
66
|
+
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
|
|
62
67
|
}
|
|
63
|
-
}
|
|
68
|
+
}
|
package/src/starter-kit.ts
CHANGED
|
@@ -1,152 +1,170 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core'
|
|
2
2
|
import { Blockquote, BlockquoteOptions } from '@tiptap/extension-blockquote'
|
|
3
3
|
import { Bold, BoldOptions } from '@tiptap/extension-bold'
|
|
4
|
-
import { BulletList, BulletListOptions } from '@tiptap/extension-bullet-list'
|
|
5
4
|
import { Code, CodeOptions } from '@tiptap/extension-code'
|
|
6
5
|
import { CodeBlock, CodeBlockOptions } from '@tiptap/extension-code-block'
|
|
7
6
|
import { Document } from '@tiptap/extension-document'
|
|
8
|
-
import { Dropcursor, DropcursorOptions } from '@tiptap/extension-dropcursor'
|
|
9
|
-
import { Gapcursor } from '@tiptap/extension-gapcursor'
|
|
10
7
|
import { HardBreak, HardBreakOptions } from '@tiptap/extension-hard-break'
|
|
11
8
|
import { Heading, HeadingOptions } from '@tiptap/extension-heading'
|
|
12
|
-
import { History, HistoryOptions } from '@tiptap/extension-history'
|
|
13
9
|
import { HorizontalRule, HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'
|
|
14
10
|
import { Italic, ItalicOptions } from '@tiptap/extension-italic'
|
|
15
11
|
import { Link, LinkOptions } from '@tiptap/extension-link'
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
import {
|
|
13
|
+
BulletList,
|
|
14
|
+
BulletListOptions,
|
|
15
|
+
ListItem,
|
|
16
|
+
ListItemOptions,
|
|
17
|
+
ListKeymap,
|
|
18
|
+
ListKeymapOptions,
|
|
19
|
+
OrderedList,
|
|
20
|
+
OrderedListOptions,
|
|
21
|
+
} from '@tiptap/extension-list'
|
|
19
22
|
import { Paragraph, ParagraphOptions } from '@tiptap/extension-paragraph'
|
|
20
23
|
import { Strike, StrikeOptions } from '@tiptap/extension-strike'
|
|
21
24
|
import { Text } from '@tiptap/extension-text'
|
|
22
25
|
import { Underline, UnderlineOptions } from '@tiptap/extension-underline'
|
|
26
|
+
import {
|
|
27
|
+
Dropcursor,
|
|
28
|
+
DropcursorOptions,
|
|
29
|
+
Gapcursor,
|
|
30
|
+
History,
|
|
31
|
+
HistoryOptions,
|
|
32
|
+
TrailingNode,
|
|
33
|
+
TrailingNodeOptions,
|
|
34
|
+
} from '@tiptap/extensions'
|
|
23
35
|
|
|
24
36
|
export interface StarterKitOptions {
|
|
25
37
|
/**
|
|
26
38
|
* If set to false, the blockquote extension will not be registered
|
|
27
39
|
* @example blockquote: false
|
|
28
40
|
*/
|
|
29
|
-
blockquote: Partial<BlockquoteOptions> | false
|
|
41
|
+
blockquote: Partial<BlockquoteOptions> | false
|
|
30
42
|
|
|
31
43
|
/**
|
|
32
44
|
* If set to false, the bold extension will not be registered
|
|
33
45
|
* @example bold: false
|
|
34
46
|
*/
|
|
35
|
-
bold: Partial<BoldOptions> | false
|
|
47
|
+
bold: Partial<BoldOptions> | false
|
|
36
48
|
|
|
37
49
|
/**
|
|
38
50
|
* If set to false, the bulletList extension will not be registered
|
|
39
51
|
* @example bulletList: false
|
|
40
52
|
*/
|
|
41
|
-
bulletList: Partial<BulletListOptions> | false
|
|
53
|
+
bulletList: Partial<BulletListOptions> | false
|
|
42
54
|
|
|
43
55
|
/**
|
|
44
56
|
* If set to false, the code extension will not be registered
|
|
45
57
|
* @example code: false
|
|
46
58
|
*/
|
|
47
|
-
code: Partial<CodeOptions> | false
|
|
59
|
+
code: Partial<CodeOptions> | false
|
|
48
60
|
|
|
49
61
|
/**
|
|
50
62
|
* If set to false, the codeBlock extension will not be registered
|
|
51
63
|
* @example codeBlock: false
|
|
52
64
|
*/
|
|
53
|
-
codeBlock: Partial<CodeBlockOptions> | false
|
|
65
|
+
codeBlock: Partial<CodeBlockOptions> | false
|
|
54
66
|
|
|
55
67
|
/**
|
|
56
68
|
* If set to false, the document extension will not be registered
|
|
57
69
|
* @example document: false
|
|
58
70
|
*/
|
|
59
|
-
document: false
|
|
71
|
+
document: false
|
|
60
72
|
|
|
61
73
|
/**
|
|
62
74
|
* If set to false, the dropcursor extension will not be registered
|
|
63
75
|
* @example dropcursor: false
|
|
64
76
|
*/
|
|
65
|
-
dropcursor: Partial<DropcursorOptions> | false
|
|
77
|
+
dropcursor: Partial<DropcursorOptions> | false
|
|
66
78
|
|
|
67
79
|
/**
|
|
68
80
|
* If set to false, the gapcursor extension will not be registered
|
|
69
81
|
* @example gapcursor: false
|
|
70
82
|
*/
|
|
71
|
-
gapcursor: false
|
|
83
|
+
gapcursor: false
|
|
72
84
|
|
|
73
85
|
/**
|
|
74
86
|
* If set to false, the hardBreak extension will not be registered
|
|
75
87
|
* @example hardBreak: false
|
|
76
88
|
*/
|
|
77
|
-
hardBreak: Partial<HardBreakOptions> | false
|
|
89
|
+
hardBreak: Partial<HardBreakOptions> | false
|
|
78
90
|
|
|
79
91
|
/**
|
|
80
92
|
* If set to false, the heading extension will not be registered
|
|
81
93
|
* @example heading: false
|
|
82
94
|
*/
|
|
83
|
-
heading: Partial<HeadingOptions> | false
|
|
95
|
+
heading: Partial<HeadingOptions> | false
|
|
84
96
|
|
|
85
97
|
/**
|
|
86
98
|
* If set to false, the history extension will not be registered
|
|
87
99
|
* @example history: false
|
|
88
100
|
*/
|
|
89
|
-
history: Partial<HistoryOptions> | false
|
|
101
|
+
history: Partial<HistoryOptions> | false
|
|
90
102
|
|
|
91
103
|
/**
|
|
92
104
|
* If set to false, the horizontalRule extension will not be registered
|
|
93
105
|
* @example horizontalRule: false
|
|
94
106
|
*/
|
|
95
|
-
horizontalRule: Partial<HorizontalRuleOptions> | false
|
|
107
|
+
horizontalRule: Partial<HorizontalRuleOptions> | false
|
|
96
108
|
|
|
97
109
|
/**
|
|
98
110
|
* If set to false, the italic extension will not be registered
|
|
99
111
|
* @example italic: false
|
|
100
112
|
*/
|
|
101
|
-
italic: Partial<ItalicOptions> | false
|
|
113
|
+
italic: Partial<ItalicOptions> | false
|
|
102
114
|
|
|
103
115
|
/**
|
|
104
116
|
* If set to false, the listItem extension will not be registered
|
|
105
117
|
* @example listItem: false
|
|
106
118
|
*/
|
|
107
|
-
listItem: Partial<ListItemOptions> | false
|
|
119
|
+
listItem: Partial<ListItemOptions> | false
|
|
108
120
|
|
|
109
121
|
/**
|
|
110
122
|
* If set to false, the listItemKeymap extension will not be registered
|
|
111
123
|
* @example listKeymap: false
|
|
112
124
|
*/
|
|
113
|
-
listKeymap: Partial<ListKeymapOptions> | false
|
|
125
|
+
listKeymap: Partial<ListKeymapOptions> | false
|
|
114
126
|
|
|
115
127
|
/**
|
|
116
128
|
* If set to false, the link extension will not be registered
|
|
117
129
|
* @example link: false
|
|
118
130
|
*/
|
|
119
|
-
link: Partial<LinkOptions> | false
|
|
131
|
+
link: Partial<LinkOptions> | false
|
|
120
132
|
|
|
121
133
|
/**
|
|
122
134
|
* If set to false, the orderedList extension will not be registered
|
|
123
135
|
* @example orderedList: false
|
|
124
136
|
*/
|
|
125
|
-
orderedList: Partial<OrderedListOptions> | false
|
|
137
|
+
orderedList: Partial<OrderedListOptions> | false
|
|
126
138
|
|
|
127
139
|
/**
|
|
128
140
|
* If set to false, the paragraph extension will not be registered
|
|
129
141
|
* @example paragraph: false
|
|
130
142
|
*/
|
|
131
|
-
paragraph: Partial<ParagraphOptions> | false
|
|
143
|
+
paragraph: Partial<ParagraphOptions> | false
|
|
132
144
|
|
|
133
145
|
/**
|
|
134
146
|
* If set to false, the strike extension will not be registered
|
|
135
147
|
* @example strike: false
|
|
136
148
|
*/
|
|
137
|
-
strike: Partial<StrikeOptions> | false
|
|
149
|
+
strike: Partial<StrikeOptions> | false
|
|
138
150
|
|
|
139
151
|
/**
|
|
140
152
|
* If set to false, the text extension will not be registered
|
|
141
153
|
* @example text: false
|
|
142
154
|
*/
|
|
143
|
-
text: false
|
|
155
|
+
text: false
|
|
144
156
|
|
|
145
157
|
/**
|
|
146
158
|
* If set to false, the underline extension will not be registered
|
|
147
159
|
* @example underline: false
|
|
148
160
|
*/
|
|
149
|
-
underline: Partial<UnderlineOptions> | false
|
|
161
|
+
underline: Partial<UnderlineOptions> | false
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* If set to false, the trailingNode extension will not be registered
|
|
165
|
+
* @example trailingNode: false
|
|
166
|
+
*/
|
|
167
|
+
trailingNode: Partial<TrailingNodeOptions> | false
|
|
150
168
|
}
|
|
151
169
|
|
|
152
170
|
/**
|
|
@@ -244,6 +262,10 @@ export const StarterKit = Extension.create<StarterKitOptions>({
|
|
|
244
262
|
extensions.push(Underline.configure(this.options?.underline))
|
|
245
263
|
}
|
|
246
264
|
|
|
265
|
+
if (this.options.trailingNode !== false) {
|
|
266
|
+
extensions.push(TrailingNode.configure(this.options?.trailingNode))
|
|
267
|
+
}
|
|
268
|
+
|
|
247
269
|
return extensions
|
|
248
270
|
},
|
|
249
271
|
})
|