GrapesJS / preset-newsletter

GrapesJS preset configuration for the newsletter editor.
https://grapesjs.com/demo-newsletter-editor.html
BSD 3-Clause "New" or "Revised" License
195 stars 143 forks source link

[Question]: Adding 'Extra' to styleManager #53

Closed ghost closed 1 year ago

ghost commented 6 years ago

Hi, I've been using the newsletter preset version of GrapesJS and I would like to add the built in transforms options to the styleManager. I've added them to the inititialization (shown below trucated) but I can't get the Extra section to show in the side panel.

styleManager: {
                    sectors: [{
                    name: 'General',
                    buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom'],
                    properties: [{
                        name: 'Alignment',
                        property: 'float',
                        type: 'radio',
                        defaults: 'none',
                        list: [
                            { value: 'none', className: 'fa fa-times' },
                            { value: 'left', className: 'fa fa-align-left' },
                            { value: 'right', className: 'fa fa-align-right' }
                        ],
                    },
                    { property: 'position', type: 'select' }
                    ],
                },
                . . .
                 {
                        name: 'Extra',
                        open: false,
                        buildProps: ['transform'],
                        properties: [{
                            property: 'transform',
                            properties: [
                                { name: 'Rotate X', property: 'transform-rotate-x' },
                                { name: 'Rotate Y', property: 'transform-rotate-y' },
                                { name: 'Rotate Z', property: 'transform-rotate-z' },
                                { name: 'Scale X', property: 'transform-scale-x' },
                                { name: 'Scale Y', property: 'transform-scale-y' },
                                { name: 'Scale Z', property: 'transform-scale-z' }
                            ],
                        }]
                    }
                ]
            }

The following logging shows all the styleManagers including the Extras. console.log("StyleManager is : ", editor.StyleManager.getConfig()); I'm guessing I'm missing something but can't see in the documentation what that could be. I've also looked at the full GrapesJS demo but still can't seem to get it to show in the side panel, The Dimensions, Typography and Decorations sectors show fine though. Any guidance on this issue would be great. Thanks