{hideDivider ? 'no-divider' : 'has-divider'}
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/components/GlobalHeaderDropdownContent.tsx b/workspaces/global-header/plugins/global-header/src/components/GlobalHeaderDropdownContent.tsx
similarity index 96%
rename from workspaces/global-header/plugins/global-header/src/alpha/components/GlobalHeaderDropdownContent.tsx
rename to workspaces/global-header/plugins/global-header/src/components/GlobalHeaderDropdownContent.tsx
index daf9f31af14..1362fcbaacf 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/components/GlobalHeaderDropdownContent.tsx
+++ b/workspaces/global-header/plugins/global-header/src/components/GlobalHeaderDropdownContent.tsx
@@ -15,7 +15,7 @@
*/
import type { DropdownEntry } from '../utils/menuItemGrouping';
-import { MenuSection } from '../../components/HeaderDropdownComponent/MenuSection';
+import { MenuSection } from './HeaderDropdownComponent/MenuSection';
/** Renders a standalone component or a data-driven `MenuSection`. */
const DropdownItem = ({
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/components/GlobalHeaderMenuItem.tsx b/workspaces/global-header/plugins/global-header/src/components/GlobalHeaderMenuItem.tsx
similarity index 96%
rename from workspaces/global-header/plugins/global-header/src/alpha/components/GlobalHeaderMenuItem.tsx
rename to workspaces/global-header/plugins/global-header/src/components/GlobalHeaderMenuItem.tsx
index f01e77dd9a2..3dc81c31a7b 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/components/GlobalHeaderMenuItem.tsx
+++ b/workspaces/global-header/plugins/global-header/src/components/GlobalHeaderMenuItem.tsx
@@ -18,12 +18,12 @@ import { Link } from '@backstage/core-components';
import MenuItem from '@mui/material/MenuItem';
-import { MenuItemLink } from '../../components/MenuItemLink/MenuItemLink';
+import { MenuItemLink } from './MenuItemLink/MenuItemLink';
/**
* Props for {@link GlobalHeaderMenuItem}.
*
- * @alpha
+ * @public
*/
export interface GlobalHeaderMenuItemProps {
/** Navigation URL. When absent the item renders as a plain action button. */
@@ -64,7 +64,7 @@ export interface GlobalHeaderMenuItemProps {
* );
* ```
*
- * @alpha
+ * @public
*/
export const GlobalHeaderMenuItem = ({
to,
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/components/HelpDropdown.tsx b/workspaces/global-header/plugins/global-header/src/components/HelpDropdown.tsx
similarity index 90%
rename from workspaces/global-header/plugins/global-header/src/alpha/components/HelpDropdown.tsx
rename to workspaces/global-header/plugins/global-header/src/components/HelpDropdown.tsx
index b7cf159fa0b..9c9f9e42e00 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/components/HelpDropdown.tsx
+++ b/workspaces/global-header/plugins/global-header/src/components/HelpDropdown.tsx
@@ -17,8 +17,8 @@
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
import SupportAgentIcon from '@mui/icons-material/SupportAgent';
-import { useTranslation } from '../../hooks/useTranslation';
-import { DropdownEmptyState } from '../../components/HeaderDropdownComponent/DropdownEmptyState';
+import { useTranslation } from '../hooks/useTranslation';
+import { DropdownEmptyState } from './HeaderDropdownComponent/DropdownEmptyState';
import { GlobalHeaderDropdown } from './GlobalHeaderDropdown';
/**
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/components/MyProfileMenuItem.tsx b/workspaces/global-header/plugins/global-header/src/components/MyProfileMenuItem.tsx
similarity index 93%
rename from workspaces/global-header/plugins/global-header/src/alpha/components/MyProfileMenuItem.tsx
rename to workspaces/global-header/plugins/global-header/src/components/MyProfileMenuItem.tsx
index 09a4b729d26..caa8bbdbf3b 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/components/MyProfileMenuItem.tsx
+++ b/workspaces/global-header/plugins/global-header/src/components/MyProfileMenuItem.tsx
@@ -22,8 +22,8 @@ import { Link } from '@backstage/core-components';
import MenuItem from '@mui/material/MenuItem';
-import { MenuItemLinkContent } from '../../components/MenuItemLink/MenuItemLinkContent';
-import { useTranslation } from '../../hooks/useTranslation';
+import { MenuItemLinkContent } from './MenuItemLink/MenuItemLinkContent';
+import { useTranslation } from '../hooks/useTranslation';
/**
* Custom component for the "My Profile" menu item.
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/components/ProfileDropdown.tsx b/workspaces/global-header/plugins/global-header/src/components/ProfileDropdown.tsx
similarity index 98%
rename from workspaces/global-header/plugins/global-header/src/alpha/components/ProfileDropdown.tsx
rename to workspaces/global-header/plugins/global-header/src/components/ProfileDropdown.tsx
index 5492f8b029c..c9595827c19 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/components/ProfileDropdown.tsx
+++ b/workspaces/global-header/plugins/global-header/src/components/ProfileDropdown.tsx
@@ -28,7 +28,7 @@ import Typography from '@mui/material/Typography';
import Box from '@mui/material/Box';
import { useTheme } from '@mui/material/styles';
-import { useTranslation } from '../../hooks/useTranslation';
+import { useTranslation } from '../hooks/useTranslation';
import { GlobalHeaderDropdown } from './GlobalHeaderDropdown';
/**
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/defaults/index.ts b/workspaces/global-header/plugins/global-header/src/defaults/index.ts
similarity index 98%
rename from workspaces/global-header/plugins/global-header/src/alpha/defaults/index.ts
rename to workspaces/global-header/plugins/global-header/src/defaults/index.ts
index e84e35fe8f7..0f8a91efc15 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/defaults/index.ts
+++ b/workspaces/global-header/plugins/global-header/src/defaults/index.ts
@@ -41,7 +41,7 @@ import {
/**
* All default toolbar component extensions.
- * @alpha
+ * @public
*/
export const defaultToolbarExtensions = [
companyLogoExtension,
@@ -58,7 +58,7 @@ export const defaultToolbarExtensions = [
/**
* All default menu item extensions.
- * @alpha
+ * @public
*/
export const defaultMenuItemExtensions = [
settingsMenuItemExtension,
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/defaults/menuItemExtensions.tsx b/workspaces/global-header/plugins/global-header/src/defaults/menuItemExtensions.tsx
similarity index 93%
rename from workspaces/global-header/plugins/global-header/src/alpha/defaults/menuItemExtensions.tsx
rename to workspaces/global-header/plugins/global-header/src/defaults/menuItemExtensions.tsx
index 11e74d7ab35..cc7f12602d0 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/defaults/menuItemExtensions.tsx
+++ b/workspaces/global-header/plugins/global-header/src/defaults/menuItemExtensions.tsx
@@ -27,15 +27,15 @@
import { GlobalHeaderMenuItemBlueprint } from '../extensions/blueprints';
-import { LogoutButton } from '../../components/LogoutButton/LogoutButton';
-import { SupportButton } from '../../components/SupportButton/SupportButton';
+import { LogoutButton } from '../components/LogoutButton/LogoutButton';
+import { SupportButton } from '../components/SupportButton/SupportButton';
import { MyProfileMenuItem } from '../components/MyProfileMenuItem';
// ---------------------------------------------------------------------------
// Profile dropdown items
// ---------------------------------------------------------------------------
-/** @alpha */
+/** @public */
export const settingsMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
name: 'settings',
params: {
@@ -48,7 +48,7 @@ export const settingsMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
},
});
-/** @alpha */
+/** @public */
export const myProfileMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
name: 'my-profile',
params: {
@@ -58,7 +58,7 @@ export const myProfileMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
},
});
-/** @alpha */
+/** @public */
export const logoutMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
name: 'logout',
params: {
@@ -72,7 +72,7 @@ export const logoutMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
// Help dropdown items
// ---------------------------------------------------------------------------
-/** @alpha */
+/** @public */
export const supportButtonMenuItemExtension =
GlobalHeaderMenuItemBlueprint.make({
name: 'support-button',
@@ -87,7 +87,7 @@ export const supportButtonMenuItemExtension =
// App launcher dropdown items
// ---------------------------------------------------------------------------
-/** @alpha */
+/** @public */
export const appLauncherDevHubMenuItemExtension =
GlobalHeaderMenuItemBlueprint.make({
name: 'app-launcher-devhub',
@@ -102,7 +102,7 @@ export const appLauncherDevHubMenuItemExtension =
},
});
-/** @alpha */
+/** @public */
export const appLauncherRhdhLocalMenuItemExtension =
GlobalHeaderMenuItemBlueprint.make({
name: 'app-launcher-rhdh-local',
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/defaults/rhdhLogo.ts b/workspaces/global-header/plugins/global-header/src/defaults/rhdhLogo.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/alpha/defaults/rhdhLogo.ts
rename to workspaces/global-header/plugins/global-header/src/defaults/rhdhLogo.ts
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/defaults/toolbarExtensions.tsx b/workspaces/global-header/plugins/global-header/src/defaults/toolbarExtensions.tsx
similarity index 81%
rename from workspaces/global-header/plugins/global-header/src/alpha/defaults/toolbarExtensions.tsx
rename to workspaces/global-header/plugins/global-header/src/defaults/toolbarExtensions.tsx
index e63925115ac..3f300b83808 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/defaults/toolbarExtensions.tsx
+++ b/workspaces/global-header/plugins/global-header/src/defaults/toolbarExtensions.tsx
@@ -22,13 +22,13 @@
import { GlobalHeaderComponentBlueprint } from '../extensions/blueprints';
-import { SearchComponent } from '../../components/SearchComponent/SearchComponent';
-import { Spacer } from '../../components/Spacer/Spacer';
-import { StarredDropdown } from '../../components/HeaderDropdownComponent/StarredDropdown';
-import { NotificationButton } from '../../components/NotificationButton/NotificationButton';
-import { Divider } from '../../components/Divider/Divider';
-import { CompanyLogo } from '../../components/CompanyLogo/CompanyLogo';
-import { HeaderIconButton } from '../../components/HeaderIconButton/HeaderIconButton';
+import { SearchComponent } from '../components/SearchComponent/SearchComponent';
+import { Spacer } from '../components/Spacer/Spacer';
+import { StarredDropdown } from '../components/HeaderDropdownComponent/StarredDropdown';
+import { NotificationButton } from '../components/NotificationButton/NotificationButton';
+import { Divider } from '../components/Divider/Divider';
+import { CompanyLogo } from '../components/CompanyLogo/CompanyLogo';
+import { HeaderIconButton } from '../components/HeaderIconButton/HeaderIconButton';
import { ProfileDropdown } from '../components/ProfileDropdown';
import { HelpDropdown } from '../components/HelpDropdown';
import { ApplicationLauncherDropdown } from '../components/ApplicationLauncherDropdown';
@@ -45,13 +45,13 @@ const SelfServiceButton = () => (
/>
);
-/** @alpha */
+/** @public */
export const companyLogoExtension = GlobalHeaderComponentBlueprint.make({
name: 'company-logo',
params: { component: CompanyLogoWrapper, priority: 200 },
});
-/** @alpha */
+/** @public */
export const searchExtension = GlobalHeaderComponentBlueprint.make({
name: 'search',
params: {
@@ -61,13 +61,13 @@ export const searchExtension = GlobalHeaderComponentBlueprint.make({
},
});
-/** @alpha */
+/** @public */
export const spacerExtension = GlobalHeaderComponentBlueprint.make({
name: 'spacer',
params: { component: Spacer, priority: 99, layout: { flexGrow: 0 } },
});
-/** @alpha */
+/** @public */
export const selfServiceButtonExtension = GlobalHeaderComponentBlueprint.make({
name: 'self-service-button',
params: {
@@ -76,38 +76,38 @@ export const selfServiceButtonExtension = GlobalHeaderComponentBlueprint.make({
},
});
-/** @alpha */
+/** @public */
export const starredDropdownExtension = GlobalHeaderComponentBlueprint.make({
name: 'starred-dropdown',
params: { component: StarredDropdown, priority: 85 },
});
-/** @alpha */
+/** @public */
export const applicationLauncherDropdownExtension =
GlobalHeaderComponentBlueprint.make({
name: 'app-launcher-dropdown',
params: { component: ApplicationLauncherDropdown, priority: 82 },
});
-/** @alpha */
+/** @public */
export const helpDropdownExtension = GlobalHeaderComponentBlueprint.make({
name: 'help-dropdown',
params: { component: HelpDropdown, priority: 80 },
});
-/** @alpha */
+/** @public */
export const notificationButtonExtension = GlobalHeaderComponentBlueprint.make({
name: 'notification-button',
params: { component: NotificationButton, priority: 70 },
});
-/** @alpha */
+/** @public */
export const dividerExtension = GlobalHeaderComponentBlueprint.make({
name: 'divider',
params: { component: Divider, priority: 50 },
});
-/** @alpha */
+/** @public */
export const profileDropdownExtension = GlobalHeaderComponentBlueprint.make({
name: 'profile-dropdown',
params: { component: ProfileDropdown, priority: 10 },
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/extensions/GlobalHeaderContext.test.tsx b/workspaces/global-header/plugins/global-header/src/extensions/GlobalHeaderContext.test.tsx
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/alpha/extensions/GlobalHeaderContext.test.tsx
rename to workspaces/global-header/plugins/global-header/src/extensions/GlobalHeaderContext.test.tsx
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/extensions/GlobalHeaderContext.tsx b/workspaces/global-header/plugins/global-header/src/extensions/GlobalHeaderContext.tsx
similarity index 76%
rename from workspaces/global-header/plugins/global-header/src/alpha/extensions/GlobalHeaderContext.tsx
rename to workspaces/global-header/plugins/global-header/src/extensions/GlobalHeaderContext.tsx
index 7fa15236c4f..bddce4673a2 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/extensions/GlobalHeaderContext.tsx
+++ b/workspaces/global-header/plugins/global-header/src/extensions/GlobalHeaderContext.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import { createContext, useContext, useMemo } from 'react';
+import React, { createContext, useContext, useMemo } from 'react';
import type {
GlobalHeaderComponentData,
@@ -26,10 +26,20 @@ interface GlobalHeaderContextValue {
menuItems: GlobalHeaderMenuItemData[];
}
-const GlobalHeaderContext = createContext
({
- components: [],
- menuItems: [],
-});
+const CONTEXT_KEY = '__global_header_context__' as keyof typeof globalThis;
+
+function getOrCreateContext(): React.Context {
+ const existing = (globalThis as any)[CONTEXT_KEY];
+ if (existing) return existing as React.Context;
+ const ctx = createContext({
+ components: [],
+ menuItems: [],
+ });
+ (globalThis as any)[CONTEXT_KEY] = ctx;
+ return ctx;
+}
+
+const GlobalHeaderContext = getOrCreateContext();
/**
* Provider that distributes collected header extension data to child components.
@@ -56,7 +66,7 @@ export const GlobalHeaderProvider = ({
/**
* Returns all toolbar-level header components, sorted by priority (highest first).
*
- * @alpha
+ * @public
*/
export function useGlobalHeaderComponents(): GlobalHeaderComponentData[] {
return useContext(GlobalHeaderContext).components;
@@ -65,7 +75,7 @@ export function useGlobalHeaderComponents(): GlobalHeaderComponentData[] {
/**
* Returns menu items for a specific dropdown target, sorted by priority (highest first).
*
- * @alpha
+ * @public
*/
export function useGlobalHeaderMenuItems(
target: string,
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/extensions/blueprints.tsx b/workspaces/global-header/plugins/global-header/src/extensions/blueprints.tsx
similarity index 95%
rename from workspaces/global-header/plugins/global-header/src/alpha/extensions/blueprints.tsx
rename to workspaces/global-header/plugins/global-header/src/extensions/blueprints.tsx
index a3b172c5f49..3657e987147 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/extensions/blueprints.tsx
+++ b/workspaces/global-header/plugins/global-header/src/extensions/blueprints.tsx
@@ -20,10 +20,10 @@ import { createExtensionBlueprint } from '@backstage/frontend-plugin-api';
import IconButton from '@mui/material/IconButton';
import Tooltip from '@mui/material/Tooltip';
-import { HeaderIconButton } from '../../components/HeaderIconButton/HeaderIconButton';
-import { HeaderIcon } from '../../components/HeaderIcon/HeaderIcon';
-import { useTranslation } from '../../hooks/useTranslation';
-import { translateWithFallback } from '../../utils/translationUtils';
+import { HeaderIconButton } from '../components/HeaderIconButton/HeaderIconButton';
+import { HeaderIcon } from '../components/HeaderIcon/HeaderIcon';
+import { useTranslation } from '../hooks/useTranslation';
+import { translateWithFallback } from '../utils/translationUtils';
import {
globalHeaderComponentDataRef,
@@ -37,7 +37,7 @@ import {
* (`icon`, `title`, `link`/`onClick`) and let the framework render a
* consistent `HeaderIconButton` automatically (tier 1).
*
- * @alpha
+ * @public
*/
export interface ToolbarComponentParams {
icon?: string;
@@ -67,7 +67,7 @@ export interface ToolbarComponentParams {
* Items with data fields (with or without a custom component) are grouped
* by `sectionLabel` and rendered inside `MenuSection`.
*
- * @alpha
+ * @public
*/
export interface MenuItemParams {
target: string;
@@ -156,7 +156,7 @@ function createDataDrivenToolbarComponent(
* priority: 200
* ```
*
- * @alpha
+ * @public
*/
export const GlobalHeaderComponentBlueprint = createExtensionBlueprint({
kind: 'gh-component',
@@ -206,7 +206,7 @@ export const GlobalHeaderComponentBlueprint = createExtensionBlueprint({
* sectionLabel: mySection
* ```
*
- * @alpha
+ * @public
*/
export const GlobalHeaderMenuItemBlueprint = createExtensionBlueprint({
kind: 'gh-menu-item',
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/extensions/dataRefs.ts b/workspaces/global-header/plugins/global-header/src/extensions/dataRefs.ts
similarity index 98%
rename from workspaces/global-header/plugins/global-header/src/alpha/extensions/dataRefs.ts
rename to workspaces/global-header/plugins/global-header/src/extensions/dataRefs.ts
index 173f2fa8916..4a6494387d7 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/extensions/dataRefs.ts
+++ b/workspaces/global-header/plugins/global-header/src/extensions/dataRefs.ts
@@ -25,7 +25,7 @@ import type {
* Extension data ref carrying toolbar component data from a plugin to the
* global header wrapper.
*
- * @alpha
+ * @public
*/
export const globalHeaderComponentDataRef =
createExtensionDataRef().with({
@@ -36,7 +36,7 @@ export const globalHeaderComponentDataRef =
* Extension data ref carrying menu item data from a plugin to the
* global header wrapper.
*
- * @alpha
+ * @public
*/
export const globalHeaderMenuItemDataRef =
createExtensionDataRef().with({
diff --git a/workspaces/global-header/plugins/global-header/src/alpha/extensions/globalHeaderModule.tsx b/workspaces/global-header/plugins/global-header/src/extensions/globalHeaderModule.tsx
similarity index 99%
rename from workspaces/global-header/plugins/global-header/src/alpha/extensions/globalHeaderModule.tsx
rename to workspaces/global-header/plugins/global-header/src/extensions/globalHeaderModule.tsx
index e47c1fd9301..a4938a83799 100644
--- a/workspaces/global-header/plugins/global-header/src/alpha/extensions/globalHeaderModule.tsx
+++ b/workspaces/global-header/plugins/global-header/src/extensions/globalHeaderModule.tsx
@@ -119,7 +119,7 @@ const globalHeaderExtension = AppRootWrapperBlueprint.makeWithOverrides({
* marked `internal: true`, restricting attachments to extensions from the
* `app` plugin.
*
- * @alpha
+ * @public
*/
export const globalHeaderModule = createFrontendModule({
pluginId: 'app',
diff --git a/workspaces/global-header/plugins/global-header/src/globalHeaderModuleExport.ts b/workspaces/global-header/plugins/global-header/src/globalHeaderModuleExport.ts
new file mode 100644
index 00000000000..2ea291b7b43
--- /dev/null
+++ b/workspaces/global-header/plugins/global-header/src/globalHeaderModuleExport.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export { globalHeaderModule as default } from './extensions/globalHeaderModule';
diff --git a/workspaces/global-header/plugins/global-header/src/globalHeaderTranslationsModuleExport.ts b/workspaces/global-header/plugins/global-header/src/globalHeaderTranslationsModuleExport.ts
new file mode 100644
index 00000000000..13a0aa375ff
--- /dev/null
+++ b/workspaces/global-header/plugins/global-header/src/globalHeaderTranslationsModuleExport.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export { globalHeaderTranslationsModule as default } from './index';
diff --git a/workspaces/global-header/plugins/global-header/src/index.ts b/workspaces/global-header/plugins/global-header/src/index.ts
index 33fb9e71d0a..adeb98f314f 100644
--- a/workspaces/global-header/plugins/global-header/src/index.ts
+++ b/workspaces/global-header/plugins/global-header/src/index.ts
@@ -13,6 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/**
+ * New Frontend System API surface for the global header plugin.
+ *
+ * @public
+ * @packageDocumentation
+ */
+
import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';
ClassNameGenerator.configure(componentName => {
@@ -21,6 +29,77 @@ ClassNameGenerator.configure(componentName => {
: `v5-${componentName}`;
});
-export * from './plugin';
+import { createFrontendModule } from '@backstage/frontend-plugin-api';
+import { TranslationBlueprint } from '@backstage/plugin-app-react';
+import { globalHeaderTranslations } from './translations';
+
+// ── Core: plugin + module ──────────────────────────────────────────────
+
+export { default } from './plugin';
+export { globalHeaderModule } from './extensions/globalHeaderModule';
+
+// ── Blueprints: for other plugins to contribute header items ───────────
+
+export {
+ GlobalHeaderComponentBlueprint,
+ GlobalHeaderMenuItemBlueprint,
+} from './extensions/blueprints';
+export type {
+ ToolbarComponentParams,
+ MenuItemParams,
+} from './extensions/blueprints';
+
+// ── Data refs ──────────────────────────────────────────────────────────
+
+export {
+ globalHeaderComponentDataRef,
+ globalHeaderMenuItemDataRef,
+} from './extensions/dataRefs';
+
+// ── Context hooks for custom dropdown components ───────────────────────
+
+export {
+ useGlobalHeaderComponents,
+ useGlobalHeaderMenuItems,
+} from './extensions/GlobalHeaderContext';
-export * from './translations';
+// ── Types ──────────────────────────────────────────────────────────────
+
+export type {
+ GlobalHeaderComponentData,
+ GlobalHeaderMenuItemData,
+} from './types';
+
+// ── Building block components for plugin authors ───────────────────────
+
+export { HeaderIconButton as GlobalHeaderIconButton } from './components/HeaderIconButton/HeaderIconButton';
+export type { HeaderIconButtonProps } from './components/HeaderIconButton/HeaderIconButton';
+export { GlobalHeaderMenuItem } from './components/GlobalHeaderMenuItem';
+export type { GlobalHeaderMenuItemProps } from './components/GlobalHeaderMenuItem';
+export { GlobalHeaderDropdown } from './components/GlobalHeaderDropdown';
+export type { GlobalHeaderDropdownProps } from './components/GlobalHeaderDropdown';
+
+// ── Default extensions (collections + individual for cherry-picking) ───
+
+export * from './defaults';
+
+// ── Translations ───────────────────────────────────────────────────────
+
+export { globalHeaderTranslationRef } from './translations/ref';
+export { globalHeaderTranslations } from './translations';
+
+const globalHeaderTranslation = TranslationBlueprint.make({
+ name: 'global-header-translations',
+ params: {
+ resource: globalHeaderTranslations,
+ },
+});
+
+/**
+ * App module that registers global header translations.
+ * @public
+ */
+export const globalHeaderTranslationsModule = createFrontendModule({
+ pluginId: 'app',
+ extensions: [globalHeaderTranslation],
+});
diff --git a/workspaces/global-header/plugins/global-header/src/legacy.ts b/workspaces/global-header/plugins/global-header/src/legacy.ts
new file mode 100644
index 00000000000..9ef3c0d01c1
--- /dev/null
+++ b/workspaces/global-header/plugins/global-header/src/legacy.ts
@@ -0,0 +1,34 @@
+/*
+ * Copyright Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Legacy frontend system API surface for the global header plugin.
+ *
+ * @deprecated Use the root import instead: `import from '@red-hat-developer-hub/backstage-plugin-global-header'`
+ * @packageDocumentation
+ */
+
+import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';
+
+ClassNameGenerator.configure(componentName => {
+ return componentName.startsWith('v5-')
+ ? componentName
+ : `v5-${componentName}`;
+});
+
+export * from './legacy/plugin';
+
+export * from './translations';
diff --git a/workspaces/global-header/plugins/global-header/src/legacy/components/GlobalHeader.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/GlobalHeader.tsx
new file mode 100644
index 00000000000..b9cd15f491a
--- /dev/null
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/GlobalHeader.tsx
@@ -0,0 +1,28 @@
+/*
+ * Copyright Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { useGlobalHeaderMountPoints } from '../hooks/useGlobalHeaderMountPoints';
+import { GlobalHeaderComponent } from './GlobalHeaderComponent';
+
+export const GlobalHeader = () => {
+ const allGlobalHeaderMountPoints = useGlobalHeaderMountPoints();
+
+ return (
+
+ );
+};
diff --git a/workspaces/global-header/plugins/global-header/src/components/GlobalHeaderComponent.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/GlobalHeaderComponent.tsx
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/components/GlobalHeaderComponent.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/GlobalHeaderComponent.tsx
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.test.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ApplicationLauncherDropdown.test.tsx
similarity index 90%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.test.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ApplicationLauncherDropdown.test.tsx
index a0ba476423c..549df8ca9a0 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.test.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ApplicationLauncherDropdown.test.tsx
@@ -18,12 +18,12 @@ import { renderInTestApp } from '@backstage/test-utils';
import {
MockTrans,
mockUseTranslation,
-} from '../../test-utils/mockTranslations';
+} from '../../../test-utils/mockTranslations';
import { ApplicationLauncherDropdown } from './ApplicationLauncherDropdown';
-import { useDropdownManager } from '../../hooks';
+import { useDropdownManager } from '../../../hooks';
import { useApplicationLauncherDropdownMountPoints } from '../../hooks/useApplicationLauncherDropdownMountPoints';
-jest.mock('../../hooks', () => ({
+jest.mock('../../../hooks', () => ({
useDropdownManager: jest.fn(),
}));
@@ -32,11 +32,11 @@ jest.mock('../../hooks/useApplicationLauncherDropdownMountPoints', () => ({
}));
// Mock translation hooks
-jest.mock('../../hooks/useTranslation', () => ({
+jest.mock('../../../hooks/useTranslation', () => ({
useTranslation: mockUseTranslation,
}));
-jest.mock('../../components/Trans', () => ({
+jest.mock('../../../components/Trans', () => ({
Trans: MockTrans,
}));
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ApplicationLauncherDropdown.tsx
similarity index 88%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ApplicationLauncherDropdown.tsx
index 0ddf4daf8d0..4ee012405e9 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ApplicationLauncherDropdown.tsx
@@ -19,11 +19,11 @@ import AppsIcon from '@mui/icons-material/Apps';
import AppRegistrationIcon from '@mui/icons-material/AppRegistration';
import { useApplicationLauncherDropdownMountPoints } from '../../hooks/useApplicationLauncherDropdownMountPoints';
-import { useDropdownManager } from '../../hooks';
-import { HeaderDropdownComponent } from './HeaderDropdownComponent';
-import { MenuSection } from './MenuSection';
-import { DropdownEmptyState } from './DropdownEmptyState';
-import { useTranslation } from '../../hooks/useTranslation';
+import { useDropdownManager } from '../../../hooks';
+import { HeaderDropdownComponent } from '../../../components/HeaderDropdownComponent/HeaderDropdownComponent';
+import { MenuSection } from '../../../components/HeaderDropdownComponent/MenuSection';
+import { DropdownEmptyState } from '../../../components/HeaderDropdownComponent/DropdownEmptyState';
+import { useTranslation } from '../../../hooks/useTranslation';
export const ApplicationLauncherDropdown = () => {
const { anchorEl, handleOpen, handleClose } = useDropdownManager();
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/CreateDropdown.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/CreateDropdown.tsx
similarity index 88%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/CreateDropdown.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/CreateDropdown.tsx
index b301afcfbbc..68120cf0f86 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/CreateDropdown.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/CreateDropdown.tsx
@@ -19,11 +19,11 @@ import type { CSSProperties, ComponentType } from 'react';
import ArrowDropDownOutlinedIcon from '@mui/icons-material/ArrowDropDownOutlined';
-import { MenuItemConfig } from './MenuSection';
+import { MenuItemConfig } from '../../../components/HeaderDropdownComponent/MenuSection';
import { useCreateDropdownMountPoints } from '../../hooks/useCreateDropdownMountPoints';
-import { useTranslation } from '../../hooks/useTranslation';
-import { useDropdownManager } from '../../hooks';
-import { HeaderDropdownComponent } from './HeaderDropdownComponent';
+import { useTranslation } from '../../../hooks/useTranslation';
+import { useDropdownManager } from '../../../hooks';
+import { HeaderDropdownComponent } from '../../../components/HeaderDropdownComponent/HeaderDropdownComponent';
import Box from '@mui/material/Box';
/**
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/HelpDropdown.test.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/HelpDropdown.test.tsx
similarity index 97%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/HelpDropdown.test.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/HelpDropdown.test.tsx
index 138fee7ba21..03b7a5e814c 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/HelpDropdown.test.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/HelpDropdown.test.tsx
@@ -18,13 +18,13 @@ import { renderInTestApp } from '@backstage/test-utils';
import {
MockTrans,
mockUseTranslation,
-} from '../../test-utils/mockTranslations';
+} from '../../../test-utils/mockTranslations';
import { HelpDropdown } from './HelpDropdown';
-import { useDropdownManager } from '../../hooks';
+import { useDropdownManager } from '../../../hooks';
import { useHelpDropdownMountPoints } from '../../hooks/useHelpDropdownMountPoints';
import { HelpDropdownMountPoint } from '../../types';
-jest.mock('../../hooks', () => ({
+jest.mock('../../../hooks', () => ({
useDropdownManager: jest.fn(),
}));
@@ -33,11 +33,11 @@ jest.mock('../../hooks/useHelpDropdownMountPoints', () => ({
}));
// Mock translation hooks
-jest.mock('../../hooks/useTranslation', () => ({
+jest.mock('../../../hooks/useTranslation', () => ({
useTranslation: mockUseTranslation,
}));
-jest.mock('../../components/Trans', () => ({
+jest.mock('../../../components/Trans', () => ({
Trans: MockTrans,
}));
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/HelpDropdown.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/HelpDropdown.tsx
similarity index 88%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/HelpDropdown.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/HelpDropdown.tsx
index e7dc233476e..1acec2a2b28 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/HelpDropdown.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/HelpDropdown.tsx
@@ -17,16 +17,16 @@
import { useEffect, useMemo, useRef } from 'react';
import type { ComponentType, CSSProperties } from 'react';
import type { MenuItemProps } from '@mui/material/MenuItem';
-import { HeaderDropdownComponent } from './HeaderDropdownComponent';
-import { useDropdownManager } from '../../hooks';
+import { HeaderDropdownComponent } from '../../../components/HeaderDropdownComponent/HeaderDropdownComponent';
+import { useDropdownManager } from '../../../hooks';
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
import { useHelpDropdownMountPoints } from '../../hooks/useHelpDropdownMountPoints';
-import { MenuSection } from './MenuSection';
-import { DropdownEmptyState } from './DropdownEmptyState';
+import { MenuSection } from '../../../components/HeaderDropdownComponent/MenuSection';
+import { DropdownEmptyState } from '../../../components/HeaderDropdownComponent/DropdownEmptyState';
import SupportAgentIcon from '@mui/icons-material/SupportAgent';
-import { useValidComponentTracker } from '../../hooks/useValidComponentTracker';
-import { useTranslation } from '../../hooks/useTranslation';
-import type { MenuItemLinkProps } from '../MenuItemLink/MenuItemLink';
+import { useValidComponentTracker } from '../../../hooks/useValidComponentTracker';
+import { useTranslation } from '../../../hooks/useTranslation';
+import type { MenuItemLinkProps } from '../../../components/MenuItemLink/MenuItemLink';
/**
* @public
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ProfileDropdown.test.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ProfileDropdown.test.tsx
similarity index 97%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ProfileDropdown.test.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ProfileDropdown.test.tsx
index 5b554cf18a5..c9011d6bab8 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ProfileDropdown.test.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ProfileDropdown.test.tsx
@@ -22,7 +22,7 @@ import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import {
MockTrans,
mockUseTranslation,
-} from '../../test-utils/mockTranslations';
+} from '../../../test-utils/mockTranslations';
import { ProfileDropdown } from './ProfileDropdown';
jest.mock('@backstage/plugin-user-settings', () => ({
@@ -30,11 +30,11 @@ jest.mock('@backstage/plugin-user-settings', () => ({
}));
// Mock translation hooks
-jest.mock('../../hooks/useTranslation', () => ({
+jest.mock('../../../hooks/useTranslation', () => ({
useTranslation: mockUseTranslation,
}));
-jest.mock('../../components/Trans', () => ({
+jest.mock('../../../components/Trans', () => ({
Trans: MockTrans,
}));
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ProfileDropdown.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ProfileDropdown.tsx
similarity index 94%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ProfileDropdown.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ProfileDropdown.tsx
index 3dedf8c5adf..c111aac8bce 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/ProfileDropdown.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/ProfileDropdown.tsx
@@ -27,12 +27,15 @@ import Typography from '@mui/material/Typography';
import { lighten } from '@mui/material/styles';
import Box from '@mui/material/Box';
-import { MenuItemConfig, MenuSection } from './MenuSection';
-import { HeaderDropdownComponent } from './HeaderDropdownComponent';
+import {
+ MenuItemConfig,
+ MenuSection,
+} from '../../../components/HeaderDropdownComponent/MenuSection';
+import { HeaderDropdownComponent } from '../../../components/HeaderDropdownComponent/HeaderDropdownComponent';
import { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints';
-import { useDropdownManager } from '../../hooks';
-import { useTranslation } from '../../hooks/useTranslation';
-import { translateWithFallback } from '../../utils/translationUtils';
+import { useDropdownManager } from '../../../hooks';
+import { useTranslation } from '../../../hooks/useTranslation';
+import { translateWithFallback } from '../../../utils/translationUtils';
/**
* @public
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/RegisterAComponentSection.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/RegisterAComponentSection.tsx
similarity index 85%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/RegisterAComponentSection.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/RegisterAComponentSection.tsx
index 130d75ec72a..401456b241e 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/RegisterAComponentSection.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/RegisterAComponentSection.tsx
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import type { ComponentType } from 'react';
-import { MenuSection } from './MenuSection';
-import { MenuItemLink } from '../MenuItemLink/MenuItemLink';
-import { useTranslation } from '../../hooks/useTranslation';
+import { MenuSection } from '../../../components/HeaderDropdownComponent/MenuSection';
+import { MenuItemLink } from '../../../components/MenuItemLink/MenuItemLink';
+import { useTranslation } from '../../../hooks/useTranslation';
/**
* Register A Component Section properties
diff --git a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/SoftwareTemplatesSection.tsx b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/SoftwareTemplatesSection.tsx
similarity index 93%
rename from workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/SoftwareTemplatesSection.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/SoftwareTemplatesSection.tsx
index c44b0204259..e7b99c7a745 100644
--- a/workspaces/global-header/plugins/global-header/src/components/HeaderDropdownComponent/SoftwareTemplatesSection.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/components/HeaderDropdownComponent/SoftwareTemplatesSection.tsx
@@ -25,9 +25,9 @@ import Box from '@mui/material/Box';
import Divider from '@mui/material/Divider';
import Typography from '@mui/material/Typography';
-import { MenuSection } from './MenuSection';
-import { MenuItemLink } from '../MenuItemLink/MenuItemLink';
-import { useTranslation } from '../../hooks/useTranslation';
+import { MenuSection } from '../../../components/HeaderDropdownComponent/MenuSection';
+import { MenuItemLink } from '../../../components/MenuItemLink/MenuItemLink';
+import { useTranslation } from '../../../hooks/useTranslation';
/**
* Software Templates Section properties
diff --git a/workspaces/global-header/plugins/global-header/src/components/index.ts b/workspaces/global-header/plugins/global-header/src/legacy/components/index.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/components/index.ts
rename to workspaces/global-header/plugins/global-header/src/legacy/components/index.ts
diff --git a/workspaces/global-header/plugins/global-header/src/defaultMountPoints/defaultMountPoints.tsx b/workspaces/global-header/plugins/global-header/src/legacy/defaultMountPoints/defaultMountPoints.tsx
similarity index 97%
rename from workspaces/global-header/plugins/global-header/src/defaultMountPoints/defaultMountPoints.tsx
rename to workspaces/global-header/plugins/global-header/src/legacy/defaultMountPoints/defaultMountPoints.tsx
index 709812be39d..fe55c86e372 100644
--- a/workspaces/global-header/plugins/global-header/src/defaultMountPoints/defaultMountPoints.tsx
+++ b/workspaces/global-header/plugins/global-header/src/legacy/defaultMountPoints/defaultMountPoints.tsx
@@ -14,13 +14,13 @@
* limitations under the License.
*/
import type { ComponentType } from 'react';
-import { LogoutButton } from '../components/LogoutButton/LogoutButton';
+import { LogoutButton } from '../../components/LogoutButton/LogoutButton';
import { ProfileDropdown } from '../components/HeaderDropdownComponent/ProfileDropdown';
import { RegisterAComponentSection } from '../components/HeaderDropdownComponent/RegisterAComponentSection';
import { SoftwareTemplatesSection } from '../components/HeaderDropdownComponent/SoftwareTemplatesSection';
-import { SearchComponent } from '../components/SearchComponent/SearchComponent';
-import { HeaderIconButton } from '../components/HeaderIconButton/HeaderIconButton';
-import { SupportButton } from '../components/SupportButton/SupportButton';
+import { SearchComponent } from '../../components/SearchComponent/SearchComponent';
+import { HeaderIconButton } from '../../components/HeaderIconButton/HeaderIconButton';
+import { SupportButton } from '../../components/SupportButton/SupportButton';
import {
ApplicationLauncherDropdownMountPoint,
CreateDropdownMountPoint,
@@ -28,13 +28,13 @@ import {
HelpDropdownMountPoint,
ProfileDropdownMountPoint,
} from '../types';
-import { NotificationButton } from '../components/NotificationButton/NotificationButton';
-import { Divider } from '../components/Divider/Divider';
-import { MenuItemLink } from '../components/MenuItemLink/MenuItemLink';
-import { Spacer } from '../components/Spacer/Spacer';
-import { StarredDropdown } from '../components/HeaderDropdownComponent/StarredDropdown';
+import { NotificationButton } from '../../components/NotificationButton/NotificationButton';
+import { Divider } from '../../components/Divider/Divider';
+import { MenuItemLink } from '../../components/MenuItemLink/MenuItemLink';
+import { Spacer } from '../../components/Spacer/Spacer';
+import { StarredDropdown } from '../../components/HeaderDropdownComponent/StarredDropdown';
import { ApplicationLauncherDropdown } from '../components/HeaderDropdownComponent/ApplicationLauncherDropdown';
-import { CompanyLogo } from '../components/CompanyLogo/CompanyLogo';
+import { CompanyLogo } from '../../components/CompanyLogo/CompanyLogo';
import { HelpDropdown } from '../components/HeaderDropdownComponent/HelpDropdown';
/**
diff --git a/workspaces/global-header/plugins/global-header/src/hooks/useApplicationLauncherDropdownMountPoints.ts b/workspaces/global-header/plugins/global-header/src/legacy/hooks/useApplicationLauncherDropdownMountPoints.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/hooks/useApplicationLauncherDropdownMountPoints.ts
rename to workspaces/global-header/plugins/global-header/src/legacy/hooks/useApplicationLauncherDropdownMountPoints.ts
diff --git a/workspaces/global-header/plugins/global-header/src/hooks/useCreateDropdownMountPoints.ts b/workspaces/global-header/plugins/global-header/src/legacy/hooks/useCreateDropdownMountPoints.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/hooks/useCreateDropdownMountPoints.ts
rename to workspaces/global-header/plugins/global-header/src/legacy/hooks/useCreateDropdownMountPoints.ts
diff --git a/workspaces/global-header/plugins/global-header/src/hooks/useGlobalHeaderMountPoints.ts b/workspaces/global-header/plugins/global-header/src/legacy/hooks/useGlobalHeaderMountPoints.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/hooks/useGlobalHeaderMountPoints.ts
rename to workspaces/global-header/plugins/global-header/src/legacy/hooks/useGlobalHeaderMountPoints.ts
diff --git a/workspaces/global-header/plugins/global-header/src/hooks/useHelpDropdownMountPoints.ts b/workspaces/global-header/plugins/global-header/src/legacy/hooks/useHelpDropdownMountPoints.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/hooks/useHelpDropdownMountPoints.ts
rename to workspaces/global-header/plugins/global-header/src/legacy/hooks/useHelpDropdownMountPoints.ts
diff --git a/workspaces/global-header/plugins/global-header/src/hooks/useProfileDropdownMountPoints.ts b/workspaces/global-header/plugins/global-header/src/legacy/hooks/useProfileDropdownMountPoints.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/hooks/useProfileDropdownMountPoints.ts
rename to workspaces/global-header/plugins/global-header/src/legacy/hooks/useProfileDropdownMountPoints.ts
diff --git a/workspaces/global-header/plugins/global-header/src/plugin.test.ts b/workspaces/global-header/plugins/global-header/src/legacy/plugin.test.ts
similarity index 100%
rename from workspaces/global-header/plugins/global-header/src/plugin.test.ts
rename to workspaces/global-header/plugins/global-header/src/legacy/plugin.test.ts
diff --git a/workspaces/global-header/plugins/global-header/src/legacy/plugin.ts b/workspaces/global-header/plugins/global-header/src/legacy/plugin.ts
new file mode 100644
index 00000000000..130e6f7d7fe
--- /dev/null
+++ b/workspaces/global-header/plugins/global-header/src/legacy/plugin.ts
@@ -0,0 +1,430 @@
+/*
+ * Copyright Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { ComponentType } from 'react';
+
+import {
+ createPlugin,
+ createComponentExtension,
+} from '@backstage/core-plugin-api';
+
+import { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';
+import { MenuItemLinkProps } from '../components/MenuItemLink/MenuItemLink';
+import { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';
+import { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';
+import { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';
+import { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';
+import { SupportButtonProps } from '../components/SupportButton/SupportButton';
+import { HelpDropdownProps } from './components/HeaderDropdownComponent/HelpDropdown';
+import { globalHeaderTranslationRef } from '../translations';
+
+export type { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';
+
+export type { HeaderButtonProps } from '../components/HeaderButton/HeaderButton';
+export type { HeaderIconProps } from '../components/HeaderIcon/HeaderIcon';
+export type { HeaderIconButtonProps } from '../components/HeaderIconButton/HeaderIconButton';
+export type { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';
+export type { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';
+export type { HelpDropdownProps } from './components/HeaderDropdownComponent/HelpDropdown';
+
+export type { MenuItemLinkProps } from '../components/MenuItemLink/MenuItemLink';
+export type { MenuItemConfig } from '../components/HeaderDropdownComponent/MenuSection';
+export type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';
+export type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';
+export type { DividerProps } from '../components/Divider/Divider';
+export type { SpacerProps } from '../components/Spacer/Spacer';
+export type { SupportButtonProps } from '../components/SupportButton/SupportButton';
+export type { NotificationButtonProps } from '../components/NotificationButton/NotificationButton';
+export type {
+ LogoURLs,
+ CompanyLogoProps,
+} from '../components/CompanyLogo/CompanyLogo';
+
+export type {
+ NotificationBannerProps,
+ NotificationBannerDismiss,
+} from '../components/NotificationBanner';
+
+export type {
+ GlobalHeaderComponentMountPoint,
+ GlobalHeaderComponentMountPointConfig,
+} from './types';
+
+export { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints';
+
+/**
+ * Global Header Plugin
+ *
+ * @public
+ */
+export const globalHeaderPlugin = createPlugin({
+ id: 'global-header',
+ __experimentalTranslations: {
+ availableLanguages: ['en', 'de', 'es', 'fr', 'it', 'ja'],
+ resources: [globalHeaderTranslationRef],
+ },
+} as any);
+
+/**
+ * Global Header
+ *
+ * @public
+ */
+export const GlobalHeader = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'GlobalHeader',
+ component: {
+ lazy: () => import('./components/GlobalHeader').then(m => m.GlobalHeader),
+ },
+ }),
+);
+
+/**
+ * Global Header Component
+ *
+ * @public
+ */
+export const GlobalHeaderComponent: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'GlobalHeaderComponent',
+ component: {
+ lazy: () =>
+ import('./components/GlobalHeaderComponent').then(
+ m => m.GlobalHeaderComponent,
+ ),
+ },
+ }),
+ );
+
+/**
+ * @public
+ */
+export const HeaderButton = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'HeaderButton',
+ component: {
+ lazy: () =>
+ import('../components/HeaderButton/HeaderButton').then(
+ m => m.HeaderButton,
+ ),
+ },
+ }),
+);
+
+/**
+ * @public
+ */
+export const HeaderIcon = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'HeaderIcon',
+ component: {
+ lazy: () =>
+ import('../components/HeaderIcon/HeaderIcon').then(m => m.HeaderIcon),
+ },
+ }),
+);
+
+/**
+ * @public
+ */
+export const HeaderIconButton = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'HeaderIconButton',
+ component: {
+ lazy: () =>
+ import('../components/HeaderIconButton/HeaderIconButton').then(
+ m => m.HeaderIconButton,
+ ),
+ },
+ }),
+);
+
+/**
+ * Search Component
+ *
+ * @public
+ */
+export const SearchComponent: ComponentType = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'SearchComponent',
+ component: {
+ lazy: () =>
+ import('../components/SearchComponent/SearchComponent').then(
+ m => m.SearchComponent,
+ ),
+ },
+ }),
+);
+
+/**
+ * Create Dropdown
+ *
+ * @public
+ */
+export const CreateDropdown: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'CreateDropdown',
+ component: {
+ lazy: () =>
+ import('./components/HeaderDropdownComponent/CreateDropdown').then(
+ m => m.CreateDropdown,
+ ),
+ },
+ }),
+ );
+
+/**
+ * Profile Dropdown
+ *
+ * @public
+ */
+export const ProfileDropdown: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'ProfileDropdown',
+ component: {
+ lazy: () =>
+ import('./components/HeaderDropdownComponent/ProfileDropdown').then(
+ m => m.ProfileDropdown,
+ ),
+ },
+ }),
+ );
+
+/**
+ * Help Dropdown
+ *
+ * @public
+ */
+export const HelpDropdown: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'HelpDropdown',
+ component: {
+ lazy: () =>
+ import('./components/HeaderDropdownComponent/HelpDropdown').then(
+ m => m.HelpDropdown,
+ ),
+ },
+ }),
+ );
+
+/**
+ * Software Templates List
+ *
+ * @public
+ */
+export const SoftwareTemplatesSection: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'SoftwareTemplatesSection',
+ component: {
+ lazy: () =>
+ import(
+ './components/HeaderDropdownComponent/SoftwareTemplatesSection'
+ ).then(m => m.SoftwareTemplatesSection),
+ },
+ }),
+ );
+
+/**
+ * Register A Component Link
+ *
+ * @public
+ */
+export const RegisterAComponentSection: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'RegisterAComponentSection',
+ component: {
+ lazy: () =>
+ import(
+ './components/HeaderDropdownComponent/RegisterAComponentSection'
+ ).then(m => m.RegisterAComponentSection),
+ },
+ }),
+ );
+
+/**
+ * Header Link
+ *
+ * @public
+ */
+export const MenuItemLink: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'MenuItemLink',
+ component: {
+ lazy: () =>
+ import('../components/MenuItemLink/MenuItemLink').then(
+ m => m.MenuItemLink,
+ ),
+ },
+ }),
+ );
+
+/**
+ * Header Logout Button
+ *
+ * @public
+ */
+export const LogoutButton: ComponentType = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'LogoutButton',
+ component: {
+ lazy: () =>
+ import('../components/LogoutButton/LogoutButton').then(
+ m => m.LogoutButton,
+ ),
+ },
+ }),
+);
+
+/**
+ * Spacer component that allow users to add a flexible spacing between components.
+ *
+ * Supports two props: `growFactor` with default 1 and `minWidth` width default 8 pixels.
+ *
+ * @public
+ */
+export const Spacer = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'Spacer',
+ component: {
+ lazy: () => import('../components/Spacer/Spacer').then(m => m.Spacer),
+ },
+ }),
+);
+
+/**
+ * @public
+ */
+export const Divider = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'Divider',
+ component: {
+ lazy: () => import('../components/Divider/Divider').then(m => m.Divider),
+ },
+ }),
+);
+
+/**
+ * @public
+ */
+export const SupportButton: ComponentType =
+ globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'SupportButton',
+ component: {
+ lazy: () =>
+ import('../components/SupportButton/SupportButton').then(
+ m => m.SupportButton,
+ ),
+ },
+ }),
+ );
+
+/**
+ * @public
+ */
+export const NotificationButton = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'NotificationButton',
+ component: {
+ lazy: () =>
+ import('../components/NotificationButton/NotificationButton').then(
+ m => m.NotificationButton,
+ ),
+ },
+ }),
+);
+
+/**
+ * NotificationBanner
+ *
+ * @public
+ */
+export const NotificationBanner = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'NotificationBanner',
+ component: {
+ lazy: () =>
+ import('../components/NotificationBanner').then(
+ m => m.NotificationBanner,
+ ),
+ },
+ }),
+);
+
+/**
+ * Starred Dropdown
+ *
+ * @public
+ */
+export const StarredDropdown = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'StarredDropdown',
+ component: {
+ lazy: () =>
+ import('../components/HeaderDropdownComponent/StarredDropdown').then(
+ m => m.StarredDropdown,
+ ),
+ },
+ }),
+);
+
+/**
+ * Application Launcher Dropdown
+ *
+ * @public
+ */
+export const ApplicationLauncherDropdown = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'ApplicationLauncherDropdown',
+ component: {
+ lazy: () =>
+ import(
+ './components/HeaderDropdownComponent/ApplicationLauncherDropdown'
+ ).then(m => m.ApplicationLauncherDropdown),
+ },
+ }),
+);
+
+/**
+ * Company Logo
+ *
+ * @public
+ */
+export const CompanyLogo = globalHeaderPlugin.provide(
+ createComponentExtension({
+ name: 'CompanyLogo',
+ component: {
+ lazy: () =>
+ import('../components/CompanyLogo/CompanyLogo').then(
+ m => m.CompanyLogo,
+ ),
+ },
+ }),
+);
+
+/**
+ * Translation resource for the global header plugin
+ *
+ * @public
+ */
+export { globalHeaderTranslations } from '../translations';
diff --git a/workspaces/global-header/plugins/global-header/src/legacy/types.ts b/workspaces/global-header/plugins/global-header/src/legacy/types.ts
new file mode 100644
index 00000000000..6392ae41abf
--- /dev/null
+++ b/workspaces/global-header/plugins/global-header/src/legacy/types.ts
@@ -0,0 +1,148 @@
+/*
+ * Copyright Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { ComponentType, CSSProperties } from 'react';
+
+/**
+ * Global Header Config
+ *
+ * @public
+ */
+export interface GlobalHeaderComponentMountPointConfig {
+ priority?: number;
+}
+
+/**
+ * Create Dropdown Config
+ *
+ * @public
+ */
+export interface CreateDropdownMountPointConfig {
+ priority?: number;
+ props?: Record;
+}
+/**
+ * Profile Dropdown Config
+ *
+ * @public
+ */
+export interface ProfileDropdownMountPointConfig {
+ priority?: number;
+ icon?: string;
+ title?: string;
+ link?: string;
+ props?: Record;
+}
+/**
+ * Help Dropdown Config
+ *
+ * @public
+ */
+export interface HelpDropdownMountPointConfig {
+ priority?: number;
+ icon?: string;
+ title?: string;
+ link?: string;
+ style?: CSSProperties;
+ props?: Record;
+}
+/**
+ * Application Launcher Dropdown Config
+ *
+ * @public
+ */
+export interface ApplicationLauncherDropdownMountPointConfig {
+ section?: string;
+ sectionLink?: string;
+ sectionLinkLabel?: string;
+ priority?: number;
+ icon?: string;
+ title?: string;
+ link?: string;
+ props?: Record;
+}
+
+/**
+ * Global Header Component Mount Point
+ *
+ * @public
+ */
+export interface GlobalHeaderComponentMountPoint {
+ Component: ComponentType<{
+ layout?: CSSProperties;
+ }>;
+ config?: GlobalHeaderComponentMountPointConfig & {
+ props?: Record;
+ layout?: CSSProperties;
+ };
+}
+
+/**
+ * Create Dropdown Mount Point
+ *
+ * @public
+ */
+export interface CreateDropdownMountPoint {
+ Component: ComponentType;
+ config?: CreateDropdownMountPointConfig & {
+ props?: Record;
+ };
+}
+
+/**
+ * Profile Dropdown Mount Point
+ *
+ * @public
+ */
+export interface ProfileDropdownMountPoint {
+ Component: ComponentType;
+ config?: ProfileDropdownMountPointConfig & {
+ props?: Record;
+ };
+}
+
+export interface HelpDropdownMountPoint {
+ Component: ComponentType;
+ config?: HelpDropdownMountPointConfig & {
+ props?: Record;
+ };
+}
+
+export interface ApplicationLauncherDropdownMountPoint {
+ Component: ComponentType;
+ config?: ApplicationLauncherDropdownMountPointConfig & {
+ props?: Record;
+ };
+}
+
+/**
+ * ScalprumState
+ *
+ * @public
+ */
+export interface ScalprumState {
+ api?: {
+ dynamicRootConfig?: {
+ mountPoints?: {
+ 'global.header/component': GlobalHeaderComponentMountPoint[];
+ 'global.header/create': CreateDropdownMountPoint[];
+ 'global.header/profile': ProfileDropdownMountPoint[];
+ 'global.header/application-launcher': ApplicationLauncherDropdownMountPoint[];
+ 'global.header/help': HelpDropdownMountPoint[];
+ };
+ };
+ };
+}
diff --git a/workspaces/global-header/plugins/global-header/src/plugin.ts b/workspaces/global-header/plugins/global-header/src/plugin.ts
index 45dcbf93ac4..a17d7398dc7 100644
--- a/workspaces/global-header/plugins/global-header/src/plugin.ts
+++ b/workspaces/global-header/plugins/global-header/src/plugin.ts
@@ -14,415 +14,53 @@
* limitations under the License.
*/
-import type { ComponentType } from 'react';
+import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
import {
- createPlugin,
- createComponentExtension,
-} from '@backstage/core-plugin-api';
-
-import { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';
-import { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';
-import { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';
-import { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';
-import { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';
-import { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';
-import { SupportButtonProps } from './plugin';
-import { HelpDropdownProps } from './components/HeaderDropdownComponent/HelpDropdown';
-import { globalHeaderTranslationRef } from './translations';
-
-export type { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';
-
-export type { HeaderButtonProps } from './components/HeaderButton/HeaderButton';
-export type { HeaderIconProps } from './components/HeaderIcon/HeaderIcon';
-export type { HeaderIconButtonProps } from './components/HeaderIconButton/HeaderIconButton';
-export type { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';
-export type { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';
-export type { HelpDropdownProps } from './components/HeaderDropdownComponent/HelpDropdown';
-
-export type { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';
-export type { MenuItemConfig } from './components/HeaderDropdownComponent/MenuSection';
-export type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';
-export type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';
-export type { DividerProps } from './components/Divider/Divider';
-export type { SpacerProps } from './components/Spacer/Spacer';
-export type { SupportButtonProps } from './components/SupportButton/SupportButton';
-export type { NotificationButtonProps } from './components/NotificationButton/NotificationButton';
-export type {
- LogoURLs,
- CompanyLogoProps,
-} from './components/CompanyLogo/CompanyLogo';
-
-export type {
- NotificationBannerProps,
- NotificationBannerDismiss,
-} from './components/NotificationBanner';
-
-export type {
- GlobalHeaderComponentMountPoint,
- GlobalHeaderComponentMountPointConfig,
-} from './types';
-
-export { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints';
-
-/**
- * Global Header Plugin
- *
- * @public
- */
-export const globalHeaderPlugin = createPlugin({
- id: 'global-header',
- __experimentalTranslations: {
- availableLanguages: ['en', 'de', 'es', 'fr', 'it', 'ja'],
- resources: [globalHeaderTranslationRef],
- },
-} as any);
-
-/**
- * Global Header
- *
- * @public
- */
-export const GlobalHeader = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'GlobalHeader',
- component: {
- lazy: () => import('./components/GlobalHeader').then(m => m.GlobalHeader),
- },
- }),
-);
-
-/**
- * Global Header Component
- *
- * @public
- */
-export const GlobalHeaderComponent: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'GlobalHeaderComponent',
- component: {
- lazy: () =>
- import('./components/GlobalHeaderComponent').then(
- m => m.GlobalHeaderComponent,
- ),
- },
- }),
- );
-
-/**
- * @public
- */
-export const HeaderButton = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'HeaderButton',
- component: {
- lazy: () =>
- import('./components/HeaderButton/HeaderButton').then(
- m => m.HeaderButton,
- ),
- },
- }),
-);
-
-/**
- * @public
- */
-export const HeaderIcon = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'HeaderIcon',
- component: {
- lazy: () =>
- import('./components/HeaderIcon/HeaderIcon').then(m => m.HeaderIcon),
- },
- }),
-);
-
-/**
- * @public
- */
-export const HeaderIconButton = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'HeaderIconButton',
- component: {
- lazy: () =>
- import('./components/HeaderIconButton/HeaderIconButton').then(
- m => m.HeaderIconButton,
- ),
- },
- }),
-);
-
-/**
- * Search Component
- *
- * @public
- */
-export const SearchComponent: ComponentType = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'SearchComponent',
- component: {
- lazy: () =>
- import('./components/SearchComponent/SearchComponent').then(
- m => m.SearchComponent,
- ),
- },
- }),
-);
-
-/**
- * Create Dropdown
- *
- * @public
- */
-export const CreateDropdown: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'CreateDropdown',
- component: {
- lazy: () =>
- import('./components/HeaderDropdownComponent/CreateDropdown').then(
- m => m.CreateDropdown,
- ),
- },
- }),
- );
-
-/**
- * Profile Dropdown
- *
- * @public
- */
-export const ProfileDropdown: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'ProfileDropdown',
- component: {
- lazy: () =>
- import('./components/HeaderDropdownComponent/ProfileDropdown').then(
- m => m.ProfileDropdown,
- ),
- },
- }),
- );
-
-/**
- * Help Dropdown
- *
- * @public
- */
-export const HelpDropdown: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'HelpDropdown',
- component: {
- lazy: () =>
- import('./components/HeaderDropdownComponent/HelpDropdown').then(
- m => m.HelpDropdown,
- ),
- },
- }),
- );
-
-/**
- * Software Templates List
- *
- * @public
- */
-export const SoftwareTemplatesSection: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'SoftwareTemplatesSection',
- component: {
- lazy: () =>
- import(
- './components/HeaderDropdownComponent/SoftwareTemplatesSection'
- ).then(m => m.SoftwareTemplatesSection),
- },
- }),
- );
-
-/**
- * Register A Component Link
- *
- * @public
- */
-export const RegisterAComponentSection: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'RegisterAComponentSection',
- component: {
- lazy: () =>
- import(
- './components/HeaderDropdownComponent/RegisterAComponentSection'
- ).then(m => m.RegisterAComponentSection),
- },
- }),
- );
-
-/**
- * Header Link
- *
- * @public
- */
-export const MenuItemLink: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'MenuItemLink',
- component: {
- lazy: () =>
- import('./components/MenuItemLink/MenuItemLink').then(
- m => m.MenuItemLink,
- ),
- },
- }),
- );
-
-/**
- * Header Logout Button
- *
- * @public
- */
-export const LogoutButton: ComponentType = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'LogoutButton',
- component: {
- lazy: () =>
- import('./components/LogoutButton/LogoutButton').then(
- m => m.LogoutButton,
- ),
- },
- }),
-);
-
-/**
- * Spacer component that allow users to add a flexible spacing between components.
- *
- * Supports two props: `growFactor` with default 1 and `minWidth` width default 8 pixels.
- *
- * @public
- */
-export const Spacer = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'Spacer',
- component: {
- lazy: () => import('./components/Spacer/Spacer').then(m => m.Spacer),
- },
- }),
-);
-
-/**
- * @public
- */
-export const Divider = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'Divider',
- component: {
- lazy: () => import('./components/Divider/Divider').then(m => m.Divider),
- },
- }),
-);
-
-/**
- * @public
- */
-export const SupportButton: ComponentType =
- globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'SupportButton',
- component: {
- lazy: () =>
- import('./components/SupportButton/SupportButton').then(
- m => m.SupportButton,
- ),
- },
- }),
- );
-
-/**
- * @public
- */
-export const NotificationButton = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'NotificationButton',
- component: {
- lazy: () =>
- import('./components/NotificationButton/NotificationButton').then(
- m => m.NotificationButton,
- ),
- },
- }),
-);
-
-/**
- * NotificationBanner
- *
- * @public
- */
-export const NotificationBanner = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'NotificationBanner',
- component: {
- lazy: () =>
- import('./components/NotificationBanner').then(
- m => m.NotificationBanner,
- ),
- },
- }),
-);
-
-/**
- * Starred Dropdown
- *
- * @public
- */
-export const StarredDropdown = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'StarredDropdown',
- component: {
- lazy: () =>
- import('./components/HeaderDropdownComponent/StarredDropdown').then(
- m => m.StarredDropdown,
- ),
- },
- }),
-);
-
-/**
- * Application Launcher Dropdown
- *
- * @public
- */
-export const ApplicationLauncherDropdown = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'ApplicationLauncherDropdown',
- component: {
- lazy: () =>
- import(
- './components/HeaderDropdownComponent/ApplicationLauncherDropdown'
- ).then(m => m.ApplicationLauncherDropdown),
- },
- }),
-);
-
-/**
- * Company Logo
- *
- * @public
- */
-export const CompanyLogo = globalHeaderPlugin.provide(
- createComponentExtension({
- name: 'CompanyLogo',
- component: {
- lazy: () =>
- import('./components/CompanyLogo/CompanyLogo').then(m => m.CompanyLogo),
- },
- }),
-);
-
-/**
- * Translation resource for the global header plugin
- *
- * @public
- */
-export { globalHeaderTranslations } from './translations';
+ companyLogoExtension,
+ searchExtension,
+ spacerExtension,
+ selfServiceButtonExtension,
+ starredDropdownExtension,
+ applicationLauncherDropdownExtension,
+ helpDropdownExtension,
+ notificationButtonExtension,
+ dividerExtension,
+ profileDropdownExtension,
+ settingsMenuItemExtension,
+ myProfileMenuItemExtension,
+ logoutMenuItemExtension,
+ supportButtonMenuItemExtension,
+ appLauncherDevHubMenuItemExtension,
+ appLauncherRhdhLocalMenuItemExtension,
+} from './defaults';
+
+/**
+ * Plugin providing the default global header toolbar items and
+ * dropdown menu items.
+ *
+ * @public
+ */
+const globalHeaderPlugin = createFrontendPlugin({
+ pluginId: 'global-header',
+ extensions: [
+ companyLogoExtension,
+ searchExtension,
+ spacerExtension,
+ selfServiceButtonExtension,
+ starredDropdownExtension,
+ applicationLauncherDropdownExtension,
+ helpDropdownExtension,
+ notificationButtonExtension,
+ dividerExtension,
+ profileDropdownExtension,
+ settingsMenuItemExtension,
+ myProfileMenuItemExtension,
+ logoutMenuItemExtension,
+ supportButtonMenuItemExtension,
+ appLauncherDevHubMenuItemExtension,
+ appLauncherRhdhLocalMenuItemExtension,
+ ],
+});
+
+export default globalHeaderPlugin;
diff --git a/workspaces/global-header/plugins/global-header/src/types.ts b/workspaces/global-header/plugins/global-header/src/types.ts
index 6392ae41abf..a7f21827e34 100644
--- a/workspaces/global-header/plugins/global-header/src/types.ts
+++ b/workspaces/global-header/plugins/global-header/src/types.ts
@@ -14,135 +14,76 @@
* limitations under the License.
*/
-import type { ComponentType, CSSProperties } from 'react';
+import type { ComponentType } from 'react';
/**
- * Global Header Config
+ * Data produced by a `GlobalHeaderComponentBlueprint` extension.
+ * Represents a single toolbar-level item in the global header.
*
* @public
*/
-export interface GlobalHeaderComponentMountPointConfig {
+export interface GlobalHeaderComponentData {
+ component: ComponentType;
priority?: number;
+ /** MUI `sx`-compatible layout overrides applied by the header wrapper. */
+ layout?: Record;
}
/**
- * Create Dropdown Config
+ * Data produced by a `GlobalHeaderMenuItemBlueprint` extension.
+ * Represents a single menu item inside a header dropdown.
*
- * @public
- */
-export interface CreateDropdownMountPointConfig {
- priority?: number;
- props?: Record;
-}
-/**
- * Profile Dropdown Config
+ * When `type` is `'component'`, the item is a self-contained component that
+ * controls its own layout and `MenuItem` wrapping (e.g. `SoftwareTemplatesSection`,
+ * `LogoutButton`).
*
- * @public
- */
-export interface ProfileDropdownMountPointConfig {
- priority?: number;
- icon?: string;
- title?: string;
- link?: string;
- props?: Record;
-}
-/**
- * Help Dropdown Config
+ * When `type` is `'data'` (the default), the item is data-driven: it is
+ * grouped by `sectionLabel` and rendered through `MenuSection`
+ * which provides `