mjawad096 / laravel-grapesjs

This package provide an esay way to integrate GrapesJS into your laravel proejct.
MIT License
107 stars 54 forks source link

Older version of Grapesjs #46

Closed m-faizanrasool closed 1 year ago

m-faizanrasool commented 1 year ago

Hi I'm using your package and it is working nice.

But You are using the older version of Grapesjs that uses "display: table" to design rows and cells. // 0.18.4 I want to use the latest version of Grapesjs that supports flex box to design. // 0.19.5

How can I use the latest version of Grapesjs in your package?

ghost commented 1 year ago

Hi Faizan,

Thanks for using my package. But for now, there is no way to update the core Grapesjs package. I'll update it soon.

Or you can submit a PR for updating.

Thanks.

ghost commented 1 year ago

The gjs updated, see v3.4.0

m-faizanrasool commented 1 year ago

Hi thanks for updating the core grapesjs in your package

I have updated to the 3.4.0

I have another question for you how can I customize the basic blocks of grapesjs Like in Grapesjs we can tell the basic blocks to use flexGrid, as by default it's using table layout I need to change to flexGrid.

In the config file how can I tell the basic blocks to use flexGrid. I tried something like this but it's not working

'plugins' => [
        'default' => [
            'basic_blocks' => [
                    'flexGrid' => 1,
                    'stylePrefix' => '',
                ],
            'bootstrap4_blocks' => false,
            'code_editor' => true,
            'image_editor' => false,
            'custom_fonts' => [],
            'templates' => true,
        ],
...,
]

there is only option to set it true or false but I need to tell here to use flexGrid.

ghost commented 1 year ago

Hello @m-faizanrasool, Currently there is no way to pass the options to default plugins.

But you can disable it from the default, and then add it in the custom plugins as below (I've not tested it, confirm here if it works for you).

'plugins' => [
    'default' => [
        ....
        'basic_blocks' => false
        ....
    ],
    'custom' => [
        ...
        [
            'enabled' => true,
            'name' => 'gjs-blocks-basic',
            'options' => [
                'flexGrid' => 1,
                'stylePrefix' => '',
            ],
            'scripts' => 'https://cdn.jsdelivr.net/npm/grapesjs-blocks-basic@1.0.1/dist/index.min.js',
        ],
        ...
    ]
]
m-faizanrasool commented 1 year ago

Yes that's working, Thanks

But I don't want to use it through cdn. is there any other way to use that?

ghost commented 1 year ago

Great, you can simply download the js file and store it in your public directory under public/js/gjs and then use it as

'scripts' => 'gjs-plugins/grapesjs-blocks-basic@1.0.1/dist/index.min.js',
m-faizanrasool commented 1 year ago

Great, Thanks