Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review plugin containers interface configurations #10789

Open
1 task
allyoucanmap opened this issue Jan 28, 2025 · 0 comments
Open
1 task

Review plugin containers interface configurations #10789

allyoucanmap opened this issue Jan 28, 2025 · 0 comments
Assignees

Comments

@allyoucanmap
Copy link
Contributor

Description

At the moment we have plugins container with different interface configurations. A common pattern is to allow to pass a connected react component from the child plugin to the parent container but the naming is inconsistent, eg:

  • Map plugin exposes Tool property
  • TOC plugin exposes Component property
  • SidebarMenu plugin exposes tool property
  • BurgerMenu plugin exposes tool property

Following the work done after the introduction of the usePluginItems hooks we could normalize the configuration as follow:

  • Component a react component to be used inside the plugin container. Plugin container could pass specific props including an itemComponent prop as a default component for the item (eg. for toolbar or list)
  • name identifier for the injected component (optional)
  • target a string property supported by the plugin container to render the child item component in a specific section. A plugin container could implement multiple target (optional)

Common configuration already supported

  • position (optional)
  • priority (optional)
  • alwaysRender (optional)
  • doNotHide (optional) (to rename?)
{
  PluginContainerName: {
    name: "PluginContainerName",
    Component: ReactComponent,
    target: "menu-left"
  }
}

We could also deprecate previous configuration based on actions (see ToolContainer component) and update everything to the component approach

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features

Other useful information

@tdipisa tdipisa self-assigned this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants