nib-edit / nib

Wysiwyg / Text editor components built using React and Prosemirror
https://nib-edit.github.io/nib/
GNU General Public License v3.0
228 stars 26 forks source link

Documentation for adding a new ProseMirror plugin #91

Closed maniraghubansh closed 4 years ago

maniraghubansh commented 4 years ago

Hey Jyoti, thanks for your great efforts on this editor. I am trying to add Mentions plugin to the editor as an addon, but am not sure on what attributes to pass in it. Here is an example given by Joe, the creator. Could you help me out here?

  1. What are the specific callbacks, like, viewUpdateCallback, dispatchTransactionCallback, etc, supposed to do? I don't see them used in your plugins.
  2. I am not able to pass in the new schema for this plugin. The buildSchema function in utils adds only the schemas defined in nib-schema package.
  3. As far as I understood ProseMirror and the above plugin, passing in the pmPlugin and schema objects should be sufficient, am I wrong?
jpuri commented 4 years ago

Hello @maniraghubansh ,

I am glad that you liked editor. I see point-2 above is a limitation that I need to fix.

I will fix this and create an example of plugin extension that you can refer.

jpuri commented 4 years ago

Plz check this: http://www.nibedit.com/index.html#/Advance%20Features/CustomPlugin

Note it is added as advance feature.

maniraghubansh commented 4 years ago

Thanks for your consideration. The demo that you shared doesn't work,says TypeError: n is undefined. I had managed to make that particular plugin with a fork of this repo and relevant changes in buildSchema. However, figuring out how to build nib-core from source proved to be challenging to me. I am new to frontend development, have done mostly Android and backend development. It would be very useful for newcomers like me if you could also document how to build locally. I am feeling frontend development to be 10 times more difficult than Android development on all fronts - language, framework, tooling, environment, etc. Would you agree with this assessment of mine?

jpuri commented 4 years ago

Hey @maniraghubansh : demo pages are fixed.

FE development is indeed tough, its less structures and more fun :)

I would encourage you guys buy license or support contract, I do consider discounts for startups. That makes projects like this more sustainable for authors.

maniraghubansh commented 4 years ago

We are considering buying a license, just not yet though. Thanks for your replies. Cheers.