clean up
This commit is contained in:
@@ -87,6 +87,7 @@ export default {
|
|||||||
Document,
|
Document,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Text,
|
Text,
|
||||||
|
Gapcursor,
|
||||||
Table.configure({
|
Table.configure({
|
||||||
resizable: true,
|
resizable: true,
|
||||||
}),
|
}),
|
||||||
@@ -95,6 +96,7 @@ export default {
|
|||||||
TableCell.extend({
|
TableCell.extend({
|
||||||
addAttributes() {
|
addAttributes() {
|
||||||
return {
|
return {
|
||||||
|
// original attributes
|
||||||
colspan: {
|
colspan: {
|
||||||
default: 1,
|
default: 1,
|
||||||
},
|
},
|
||||||
@@ -104,11 +106,10 @@ export default {
|
|||||||
colwidth: {
|
colwidth: {
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
// add a color attribute to the table cell
|
||||||
color: {
|
color: {
|
||||||
default: null,
|
default: null,
|
||||||
// Take the attribute values
|
|
||||||
renderHTML: attributes => {
|
renderHTML: attributes => {
|
||||||
// … and return an object with HTML attributes.
|
|
||||||
return {
|
return {
|
||||||
style: `color: ${attributes.color}`,
|
style: `color: ${attributes.color}`,
|
||||||
}
|
}
|
||||||
@@ -117,7 +118,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
Gapcursor,
|
|
||||||
],
|
],
|
||||||
content: `
|
content: `
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import {
|
|||||||
toggleHeaderCell,
|
toggleHeaderCell,
|
||||||
setCellAttr,
|
setCellAttr,
|
||||||
fixTables,
|
fixTables,
|
||||||
CellSelection,
|
|
||||||
} from 'prosemirror-tables'
|
} from 'prosemirror-tables'
|
||||||
import { TextSelection } from 'prosemirror-state'
|
import { TextSelection } from 'prosemirror-state'
|
||||||
import { createTable } from './utilities/createTable'
|
import { createTable } from './utilities/createTable'
|
||||||
@@ -100,7 +99,6 @@ export const Table = Node.create({
|
|||||||
return deleteTable(state, dispatch)
|
return deleteTable(state, dispatch)
|
||||||
},
|
},
|
||||||
mergeCells: (): Command => ({ state, dispatch }) => {
|
mergeCells: (): Command => ({ state, dispatch }) => {
|
||||||
console.log('mergeCells', { state }, state.selection instanceof CellSelection)
|
|
||||||
return mergeCells(state, dispatch)
|
return mergeCells(state, dispatch)
|
||||||
},
|
},
|
||||||
splitCell: (): Command => ({ state, dispatch }) => {
|
splitCell: (): Command => ({ state, dispatch }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user