Skip to content

Add a tab to the "Editor tools"ย #112

@josephfusco

Description

@josephfusco

Acceptance Criteria

  • registerEditorToolsTab() exists and is callable by 3rd party plugins
  • Function handles edge cases & invalid input

Technical Details

const { registerEditorToolsTab } = WPGRAPHQL_IDE;

registerEditorToolsTab( 'my-editor-tools-tab', {
  title: 'My Tab',
  label: 'My tab does x, y and z',
  icon: () => {}, // name of icon from supported icon library or custom Icon component
  content: () => {} // callback for the content panel that opens when this tab is active
} );

If we were to use this API for document settings, it might look like this:

const { registerEditorToolsTab } = WPGRAPHQL_IDE;

registerEditorToolsTab( 'document-settings', {
  title: 'Document Settings',
  label: 'Edit settings related to this query document',
  icon: () => <SettingsIcon />,
  content: () => <DocumentSettingsFormOrWhatever />
});

Image

The list of tabs should be maintained in the Redux store, so registering a editor utility tab should modify the list of editor utility tabs in the Redux store. Similar when you call registerBlockType in Gutenberg.

Reference

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementImprovements to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions