@tiptap/starter-kit 2.0.0-beta.18 → 2.0.0-beta.180
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 +1 -1
- package/README.md +2 -2
- package/dist/packages/starter-kit/src/index.d.ts +3 -32
- package/dist/packages/starter-kit/src/starter-kit.d.ts +37 -0
- package/dist/tiptap-starter-kit.cjs.js +88 -49
- package/dist/tiptap-starter-kit.cjs.js.map +1 -1
- package/dist/tiptap-starter-kit.esm.js +76 -35
- package/dist/tiptap-starter-kit.esm.js.map +1 -1
- package/dist/tiptap-starter-kit.umd.js +80 -42
- package/dist/tiptap-starter-kit.umd.js.map +1 -1
- package/package.json +26 -22
- package/src/index.ts +4 -56
- package/src/starter-kit.ts +122 -0
- package/CHANGELOG.md +0 -272
- package/dist/tiptap-starter-kit.bundle.umd.min.js +0 -2
- package/dist/tiptap-starter-kit.bundle.umd.min.js.map +0 -1
|
@@ -1,56 +1,94 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self,
|
|
5
|
-
}(this, (function (
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@tiptap/core'), require('@tiptap/extension-blockquote'), require('@tiptap/extension-bold'), require('@tiptap/extension-bullet-list'), require('@tiptap/extension-code'), require('@tiptap/extension-code-block'), require('@tiptap/extension-document'), require('@tiptap/extension-dropcursor'), require('@tiptap/extension-gapcursor'), require('@tiptap/extension-hard-break'), require('@tiptap/extension-heading'), require('@tiptap/extension-history'), require('@tiptap/extension-horizontal-rule'), require('@tiptap/extension-italic'), require('@tiptap/extension-list-item'), require('@tiptap/extension-ordered-list'), require('@tiptap/extension-paragraph'), require('@tiptap/extension-strike'), require('@tiptap/extension-text')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['@tiptap/core', '@tiptap/extension-blockquote', '@tiptap/extension-bold', '@tiptap/extension-bullet-list', '@tiptap/extension-code', '@tiptap/extension-code-block', '@tiptap/extension-document', '@tiptap/extension-dropcursor', '@tiptap/extension-gapcursor', '@tiptap/extension-hard-break', '@tiptap/extension-heading', '@tiptap/extension-history', '@tiptap/extension-horizontal-rule', '@tiptap/extension-italic', '@tiptap/extension-list-item', '@tiptap/extension-ordered-list', '@tiptap/extension-paragraph', '@tiptap/extension-strike', '@tiptap/extension-text'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["@tiptap/starter-kit"] = factory(global.core, global.Blockquote, global.Bold, global.BulletList, global.Code, global.CodeBlock, global.Document, global.Dropcursor, global.Gapcursor, global.HardBreak, global.Heading, global.History, global.HorizontalRule, global.Italic, global.ListItem, global.OrderedList, global.Paragraph, global.Strike, global.Text));
|
|
5
|
+
})(this, (function (core, Blockquote, Bold, BulletList, Code, CodeBlock, Document, Dropcursor, Gapcursor, HardBreak, Heading, History, HorizontalRule, Italic, ListItem, OrderedList, Paragraph, Strike, Text) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
var Gapcursor__default = /*#__PURE__*/_interopDefaultLegacy(Gapcursor);
|
|
11
|
-
var Document__default = /*#__PURE__*/_interopDefaultLegacy(Document);
|
|
12
|
-
var Paragraph__default = /*#__PURE__*/_interopDefaultLegacy(Paragraph);
|
|
13
|
-
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
14
|
-
var History__default = /*#__PURE__*/_interopDefaultLegacy(History);
|
|
9
|
+
var Blockquote__default = /*#__PURE__*/_interopDefaultLegacy(Blockquote);
|
|
15
10
|
var Bold__default = /*#__PURE__*/_interopDefaultLegacy(Bold);
|
|
16
|
-
var
|
|
11
|
+
var BulletList__default = /*#__PURE__*/_interopDefaultLegacy(BulletList);
|
|
17
12
|
var Code__default = /*#__PURE__*/_interopDefaultLegacy(Code);
|
|
18
13
|
var CodeBlock__default = /*#__PURE__*/_interopDefaultLegacy(CodeBlock);
|
|
19
|
-
var
|
|
14
|
+
var Document__default = /*#__PURE__*/_interopDefaultLegacy(Document);
|
|
15
|
+
var Dropcursor__default = /*#__PURE__*/_interopDefaultLegacy(Dropcursor);
|
|
16
|
+
var Gapcursor__default = /*#__PURE__*/_interopDefaultLegacy(Gapcursor);
|
|
20
17
|
var HardBreak__default = /*#__PURE__*/_interopDefaultLegacy(HardBreak);
|
|
21
|
-
var
|
|
22
|
-
var
|
|
18
|
+
var Heading__default = /*#__PURE__*/_interopDefaultLegacy(Heading);
|
|
19
|
+
var History__default = /*#__PURE__*/_interopDefaultLegacy(History);
|
|
23
20
|
var HorizontalRule__default = /*#__PURE__*/_interopDefaultLegacy(HorizontalRule);
|
|
24
|
-
var
|
|
25
|
-
var OrderedList__default = /*#__PURE__*/_interopDefaultLegacy(OrderedList);
|
|
21
|
+
var Italic__default = /*#__PURE__*/_interopDefaultLegacy(Italic);
|
|
26
22
|
var ListItem__default = /*#__PURE__*/_interopDefaultLegacy(ListItem);
|
|
23
|
+
var OrderedList__default = /*#__PURE__*/_interopDefaultLegacy(OrderedList);
|
|
24
|
+
var Paragraph__default = /*#__PURE__*/_interopDefaultLegacy(Paragraph);
|
|
25
|
+
var Strike__default = /*#__PURE__*/_interopDefaultLegacy(Strike);
|
|
26
|
+
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
28
|
+
const StarterKit = core.Extension.create({
|
|
29
|
+
name: 'starterKit',
|
|
30
|
+
addExtensions() {
|
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
32
|
+
const extensions = [];
|
|
33
|
+
if (this.options.blockquote !== false) {
|
|
34
|
+
extensions.push(Blockquote__default["default"].configure((_a = this.options) === null || _a === void 0 ? void 0 : _a.blockquote));
|
|
35
|
+
}
|
|
36
|
+
if (this.options.bold !== false) {
|
|
37
|
+
extensions.push(Bold__default["default"].configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.bold));
|
|
38
|
+
}
|
|
39
|
+
if (this.options.bulletList !== false) {
|
|
40
|
+
extensions.push(BulletList__default["default"].configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
|
|
41
|
+
}
|
|
42
|
+
if (this.options.code !== false) {
|
|
43
|
+
extensions.push(Code__default["default"].configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code));
|
|
44
|
+
}
|
|
45
|
+
if (this.options.codeBlock !== false) {
|
|
46
|
+
extensions.push(CodeBlock__default["default"].configure((_e = this.options) === null || _e === void 0 ? void 0 : _e.codeBlock));
|
|
47
|
+
}
|
|
48
|
+
if (this.options.document !== false) {
|
|
49
|
+
extensions.push(Document__default["default"].configure((_f = this.options) === null || _f === void 0 ? void 0 : _f.document));
|
|
50
|
+
}
|
|
51
|
+
if (this.options.dropcursor !== false) {
|
|
52
|
+
extensions.push(Dropcursor__default["default"].configure((_g = this.options) === null || _g === void 0 ? void 0 : _g.dropcursor));
|
|
53
|
+
}
|
|
54
|
+
if (this.options.gapcursor !== false) {
|
|
55
|
+
extensions.push(Gapcursor__default["default"].configure((_h = this.options) === null || _h === void 0 ? void 0 : _h.gapcursor));
|
|
56
|
+
}
|
|
57
|
+
if (this.options.hardBreak !== false) {
|
|
58
|
+
extensions.push(HardBreak__default["default"].configure((_j = this.options) === null || _j === void 0 ? void 0 : _j.hardBreak));
|
|
59
|
+
}
|
|
60
|
+
if (this.options.heading !== false) {
|
|
61
|
+
extensions.push(Heading__default["default"].configure((_k = this.options) === null || _k === void 0 ? void 0 : _k.heading));
|
|
62
|
+
}
|
|
63
|
+
if (this.options.history !== false) {
|
|
64
|
+
extensions.push(History__default["default"].configure((_l = this.options) === null || _l === void 0 ? void 0 : _l.history));
|
|
65
|
+
}
|
|
66
|
+
if (this.options.horizontalRule !== false) {
|
|
67
|
+
extensions.push(HorizontalRule__default["default"].configure((_m = this.options) === null || _m === void 0 ? void 0 : _m.horizontalRule));
|
|
68
|
+
}
|
|
69
|
+
if (this.options.italic !== false) {
|
|
70
|
+
extensions.push(Italic__default["default"].configure((_o = this.options) === null || _o === void 0 ? void 0 : _o.italic));
|
|
71
|
+
}
|
|
72
|
+
if (this.options.listItem !== false) {
|
|
73
|
+
extensions.push(ListItem__default["default"].configure((_p = this.options) === null || _p === void 0 ? void 0 : _p.listItem));
|
|
74
|
+
}
|
|
75
|
+
if (this.options.orderedList !== false) {
|
|
76
|
+
extensions.push(OrderedList__default["default"].configure((_q = this.options) === null || _q === void 0 ? void 0 : _q.orderedList));
|
|
77
|
+
}
|
|
78
|
+
if (this.options.paragraph !== false) {
|
|
79
|
+
extensions.push(Paragraph__default["default"].configure((_r = this.options) === null || _r === void 0 ? void 0 : _r.paragraph));
|
|
80
|
+
}
|
|
81
|
+
if (this.options.strike !== false) {
|
|
82
|
+
extensions.push(Strike__default["default"].configure((_s = this.options) === null || _s === void 0 ? void 0 : _s.strike));
|
|
83
|
+
}
|
|
84
|
+
if (this.options.text !== false) {
|
|
85
|
+
extensions.push(Text__default["default"].configure((_t = this.options) === null || _t === void 0 ? void 0 : _t.text));
|
|
86
|
+
}
|
|
87
|
+
return extensions;
|
|
88
|
+
},
|
|
89
|
+
});
|
|
52
90
|
|
|
53
|
-
|
|
91
|
+
return StarterKit;
|
|
54
92
|
|
|
55
|
-
}))
|
|
93
|
+
}));
|
|
56
94
|
//# sourceMappingURL=tiptap-starter-kit.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-starter-kit.umd.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"tiptap-starter-kit.umd.js","sources":["../src/starter-kit.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 ListItem, { ListItemOptions } from '@tiptap/extension-list-item'\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'\n\nexport interface StarterKitOptions {\n blockquote: Partial<BlockquoteOptions> | false,\n bold: Partial<BoldOptions> | false,\n bulletList: Partial<BulletListOptions> | false,\n code: Partial<CodeOptions> | false,\n codeBlock: Partial<CodeBlockOptions> | false,\n document: false,\n dropcursor: Partial<DropcursorOptions> | false,\n gapcursor: false,\n hardBreak: Partial<HardBreakOptions> | false,\n heading: Partial<HeadingOptions> | false,\n history: Partial<HistoryOptions> | false,\n horizontalRule: Partial<HorizontalRuleOptions> | false,\n italic: Partial<ItalicOptions> | false,\n listItem: Partial<ListItemOptions> | false,\n orderedList: Partial<OrderedListOptions> | false,\n paragraph: Partial<ParagraphOptions> | false,\n strike: Partial<StrikeOptions> | false,\n text: false,\n}\n\nexport const StarterKit = Extension.create<StarterKitOptions>({\n name: 'starterKit',\n\n addExtensions() {\n const extensions = []\n\n if (this.options.blockquote !== false) {\n extensions.push(Blockquote.configure(this.options?.blockquote))\n }\n\n if (this.options.bold !== false) {\n extensions.push(Bold.configure(this.options?.bold))\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.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 return extensions\n },\n})\n"],"names":["Extension","Blockquote","Bold","BulletList","Code","CodeBlock","Document","Dropcursor","Gapcursor","HardBreak","Heading","History","HorizontalRule","Italic","ListItem","OrderedList","Paragraph","Strike","Text"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;QAyCa,UAAU,GAAGA,cAAS,CAAC,MAAM,CAAoB;MAC5D,IAAI,EAAE,YAAY;MAElB,aAAa;;UACX,MAAM,UAAU,GAAG,EAAE,CAAA;UAErB,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,KAAK,EAAE;cACrC,UAAU,CAAC,IAAI,CAACC,8BAAU,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC,CAAC,CAAA;WAChE;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE;cAC/B,UAAU,CAAC,IAAI,CAACC,wBAAI,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,CAAC,CAAA;WACpD;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,KAAK,EAAE;cACrC,UAAU,CAAC,IAAI,CAACC,8BAAU,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC,CAAC,CAAA;WAChE;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE;cAC/B,UAAU,CAAC,IAAI,CAACC,wBAAI,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,CAAC,CAAA;WACpD;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,KAAK,EAAE;cACpC,UAAU,CAAC,IAAI,CAACC,6BAAS,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,CAAC,CAAA;WAC9D;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,KAA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-beta.180",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -15,32 +15,36 @@
|
|
|
15
15
|
"main": "dist/tiptap-starter-kit.cjs.js",
|
|
16
16
|
"umd": "dist/tiptap-starter-kit.umd.js",
|
|
17
17
|
"module": "dist/tiptap-starter-kit.esm.js",
|
|
18
|
-
"unpkg": "dist/tiptap-starter-kit.bundle.umd.min.js",
|
|
19
18
|
"types": "dist/packages/starter-kit/src/index.d.ts",
|
|
20
19
|
"files": [
|
|
21
20
|
"src",
|
|
22
21
|
"dist"
|
|
23
22
|
],
|
|
24
23
|
"dependencies": {
|
|
25
|
-
"@tiptap/core": "^2.0.0-beta.
|
|
26
|
-
"@tiptap/extension-blockquote": "^2.0.0-beta.
|
|
27
|
-
"@tiptap/extension-bold": "^2.0.0-beta.
|
|
28
|
-
"@tiptap/extension-bullet-list": "^2.0.0-beta.
|
|
29
|
-
"@tiptap/extension-code": "^2.0.0-beta.
|
|
30
|
-
"@tiptap/extension-code-block": "^2.0.0-beta.
|
|
31
|
-
"@tiptap/extension-document": "^2.0.0-beta.
|
|
32
|
-
"@tiptap/extension-dropcursor": "^2.0.0-beta.
|
|
33
|
-
"@tiptap/extension-gapcursor": "^2.0.0-beta.
|
|
34
|
-
"@tiptap/extension-hard-break": "^2.0.0-beta.
|
|
35
|
-
"@tiptap/extension-heading": "^2.0.0-beta.
|
|
36
|
-
"@tiptap/extension-history": "^2.0.0-beta.
|
|
37
|
-
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.
|
|
38
|
-
"@tiptap/extension-italic": "^2.0.0-beta.
|
|
39
|
-
"@tiptap/extension-list-item": "^2.0.0-beta.
|
|
40
|
-
"@tiptap/extension-ordered-list": "^2.0.0-beta.
|
|
41
|
-
"@tiptap/extension-paragraph": "^2.0.0-beta.
|
|
42
|
-
"@tiptap/extension-strike": "^2.0.0-beta.
|
|
43
|
-
"@tiptap/extension-text": "^2.0.0-beta.
|
|
24
|
+
"@tiptap/core": "^2.0.0-beta.171",
|
|
25
|
+
"@tiptap/extension-blockquote": "^2.0.0-beta.26",
|
|
26
|
+
"@tiptap/extension-bold": "^2.0.0-beta.25",
|
|
27
|
+
"@tiptap/extension-bullet-list": "^2.0.0-beta.26",
|
|
28
|
+
"@tiptap/extension-code": "^2.0.0-beta.26",
|
|
29
|
+
"@tiptap/extension-code-block": "^2.0.0-beta.37",
|
|
30
|
+
"@tiptap/extension-document": "^2.0.0-beta.15",
|
|
31
|
+
"@tiptap/extension-dropcursor": "^2.0.0-beta.25",
|
|
32
|
+
"@tiptap/extension-gapcursor": "^2.0.0-beta.34",
|
|
33
|
+
"@tiptap/extension-hard-break": "^2.0.0-beta.30",
|
|
34
|
+
"@tiptap/extension-heading": "^2.0.0-beta.26",
|
|
35
|
+
"@tiptap/extension-history": "^2.0.0-beta.21",
|
|
36
|
+
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.31",
|
|
37
|
+
"@tiptap/extension-italic": "^2.0.0-beta.25",
|
|
38
|
+
"@tiptap/extension-list-item": "^2.0.0-beta.20",
|
|
39
|
+
"@tiptap/extension-ordered-list": "^2.0.0-beta.27",
|
|
40
|
+
"@tiptap/extension-paragraph": "^2.0.0-beta.23",
|
|
41
|
+
"@tiptap/extension-strike": "^2.0.0-beta.27",
|
|
42
|
+
"@tiptap/extension-text": "^2.0.0-beta.15"
|
|
44
43
|
},
|
|
45
|
-
"
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://github.com/ueberdosis/tiptap",
|
|
47
|
+
"directory": "packages/starter-kit"
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "f4fc935c6c89f7ef94aebd4b916bc4d68795bf93"
|
|
46
50
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,57 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Gapcursor from '@tiptap/extension-gapcursor'
|
|
3
|
-
import Document from '@tiptap/extension-document'
|
|
4
|
-
import Paragraph, { ParagraphOptions } from '@tiptap/extension-paragraph'
|
|
5
|
-
import Text from '@tiptap/extension-text'
|
|
6
|
-
import History, { HistoryOptions } from '@tiptap/extension-history'
|
|
7
|
-
import Bold, { BoldOptions } from '@tiptap/extension-bold'
|
|
8
|
-
import Italic, { ItalicOptions } from '@tiptap/extension-italic'
|
|
9
|
-
import Code, { CodeOptions } from '@tiptap/extension-code'
|
|
10
|
-
import CodeBlock, { CodeBlockOptions } from '@tiptap/extension-code-block'
|
|
11
|
-
import Heading, { HeadingOptions } from '@tiptap/extension-heading'
|
|
12
|
-
import HardBreak, { HardBreakOptions } from '@tiptap/extension-hard-break'
|
|
13
|
-
import Strike, { StrikeOptions } from '@tiptap/extension-strike'
|
|
14
|
-
import Blockquote, { BlockquoteOptions } from '@tiptap/extension-blockquote'
|
|
15
|
-
import HorizontalRule, { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'
|
|
16
|
-
import BulletList, { BulletListOptions } from '@tiptap/extension-bullet-list'
|
|
17
|
-
import OrderedList, { OrderedListOptions } from '@tiptap/extension-ordered-list'
|
|
18
|
-
import ListItem, { ListItemOptions } from '@tiptap/extension-list-item'
|
|
1
|
+
import { StarterKit } from './starter-kit'
|
|
19
2
|
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
history: Partial<HistoryOptions>,
|
|
24
|
-
bold: Partial<BoldOptions>,
|
|
25
|
-
italic: Partial<ItalicOptions>,
|
|
26
|
-
code: Partial<CodeOptions>,
|
|
27
|
-
codeBlock: Partial<CodeBlockOptions>,
|
|
28
|
-
heading: Partial<HeadingOptions>,
|
|
29
|
-
hardBreak: Partial<HardBreakOptions>,
|
|
30
|
-
strike: Partial<StrikeOptions>,
|
|
31
|
-
blockquote: Partial<BlockquoteOptions>,
|
|
32
|
-
horizontalRule: Partial<HorizontalRuleOptions>,
|
|
33
|
-
bulletList: Partial<BulletListOptions>,
|
|
34
|
-
orderedList: Partial<OrderedListOptions>,
|
|
35
|
-
listItem: Partial<ListItemOptions>,
|
|
36
|
-
}>) {
|
|
37
|
-
return [
|
|
38
|
-
Document,
|
|
39
|
-
Paragraph.configure(options?.paragraph),
|
|
40
|
-
Text,
|
|
41
|
-
Bold.configure(options?.bold),
|
|
42
|
-
Italic.configure(options?.italic),
|
|
43
|
-
Code.configure(options?.code),
|
|
44
|
-
Strike.configure(options?.strike),
|
|
45
|
-
HardBreak.configure(options?.hardBreak),
|
|
46
|
-
Heading.configure(options?.heading),
|
|
47
|
-
Blockquote.configure(options?.blockquote),
|
|
48
|
-
BulletList.configure(options?.bulletList),
|
|
49
|
-
OrderedList.configure(options?.orderedList),
|
|
50
|
-
ListItem.configure(options?.listItem),
|
|
51
|
-
HorizontalRule.configure(options?.horizontalRule),
|
|
52
|
-
CodeBlock.configure(options?.codeBlock),
|
|
53
|
-
History.configure(options?.history),
|
|
54
|
-
Dropcursor.configure(options?.dropcursor),
|
|
55
|
-
Gapcursor,
|
|
56
|
-
]
|
|
57
|
-
}
|
|
3
|
+
export type { StarterKitOptions } from './starter-kit'
|
|
4
|
+
|
|
5
|
+
export default StarterKit
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core'
|
|
2
|
+
import Blockquote, { BlockquoteOptions } from '@tiptap/extension-blockquote'
|
|
3
|
+
import Bold, { BoldOptions } from '@tiptap/extension-bold'
|
|
4
|
+
import BulletList, { BulletListOptions } from '@tiptap/extension-bullet-list'
|
|
5
|
+
import Code, { CodeOptions } from '@tiptap/extension-code'
|
|
6
|
+
import CodeBlock, { CodeBlockOptions } from '@tiptap/extension-code-block'
|
|
7
|
+
import Document from '@tiptap/extension-document'
|
|
8
|
+
import Dropcursor, { DropcursorOptions } from '@tiptap/extension-dropcursor'
|
|
9
|
+
import Gapcursor from '@tiptap/extension-gapcursor'
|
|
10
|
+
import HardBreak, { HardBreakOptions } from '@tiptap/extension-hard-break'
|
|
11
|
+
import Heading, { HeadingOptions } from '@tiptap/extension-heading'
|
|
12
|
+
import History, { HistoryOptions } from '@tiptap/extension-history'
|
|
13
|
+
import HorizontalRule, { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'
|
|
14
|
+
import Italic, { ItalicOptions } from '@tiptap/extension-italic'
|
|
15
|
+
import ListItem, { ListItemOptions } from '@tiptap/extension-list-item'
|
|
16
|
+
import OrderedList, { OrderedListOptions } from '@tiptap/extension-ordered-list'
|
|
17
|
+
import Paragraph, { ParagraphOptions } from '@tiptap/extension-paragraph'
|
|
18
|
+
import Strike, { StrikeOptions } from '@tiptap/extension-strike'
|
|
19
|
+
import Text from '@tiptap/extension-text'
|
|
20
|
+
|
|
21
|
+
export interface StarterKitOptions {
|
|
22
|
+
blockquote: Partial<BlockquoteOptions> | false,
|
|
23
|
+
bold: Partial<BoldOptions> | false,
|
|
24
|
+
bulletList: Partial<BulletListOptions> | false,
|
|
25
|
+
code: Partial<CodeOptions> | false,
|
|
26
|
+
codeBlock: Partial<CodeBlockOptions> | false,
|
|
27
|
+
document: false,
|
|
28
|
+
dropcursor: Partial<DropcursorOptions> | false,
|
|
29
|
+
gapcursor: false,
|
|
30
|
+
hardBreak: Partial<HardBreakOptions> | false,
|
|
31
|
+
heading: Partial<HeadingOptions> | false,
|
|
32
|
+
history: Partial<HistoryOptions> | false,
|
|
33
|
+
horizontalRule: Partial<HorizontalRuleOptions> | false,
|
|
34
|
+
italic: Partial<ItalicOptions> | false,
|
|
35
|
+
listItem: Partial<ListItemOptions> | false,
|
|
36
|
+
orderedList: Partial<OrderedListOptions> | false,
|
|
37
|
+
paragraph: Partial<ParagraphOptions> | false,
|
|
38
|
+
strike: Partial<StrikeOptions> | false,
|
|
39
|
+
text: false,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const StarterKit = Extension.create<StarterKitOptions>({
|
|
43
|
+
name: 'starterKit',
|
|
44
|
+
|
|
45
|
+
addExtensions() {
|
|
46
|
+
const extensions = []
|
|
47
|
+
|
|
48
|
+
if (this.options.blockquote !== false) {
|
|
49
|
+
extensions.push(Blockquote.configure(this.options?.blockquote))
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (this.options.bold !== false) {
|
|
53
|
+
extensions.push(Bold.configure(this.options?.bold))
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (this.options.bulletList !== false) {
|
|
57
|
+
extensions.push(BulletList.configure(this.options?.bulletList))
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (this.options.code !== false) {
|
|
61
|
+
extensions.push(Code.configure(this.options?.code))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (this.options.codeBlock !== false) {
|
|
65
|
+
extensions.push(CodeBlock.configure(this.options?.codeBlock))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (this.options.document !== false) {
|
|
69
|
+
extensions.push(Document.configure(this.options?.document))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (this.options.dropcursor !== false) {
|
|
73
|
+
extensions.push(Dropcursor.configure(this.options?.dropcursor))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (this.options.gapcursor !== false) {
|
|
77
|
+
extensions.push(Gapcursor.configure(this.options?.gapcursor))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (this.options.hardBreak !== false) {
|
|
81
|
+
extensions.push(HardBreak.configure(this.options?.hardBreak))
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (this.options.heading !== false) {
|
|
85
|
+
extensions.push(Heading.configure(this.options?.heading))
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (this.options.history !== false) {
|
|
89
|
+
extensions.push(History.configure(this.options?.history))
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (this.options.horizontalRule !== false) {
|
|
93
|
+
extensions.push(HorizontalRule.configure(this.options?.horizontalRule))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (this.options.italic !== false) {
|
|
97
|
+
extensions.push(Italic.configure(this.options?.italic))
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (this.options.listItem !== false) {
|
|
101
|
+
extensions.push(ListItem.configure(this.options?.listItem))
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (this.options.orderedList !== false) {
|
|
105
|
+
extensions.push(OrderedList.configure(this.options?.orderedList))
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (this.options.paragraph !== false) {
|
|
109
|
+
extensions.push(Paragraph.configure(this.options?.paragraph))
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (this.options.strike !== false) {
|
|
113
|
+
extensions.push(Strike.configure(this.options?.strike))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (this.options.text !== false) {
|
|
117
|
+
extensions.push(Text.configure(this.options?.text))
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return extensions
|
|
121
|
+
},
|
|
122
|
+
})
|