cjpollard
cjpollard
Someone put up a nice bit of code for that here. https://github.com/artf/grapesjs/issues/74#issuecomment-322427387
You can listen for the [event](https://github.com/artf/grapesjs/wiki/API-Editor#available-events) with: ``` editor.on('load', fn); ```
[Asset Manager](https://github.com/artf/grapesjs/wiki/Assets)'s getAll function should do just that. ``` const am = editor.AssetManager; am.getAll(); ```
I managed to fix this in my fork [here](https://github.com/cjpollard/grapesjs/commit/70078331dcefe8c7524dccec4801fef5e5672187). Not sure if this is the best way of doing it, but I can submit a pull request if desired.
This thread should answer your question. https://github.com/artf/grapesjs/issues/275
https://github.com/artf/grapesjs/tree/gh-pages
If you're using webpack to build your React app, you can include it as a plugin. It'll pull it from node_modules. ``plugins: [ new webpack.ProvidePlugin({ grapesjs: "grapesjs" }) ],`` This...
"grapejs" is a different npm module to "grapesjs". You should npm install grapesjs. Step 3 shouldn't be necessary.
ProvidePlugin automatically loads grapesjs so it's available anywhere in the code, making importing it again redundant.
If you use the [CKEditor plugin](https://github.com/artf/grapesjs-plugin-ckeditor), that button's there.