I started working on a prosemirror package for Meteor.js. My ultimate goal is to create a package that can be dropped in and get both editing and collab functionality out of the box.
First step towards this goal is really to just get Prosemirror working properly on the client side through the use of a Meteor1.3 package.
I’ve was able to get something basic working with the following set of options once the package was setup and a demo app created.
let editor = new Prosemirror({
place: document.body,
menuBar: true,
autoInput: true,
tooltipMenu: {selectedBlockMenu: true},
doc: "Placeholder content",
docFormat: "html"
});
That code can be seen here if useful: https://github.com/prosemeteor/prosemirror
Then I started working on improving the demo. One of the first orders of business was to place Prosemirror somewhere different. A couple attempts failed so I looked at the Prosemirror’s own demo code and tried to replicate that.
To the html file I added
<div class="full"></div>
and change the option
place: document.body,
to
place: document.querySelector(".full"),
That change alone causes Prosemirror not to instantiate properly. I’m assuming I’m missing something stupid or have a fundamental misunderstanding of how this is supposed to work.
I was thinking maybe a likely screw-up is in how I import/export. Right now the package that brings in Prosemirror imports/exports like this:
import { ProseMirror } from "prosemirror/dist/edit"
import "prosemirror/dist/inputrules/autoinput"
import "prosemirror/dist/menu/tooltipmenu"
import "prosemirror/dist/menu/menubar"
export const Prosemirror = ProseMirror;
and in my app:
import { Prosemirror } from 'meteor/prosemeteor:prosemirror'