QUESTION : How to create new custom manager?
Question
Hi @artf,
I am using and developing grapesjs for my project. I want to add new manager such that PackageManager. However, I couldn't find which object includes other managers.
How can I add my custom manager to grapesjs?
Answers (1)
During this time, I tried to add my custom manager to grapesjs on npm.
// editor/index.js
['Styles', 'StyleManager'],
'DeviceManager',
['Devices', 'DeviceManager'],
'PackageManager', //this
].forEach(prop => {
if (Array.isArray(prop)) {
this[prop[0]] = em.get(prop[1]);
and
//editor/model/Editor.js
const deps = [
...
require('block_manager'),
require('package_manager'), // this
];
However, I failed.
This is my test code:
export default () =>{
return {
name : "PackageManager",
test(){
console.log("hello form package manager");
}
}
}
When I build, I am taking a blank page. Please rescue me from this black hole.
Thanks.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3119
[QUESTION] How to create custom block made of grapesjs components?
Hi, i want to have custom blocks made of grapesjs components. I found solution how to add components: https://github.com/artf/grapesjs/issu...
Issue #1733
How to remove script tag which is added by add block manager script
Hello @artf I want to export final/production based html content excluding the script(Only which is added by block manager). Suppose i am a...
Issue #2165
[QUESTION] How to extend style manger Sector's property
Hi @artf , We have created a custom asset manager which is working perfectly for image component. However we are not able to call custom as...
Issue #2687
[Question] How to append style manager to custom panel
I would like to append the whole style manager module to a panel? I have been digging up the docs for the past 2 days and couldn't find a p...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.