mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 01:12:56 +08:00
feat(starter-kit): enable more extensions in the starter-kit for easier onboarding (#5466)
This commit is contained in:
parent
d086c4e423
commit
64a74f62be
7
.changeset/weak-books-eat.md
Normal file
7
.changeset/weak-books-eat.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
"@tiptap/starter-kit": major
|
||||
---
|
||||
|
||||
We have now added the Link, ListKeymap, and Underline extensions to the starter kit for a smoother onboarding experience
|
||||
|
||||
If you have theses extensions in your project, you can remove them from your project and use the ones from the starter kit instead.
|
12
package-lock.json
generated
12
package-lock.json
generated
@ -4730,10 +4730,6 @@
|
||||
"vite": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@tiptap-shared/rollup-config": {
|
||||
"resolved": "shared/rollup-config",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@tiptap/core": {
|
||||
"resolved": "packages/core",
|
||||
"link": true
|
||||
@ -17411,11 +17407,14 @@
|
||||
"@tiptap/extension-history": "^3.0.0-next.0",
|
||||
"@tiptap/extension-horizontal-rule": "^3.0.0-next.0",
|
||||
"@tiptap/extension-italic": "^3.0.0-next.0",
|
||||
"@tiptap/extension-link": "^3.0.0-next.0",
|
||||
"@tiptap/extension-list-item": "^3.0.0-next.0",
|
||||
"@tiptap/extension-list-keymap": "^3.0.0-next.0",
|
||||
"@tiptap/extension-ordered-list": "^3.0.0-next.0",
|
||||
"@tiptap/extension-paragraph": "^3.0.0-next.0",
|
||||
"@tiptap/extension-strike": "^3.0.0-next.0",
|
||||
"@tiptap/extension-text": "^3.0.0-next.0"
|
||||
"@tiptap/extension-text": "^3.0.0-next.0",
|
||||
"@tiptap/extension-underline": "^3.0.0-next.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
@ -17508,7 +17507,8 @@
|
||||
}
|
||||
},
|
||||
"shared/rollup-config": {
|
||||
"name": "@tiptap-shared/rollup-config"
|
||||
"name": "@tiptap-shared/rollup-config",
|
||||
"extraneous": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,9 +43,12 @@
|
||||
"@tiptap/extension-horizontal-rule": "^3.0.0-next.0",
|
||||
"@tiptap/extension-italic": "^3.0.0-next.0",
|
||||
"@tiptap/extension-list-item": "^3.0.0-next.0",
|
||||
"@tiptap/extension-list-keymap": "^3.0.0-next.0",
|
||||
"@tiptap/extension-link": "^3.0.0-next.0",
|
||||
"@tiptap/extension-ordered-list": "^3.0.0-next.0",
|
||||
"@tiptap/extension-paragraph": "^3.0.0-next.0",
|
||||
"@tiptap/extension-strike": "^3.0.0-next.0",
|
||||
"@tiptap/extension-underline": "^3.0.0-next.0",
|
||||
"@tiptap/extension-text": "^3.0.0-next.0"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -12,11 +12,14 @@ import { Heading, HeadingOptions } from '@tiptap/extension-heading'
|
||||
import { History, HistoryOptions } from '@tiptap/extension-history'
|
||||
import { HorizontalRule, HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'
|
||||
import { Italic, ItalicOptions } from '@tiptap/extension-italic'
|
||||
import { Link, LinkOptions } from '@tiptap/extension-link'
|
||||
import { ListItem, ListItemOptions } from '@tiptap/extension-list-item'
|
||||
import { ListKeymap, ListKeymapOptions } from '@tiptap/extension-list-keymap'
|
||||
import { OrderedList, OrderedListOptions } from '@tiptap/extension-ordered-list'
|
||||
import { Paragraph, ParagraphOptions } from '@tiptap/extension-paragraph'
|
||||
import { Strike, StrikeOptions } from '@tiptap/extension-strike'
|
||||
import { Text } from '@tiptap/extension-text'
|
||||
import { Underline, UnderlineOptions } from '@tiptap/extension-underline'
|
||||
|
||||
export interface StarterKitOptions {
|
||||
/**
|
||||
@ -103,6 +106,18 @@ export interface StarterKitOptions {
|
||||
*/
|
||||
listItem: Partial<ListItemOptions> | false,
|
||||
|
||||
/**
|
||||
* If set to false, the listItemKeymap extension will not be registered
|
||||
* @example listKeymap: false
|
||||
*/
|
||||
listKeymap: Partial<ListKeymapOptions> | false,
|
||||
|
||||
/**
|
||||
* If set to false, the link extension will not be registered
|
||||
* @example link: false
|
||||
*/
|
||||
link: Partial<LinkOptions> | false,
|
||||
|
||||
/**
|
||||
* If set to false, the orderedList extension will not be registered
|
||||
* @example orderedList: false
|
||||
@ -126,6 +141,12 @@ export interface StarterKitOptions {
|
||||
* @example text: false
|
||||
*/
|
||||
text: false,
|
||||
|
||||
/**
|
||||
* If set to false, the underline extension will not be registered
|
||||
* @example underline: false
|
||||
*/
|
||||
underline: Partial<UnderlineOptions> | false,
|
||||
}
|
||||
|
||||
/**
|
||||
@ -195,6 +216,14 @@ export const StarterKit = Extension.create<StarterKitOptions>({
|
||||
extensions.push(ListItem.configure(this.options?.listItem))
|
||||
}
|
||||
|
||||
if (this.options.listKeymap !== false) {
|
||||
extensions.push(ListKeymap.configure(this.options?.listKeymap))
|
||||
}
|
||||
|
||||
if (this.options.link !== false) {
|
||||
extensions.push(Link.configure(this.options?.link))
|
||||
}
|
||||
|
||||
if (this.options.orderedList !== false) {
|
||||
extensions.push(OrderedList.configure(this.options?.orderedList))
|
||||
}
|
||||
@ -211,6 +240,10 @@ export const StarterKit = Extension.create<StarterKitOptions>({
|
||||
extensions.push(Text.configure(this.options?.text))
|
||||
}
|
||||
|
||||
if (this.options.underline !== false) {
|
||||
extensions.push(Underline.configure(this.options?.underline))
|
||||
}
|
||||
|
||||
return extensions
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user