Commit 308ceeaf authored by chris's avatar chris

add external plugins

parent c4b37e85
import React, { Component } from "react";
import styled, { createGlobalStyle } from "styled-components";
import { orderedList, bulletList, listItem } from "prosemirror-schema-list";
import {
tableNodes,
columnResizing,
tableEditing,
goToNextCell
} from "prosemirror-tables";
import { Wax, CreateSchema } from "wax-prosemirror-core";
import { EditoriaSchema } from "wax-prosemirror-schema";
import { orderedList, bulletList, listItem } from "prosemirror-schema-list";
import { tableNodes } from "prosemirror-tables";
import { MainMenuBar, SideMenuBar } from "wax-prosemirror-components";
import "wax-prosemirror-layouts/layouts/editoria-layout.css";
import "wax-prosemirror-themes/themes/editoria-theme.css";
const plugins = [];
const keys = {};
const extraNodes = {
ordered_list: {
...orderedList,
......@@ -34,9 +37,12 @@ const extraNodes = {
};
EditoriaSchema.nodes = { ...EditoriaSchema.nodes, ...extraNodes };
const plugins = [columnResizing(), tableEditing()];
const keys = {};
const options = {
schema: new CreateSchema(EditoriaSchema)
schema: new CreateSchema(EditoriaSchema),
plugins
};
const GlobalStyle = createGlobalStyle`
......
......@@ -41,9 +41,9 @@ class Wax extends Component {
: new WaxKeys({ schema: schema, shortCuts: {} });
const editorContent = value ? value : "";
// TO DO Find a way to start plugins with options
defaultPlugins.push(
...[placeholder({ content: this.props.placeholder }), keys]
...[placeholder({ content: this.props.placeholder }), ...plugins, keys]
);
this.WaxOptions = {
......@@ -82,8 +82,6 @@ class Wax extends Component {
<React.Fragment>{editor}</React.Fragment>
);
console.log(className);
const WaxRender = renderLayout ? renderLayout : defaultRender;
const WaxLayout = layout
? `wax-container wax-l-${layout}`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment