Automattic / isolated-block-editor

Repackages Gutenberg's editor playground as a full-featured multi-instance editor that does not require WordPress.
343 stars 50 forks source link

How to show Document Inspector Summary tab #234

Closed grogou closed 1 year ago

grogou commented 1 year ago

I want to have Summary tab like in Post editor. Am I need to do custom implementation or there is a way to show? Thank you! image

johngodley commented 1 year ago

You may be able to import the component from Gutenberg, otherwise it will need to be custom.

grogou commented 1 year ago

Yes I am trying to import and it is importing, but there is issue with canEdit it is false in frontend. Is it related to ISO editor config? I have copied settings from Blocks Everywhere plugin.

Thank you!

<PostVisibilityCheck
    render={ ( { canEdit } ) => (
        <PanelRow
            ref={ setPopoverAnchor }
            className="edit-post-post-visibility"
        >
            <span>{ __( 'Visibility' ) }</span>
            { ! canEdit && (
                <span>
                    <PostVisibilityLabel />
                </span>
            ) }
            { canEdit && (
                <Dropdown
                    contentClassName="edit-post-post-visibility__dialog"
                    popoverProps={ popoverProps }
                    focusOnMount
                    renderToggle={ ( { isOpen, onToggle } ) => (
                        <PostVisibilityToggle
                            isOpen={ isOpen }
                            onClick={ onToggle }
                        />
                    ) }
                    renderContent={ ( { onClose } ) => (
                        <PostVisibilityForm onClose={ onClose } />
                    ) }
                />
            ) }
        </PanelRow>
    ) }
/>
johngodley commented 1 year ago

I really couldn't say what you need to do to get the component working and it's quite a bit outside the scope of this repo. It should be noted that the ISO editor does not use @wordpress/edit-post, so anything that depends on it will need a lot of work.

grogou commented 1 year ago

And one more question, is Gutenberg use ISO editor?

johngodley commented 1 year ago

No, it is the other way round - this uses Gutenberg.

grogou commented 1 year ago

Thank you)