Plugin extensions: Introduce new registry for added components (#91877)
* add added component registry * fix broken test * add tests for usePluginComponents hook * readd expose components * add type assertion exceptions to betterer results * use new addedComponent registry in legacy endpoints * remove unused code * cleanup * revert test code * remove commented code * wrap in try catch * pr feedback
This commit is contained in:
1 parent
419edef4dc
commit
b648ce3acf
26 files changed
+1171
-205
No files matched your search
@@ -16,6 +16,11 @@ export type GetPluginExtensionsOptions = {
|
||||
limitPerPlugin?: number;
|
||||
};
|
||||
|
||||
export type UsePluginComponentOptions = {
|
||||
extensionPointId: string;
|
||||
limitPerPlugin?: number;
|
||||
};
|
||||
|
||||
export type GetPluginExtensionsResult<T = PluginExtension> = {
|
||||
extensions: T[];
|
||||
};
|
||||
@@ -30,6 +35,11 @@ export type UsePluginComponentResult<Props = {}> = {
|
||||
isLoading: boolean;
|
||||
};
|
||||
|
||||
export type UsePluginComponentsResult<Props = {}> = {
|
||||
components: Array<React.ComponentType<Props>>;
|
||||
isLoading: boolean;
|
||||
};
|
||||
|
||||
let singleton: GetPluginExtensions | undefined;
|
||||
|
||||
export function setPluginExtensionGetter(instance: GetPluginExtensions): void {
|
||||
|
||||
Reference in new issue
Block a user