fix build for now
This commit is contained in:
37
packages/extension-list-item/src/index.ts
Normal file
37
packages/extension-list-item/src/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { createNode } from '@tiptap/core'
|
||||
|
||||
const ListItem = createNode({
|
||||
name: 'listItem',
|
||||
|
||||
content: '(paragraph|list?)+',
|
||||
|
||||
defining: true,
|
||||
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
tag: 'li',
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
renderHTML({ attributes }) {
|
||||
return ['li', attributes, 0]
|
||||
},
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
Enter: () => this.editor.splitListItem('listItem'),
|
||||
Tab: () => this.editor.sinkListItem('listItem'),
|
||||
'Shift-Tab': () => this.editor.liftListItem('listItem'),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
export default ListItem
|
||||
|
||||
declare module '@tiptap/core/src/Editor' {
|
||||
interface AllExtensions {
|
||||
ListItem: typeof ListItem,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user