UI Extensions: Add openInNewTab property to link extensions (#114831)

feat: add `openInNewTab` property for link extensions
This commit is contained in:
Levente Balogh
2025-12-08 12:09:56 +01:00
committed by GitHub
parent 7c5457a75e
commit 5a8a730cfe
6 changed files with 20 additions and 1 deletions
@@ -30,6 +30,7 @@ export type PluginExtensionLink = PluginExtensionBase & {
onClick?: (event?: React.MouseEvent) => void;
icon?: IconName;
category?: string;
openInNewTab?: boolean;
};
export type PluginExtensionComponentMeta = Omit<PluginExtensionComponent, 'component'>;
@@ -86,6 +87,7 @@ export type PluginExtensionAddedComponentConfig<Props = {}> = PluginExtensionCon
*/
component: React.ComponentType<Props>;
};
export type PluginExtensionAddedFunctionConfig<Signature = unknown> = PluginExtensionConfigBase & {
/**
* The target extension points where the component will be added
@@ -106,6 +108,7 @@ export type PluginAddedLinksConfigureFunc<Context extends object> = (context: Re
onClick: (event: React.MouseEvent | undefined, helpers: PluginExtensionEventHelpers<Context>) => void;
icon: IconName;
category: string;
openInNewTab: boolean;
}>
| undefined;
@@ -137,6 +140,10 @@ export type PluginExtensionAddedLinkConfig<Context extends object = object> = Pl
// (Optional) A category to be used when grouping the options in the ui
category?: string;
// (Optional) If true, opens the link in a new tab (renders with target="_blank")
// (Important: this is not guaranteed, depends on the extension point if it implements it.)
openInNewTab?: boolean;
};
export type PluginExtensionExposedComponentConfig<Props = {}> = PluginExtensionConfigBase & {