Plugins: Allow apps to expose components. Update the extensions API. (#87236)
* feat: introduce exposable components and update the public APIs Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * tests: fix the tests for `usePluginComponent()` I broke them when I wrapped the component with the PluginContextProvider which fetches the plugin metadata. * fix: typo --------- Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
This commit is contained in:
1 parent
27a791db12
commit
ebe42e1ada
17 files changed
+366
-38
No files matched your search
@@ -25,6 +25,11 @@ export type UsePluginExtensionsResult<T = PluginExtension> = {
|
||||
isLoading: boolean;
|
||||
};
|
||||
|
||||
export type UsePluginComponentResult<Props = {}> = {
|
||||
component: React.ComponentType<Props> | undefined | null;
|
||||
isLoading: boolean;
|
||||
};
|
||||
|
||||
let singleton: GetPluginExtensions | undefined;
|
||||
|
||||
export function setPluginExtensionGetter(instance: GetPluginExtensions): void {
|
||||
|
||||
Reference in new issue
Block a user