@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
30 lines • 1.36 kB
JavaScript
import * as React from 'react';
import { tableEditing } from '../../../prosemirror';
import { plugin, stateKey } from '../../../plugins/table';
import { table, tableCell, tableHeader, tableRow } from '../../../schema/nodes/tableNodes';
import TableFloatingControls from '../../../ui/TableFloatingControls';
import TableFloatingToolbar from '../../../ui/TableFloatingToolbar';
var tablesPlugin = {
nodes: function () {
return [
{ rank: 1700, name: 'table', node: table },
{ rank: 1800, name: 'tableHeader', node: tableHeader },
{ rank: 1900, name: 'tableRow', node: tableRow },
{ rank: 2000, name: 'tableCell', node: tableCell }
];
},
pmPlugins: function () {
return [
{ rank: 900, plugin: function () { return plugin(); } },
{ rank: 910, plugin: function () { return tableEditing(); } },
];
},
contentComponent: function (editorView) {
var pluginState = stateKey.getState(editorView.state);
return (React.createElement("div", null,
React.createElement(TableFloatingControls, { editorView: editorView, pluginState: pluginState }),
React.createElement(TableFloatingToolbar, { editorView: editorView, pluginState: pluginState })));
}
};
export default tablesPlugin;
//# sourceMappingURL=index.js.map