rename schema names
This commit is contained in:
@@ -4,11 +4,11 @@ import { wrappingInputRule } from 'prosemirror-inputrules'
|
||||
export const inputRegex = /^\s*([-+*])\s$/
|
||||
|
||||
const BulletList = createNode({
|
||||
name: 'bullet_list',
|
||||
name: 'bulletList',
|
||||
|
||||
group: 'block list',
|
||||
|
||||
content: 'list_item+',
|
||||
content: 'listItem+',
|
||||
|
||||
parseHTML() {
|
||||
return [
|
||||
@@ -23,7 +23,7 @@ const BulletList = createNode({
|
||||
addCommands() {
|
||||
return {
|
||||
bulletList: (): Command => ({ commands }) => {
|
||||
return commands.toggleList('bullet_list', 'list_item')
|
||||
return commands.toggleList('bulletList', 'listItem')
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createNode } from '@tiptap/core'
|
||||
|
||||
const ListItem = createNode({
|
||||
name: 'list_item',
|
||||
name: 'listItem',
|
||||
|
||||
content: '(paragraph|list?)+',
|
||||
|
||||
@@ -21,9 +21,9 @@ const ListItem = createNode({
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
Enter: () => this.editor.splitListItem('list_item'),
|
||||
Tab: () => this.editor.sinkListItem('list_item'),
|
||||
'Shift-Tab': () => this.editor.liftListItem('list_item'),
|
||||
Enter: () => this.editor.splitListItem('listItem'),
|
||||
Tab: () => this.editor.sinkListItem('listItem'),
|
||||
'Shift-Tab': () => this.editor.liftListItem('listItem'),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -4,11 +4,11 @@ import { wrappingInputRule } from 'prosemirror-inputrules'
|
||||
export const inputRegex = /^(\d+)\.\s$/
|
||||
|
||||
const OrderedList = createNode({
|
||||
name: 'ordered_list',
|
||||
name: 'orderedList',
|
||||
|
||||
group: 'block list',
|
||||
|
||||
content: 'list_item+',
|
||||
content: 'listItem+',
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
@@ -42,7 +42,7 @@ const OrderedList = createNode({
|
||||
addCommands() {
|
||||
return {
|
||||
orderedList: (): Command => ({ commands }) => {
|
||||
return commands.toggleList('ordered_list', 'list_item')
|
||||
return commands.toggleList('orderedList', 'listItem')
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface TaskItemOptions {
|
||||
}
|
||||
|
||||
const TaskItem = createNode({
|
||||
name: 'task_item',
|
||||
name: 'taskItem',
|
||||
|
||||
content() {
|
||||
return this.options.nested ? '(paragraph|task_list)+' : 'paragraph+'
|
||||
@@ -37,20 +37,20 @@ const TaskItem = createNode({
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
tag: 'li[data-type="task_item"]',
|
||||
tag: 'li[data-type="taskItem"]',
|
||||
priority: 51,
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
renderHTML({ attributes }) {
|
||||
return ['li', mergeAttributes(attributes, { 'data-type': 'task_item' }), 0]
|
||||
return ['li', mergeAttributes(attributes, { 'data-type': 'taskItem' }), 0]
|
||||
},
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
const shortcuts = {
|
||||
Enter: () => this.editor.splitListItem('task_item'),
|
||||
'Shift-Tab': () => this.editor.liftListItem('task_item'),
|
||||
Enter: () => this.editor.splitListItem('taskItem'),
|
||||
'Shift-Tab': () => this.editor.liftListItem('taskItem'),
|
||||
}
|
||||
|
||||
if (!this.options.nested) {
|
||||
@@ -59,7 +59,7 @@ const TaskItem = createNode({
|
||||
|
||||
return {
|
||||
...shortcuts,
|
||||
Tab: () => this.editor.sinkListItem('task_item'),
|
||||
Tab: () => this.editor.sinkListItem('taskItem'),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ const TaskList = createNode({
|
||||
|
||||
group: 'block list',
|
||||
|
||||
content: 'task_item+',
|
||||
content: 'taskItem+',
|
||||
|
||||
parseHTML() {
|
||||
return [
|
||||
@@ -23,7 +23,7 @@ const TaskList = createNode({
|
||||
addCommands() {
|
||||
return {
|
||||
taskList: (): Command => ({ commands }) => {
|
||||
return commands.toggleList('task_list', 'task_item')
|
||||
return commands.toggleList('task_list', 'taskItem')
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user