@tiptap/starter-kit
Advanced tools
Comparing version
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.0.0-beta.43](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.42...@tiptap/starter-kit@2.0.0-beta.43) (2021-05-06) | ||
### Features | ||
* add StarterKit extension ([21384fc](https://github.com/ueberdosis/tiptap/commit/21384fc7a66dd7d1e3849be52ae4ab9adc26cf4e)) | ||
# [2.0.0-beta.42](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.41...@tiptap/starter-kit@2.0.0-beta.42) (2021-05-06) | ||
@@ -8,0 +19,0 @@ |
@@ -16,2 +16,4 @@ import { DropcursorOptions } from '@tiptap/extension-dropcursor'; | ||
import { ListItemOptions } from '@tiptap/extension-list-item'; | ||
import { StarterKit } from './starter-kit'; | ||
export default StarterKit; | ||
export declare function defaultExtensions(options?: Partial<{ | ||
@@ -33,2 +35,2 @@ dropcursor: Partial<DropcursorOptions>; | ||
listItem: Partial<ListItemOptions>; | ||
}>): (import("@tiptap/core").Node<unknown> | import("@tiptap/core").Mark<BoldOptions> | import("@tiptap/core").Extension<unknown>)[]; | ||
}>): (import("@tiptap/core").Mark<BoldOptions> | import("@tiptap/core").Node<unknown> | import("@tiptap/core").Extension<unknown>)[]; |
@@ -23,2 +23,3 @@ 'use strict'; | ||
var ListItem = require('@tiptap/extension-list-item'); | ||
var core = require('@tiptap/core'); | ||
@@ -46,3 +47,67 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
const StarterKit = core.Extension.create({ | ||
name: 'starterKit', | ||
addExtensions() { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; | ||
const extensions = []; | ||
if (this.options.blockquote !== false) { | ||
extensions.push(Blockquote__default['default'].configure((_a = this.options) === null || _a === void 0 ? void 0 : _a.blockquote)); | ||
} | ||
if (this.options.bold !== false) { | ||
extensions.push(Bold__default['default'].configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.bold)); | ||
} | ||
if (this.options.bulletList !== false) { | ||
extensions.push(BulletList__default['default'].configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList)); | ||
} | ||
if (this.options.code !== false) { | ||
extensions.push(Code__default['default'].configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code)); | ||
} | ||
if (this.options.codeBlock !== false) { | ||
extensions.push(CodeBlock__default['default'].configure((_e = this.options) === null || _e === void 0 ? void 0 : _e.codeBlock)); | ||
} | ||
if (this.options.document !== false) { | ||
extensions.push(Document__default['default'].configure((_f = this.options) === null || _f === void 0 ? void 0 : _f.document)); | ||
} | ||
if (this.options.dropcursor !== false) { | ||
extensions.push(Dropcursor__default['default'].configure((_g = this.options) === null || _g === void 0 ? void 0 : _g.dropcursor)); | ||
} | ||
if (this.options.gapcursor !== false) { | ||
extensions.push(Gapcursor__default['default'].configure((_h = this.options) === null || _h === void 0 ? void 0 : _h.gapcursor)); | ||
} | ||
if (this.options.hardBreak !== false) { | ||
extensions.push(HardBreak__default['default'].configure((_j = this.options) === null || _j === void 0 ? void 0 : _j.hardBreak)); | ||
} | ||
if (this.options.heading !== false) { | ||
extensions.push(Heading__default['default'].configure((_k = this.options) === null || _k === void 0 ? void 0 : _k.heading)); | ||
} | ||
if (this.options.history !== false) { | ||
extensions.push(History__default['default'].configure((_l = this.options) === null || _l === void 0 ? void 0 : _l.history)); | ||
} | ||
if (this.options.horizontalRule !== false) { | ||
extensions.push(HorizontalRule__default['default'].configure((_m = this.options) === null || _m === void 0 ? void 0 : _m.horizontalRule)); | ||
} | ||
if (this.options.italic !== false) { | ||
extensions.push(Italic__default['default'].configure((_o = this.options) === null || _o === void 0 ? void 0 : _o.italic)); | ||
} | ||
if (this.options.listItem !== false) { | ||
extensions.push(ListItem__default['default'].configure((_p = this.options) === null || _p === void 0 ? void 0 : _p.listItem)); | ||
} | ||
if (this.options.orderedList !== false) { | ||
extensions.push(OrderedList__default['default'].configure((_q = this.options) === null || _q === void 0 ? void 0 : _q.orderedList)); | ||
} | ||
if (this.options.paragraph !== false) { | ||
extensions.push(Paragraph__default['default'].configure((_r = this.options) === null || _r === void 0 ? void 0 : _r.paragraph)); | ||
} | ||
if (this.options.strike !== false) { | ||
extensions.push(Strike__default['default'].configure((_s = this.options) === null || _s === void 0 ? void 0 : _s.strike)); | ||
} | ||
if (this.options.text !== false) { | ||
extensions.push(Text__default['default'].configure((_t = this.options) === null || _t === void 0 ? void 0 : _t.text)); | ||
} | ||
return extensions; | ||
}, | ||
}); | ||
function defaultExtensions(options) { | ||
console.warn('[tiptap warn]: defaultExtensions() is deprecated. please use the default export "StarterKit". "StarterKit" is a regular extension that contains all other extensions.'); | ||
return [ | ||
@@ -70,3 +135,4 @@ Document__default['default'], | ||
exports.default = StarterKit; | ||
exports.defaultExtensions = defaultExtensions; | ||
//# sourceMappingURL=tiptap-starter-kit.cjs.js.map |
@@ -19,4 +19,69 @@ import Dropcursor from '@tiptap/extension-dropcursor'; | ||
import ListItem from '@tiptap/extension-list-item'; | ||
import { Extension } from '@tiptap/core'; | ||
const StarterKit = Extension.create({ | ||
name: 'starterKit', | ||
addExtensions() { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; | ||
const extensions = []; | ||
if (this.options.blockquote !== false) { | ||
extensions.push(Blockquote.configure((_a = this.options) === null || _a === void 0 ? void 0 : _a.blockquote)); | ||
} | ||
if (this.options.bold !== false) { | ||
extensions.push(Bold.configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.bold)); | ||
} | ||
if (this.options.bulletList !== false) { | ||
extensions.push(BulletList.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList)); | ||
} | ||
if (this.options.code !== false) { | ||
extensions.push(Code.configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code)); | ||
} | ||
if (this.options.codeBlock !== false) { | ||
extensions.push(CodeBlock.configure((_e = this.options) === null || _e === void 0 ? void 0 : _e.codeBlock)); | ||
} | ||
if (this.options.document !== false) { | ||
extensions.push(Document.configure((_f = this.options) === null || _f === void 0 ? void 0 : _f.document)); | ||
} | ||
if (this.options.dropcursor !== false) { | ||
extensions.push(Dropcursor.configure((_g = this.options) === null || _g === void 0 ? void 0 : _g.dropcursor)); | ||
} | ||
if (this.options.gapcursor !== false) { | ||
extensions.push(Gapcursor.configure((_h = this.options) === null || _h === void 0 ? void 0 : _h.gapcursor)); | ||
} | ||
if (this.options.hardBreak !== false) { | ||
extensions.push(HardBreak.configure((_j = this.options) === null || _j === void 0 ? void 0 : _j.hardBreak)); | ||
} | ||
if (this.options.heading !== false) { | ||
extensions.push(Heading.configure((_k = this.options) === null || _k === void 0 ? void 0 : _k.heading)); | ||
} | ||
if (this.options.history !== false) { | ||
extensions.push(History.configure((_l = this.options) === null || _l === void 0 ? void 0 : _l.history)); | ||
} | ||
if (this.options.horizontalRule !== false) { | ||
extensions.push(HorizontalRule.configure((_m = this.options) === null || _m === void 0 ? void 0 : _m.horizontalRule)); | ||
} | ||
if (this.options.italic !== false) { | ||
extensions.push(Italic.configure((_o = this.options) === null || _o === void 0 ? void 0 : _o.italic)); | ||
} | ||
if (this.options.listItem !== false) { | ||
extensions.push(ListItem.configure((_p = this.options) === null || _p === void 0 ? void 0 : _p.listItem)); | ||
} | ||
if (this.options.orderedList !== false) { | ||
extensions.push(OrderedList.configure((_q = this.options) === null || _q === void 0 ? void 0 : _q.orderedList)); | ||
} | ||
if (this.options.paragraph !== false) { | ||
extensions.push(Paragraph.configure((_r = this.options) === null || _r === void 0 ? void 0 : _r.paragraph)); | ||
} | ||
if (this.options.strike !== false) { | ||
extensions.push(Strike.configure((_s = this.options) === null || _s === void 0 ? void 0 : _s.strike)); | ||
} | ||
if (this.options.text !== false) { | ||
extensions.push(Text.configure((_t = this.options) === null || _t === void 0 ? void 0 : _t.text)); | ||
} | ||
return extensions; | ||
}, | ||
}); | ||
function defaultExtensions(options) { | ||
console.warn('[tiptap warn]: defaultExtensions() is deprecated. please use the default export "StarterKit". "StarterKit" is a regular extension that contains all other extensions.'); | ||
return [ | ||
@@ -44,3 +109,4 @@ Document, | ||
export default StarterKit; | ||
export { defaultExtensions }; | ||
//# sourceMappingURL=tiptap-starter-kit.esm.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/extension-dropcursor'), require('@tiptap/extension-gapcursor'), require('@tiptap/extension-document'), require('@tiptap/extension-paragraph'), require('@tiptap/extension-text'), require('@tiptap/extension-history'), require('@tiptap/extension-bold'), require('@tiptap/extension-italic'), require('@tiptap/extension-code'), require('@tiptap/extension-code-block'), require('@tiptap/extension-heading'), require('@tiptap/extension-hard-break'), require('@tiptap/extension-strike'), require('@tiptap/extension-blockquote'), require('@tiptap/extension-horizontal-rule'), require('@tiptap/extension-bullet-list'), require('@tiptap/extension-ordered-list'), require('@tiptap/extension-list-item')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/extension-dropcursor', '@tiptap/extension-gapcursor', '@tiptap/extension-document', '@tiptap/extension-paragraph', '@tiptap/extension-text', '@tiptap/extension-history', '@tiptap/extension-bold', '@tiptap/extension-italic', '@tiptap/extension-code', '@tiptap/extension-code-block', '@tiptap/extension-heading', '@tiptap/extension-hard-break', '@tiptap/extension-strike', '@tiptap/extension-blockquote', '@tiptap/extension-horizontal-rule', '@tiptap/extension-bullet-list', '@tiptap/extension-ordered-list', '@tiptap/extension-list-item'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@tiptap/starter-kit'] = {}, global.Dropcursor, global.Gapcursor, global.Document, global.Paragraph, global.Text, global.History, global.Bold, global.Italic, global.Code, global.CodeBlock, global.Heading, global.HardBreak, global.Strike, global.Blockquote, global.HorizontalRule, global.BulletList, global.OrderedList, global.ListItem)); | ||
}(this, (function (exports, Dropcursor, Gapcursor, Document, Paragraph, Text, History, Bold, Italic, Code, CodeBlock, Heading, HardBreak, Strike, Blockquote, HorizontalRule, BulletList, OrderedList, ListItem) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/extension-dropcursor'), require('@tiptap/extension-gapcursor'), require('@tiptap/extension-document'), require('@tiptap/extension-paragraph'), require('@tiptap/extension-text'), require('@tiptap/extension-history'), require('@tiptap/extension-bold'), require('@tiptap/extension-italic'), require('@tiptap/extension-code'), require('@tiptap/extension-code-block'), require('@tiptap/extension-heading'), require('@tiptap/extension-hard-break'), require('@tiptap/extension-strike'), require('@tiptap/extension-blockquote'), require('@tiptap/extension-horizontal-rule'), require('@tiptap/extension-bullet-list'), require('@tiptap/extension-ordered-list'), require('@tiptap/extension-list-item'), require('@tiptap/core')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/extension-dropcursor', '@tiptap/extension-gapcursor', '@tiptap/extension-document', '@tiptap/extension-paragraph', '@tiptap/extension-text', '@tiptap/extension-history', '@tiptap/extension-bold', '@tiptap/extension-italic', '@tiptap/extension-code', '@tiptap/extension-code-block', '@tiptap/extension-heading', '@tiptap/extension-hard-break', '@tiptap/extension-strike', '@tiptap/extension-blockquote', '@tiptap/extension-horizontal-rule', '@tiptap/extension-bullet-list', '@tiptap/extension-ordered-list', '@tiptap/extension-list-item', '@tiptap/core'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@tiptap/starter-kit'] = {}, global.Dropcursor, global.Gapcursor, global.Document, global.Paragraph, global.Text, global.History, global.Bold, global.Italic, global.Code, global.CodeBlock, global.Heading, global.HardBreak, global.Strike, global.Blockquote, global.HorizontalRule, global.BulletList, global.OrderedList, global.ListItem, global.core)); | ||
}(this, (function (exports, Dropcursor, Gapcursor, Document, Paragraph, Text, History, Bold, Italic, Code, CodeBlock, Heading, HardBreak, Strike, Blockquote, HorizontalRule, BulletList, OrderedList, ListItem, core) { 'use strict'; | ||
@@ -28,3 +28,67 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
const StarterKit = core.Extension.create({ | ||
name: 'starterKit', | ||
addExtensions() { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; | ||
const extensions = []; | ||
if (this.options.blockquote !== false) { | ||
extensions.push(Blockquote__default['default'].configure((_a = this.options) === null || _a === void 0 ? void 0 : _a.blockquote)); | ||
} | ||
if (this.options.bold !== false) { | ||
extensions.push(Bold__default['default'].configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.bold)); | ||
} | ||
if (this.options.bulletList !== false) { | ||
extensions.push(BulletList__default['default'].configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList)); | ||
} | ||
if (this.options.code !== false) { | ||
extensions.push(Code__default['default'].configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code)); | ||
} | ||
if (this.options.codeBlock !== false) { | ||
extensions.push(CodeBlock__default['default'].configure((_e = this.options) === null || _e === void 0 ? void 0 : _e.codeBlock)); | ||
} | ||
if (this.options.document !== false) { | ||
extensions.push(Document__default['default'].configure((_f = this.options) === null || _f === void 0 ? void 0 : _f.document)); | ||
} | ||
if (this.options.dropcursor !== false) { | ||
extensions.push(Dropcursor__default['default'].configure((_g = this.options) === null || _g === void 0 ? void 0 : _g.dropcursor)); | ||
} | ||
if (this.options.gapcursor !== false) { | ||
extensions.push(Gapcursor__default['default'].configure((_h = this.options) === null || _h === void 0 ? void 0 : _h.gapcursor)); | ||
} | ||
if (this.options.hardBreak !== false) { | ||
extensions.push(HardBreak__default['default'].configure((_j = this.options) === null || _j === void 0 ? void 0 : _j.hardBreak)); | ||
} | ||
if (this.options.heading !== false) { | ||
extensions.push(Heading__default['default'].configure((_k = this.options) === null || _k === void 0 ? void 0 : _k.heading)); | ||
} | ||
if (this.options.history !== false) { | ||
extensions.push(History__default['default'].configure((_l = this.options) === null || _l === void 0 ? void 0 : _l.history)); | ||
} | ||
if (this.options.horizontalRule !== false) { | ||
extensions.push(HorizontalRule__default['default'].configure((_m = this.options) === null || _m === void 0 ? void 0 : _m.horizontalRule)); | ||
} | ||
if (this.options.italic !== false) { | ||
extensions.push(Italic__default['default'].configure((_o = this.options) === null || _o === void 0 ? void 0 : _o.italic)); | ||
} | ||
if (this.options.listItem !== false) { | ||
extensions.push(ListItem__default['default'].configure((_p = this.options) === null || _p === void 0 ? void 0 : _p.listItem)); | ||
} | ||
if (this.options.orderedList !== false) { | ||
extensions.push(OrderedList__default['default'].configure((_q = this.options) === null || _q === void 0 ? void 0 : _q.orderedList)); | ||
} | ||
if (this.options.paragraph !== false) { | ||
extensions.push(Paragraph__default['default'].configure((_r = this.options) === null || _r === void 0 ? void 0 : _r.paragraph)); | ||
} | ||
if (this.options.strike !== false) { | ||
extensions.push(Strike__default['default'].configure((_s = this.options) === null || _s === void 0 ? void 0 : _s.strike)); | ||
} | ||
if (this.options.text !== false) { | ||
extensions.push(Text__default['default'].configure((_t = this.options) === null || _t === void 0 ? void 0 : _t.text)); | ||
} | ||
return extensions; | ||
}, | ||
}); | ||
function defaultExtensions(options) { | ||
console.warn('[tiptap warn]: defaultExtensions() is deprecated. please use the default export "StarterKit". "StarterKit" is a regular extension that contains all other extensions.'); | ||
return [ | ||
@@ -52,2 +116,3 @@ Document__default['default'], | ||
exports.default = StarterKit; | ||
exports.defaultExtensions = defaultExtensions; | ||
@@ -54,0 +119,0 @@ |
{ | ||
"name": "@tiptap/starter-kit", | ||
"description": "starter kit for tiptap", | ||
"version": "2.0.0-beta.42", | ||
"version": "2.0.0-beta.43", | ||
"homepage": "https://tiptap.dev", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@tiptap/core": "^2.0.0-beta.45", | ||
"@tiptap/core": "^2.0.0-beta.46", | ||
"@tiptap/extension-blockquote": "^2.0.0-beta.8", | ||
@@ -45,3 +45,3 @@ "@tiptap/extension-bold": "^2.0.0-beta.8", | ||
}, | ||
"gitHead": "9718002875433e78917976ad7daf0915ecb43c6f" | ||
"gitHead": "78b336dea48a7bb0581202102c7af68a88cb424d" | ||
} |
@@ -20,2 +20,6 @@ import Dropcursor, { DropcursorOptions } from '@tiptap/extension-dropcursor' | ||
import { StarterKit } from './starter-kit' | ||
export default StarterKit | ||
export function defaultExtensions(options?: Partial<{ | ||
@@ -38,2 +42,4 @@ dropcursor: Partial<DropcursorOptions>, | ||
}>) { | ||
console.warn('[tiptap warn]: defaultExtensions() is deprecated. please use the default export "StarterKit". "StarterKit" is a regular extension that contains all other extensions.') | ||
return [ | ||
@@ -40,0 +46,0 @@ Document, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
86993
92.16%14
16.67%585
135.89%Updated