@red-hat-developer-hub/backstage-plugin-global-header 1.20.3 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +92 -8
- package/config.d.ts +75 -33
- package/dist/alpha/components/ApplicationLauncherDropdown.esm.js +35 -0
- package/dist/alpha/components/ApplicationLauncherDropdown.esm.js.map +1 -0
- package/dist/alpha/components/GlobalHeader.esm.js +23 -0
- package/dist/alpha/components/GlobalHeader.esm.js.map +1 -0
- package/dist/alpha/components/GlobalHeaderDropdown.esm.js +59 -0
- package/dist/alpha/components/GlobalHeaderDropdown.esm.js.map +1 -0
- package/dist/alpha/components/GlobalHeaderDropdownContent.esm.js +52 -0
- package/dist/alpha/components/GlobalHeaderDropdownContent.esm.js.map +1 -0
- package/dist/alpha/components/GlobalHeaderMenuItem.esm.js +41 -0
- package/dist/alpha/components/GlobalHeaderMenuItem.esm.js.map +1 -0
- package/dist/alpha/components/HelpDropdown.esm.js +32 -0
- package/dist/alpha/components/HelpDropdown.esm.js.map +1 -0
- package/dist/alpha/components/MyProfileMenuItem.esm.js +58 -0
- package/dist/alpha/components/MyProfileMenuItem.esm.js.map +1 -0
- package/dist/alpha/components/ProfileDropdown.esm.js +97 -0
- package/dist/alpha/components/ProfileDropdown.esm.js.map +1 -0
- package/dist/alpha/defaults/index.esm.js +26 -0
- package/dist/alpha/defaults/index.esm.js.map +1 -0
- package/dist/alpha/defaults/menuItemExtensions.esm.js +67 -0
- package/dist/alpha/defaults/menuItemExtensions.esm.js.map +1 -0
- package/dist/alpha/defaults/rhdhLogo.esm.js +7 -0
- package/dist/alpha/defaults/rhdhLogo.esm.js.map +1 -0
- package/dist/alpha/defaults/toolbarExtensions.esm.js +74 -0
- package/dist/alpha/defaults/toolbarExtensions.esm.js.map +1 -0
- package/dist/alpha/extensions/GlobalHeaderContext.esm.js +31 -0
- package/dist/alpha/extensions/GlobalHeaderContext.esm.js.map +1 -0
- package/dist/alpha/extensions/blueprints.esm.js +112 -0
- package/dist/alpha/extensions/blueprints.esm.js.map +1 -0
- package/dist/alpha/extensions/dataRefs.esm.js +11 -0
- package/dist/alpha/extensions/dataRefs.esm.js.map +1 -0
- package/dist/alpha/extensions/globalHeaderModule.esm.js +72 -0
- package/dist/alpha/extensions/globalHeaderModule.esm.js.map +1 -0
- package/dist/alpha/plugin.esm.js +28 -0
- package/dist/alpha/plugin.esm.js.map +1 -0
- package/dist/alpha/utils/menuItemGrouping.esm.js +52 -0
- package/dist/alpha/utils/menuItemGrouping.esm.js.map +1 -0
- package/dist/alpha/utils/readConfigComponents.esm.js +29 -0
- package/dist/alpha/utils/readConfigComponents.esm.js.map +1 -0
- package/dist/alpha/utils/readConfigMenuItems.esm.js +19 -0
- package/dist/alpha/utils/readConfigMenuItems.esm.js.map +1 -0
- package/dist/alpha.d.ts +1255 -0
- package/dist/alpha.esm.js +28 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js +23 -15
- package/dist/components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js.map +1 -1
- package/dist/components/HeaderDropdownComponent/MenuSection.esm.js +15 -3
- package/dist/components/HeaderDropdownComponent/MenuSection.esm.js.map +1 -1
- package/dist/components/HeaderIcon/HeaderIcon.esm.js +5 -1
- package/dist/components/HeaderIcon/HeaderIcon.esm.js.map +1 -1
- package/dist/components/HeaderIconButton/HeaderIconButton.esm.js +3 -5
- package/dist/components/HeaderIconButton/HeaderIconButton.esm.js.map +1 -1
- package/dist/components/LogoutButton/LogoutButton.esm.js +4 -2
- package/dist/components/LogoutButton/LogoutButton.esm.js.map +1 -1
- package/dist/components/MenuItemLink/MenuItemLink.esm.js.map +1 -1
- package/dist/defaultMountPoints/defaultMountPoints.esm.js +7 -10
- package/dist/defaultMountPoints/defaultMountPoints.esm.js.map +1 -1
- package/dist/hooks/useDropdownManager.esm.js +10 -5
- package/dist/hooks/useDropdownManager.esm.js.map +1 -1
- package/dist/index.d.ts +7 -66
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +6 -7
- package/dist/plugin.esm.js.map +1 -1
- package/dist/types/index.d-CdKdPbQ2.d.ts +67 -0
- package/package.json +57 -37
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { useUserProfile } from '@backstage/plugin-user-settings';
|
|
4
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
5
|
+
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
6
|
+
import AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';
|
|
7
|
+
import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
|
|
8
|
+
import Avatar from '@mui/material/Avatar';
|
|
9
|
+
import Typography from '@mui/material/Typography';
|
|
10
|
+
import Box from '@mui/material/Box';
|
|
11
|
+
import { useTheme } from '@mui/material/styles';
|
|
12
|
+
import { useTranslation } from '../../hooks/useTranslation.esm.js';
|
|
13
|
+
import { GlobalHeaderDropdown } from './GlobalHeaderDropdown.esm.js';
|
|
14
|
+
|
|
15
|
+
const ProfileButtonContent = () => {
|
|
16
|
+
const [user, setUser] = useState();
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const {
|
|
19
|
+
displayName,
|
|
20
|
+
backstageIdentity,
|
|
21
|
+
profile,
|
|
22
|
+
loading: profileLoading
|
|
23
|
+
} = useUserProfile();
|
|
24
|
+
const catalogApi = useApi(catalogApiRef);
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const fetchUserEntity = async () => {
|
|
28
|
+
try {
|
|
29
|
+
if (backstageIdentity?.userEntityRef) {
|
|
30
|
+
const userProfile = await catalogApi.getEntityByRef(
|
|
31
|
+
backstageIdentity.userEntityRef
|
|
32
|
+
);
|
|
33
|
+
setUser(
|
|
34
|
+
userProfile?.spec?.profile?.displayName ?? userProfile?.metadata?.title
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
37
|
+
setUser(null);
|
|
38
|
+
}
|
|
39
|
+
} catch {
|
|
40
|
+
setUser(null);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
fetchUserEntity();
|
|
44
|
+
}, [backstageIdentity, catalogApi]);
|
|
45
|
+
const profileDisplayName = () => {
|
|
46
|
+
const name = user ?? displayName;
|
|
47
|
+
const regex = /^[^:/]+:[^/]+\/[^/]+$/;
|
|
48
|
+
if (regex.test(name)) {
|
|
49
|
+
return name.charAt(name.indexOf("/") + 1).toLocaleUpperCase("en-US").concat(name.substring(name.indexOf("/") + 2));
|
|
50
|
+
}
|
|
51
|
+
return name;
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
|
|
54
|
+
!profileLoading && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
55
|
+
profile.picture ? /* @__PURE__ */ jsx(
|
|
56
|
+
Avatar,
|
|
57
|
+
{
|
|
58
|
+
src: profile.picture,
|
|
59
|
+
sx: { mr: 2, height: "32px", width: "32px" },
|
|
60
|
+
alt: t("profile.picture")
|
|
61
|
+
}
|
|
62
|
+
) : /* @__PURE__ */ jsx(AccountCircleOutlinedIcon, { fontSize: "small", sx: { mr: 1 } }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
Typography,
|
|
65
|
+
{
|
|
66
|
+
variant: "body2",
|
|
67
|
+
sx: {
|
|
68
|
+
display: { xs: "none", md: "block" },
|
|
69
|
+
fontWeight: 500,
|
|
70
|
+
mr: "1rem"
|
|
71
|
+
},
|
|
72
|
+
children: profileDisplayName()
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
KeyboardArrowDownOutlinedIcon,
|
|
78
|
+
{
|
|
79
|
+
sx: { bgcolor: theme.palette.action.hover, borderRadius: "25%" }
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] });
|
|
83
|
+
};
|
|
84
|
+
const ProfileDropdown = () => /* @__PURE__ */ jsx(
|
|
85
|
+
GlobalHeaderDropdown,
|
|
86
|
+
{
|
|
87
|
+
target: "profile",
|
|
88
|
+
buttonContent: /* @__PURE__ */ jsx(ProfileButtonContent, {}),
|
|
89
|
+
buttonProps: {
|
|
90
|
+
color: "inherit",
|
|
91
|
+
sx: { display: "flex", alignItems: "center" }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
export { ProfileDropdown };
|
|
97
|
+
//# sourceMappingURL=ProfileDropdown.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileDropdown.esm.js","sources":["../../../src/alpha/components/ProfileDropdown.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect, useState } from 'react';\n\nimport { useUserProfile } from '@backstage/plugin-user-settings';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport type { UserEntity } from '@backstage/catalog-model';\n\nimport AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';\nimport KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';\nimport Avatar from '@mui/material/Avatar';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport { useTheme } from '@mui/material/styles';\n\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { GlobalHeaderDropdown } from './GlobalHeaderDropdown';\n\n/**\n * Trigger button content that displays the user's avatar and display name.\n */\nconst ProfileButtonContent = () => {\n const [user, setUser] = useState<string | null>();\n const { t } = useTranslation();\n const {\n displayName,\n backstageIdentity,\n profile,\n loading: profileLoading,\n } = useUserProfile();\n const catalogApi = useApi(catalogApiRef);\n const theme = useTheme();\n\n useEffect(() => {\n const fetchUserEntity = async () => {\n try {\n if (backstageIdentity?.userEntityRef) {\n const userProfile = (await catalogApi.getEntityByRef(\n backstageIdentity.userEntityRef,\n )) as unknown as UserEntity;\n setUser(\n userProfile?.spec?.profile?.displayName ??\n userProfile?.metadata?.title,\n );\n } else {\n setUser(null);\n }\n } catch {\n setUser(null);\n }\n };\n fetchUserEntity();\n }, [backstageIdentity, catalogApi]);\n\n const profileDisplayName = () => {\n const name = user ?? displayName;\n // Entity ref format (e.g. \"user:default/jdoe\") -- extract and capitalize the name after the slash\n const regex = /^[^:/]+:[^/]+\\/[^/]+$/;\n if (regex.test(name)) {\n return name\n .charAt(name.indexOf('/') + 1)\n .toLocaleUpperCase('en-US')\n .concat(name.substring(name.indexOf('/') + 2));\n }\n return name;\n };\n\n return (\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n {!profileLoading && (\n <>\n {profile.picture ? (\n <Avatar\n src={profile.picture}\n sx={{ mr: 2, height: '32px', width: '32px' }}\n alt={t('profile.picture')}\n />\n ) : (\n <AccountCircleOutlinedIcon fontSize=\"small\" sx={{ mr: 1 }} />\n )}\n <Typography\n variant=\"body2\"\n sx={{\n display: { xs: 'none', md: 'block' },\n fontWeight: 500,\n mr: '1rem',\n }}\n >\n {profileDisplayName()}\n </Typography>\n </>\n )}\n <KeyboardArrowDownOutlinedIcon\n sx={{ bgcolor: theme.palette.action.hover, borderRadius: '25%' }}\n />\n </Box>\n );\n};\n\n/**\n * Profile dropdown. Collects menu items from the `'profile'` target\n * via GlobalHeaderContext.\n *\n * @internal\n */\nexport const ProfileDropdown = () => (\n <GlobalHeaderDropdown\n target=\"profile\"\n buttonContent={<ProfileButtonContent />}\n buttonProps={{\n color: 'inherit',\n sx: { display: 'flex', alignItems: 'center' },\n }}\n />\n);\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { companyLogoExtension, searchExtension, spacerExtension, selfServiceButtonExtension, starredDropdownExtension, applicationLauncherDropdownExtension, helpDropdownExtension, notificationButtonExtension, dividerExtension, profileDropdownExtension } from './toolbarExtensions.esm.js';
|
|
2
|
+
import { settingsMenuItemExtension, myProfileMenuItemExtension, logoutMenuItemExtension, supportButtonMenuItemExtension, appLauncherDevHubMenuItemExtension, appLauncherRhdhLocalMenuItemExtension } from './menuItemExtensions.esm.js';
|
|
3
|
+
|
|
4
|
+
const defaultToolbarExtensions = [
|
|
5
|
+
companyLogoExtension,
|
|
6
|
+
searchExtension,
|
|
7
|
+
spacerExtension,
|
|
8
|
+
selfServiceButtonExtension,
|
|
9
|
+
starredDropdownExtension,
|
|
10
|
+
applicationLauncherDropdownExtension,
|
|
11
|
+
helpDropdownExtension,
|
|
12
|
+
notificationButtonExtension,
|
|
13
|
+
dividerExtension,
|
|
14
|
+
profileDropdownExtension
|
|
15
|
+
];
|
|
16
|
+
const defaultMenuItemExtensions = [
|
|
17
|
+
settingsMenuItemExtension,
|
|
18
|
+
myProfileMenuItemExtension,
|
|
19
|
+
logoutMenuItemExtension,
|
|
20
|
+
supportButtonMenuItemExtension,
|
|
21
|
+
appLauncherDevHubMenuItemExtension,
|
|
22
|
+
appLauncherRhdhLocalMenuItemExtension
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export { appLauncherDevHubMenuItemExtension, appLauncherRhdhLocalMenuItemExtension, applicationLauncherDropdownExtension, companyLogoExtension, defaultMenuItemExtensions, defaultToolbarExtensions, dividerExtension, helpDropdownExtension, logoutMenuItemExtension, myProfileMenuItemExtension, notificationButtonExtension, profileDropdownExtension, searchExtension, selfServiceButtonExtension, settingsMenuItemExtension, spacerExtension, starredDropdownExtension, supportButtonMenuItemExtension };
|
|
26
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/alpha/defaults/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './toolbarExtensions';\nexport * from './menuItemExtensions';\n\nimport {\n companyLogoExtension,\n searchExtension,\n spacerExtension,\n selfServiceButtonExtension,\n starredDropdownExtension,\n applicationLauncherDropdownExtension,\n helpDropdownExtension,\n notificationButtonExtension,\n dividerExtension,\n profileDropdownExtension,\n} from './toolbarExtensions';\n\nimport {\n settingsMenuItemExtension,\n myProfileMenuItemExtension,\n logoutMenuItemExtension,\n supportButtonMenuItemExtension,\n appLauncherDevHubMenuItemExtension,\n appLauncherRhdhLocalMenuItemExtension,\n} from './menuItemExtensions';\n\n/**\n * All default toolbar component extensions.\n * @alpha\n */\nexport const defaultToolbarExtensions = [\n companyLogoExtension,\n searchExtension,\n spacerExtension,\n selfServiceButtonExtension,\n starredDropdownExtension,\n applicationLauncherDropdownExtension,\n helpDropdownExtension,\n notificationButtonExtension,\n dividerExtension,\n profileDropdownExtension,\n];\n\n/**\n * All default menu item extensions.\n * @alpha\n */\nexport const defaultMenuItemExtensions = [\n settingsMenuItemExtension,\n myProfileMenuItemExtension,\n logoutMenuItemExtension,\n supportButtonMenuItemExtension,\n appLauncherDevHubMenuItemExtension,\n appLauncherRhdhLocalMenuItemExtension,\n];\n"],"names":[],"mappings":";;;AA6CO,MAAM,wBAA2B,GAAA;AAAA,EACtC,oBAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA,0BAAA;AAAA,EACA,wBAAA;AAAA,EACA,oCAAA;AAAA,EACA,qBAAA;AAAA,EACA,2BAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF;AAMO,MAAM,yBAA4B,GAAA;AAAA,EACvC,yBAAA;AAAA,EACA,0BAAA;AAAA,EACA,uBAAA;AAAA,EACA,8BAAA;AAAA,EACA,kCAAA;AAAA,EACA;AACF;;;;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { GlobalHeaderMenuItemBlueprint } from '../extensions/blueprints.esm.js';
|
|
2
|
+
import { LogoutButton } from '../../components/LogoutButton/LogoutButton.esm.js';
|
|
3
|
+
import { SupportButton } from '../../components/SupportButton/SupportButton.esm.js';
|
|
4
|
+
import { MyProfileMenuItem } from '../components/MyProfileMenuItem.esm.js';
|
|
5
|
+
|
|
6
|
+
const settingsMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
|
|
7
|
+
name: "settings",
|
|
8
|
+
params: {
|
|
9
|
+
target: "profile",
|
|
10
|
+
title: "Settings",
|
|
11
|
+
titleKey: "profile.settings",
|
|
12
|
+
link: "/settings",
|
|
13
|
+
icon: "manage_accounts",
|
|
14
|
+
priority: 100
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const myProfileMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
|
|
18
|
+
name: "my-profile",
|
|
19
|
+
params: {
|
|
20
|
+
target: "profile",
|
|
21
|
+
component: MyProfileMenuItem,
|
|
22
|
+
priority: 90
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const logoutMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
|
|
26
|
+
name: "logout",
|
|
27
|
+
params: {
|
|
28
|
+
target: "profile",
|
|
29
|
+
component: LogoutButton,
|
|
30
|
+
priority: 10
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const supportButtonMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
|
|
34
|
+
name: "support-button",
|
|
35
|
+
params: {
|
|
36
|
+
target: "help",
|
|
37
|
+
component: SupportButton,
|
|
38
|
+
priority: 10
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const appLauncherDevHubMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
|
|
42
|
+
name: "app-launcher-devhub",
|
|
43
|
+
params: {
|
|
44
|
+
target: "app-launcher",
|
|
45
|
+
title: "Developer Hub",
|
|
46
|
+
titleKey: "applicationLauncher.developerHub",
|
|
47
|
+
link: "https://docs.redhat.com/en/documentation/red_hat_developer_hub",
|
|
48
|
+
icon: "hub",
|
|
49
|
+
sectionLabel: "applicationLauncher.sections.documentation",
|
|
50
|
+
priority: 150
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const appLauncherRhdhLocalMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({
|
|
54
|
+
name: "app-launcher-rhdh-local",
|
|
55
|
+
params: {
|
|
56
|
+
target: "app-launcher",
|
|
57
|
+
title: "RHDH Local",
|
|
58
|
+
titleKey: "applicationLauncher.rhdhLocal",
|
|
59
|
+
link: "https://github.com/redhat-developer/rhdh-local",
|
|
60
|
+
icon: "hub",
|
|
61
|
+
sectionLabel: "applicationLauncher.sections.developerTools",
|
|
62
|
+
priority: 100
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export { appLauncherDevHubMenuItemExtension, appLauncherRhdhLocalMenuItemExtension, logoutMenuItemExtension, myProfileMenuItemExtension, settingsMenuItemExtension, supportButtonMenuItemExtension };
|
|
67
|
+
//# sourceMappingURL=menuItemExtensions.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuItemExtensions.esm.js","sources":["../../../src/alpha/defaults/menuItemExtensions.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Default menu item extensions (`gh-menu-item`) for the global header dropdowns.\n *\n * - Items with only `component` (no data fields) are rendered directly by\n * the dropdown — they control their own layout and `MenuItem` wrapping.\n * - Items with data fields (`title`, `link`, etc.) are grouped by `sectionLabel`\n * and rendered through `MenuSection`.\n *\n * @internal\n */\n\nimport { GlobalHeaderMenuItemBlueprint } from '../extensions/blueprints';\n\nimport { LogoutButton } from '../../components/LogoutButton/LogoutButton';\nimport { SupportButton } from '../../components/SupportButton/SupportButton';\nimport { MyProfileMenuItem } from '../components/MyProfileMenuItem';\n\n// ---------------------------------------------------------------------------\n// Profile dropdown items\n// ---------------------------------------------------------------------------\n\n/** @alpha */\nexport const settingsMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({\n name: 'settings',\n params: {\n target: 'profile',\n title: 'Settings',\n titleKey: 'profile.settings',\n link: '/settings',\n icon: 'manage_accounts',\n priority: 100,\n },\n});\n\n/** @alpha */\nexport const myProfileMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({\n name: 'my-profile',\n params: {\n target: 'profile',\n component: MyProfileMenuItem,\n priority: 90,\n },\n});\n\n/** @alpha */\nexport const logoutMenuItemExtension = GlobalHeaderMenuItemBlueprint.make({\n name: 'logout',\n params: {\n target: 'profile',\n component: LogoutButton,\n priority: 10,\n },\n});\n\n// ---------------------------------------------------------------------------\n// Help dropdown items\n// ---------------------------------------------------------------------------\n\n/** @alpha */\nexport const supportButtonMenuItemExtension =\n GlobalHeaderMenuItemBlueprint.make({\n name: 'support-button',\n params: {\n target: 'help',\n component: SupportButton,\n priority: 10,\n },\n });\n\n// ---------------------------------------------------------------------------\n// App launcher dropdown items\n// ---------------------------------------------------------------------------\n\n/** @alpha */\nexport const appLauncherDevHubMenuItemExtension =\n GlobalHeaderMenuItemBlueprint.make({\n name: 'app-launcher-devhub',\n params: {\n target: 'app-launcher',\n title: 'Developer Hub',\n titleKey: 'applicationLauncher.developerHub',\n link: 'https://docs.redhat.com/en/documentation/red_hat_developer_hub',\n icon: 'hub',\n sectionLabel: 'applicationLauncher.sections.documentation',\n priority: 150,\n },\n });\n\n/** @alpha */\nexport const appLauncherRhdhLocalMenuItemExtension =\n GlobalHeaderMenuItemBlueprint.make({\n name: 'app-launcher-rhdh-local',\n params: {\n target: 'app-launcher',\n title: 'RHDH Local',\n titleKey: 'applicationLauncher.rhdhLocal',\n link: 'https://github.com/redhat-developer/rhdh-local',\n icon: 'hub',\n sectionLabel: 'applicationLauncher.sections.developerTools',\n priority: 100,\n },\n });\n"],"names":[],"mappings":";;;;;AAsCa,MAAA,yBAAA,GAA4B,8BAA8B,IAAK,CAAA;AAAA,EAC1E,IAAM,EAAA,UAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,SAAA;AAAA,IACR,KAAO,EAAA,UAAA;AAAA,IACP,QAAU,EAAA,kBAAA;AAAA,IACV,IAAM,EAAA,WAAA;AAAA,IACN,IAAM,EAAA,iBAAA;AAAA,IACN,QAAU,EAAA;AAAA;AAEd,CAAC;AAGY,MAAA,0BAAA,GAA6B,8BAA8B,IAAK,CAAA;AAAA,EAC3E,IAAM,EAAA,YAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,SAAA;AAAA,IACR,SAAW,EAAA,iBAAA;AAAA,IACX,QAAU,EAAA;AAAA;AAEd,CAAC;AAGY,MAAA,uBAAA,GAA0B,8BAA8B,IAAK,CAAA;AAAA,EACxE,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,SAAA;AAAA,IACR,SAAW,EAAA,YAAA;AAAA,IACX,QAAU,EAAA;AAAA;AAEd,CAAC;AAOY,MAAA,8BAAA,GACX,8BAA8B,IAAK,CAAA;AAAA,EACjC,IAAM,EAAA,gBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,MAAA;AAAA,IACR,SAAW,EAAA,aAAA;AAAA,IACX,QAAU,EAAA;AAAA;AAEd,CAAC;AAOU,MAAA,kCAAA,GACX,8BAA8B,IAAK,CAAA;AAAA,EACjC,IAAM,EAAA,qBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,cAAA;AAAA,IACR,KAAO,EAAA,eAAA;AAAA,IACP,QAAU,EAAA,kCAAA;AAAA,IACV,IAAM,EAAA,gEAAA;AAAA,IACN,IAAM,EAAA,KAAA;AAAA,IACN,YAAc,EAAA,4CAAA;AAAA,IACd,QAAU,EAAA;AAAA;AAEd,CAAC;AAGU,MAAA,qCAAA,GACX,8BAA8B,IAAK,CAAA;AAAA,EACjC,IAAM,EAAA,yBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA,cAAA;AAAA,IACR,KAAO,EAAA,YAAA;AAAA,IACP,QAAU,EAAA,+BAAA;AAAA,IACV,IAAM,EAAA,gDAAA;AAAA,IACN,IAAM,EAAA,KAAA;AAAA,IACN,YAAc,EAAA,6CAAA;AAAA,IACd,QAAU,EAAA;AAAA;AAEd,CAAC;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const rhdhLogo = {
|
|
2
|
+
light: "data:image/svg+xml,%3Csvg%20width%3D%22451.199%22%20height%3D%2279.993%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20style%3D%22fill%3A%23000%22%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20169.9661%207.67311)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M25.629191-15.26571q0-3.87018-1.032048-6.665309-1.032048-2.79513-2.881134-4.601214-1.806084-1.849086-4.343201-2.709126-2.494116-.86004-5.461254-.86004H3.9561839V0h7.3533421q3.01014%200%205.633262-.81703798Q19.56591-1.677078%2021.500999-3.5261639q1.93509-1.849086%203.01014-4.7302199%201.118052-2.9241362%201.118052-7.0093262zm-3.354156.129006q0%203.22515-.731034%205.5472582-.731034%202.279106-2.107097%203.7411739-1.376064%201.462068-3.311154%202.1501-1.93509.64503-4.386204.64503H7.3103398V-27.048257h4.3432022q5.203242%200%207.912368%203.053142%202.709125%203.053142%202.709125%208.858411zM51.043415%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142H32.208539V0Zm28.553323-30.101399h-3.44016L69.405264-9.5894458l-.516024%201.548072q-.258012.86004-.559026%201.72008-.258012.8600399-.473021%201.6340759-.21501.731034-.344016%201.118052-.129006-.387018-.344016-1.118052-.21501-.731034-.473022-1.5480719-.258012-.86004-.559026-1.72008-.258012-.86004-.473022-1.548072L58.955779-30.101399h-3.526164L65.664091%200h3.698171zM104.62387%200v-3.0531419H89.143149V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.835691v-3.053142H85.788993V0Zm24.64014%200v-3.0531419h-14.8787V-30.101399h-3.35415V0Zm29.06938-15.093702q0-3.397158-.90304-6.235289-.90304-2.838132-2.53712-4.902228t-3.95618-3.182148q-2.27911-1.161054-5.07424-1.161054-2.79513%200-5.11724%201.161054-2.3221%201.161054-3.95618%203.22515t-2.53712%204.94523q-.90304%202.838131-.90304%206.235289%200%203.397158.86004%206.2352902.90304%202.838132%202.53712%204.9022279%201.63407%202.0640959%203.91318%203.22514992%202.32211%201.11805197%205.11724%201.11805197t5.11723-1.16105397q2.32211-1.16105402%203.95619-3.22514992%201.67708-2.0640959%202.58012-4.9022279.90304-2.8811342.90304-6.2782922zm-3.35416.086q0%202.838132-.68803%205.1602403-.68803%202.2791059-1.89209%203.9131819-1.20405%201.5910739-2.88113%202.4941159-1.67708.86004-3.61217.86004-1.97809%200-3.65517-.86004-1.67707-.903042-2.92413-2.5371179-1.20406-1.677078-1.93509-3.9561839-.68803-2.3221083-.68803-5.1602403t.68803-5.117237q.68803-2.322108%201.89209-3.913182%201.20405-1.634076%202.83813-2.494116%201.67708-.903042%203.61217-.903042%201.97809%200%203.65516.903042%201.67708.86004%202.92414%202.537118%201.24706%201.634076%201.93509%203.956184.73103%202.279105.73103%205.117237zm30.83244-6.106283q0-2.279106-.73104-3.956184-.73103-1.72008-2.02109-2.838132-1.29006-1.118052-3.05314-1.634076-1.72008-.559026-3.78418-.559026H164.9557V0h3.35415v-11.82555h7.31034q2.23611%200%204.12819-.602028%201.89209-.602028%203.22515-1.763082%201.33307-1.204056%202.0641-2.924136.77404-1.763082.77404-3.999185zm-3.35416.129006q0%206.106283-6.79432%206.106283h-7.35334v-12.169565h7.78336q3.09615%200%204.73022%201.591074%201.63408%201.548072%201.63408%204.472208zM210.32281%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142h-18.18984V0Zm27.69329-21.587003q0-2.193102-.73103-3.784176-.73104-1.591074-1.9781-2.623122-1.24705-1.07505-2.96713-1.591074t-3.69818-.516024h-11.91155V0h3.35416v-12.814596h7.13833L233.6729%200h3.87018l-6.62231-13.072608q3.22515-.688032%205.16024-2.838132%201.93509-2.1501%201.93509-5.676263zm-3.35416.129006q0%202.838131-1.63407%204.257197-1.59108%201.376064-4.94523%201.376064h-7.99837v-11.223521h8.42839q3.01014%200%204.55821%201.419066%201.59107%201.376064%201.59107%204.171194zM277.49192%200v-30.101399h-3.35415v12.857597h-14.9647v-12.857597h-3.35415V0h3.35415v-14.19066h14.9647V0Zm29.37035-12.298572v-17.802827h-3.35415v17.888831q0%204.9022282-1.67708%207.2673381-1.67708%202.36511-5.59026%202.36511-7.69736%200-7.69736-9.7184521v-17.802827h-3.35416v17.888831q0%206.2782922%202.70913%209.5034421%202.75213%203.18214789%208.17038%203.18214789%205.46125%200%208.12738-3.22514989%202.66612-3.2681519%202.66612-9.5464441zm28.2523%203.3971582q0-1.8060842-.51603-3.0961442-.51602-1.333062-1.33306-2.193102-.81704-.903042-1.84909-1.419066-1.03204-.559026-2.06409-.817038%201.93509-.688032%203.13914-2.1501%201.20406-1.505069%201.20406-3.999185%200-1.93509-.60203-3.354156-.60203-1.419066-1.72008-2.322108-1.07505-.946044-2.58012-1.376064-1.46207-.473022-3.26815-.473022h-11.00851V0h10.7935q4.77322%200%207.26734-2.1931019%202.53712-2.236104%202.53712-6.7083119zm-4.77323-13.5456292q0%201.978092-1.20405%203.397157-1.20406%201.376064-3.99919%201.376064h-7.26734v-9.374435h7.52535q2.53712%200%203.74118%201.29006%201.20405%201.247058%201.20405%203.311154zm1.41907%2013.7176372q0%202.58012-1.41907%204.1281919-1.41906%201.548072-4.81622%201.548072h-7.65436V-14.663682h7.48235q2.96714%200%204.68722%201.548072%201.72008%201.548072%201.72008%204.3862042z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-5.23714%2079.36255)%22%20aria-label%3D%22DEVELOPER%20HUB%22%2F%3E%3Cpath%20d%3D%22m18.792026%200-3.92084-7.4776021q1.624348-.7281561%202.576552-2.1284561.952204-1.4002998.952204-3.6127738%200-1.736372-.56012-2.94063-.532114-1.232264-1.54033-1.988426t-2.436522-1.092234q-1.4003-.364078-3.108666-.364078H1.988426V0h5.3491461v-6.6094161h2.1844681L12.714724%200Zm-5.797242-13.078802q0%201.064228-.56012%201.624348t-1.904408.56012H7.3375721v-4.284918h3.2767019q1.288276%200%201.82039.588126.56012.588126.56012%201.512324zM37.219965%200v-4.5649781h-9.830106v-3.36072h5.797242v-4.5089659h-5.797242v-2.604558h9.634064V-19.6042H22.012707V0Zm20.388361-9.9141242q0-2.7725938-.728156-4.6209898-.70015-1.848396-2.016432-2.968636-1.288276-1.148246-3.164678-1.624348-1.876402-.476102-4.172894-.476102h-6.86147V0h6.357362q2.604558%200%204.564978-.50410801Q53.575462-1.036222%2054.91975-2.184468q1.344288-1.1762521%202.016432-3.0526541.672144-1.904408.672144-4.6770021zm-5.573194.084018q0%201.456312-.252054%202.4645281-.252054.98021-.84018%201.596342-.56012.588126-1.456312.868186-.896192.252054-2.156462.252054h-1.176252V-14.955204h1.344288q1.26027%200%202.128456.308066.868186.28006%201.4003.896192.532114.616132.756162%201.596342.252054.98021.252054%202.3244978z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-2.65123%2027.43044)%22%20aria-label%3D%22RED%22%2F%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20442.7922%2047.06522)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M19.18411%200v-19.6042h-5.545188v7.14153H7.5336141v-7.14153H1.988426V0h5.5451881v-7.7296561h6.1053079V0Zm22.488833%200-7.113524-19.6042h-5.489176L21.956719%200h5.825248l1.064228-3.4447381h5.88126L35.791683%200Zm-8.26177-7.7576621h-3.248696l.364078-1.2882761q.252054-.924198.448096-1.6243478.196042-.70015.336072-1.26027.168036-.56012.28006-1.036222.112024-.476102.196042-.98021.08402.504108.196042.98021l.252054%201.008216q.168036.56012.364078%201.26027.196042.7001498.448096%201.6523538zm23.973112-7.1135239V-19.6042H40.972768v4.733014h5.489177V0h5.433164v-14.871186z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%2089.90877%2027.43044)%22%20aria-label%3D%22HAT%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",
|
|
3
|
+
dark: "data:image/svg+xml,%3Csvg%20width%3D%22451.199%22%20height%3D%2279.993%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20style%3D%22fill%3A%23fff%22%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20169.9661%207.67311)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M25.629191-15.26571q0-3.87018-1.032048-6.665309-1.032048-2.79513-2.881134-4.601214-1.806084-1.849086-4.343201-2.709126-2.494116-.86004-5.461254-.86004H3.9561839V0h7.3533421q3.01014%200%205.633262-.81703798Q19.56591-1.677078%2021.500999-3.5261639q1.93509-1.849086%203.01014-4.7302199%201.118052-2.9241362%201.118052-7.0093262zm-3.354156.129006q0%203.22515-.731034%205.5472582-.731034%202.279106-2.107097%203.7411739-1.376064%201.462068-3.311154%202.1501-1.93509.64503-4.386204.64503H7.3103398V-27.048257h4.3432022q5.203242%200%207.912368%203.053142%202.709125%203.053142%202.709125%208.858411zM51.043415%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142H32.208539V0Zm28.553323-30.101399h-3.44016L69.405264-9.5894458l-.516024%201.548072q-.258012.86004-.559026%201.72008-.258012.8600399-.473021%201.6340759-.21501.731034-.344016%201.118052-.129006-.387018-.344016-1.118052-.21501-.731034-.473022-1.5480719-.258012-.86004-.559026-1.72008-.258012-.86004-.473022-1.548072L58.955779-30.101399h-3.526164L65.664091%200h3.698171zM104.62387%200v-3.0531419H89.143149V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.835691v-3.053142H85.788993V0Zm24.64014%200v-3.0531419h-14.8787V-30.101399h-3.35415V0Zm29.06938-15.093702q0-3.397158-.90304-6.235289-.90304-2.838132-2.53712-4.902228t-3.95618-3.182148q-2.27911-1.161054-5.07424-1.161054-2.79513%200-5.11724%201.161054-2.3221%201.161054-3.95618%203.22515t-2.53712%204.94523q-.90304%202.838131-.90304%206.235289%200%203.397158.86004%206.2352902.90304%202.838132%202.53712%204.9022279%201.63407%202.0640959%203.91318%203.22514992%202.32211%201.11805197%205.11724%201.11805197t5.11723-1.16105397q2.32211-1.16105402%203.95619-3.22514992%201.67708-2.0640959%202.58012-4.9022279.90304-2.8811342.90304-6.2782922zm-3.35416.086q0%202.838132-.68803%205.1602403-.68803%202.2791059-1.89209%203.9131819-1.20405%201.5910739-2.88113%202.4941159-1.67708.86004-3.61217.86004-1.97809%200-3.65517-.86004-1.67707-.903042-2.92413-2.5371179-1.20406-1.677078-1.93509-3.9561839-.68803-2.3221083-.68803-5.1602403t.68803-5.117237q.68803-2.322108%201.89209-3.913182%201.20405-1.634076%202.83813-2.494116%201.67708-.903042%203.61217-.903042%201.97809%200%203.65516.903042%201.67708.86004%202.92414%202.537118%201.24706%201.634076%201.93509%203.956184.73103%202.279105.73103%205.117237zm30.83244-6.106283q0-2.279106-.73104-3.956184-.73103-1.72008-2.02109-2.838132-1.29006-1.118052-3.05314-1.634076-1.72008-.559026-3.78418-.559026H164.9557V0h3.35415v-11.82555h7.31034q2.23611%200%204.12819-.602028%201.89209-.602028%203.22515-1.763082%201.33307-1.204056%202.0641-2.924136.77404-1.763082.77404-3.999185zm-3.35416.129006q0%206.106283-6.79432%206.106283h-7.35334v-12.169565h7.78336q3.09615%200%204.73022%201.591074%201.63408%201.548072%201.63408%204.472208zM210.32281%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142h-18.18984V0Zm27.69329-21.587003q0-2.193102-.73103-3.784176-.73104-1.591074-1.9781-2.623122-1.24705-1.07505-2.96713-1.591074t-3.69818-.516024h-11.91155V0h3.35416v-12.814596h7.13833L233.6729%200h3.87018l-6.62231-13.072608q3.22515-.688032%205.16024-2.838132%201.93509-2.1501%201.93509-5.676263zm-3.35416.129006q0%202.838131-1.63407%204.257197-1.59108%201.376064-4.94523%201.376064h-7.99837v-11.223521h8.42839q3.01014%200%204.55821%201.419066%201.59107%201.376064%201.59107%204.171194zM277.49192%200v-30.101399h-3.35415v12.857597h-14.9647v-12.857597h-3.35415V0h3.35415v-14.19066h14.9647V0Zm29.37035-12.298572v-17.802827h-3.35415v17.888831q0%204.9022282-1.67708%207.2673381-1.67708%202.36511-5.59026%202.36511-7.69736%200-7.69736-9.7184521v-17.802827h-3.35416v17.888831q0%206.2782922%202.70913%209.5034421%202.75213%203.18214789%208.17038%203.18214789%205.46125%200%208.12738-3.22514989%202.66612-3.2681519%202.66612-9.5464441zm28.2523%203.3971582q0-1.8060842-.51603-3.0961442-.51602-1.333062-1.33306-2.193102-.81704-.903042-1.84909-1.419066-1.03204-.559026-2.06409-.817038%201.93509-.688032%203.13914-2.1501%201.20406-1.505069%201.20406-3.999185%200-1.93509-.60203-3.354156-.60203-1.419066-1.72008-2.322108-1.07505-.946044-2.58012-1.376064-1.46207-.473022-3.26815-.473022h-11.00851V0h10.7935q4.77322%200%207.26734-2.1931019%202.53712-2.236104%202.53712-6.7083119zm-4.77323-13.5456292q0%201.978092-1.20405%203.397157-1.20406%201.376064-3.99919%201.376064h-7.26734v-9.374435h7.52535q2.53712%200%203.74118%201.29006%201.20405%201.247058%201.20405%203.311154zm1.41907%2013.7176372q0%202.58012-1.41907%204.1281919-1.41906%201.548072-4.81622%201.548072h-7.65436V-14.663682h7.48235q2.96714%200%204.68722%201.548072%201.72008%201.548072%201.72008%204.3862042z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-5.23714%2079.36255)%22%20aria-label%3D%22DEVELOPER%20HUB%22%2F%3E%3Cpath%20d%3D%22m18.792026%200-3.92084-7.4776021q1.624348-.7281561%202.576552-2.1284561.952204-1.4002998.952204-3.6127738%200-1.736372-.56012-2.94063-.532114-1.232264-1.54033-1.988426t-2.436522-1.092234q-1.4003-.364078-3.108666-.364078H1.988426V0h5.3491461v-6.6094161h2.1844681L12.714724%200Zm-5.797242-13.078802q0%201.064228-.56012%201.624348t-1.904408.56012H7.3375721v-4.284918h3.2767019q1.288276%200%201.82039.588126.56012.588126.56012%201.512324zM37.219965%200v-4.5649781h-9.830106v-3.36072h5.797242v-4.5089659h-5.797242v-2.604558h9.634064V-19.6042H22.012707V0Zm20.388361-9.9141242q0-2.7725938-.728156-4.6209898-.70015-1.848396-2.016432-2.968636-1.288276-1.148246-3.164678-1.624348-1.876402-.476102-4.172894-.476102h-6.86147V0h6.357362q2.604558%200%204.564978-.50410801Q53.575462-1.036222%2054.91975-2.184468q1.344288-1.1762521%202.016432-3.0526541.672144-1.904408.672144-4.6770021zm-5.573194.084018q0%201.456312-.252054%202.4645281-.252054.98021-.84018%201.596342-.56012.588126-1.456312.868186-.896192.252054-2.156462.252054h-1.176252V-14.955204h1.344288q1.26027%200%202.128456.308066.868186.28006%201.4003.896192.532114.616132.756162%201.596342.252054.98021.252054%202.3244978z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-2.65123%2027.43044)%22%20aria-label%3D%22RED%22%2F%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20442.7922%2047.06522)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M19.18411%200v-19.6042h-5.545188v7.14153H7.5336141v-7.14153H1.988426V0h5.5451881v-7.7296561h6.1053079V0Zm22.488833%200-7.113524-19.6042h-5.489176L21.956719%200h5.825248l1.064228-3.4447381h5.88126L35.791683%200Zm-8.26177-7.7576621h-3.248696l.364078-1.2882761q.252054-.924198.448096-1.6243478.196042-.70015.336072-1.26027.168036-.56012.28006-1.036222.112024-.476102.196042-.98021.08402.504108.196042.98021l.252054%201.008216q.168036.56012.364078%201.26027.196042.7001498.448096%201.6523538zm23.973112-7.1135239V-19.6042H40.972768v4.733014h5.489177V0h5.433164v-14.871186z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%2089.90877%2027.43044)%22%20aria-label%3D%22HAT%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export { rhdhLogo };
|
|
7
|
+
//# sourceMappingURL=rhdhLogo.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rhdhLogo.esm.js","sources":["../../../src/alpha/defaults/rhdhLogo.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Default \"Red Hat Developer Hub\" logo SVG data URIs.\n * Used by the `companyLogoExtension` toolbar component.\n *\n * @internal\n */\nexport const rhdhLogo = {\n light:\n 'data:image/svg+xml,%3Csvg%20width%3D%22451.199%22%20height%3D%2279.993%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20style%3D%22fill%3A%23000%22%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20169.9661%207.67311)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M25.629191-15.26571q0-3.87018-1.032048-6.665309-1.032048-2.79513-2.881134-4.601214-1.806084-1.849086-4.343201-2.709126-2.494116-.86004-5.461254-.86004H3.9561839V0h7.3533421q3.01014%200%205.633262-.81703798Q19.56591-1.677078%2021.500999-3.5261639q1.93509-1.849086%203.01014-4.7302199%201.118052-2.9241362%201.118052-7.0093262zm-3.354156.129006q0%203.22515-.731034%205.5472582-.731034%202.279106-2.107097%203.7411739-1.376064%201.462068-3.311154%202.1501-1.93509.64503-4.386204.64503H7.3103398V-27.048257h4.3432022q5.203242%200%207.912368%203.053142%202.709125%203.053142%202.709125%208.858411zM51.043415%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142H32.208539V0Zm28.553323-30.101399h-3.44016L69.405264-9.5894458l-.516024%201.548072q-.258012.86004-.559026%201.72008-.258012.8600399-.473021%201.6340759-.21501.731034-.344016%201.118052-.129006-.387018-.344016-1.118052-.21501-.731034-.473022-1.5480719-.258012-.86004-.559026-1.72008-.258012-.86004-.473022-1.548072L58.955779-30.101399h-3.526164L65.664091%200h3.698171zM104.62387%200v-3.0531419H89.143149V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.835691v-3.053142H85.788993V0Zm24.64014%200v-3.0531419h-14.8787V-30.101399h-3.35415V0Zm29.06938-15.093702q0-3.397158-.90304-6.235289-.90304-2.838132-2.53712-4.902228t-3.95618-3.182148q-2.27911-1.161054-5.07424-1.161054-2.79513%200-5.11724%201.161054-2.3221%201.161054-3.95618%203.22515t-2.53712%204.94523q-.90304%202.838131-.90304%206.235289%200%203.397158.86004%206.2352902.90304%202.838132%202.53712%204.9022279%201.63407%202.0640959%203.91318%203.22514992%202.32211%201.11805197%205.11724%201.11805197t5.11723-1.16105397q2.32211-1.16105402%203.95619-3.22514992%201.67708-2.0640959%202.58012-4.9022279.90304-2.8811342.90304-6.2782922zm-3.35416.086q0%202.838132-.68803%205.1602403-.68803%202.2791059-1.89209%203.9131819-1.20405%201.5910739-2.88113%202.4941159-1.67708.86004-3.61217.86004-1.97809%200-3.65517-.86004-1.67707-.903042-2.92413-2.5371179-1.20406-1.677078-1.93509-3.9561839-.68803-2.3221083-.68803-5.1602403t.68803-5.117237q.68803-2.322108%201.89209-3.913182%201.20405-1.634076%202.83813-2.494116%201.67708-.903042%203.61217-.903042%201.97809%200%203.65516.903042%201.67708.86004%202.92414%202.537118%201.24706%201.634076%201.93509%203.956184.73103%202.279105.73103%205.117237zm30.83244-6.106283q0-2.279106-.73104-3.956184-.73103-1.72008-2.02109-2.838132-1.29006-1.118052-3.05314-1.634076-1.72008-.559026-3.78418-.559026H164.9557V0h3.35415v-11.82555h7.31034q2.23611%200%204.12819-.602028%201.89209-.602028%203.22515-1.763082%201.33307-1.204056%202.0641-2.924136.77404-1.763082.77404-3.999185zm-3.35416.129006q0%206.106283-6.79432%206.106283h-7.35334v-12.169565h7.78336q3.09615%200%204.73022%201.591074%201.63408%201.548072%201.63408%204.472208zM210.32281%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142h-18.18984V0Zm27.69329-21.587003q0-2.193102-.73103-3.784176-.73104-1.591074-1.9781-2.623122-1.24705-1.07505-2.96713-1.591074t-3.69818-.516024h-11.91155V0h3.35416v-12.814596h7.13833L233.6729%200h3.87018l-6.62231-13.072608q3.22515-.688032%205.16024-2.838132%201.93509-2.1501%201.93509-5.676263zm-3.35416.129006q0%202.838131-1.63407%204.257197-1.59108%201.376064-4.94523%201.376064h-7.99837v-11.223521h8.42839q3.01014%200%204.55821%201.419066%201.59107%201.376064%201.59107%204.171194zM277.49192%200v-30.101399h-3.35415v12.857597h-14.9647v-12.857597h-3.35415V0h3.35415v-14.19066h14.9647V0Zm29.37035-12.298572v-17.802827h-3.35415v17.888831q0%204.9022282-1.67708%207.2673381-1.67708%202.36511-5.59026%202.36511-7.69736%200-7.69736-9.7184521v-17.802827h-3.35416v17.888831q0%206.2782922%202.70913%209.5034421%202.75213%203.18214789%208.17038%203.18214789%205.46125%200%208.12738-3.22514989%202.66612-3.2681519%202.66612-9.5464441zm28.2523%203.3971582q0-1.8060842-.51603-3.0961442-.51602-1.333062-1.33306-2.193102-.81704-.903042-1.84909-1.419066-1.03204-.559026-2.06409-.817038%201.93509-.688032%203.13914-2.1501%201.20406-1.505069%201.20406-3.999185%200-1.93509-.60203-3.354156-.60203-1.419066-1.72008-2.322108-1.07505-.946044-2.58012-1.376064-1.46207-.473022-3.26815-.473022h-11.00851V0h10.7935q4.77322%200%207.26734-2.1931019%202.53712-2.236104%202.53712-6.7083119zm-4.77323-13.5456292q0%201.978092-1.20405%203.397157-1.20406%201.376064-3.99919%201.376064h-7.26734v-9.374435h7.52535q2.53712%200%203.74118%201.29006%201.20405%201.247058%201.20405%203.311154zm1.41907%2013.7176372q0%202.58012-1.41907%204.1281919-1.41906%201.548072-4.81622%201.548072h-7.65436V-14.663682h7.48235q2.96714%200%204.68722%201.548072%201.72008%201.548072%201.72008%204.3862042z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-5.23714%2079.36255)%22%20aria-label%3D%22DEVELOPER%20HUB%22%2F%3E%3Cpath%20d%3D%22m18.792026%200-3.92084-7.4776021q1.624348-.7281561%202.576552-2.1284561.952204-1.4002998.952204-3.6127738%200-1.736372-.56012-2.94063-.532114-1.232264-1.54033-1.988426t-2.436522-1.092234q-1.4003-.364078-3.108666-.364078H1.988426V0h5.3491461v-6.6094161h2.1844681L12.714724%200Zm-5.797242-13.078802q0%201.064228-.56012%201.624348t-1.904408.56012H7.3375721v-4.284918h3.2767019q1.288276%200%201.82039.588126.56012.588126.56012%201.512324zM37.219965%200v-4.5649781h-9.830106v-3.36072h5.797242v-4.5089659h-5.797242v-2.604558h9.634064V-19.6042H22.012707V0Zm20.388361-9.9141242q0-2.7725938-.728156-4.6209898-.70015-1.848396-2.016432-2.968636-1.288276-1.148246-3.164678-1.624348-1.876402-.476102-4.172894-.476102h-6.86147V0h6.357362q2.604558%200%204.564978-.50410801Q53.575462-1.036222%2054.91975-2.184468q1.344288-1.1762521%202.016432-3.0526541.672144-1.904408.672144-4.6770021zm-5.573194.084018q0%201.456312-.252054%202.4645281-.252054.98021-.84018%201.596342-.56012.588126-1.456312.868186-.896192.252054-2.156462.252054h-1.176252V-14.955204h1.344288q1.26027%200%202.128456.308066.868186.28006%201.4003.896192.532114.616132.756162%201.596342.252054.98021.252054%202.3244978z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-2.65123%2027.43044)%22%20aria-label%3D%22RED%22%2F%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20442.7922%2047.06522)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M19.18411%200v-19.6042h-5.545188v7.14153H7.5336141v-7.14153H1.988426V0h5.5451881v-7.7296561h6.1053079V0Zm22.488833%200-7.113524-19.6042h-5.489176L21.956719%200h5.825248l1.064228-3.4447381h5.88126L35.791683%200Zm-8.26177-7.7576621h-3.248696l.364078-1.2882761q.252054-.924198.448096-1.6243478.196042-.70015.336072-1.26027.168036-.56012.28006-1.036222.112024-.476102.196042-.98021.08402.504108.196042.98021l.252054%201.008216q.168036.56012.364078%201.26027.196042.7001498.448096%201.6523538zm23.973112-7.1135239V-19.6042H40.972768v4.733014h5.489177V0h5.433164v-14.871186z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%2089.90877%2027.43044)%22%20aria-label%3D%22HAT%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E',\n dark: 'data:image/svg+xml,%3Csvg%20width%3D%22451.199%22%20height%3D%2279.993%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20style%3D%22fill%3A%23fff%22%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20169.9661%207.67311)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M25.629191-15.26571q0-3.87018-1.032048-6.665309-1.032048-2.79513-2.881134-4.601214-1.806084-1.849086-4.343201-2.709126-2.494116-.86004-5.461254-.86004H3.9561839V0h7.3533421q3.01014%200%205.633262-.81703798Q19.56591-1.677078%2021.500999-3.5261639q1.93509-1.849086%203.01014-4.7302199%201.118052-2.9241362%201.118052-7.0093262zm-3.354156.129006q0%203.22515-.731034%205.5472582-.731034%202.279106-2.107097%203.7411739-1.376064%201.462068-3.311154%202.1501-1.93509.64503-4.386204.64503H7.3103398V-27.048257h4.3432022q5.203242%200%207.912368%203.053142%202.709125%203.053142%202.709125%208.858411zM51.043415%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142H32.208539V0Zm28.553323-30.101399h-3.44016L69.405264-9.5894458l-.516024%201.548072q-.258012.86004-.559026%201.72008-.258012.8600399-.473021%201.6340759-.21501.731034-.344016%201.118052-.129006-.387018-.344016-1.118052-.21501-.731034-.473022-1.5480719-.258012-.86004-.559026-1.72008-.258012-.86004-.473022-1.548072L58.955779-30.101399h-3.526164L65.664091%200h3.698171zM104.62387%200v-3.0531419H89.143149V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.835691v-3.053142H85.788993V0Zm24.64014%200v-3.0531419h-14.8787V-30.101399h-3.35415V0Zm29.06938-15.093702q0-3.397158-.90304-6.235289-.90304-2.838132-2.53712-4.902228t-3.95618-3.182148q-2.27911-1.161054-5.07424-1.161054-2.79513%200-5.11724%201.161054-2.3221%201.161054-3.95618%203.22515t-2.53712%204.94523q-.90304%202.838131-.90304%206.235289%200%203.397158.86004%206.2352902.90304%202.838132%202.53712%204.9022279%201.63407%202.0640959%203.91318%203.22514992%202.32211%201.11805197%205.11724%201.11805197t5.11723-1.16105397q2.32211-1.16105402%203.95619-3.22514992%201.67708-2.0640959%202.58012-4.9022279.90304-2.8811342.90304-6.2782922zm-3.35416.086q0%202.838132-.68803%205.1602403-.68803%202.2791059-1.89209%203.9131819-1.20405%201.5910739-2.88113%202.4941159-1.67708.86004-3.61217.86004-1.97809%200-3.65517-.86004-1.67707-.903042-2.92413-2.5371179-1.20406-1.677078-1.93509-3.9561839-.68803-2.3221083-.68803-5.1602403t.68803-5.117237q.68803-2.322108%201.89209-3.913182%201.20405-1.634076%202.83813-2.494116%201.67708-.903042%203.61217-.903042%201.97809%200%203.65516.903042%201.67708.86004%202.92414%202.537118%201.24706%201.634076%201.93509%203.956184.73103%202.279105.73103%205.117237zm30.83244-6.106283q0-2.279106-.73104-3.956184-.73103-1.72008-2.02109-2.838132-1.29006-1.118052-3.05314-1.634076-1.72008-.559026-3.78418-.559026H164.9557V0h3.35415v-11.82555h7.31034q2.23611%200%204.12819-.602028%201.89209-.602028%203.22515-1.763082%201.33307-1.204056%202.0641-2.924136.77404-1.763082.77404-3.999185zm-3.35416.129006q0%206.106283-6.79432%206.106283h-7.35334v-12.169565h7.78336q3.09615%200%204.73022%201.591074%201.63408%201.548072%201.63408%204.472208zM210.32281%200v-3.0531419h-15.48072V-14.534676h8.6004v-3.053142h-8.6004v-9.460439h14.83569v-3.053142h-18.18984V0Zm27.69329-21.587003q0-2.193102-.73103-3.784176-.73104-1.591074-1.9781-2.623122-1.24705-1.07505-2.96713-1.591074t-3.69818-.516024h-11.91155V0h3.35416v-12.814596h7.13833L233.6729%200h3.87018l-6.62231-13.072608q3.22515-.688032%205.16024-2.838132%201.93509-2.1501%201.93509-5.676263zm-3.35416.129006q0%202.838131-1.63407%204.257197-1.59108%201.376064-4.94523%201.376064h-7.99837v-11.223521h8.42839q3.01014%200%204.55821%201.419066%201.59107%201.376064%201.59107%204.171194zM277.49192%200v-30.101399h-3.35415v12.857597h-14.9647v-12.857597h-3.35415V0h3.35415v-14.19066h14.9647V0Zm29.37035-12.298572v-17.802827h-3.35415v17.888831q0%204.9022282-1.67708%207.2673381-1.67708%202.36511-5.59026%202.36511-7.69736%200-7.69736-9.7184521v-17.802827h-3.35416v17.888831q0%206.2782922%202.70913%209.5034421%202.75213%203.18214789%208.17038%203.18214789%205.46125%200%208.12738-3.22514989%202.66612-3.2681519%202.66612-9.5464441zm28.2523%203.3971582q0-1.8060842-.51603-3.0961442-.51602-1.333062-1.33306-2.193102-.81704-.903042-1.84909-1.419066-1.03204-.559026-2.06409-.817038%201.93509-.688032%203.13914-2.1501%201.20406-1.505069%201.20406-3.999185%200-1.93509-.60203-3.354156-.60203-1.419066-1.72008-2.322108-1.07505-.946044-2.58012-1.376064-1.46207-.473022-3.26815-.473022h-11.00851V0h10.7935q4.77322%200%207.26734-2.1931019%202.53712-2.236104%202.53712-6.7083119zm-4.77323-13.5456292q0%201.978092-1.20405%203.397157-1.20406%201.376064-3.99919%201.376064h-7.26734v-9.374435h7.52535q2.53712%200%203.74118%201.29006%201.20405%201.247058%201.20405%203.311154zm1.41907%2013.7176372q0%202.58012-1.41907%204.1281919-1.41906%201.548072-4.81622%201.548072h-7.65436V-14.663682h7.48235q2.96714%200%204.68722%201.548072%201.72008%201.548072%201.72008%204.3862042z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-5.23714%2079.36255)%22%20aria-label%3D%22DEVELOPER%20HUB%22%2F%3E%3Cpath%20d%3D%22m18.792026%200-3.92084-7.4776021q1.624348-.7281561%202.576552-2.1284561.952204-1.4002998.952204-3.6127738%200-1.736372-.56012-2.94063-.532114-1.232264-1.54033-1.988426t-2.436522-1.092234q-1.4003-.364078-3.108666-.364078H1.988426V0h5.3491461v-6.6094161h2.1844681L12.714724%200Zm-5.797242-13.078802q0%201.064228-.56012%201.624348t-1.904408.56012H7.3375721v-4.284918h3.2767019q1.288276%200%201.82039.588126.56012.588126.56012%201.512324zM37.219965%200v-4.5649781h-9.830106v-3.36072h5.797242v-4.5089659h-5.797242v-2.604558h9.634064V-19.6042H22.012707V0Zm20.388361-9.9141242q0-2.7725938-.728156-4.6209898-.70015-1.848396-2.016432-2.968636-1.288276-1.148246-3.164678-1.624348-1.876402-.476102-4.172894-.476102h-6.86147V0h6.357362q2.604558%200%204.564978-.50410801Q53.575462-1.036222%2054.91975-2.184468q1.344288-1.1762521%202.016432-3.0526541.672144-1.904408.672144-4.6770021zm-5.573194.084018q0%201.456312-.252054%202.4645281-.252054.98021-.84018%201.596342-.56012.588126-1.456312.868186-.896192.252054-2.156462.252054h-1.176252V-14.955204h1.344288q1.26027%200%202.128456.308066.868186.28006%201.4003.896192.532114.616132.756162%201.596342.252054.98021.252054%202.3244978z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20-2.65123%2027.43044)%22%20aria-label%3D%22RED%22%2F%3E%3Cpath%20d%3D%22M6.3052259-2.8329q0-.6232379-.226632-1.1574419-.218538-.534204-.615144-.922716-.388512-.396606-.922716-.615144-.534204-.226632-1.157442-.226632-.6232379%200-1.1574419.226632-.534204.218538-.93081.615144-.38851202.388512-.61514401.922716-.218538.534204-.218538%201.1574419%200%20.623238.218538%201.157442.22663199.534204.61514401.93081001.396606.388512.93081.61514399.534204.218538%201.1574419.218538.623238%200%201.157442-.218538.534204-.22663199.922716-.61514399.396606-.39660601.615144-.93081001.226632-.534204.226632-1.157442zm-.598956%200q0%20.52611-.178068.963186-.178068.428982-.48564.736554-.307572.30757201-.736554.47754601-.428982.169974-.922716.169974-.5018279%200-.9308099-.169974-.420888-.169974-.72846-.47754601-.307572-.307572-.48564-.736554-.178068-.437076-.178068-.963186%200-.5261099.178068-.9550919.178068-.437076.48564-.744648.307572-.307572.72846-.477546.428982-.169974.9308099-.169974.493734%200%20.922716.169974t.736554.477546q.307572.307572.48564.744648.178068.428982.178068.9550919zm-.825588%201.513578-.631332-1.206006q.259008-.12141.412794-.339948.16188-.2266319.16188-.5908619%200-.56658-.339948-.801306t-.898434-.234726H2.161098v3.1728479h.8660579V-2.38773h.356136l.518016%201.068408zm-.93081-2.1125339q0%20.169974-.097128.259008-.089034.089034-.307572.089034h-.518016v-.68799h.534204q.210444%200%20.299478.097128.089034.089034.089034.24282z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%20442.7922%2047.06522)%22%20aria-label%3D%22%C2%AE%22%2F%3E%3Cpath%20d%3D%22M19.18411%200v-19.6042h-5.545188v7.14153H7.5336141v-7.14153H1.988426V0h5.5451881v-7.7296561h6.1053079V0Zm22.488833%200-7.113524-19.6042h-5.489176L21.956719%200h5.825248l1.064228-3.4447381h5.88126L35.791683%200Zm-8.26177-7.7576621h-3.248696l.364078-1.2882761q.252054-.924198.448096-1.6243478.196042-.70015.336072-1.26027.168036-.56012.28006-1.036222.112024-.476102.196042-.98021.08402.504108.196042.98021l.252054%201.008216q.168036.56012.364078%201.26027.196042.7001498.448096%201.6523538zm23.973112-7.1135239V-19.6042H40.972768v4.733014h5.489177V0h5.433164v-14.871186z%22%20transform%3D%22matrix(1.33333%200%200%201.33333%2089.90877%2027.43044)%22%20aria-label%3D%22HAT%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E',\n};\n"],"names":[],"mappings":"AAsBO,MAAM,QAAW,GAAA;AAAA,EACtB,KACE,EAAA,yuTAAA;AAAA,EACF,IAAM,EAAA;AACR;;;;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { GlobalHeaderComponentBlueprint } from '../extensions/blueprints.esm.js';
|
|
3
|
+
import { SearchComponent } from '../../components/SearchComponent/SearchComponent.esm.js';
|
|
4
|
+
import { Spacer } from '../../components/Spacer/Spacer.esm.js';
|
|
5
|
+
import { StarredDropdown } from '../../components/HeaderDropdownComponent/StarredDropdown.esm.js';
|
|
6
|
+
import { NotificationButton } from '../../components/NotificationButton/NotificationButton.esm.js';
|
|
7
|
+
import { Divider } from '../../components/Divider/Divider.esm.js';
|
|
8
|
+
import { CompanyLogo } from '../../components/CompanyLogo/CompanyLogo.esm.js';
|
|
9
|
+
import { HeaderIconButton } from '../../components/HeaderIconButton/HeaderIconButton.esm.js';
|
|
10
|
+
import { ProfileDropdown } from '../components/ProfileDropdown.esm.js';
|
|
11
|
+
import { HelpDropdown } from '../components/HelpDropdown.esm.js';
|
|
12
|
+
import { ApplicationLauncherDropdown } from '../components/ApplicationLauncherDropdown.esm.js';
|
|
13
|
+
import { rhdhLogo } from './rhdhLogo.esm.js';
|
|
14
|
+
|
|
15
|
+
const CompanyLogoWrapper = () => /* @__PURE__ */ jsx(CompanyLogo, { to: "/", logo: rhdhLogo });
|
|
16
|
+
const SelfServiceButton = () => /* @__PURE__ */ jsx(
|
|
17
|
+
HeaderIconButton,
|
|
18
|
+
{
|
|
19
|
+
title: "Self-service",
|
|
20
|
+
titleKey: "create.title",
|
|
21
|
+
icon: "addCircleOutline",
|
|
22
|
+
to: "/create"
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
const companyLogoExtension = GlobalHeaderComponentBlueprint.make({
|
|
26
|
+
name: "company-logo",
|
|
27
|
+
params: { component: CompanyLogoWrapper, priority: 200 }
|
|
28
|
+
});
|
|
29
|
+
const searchExtension = GlobalHeaderComponentBlueprint.make({
|
|
30
|
+
name: "search",
|
|
31
|
+
params: {
|
|
32
|
+
component: SearchComponent,
|
|
33
|
+
priority: 100,
|
|
34
|
+
layout: { flexGrow: 1 }
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const spacerExtension = GlobalHeaderComponentBlueprint.make({
|
|
38
|
+
name: "spacer",
|
|
39
|
+
params: { component: Spacer, priority: 99, layout: { flexGrow: 0 } }
|
|
40
|
+
});
|
|
41
|
+
const selfServiceButtonExtension = GlobalHeaderComponentBlueprint.make({
|
|
42
|
+
name: "self-service-button",
|
|
43
|
+
params: {
|
|
44
|
+
component: SelfServiceButton,
|
|
45
|
+
priority: 90
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const starredDropdownExtension = GlobalHeaderComponentBlueprint.make({
|
|
49
|
+
name: "starred-dropdown",
|
|
50
|
+
params: { component: StarredDropdown, priority: 85 }
|
|
51
|
+
});
|
|
52
|
+
const applicationLauncherDropdownExtension = GlobalHeaderComponentBlueprint.make({
|
|
53
|
+
name: "app-launcher-dropdown",
|
|
54
|
+
params: { component: ApplicationLauncherDropdown, priority: 82 }
|
|
55
|
+
});
|
|
56
|
+
const helpDropdownExtension = GlobalHeaderComponentBlueprint.make({
|
|
57
|
+
name: "help-dropdown",
|
|
58
|
+
params: { component: HelpDropdown, priority: 80 }
|
|
59
|
+
});
|
|
60
|
+
const notificationButtonExtension = GlobalHeaderComponentBlueprint.make({
|
|
61
|
+
name: "notification-button",
|
|
62
|
+
params: { component: NotificationButton, priority: 70 }
|
|
63
|
+
});
|
|
64
|
+
const dividerExtension = GlobalHeaderComponentBlueprint.make({
|
|
65
|
+
name: "divider",
|
|
66
|
+
params: { component: Divider, priority: 50 }
|
|
67
|
+
});
|
|
68
|
+
const profileDropdownExtension = GlobalHeaderComponentBlueprint.make({
|
|
69
|
+
name: "profile-dropdown",
|
|
70
|
+
params: { component: ProfileDropdown, priority: 10 }
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export { applicationLauncherDropdownExtension, companyLogoExtension, dividerExtension, helpDropdownExtension, notificationButtonExtension, profileDropdownExtension, searchExtension, selfServiceButtonExtension, spacerExtension, starredDropdownExtension };
|
|
74
|
+
//# sourceMappingURL=toolbarExtensions.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbarExtensions.esm.js","sources":["../../../src/alpha/defaults/toolbarExtensions.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Default toolbar component extensions (`gh-component`) for the global header.\n *\n * @internal\n */\n\nimport { GlobalHeaderComponentBlueprint } from '../extensions/blueprints';\n\nimport { SearchComponent } from '../../components/SearchComponent/SearchComponent';\nimport { Spacer } from '../../components/Spacer/Spacer';\nimport { StarredDropdown } from '../../components/HeaderDropdownComponent/StarredDropdown';\nimport { NotificationButton } from '../../components/NotificationButton/NotificationButton';\nimport { Divider } from '../../components/Divider/Divider';\nimport { CompanyLogo } from '../../components/CompanyLogo/CompanyLogo';\nimport { HeaderIconButton } from '../../components/HeaderIconButton/HeaderIconButton';\nimport { ProfileDropdown } from '../components/ProfileDropdown';\nimport { HelpDropdown } from '../components/HelpDropdown';\nimport { ApplicationLauncherDropdown } from '../components/ApplicationLauncherDropdown';\nimport { rhdhLogo } from './rhdhLogo';\n\nconst CompanyLogoWrapper = () => <CompanyLogo to=\"/\" logo={rhdhLogo} />;\n\nconst SelfServiceButton = () => (\n <HeaderIconButton\n title=\"Self-service\"\n titleKey=\"create.title\"\n icon=\"addCircleOutline\"\n to=\"/create\"\n />\n);\n\n/** @alpha */\nexport const companyLogoExtension = GlobalHeaderComponentBlueprint.make({\n name: 'company-logo',\n params: { component: CompanyLogoWrapper, priority: 200 },\n});\n\n/** @alpha */\nexport const searchExtension = GlobalHeaderComponentBlueprint.make({\n name: 'search',\n params: {\n component: SearchComponent,\n priority: 100,\n layout: { flexGrow: 1 },\n },\n});\n\n/** @alpha */\nexport const spacerExtension = GlobalHeaderComponentBlueprint.make({\n name: 'spacer',\n params: { component: Spacer, priority: 99, layout: { flexGrow: 0 } },\n});\n\n/** @alpha */\nexport const selfServiceButtonExtension = GlobalHeaderComponentBlueprint.make({\n name: 'self-service-button',\n params: {\n component: SelfServiceButton,\n priority: 90,\n },\n});\n\n/** @alpha */\nexport const starredDropdownExtension = GlobalHeaderComponentBlueprint.make({\n name: 'starred-dropdown',\n params: { component: StarredDropdown, priority: 85 },\n});\n\n/** @alpha */\nexport const applicationLauncherDropdownExtension =\n GlobalHeaderComponentBlueprint.make({\n name: 'app-launcher-dropdown',\n params: { component: ApplicationLauncherDropdown, priority: 82 },\n });\n\n/** @alpha */\nexport const helpDropdownExtension = GlobalHeaderComponentBlueprint.make({\n name: 'help-dropdown',\n params: { component: HelpDropdown, priority: 80 },\n});\n\n/** @alpha */\nexport const notificationButtonExtension = GlobalHeaderComponentBlueprint.make({\n name: 'notification-button',\n params: { component: NotificationButton, priority: 70 },\n});\n\n/** @alpha */\nexport const dividerExtension = GlobalHeaderComponentBlueprint.make({\n name: 'divider',\n params: { component: Divider, priority: 50 },\n});\n\n/** @alpha */\nexport const profileDropdownExtension = GlobalHeaderComponentBlueprint.make({\n name: 'profile-dropdown',\n params: { component: ProfileDropdown, priority: 10 },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAoCA,MAAM,qBAAqB,sBAAM,GAAA,CAAC,eAAY,EAAG,EAAA,GAAA,EAAI,MAAM,QAAU,EAAA,CAAA;AAErE,MAAM,oBAAoB,sBACxB,GAAA;AAAA,EAAC,gBAAA;AAAA,EAAA;AAAA,IACC,KAAM,EAAA,cAAA;AAAA,IACN,QAAS,EAAA,cAAA;AAAA,IACT,IAAK,EAAA,kBAAA;AAAA,IACL,EAAG,EAAA;AAAA;AACL,CAAA;AAIW,MAAA,oBAAA,GAAuB,+BAA+B,IAAK,CAAA;AAAA,EACtE,IAAM,EAAA,cAAA;AAAA,EACN,MAAQ,EAAA,EAAE,SAAW,EAAA,kBAAA,EAAoB,UAAU,GAAI;AACzD,CAAC;AAGY,MAAA,eAAA,GAAkB,+BAA+B,IAAK,CAAA;AAAA,EACjE,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAW,EAAA,eAAA;AAAA,IACX,QAAU,EAAA,GAAA;AAAA,IACV,MAAA,EAAQ,EAAE,QAAA,EAAU,CAAE;AAAA;AAE1B,CAAC;AAGY,MAAA,eAAA,GAAkB,+BAA+B,IAAK,CAAA;AAAA,EACjE,IAAM,EAAA,QAAA;AAAA,EACN,MAAA,EAAQ,EAAE,SAAA,EAAW,MAAQ,EAAA,QAAA,EAAU,IAAI,MAAQ,EAAA,EAAE,QAAU,EAAA,CAAA,EAAI;AACrE,CAAC;AAGY,MAAA,0BAAA,GAA6B,+BAA+B,IAAK,CAAA;AAAA,EAC5E,IAAM,EAAA,qBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAW,EAAA,iBAAA;AAAA,IACX,QAAU,EAAA;AAAA;AAEd,CAAC;AAGY,MAAA,wBAAA,GAA2B,+BAA+B,IAAK,CAAA;AAAA,EAC1E,IAAM,EAAA,kBAAA;AAAA,EACN,MAAQ,EAAA,EAAE,SAAW,EAAA,eAAA,EAAiB,UAAU,EAAG;AACrD,CAAC;AAGY,MAAA,oCAAA,GACX,+BAA+B,IAAK,CAAA;AAAA,EAClC,IAAM,EAAA,uBAAA;AAAA,EACN,MAAQ,EAAA,EAAE,SAAW,EAAA,2BAAA,EAA6B,UAAU,EAAG;AACjE,CAAC;AAGU,MAAA,qBAAA,GAAwB,+BAA+B,IAAK,CAAA;AAAA,EACvE,IAAM,EAAA,eAAA;AAAA,EACN,MAAQ,EAAA,EAAE,SAAW,EAAA,YAAA,EAAc,UAAU,EAAG;AAClD,CAAC;AAGY,MAAA,2BAAA,GAA8B,+BAA+B,IAAK,CAAA;AAAA,EAC7E,IAAM,EAAA,qBAAA;AAAA,EACN,MAAQ,EAAA,EAAE,SAAW,EAAA,kBAAA,EAAoB,UAAU,EAAG;AACxD,CAAC;AAGY,MAAA,gBAAA,GAAmB,+BAA+B,IAAK,CAAA;AAAA,EAClE,IAAM,EAAA,SAAA;AAAA,EACN,MAAQ,EAAA,EAAE,SAAW,EAAA,OAAA,EAAS,UAAU,EAAG;AAC7C,CAAC;AAGY,MAAA,wBAAA,GAA2B,+BAA+B,IAAK,CAAA;AAAA,EAC1E,IAAM,EAAA,kBAAA;AAAA,EACN,MAAQ,EAAA,EAAE,SAAW,EAAA,eAAA,EAAiB,UAAU,EAAG;AACrD,CAAC;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
const GlobalHeaderContext = createContext({
|
|
5
|
+
components: [],
|
|
6
|
+
menuItems: []
|
|
7
|
+
});
|
|
8
|
+
const GlobalHeaderProvider = ({
|
|
9
|
+
components,
|
|
10
|
+
menuItems,
|
|
11
|
+
children
|
|
12
|
+
}) => {
|
|
13
|
+
const value = useMemo(
|
|
14
|
+
() => ({ components, menuItems }),
|
|
15
|
+
[components, menuItems]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ jsx(GlobalHeaderContext.Provider, { value, children });
|
|
18
|
+
};
|
|
19
|
+
function useGlobalHeaderComponents() {
|
|
20
|
+
return useContext(GlobalHeaderContext).components;
|
|
21
|
+
}
|
|
22
|
+
function useGlobalHeaderMenuItems(target) {
|
|
23
|
+
const { menuItems } = useContext(GlobalHeaderContext);
|
|
24
|
+
return useMemo(
|
|
25
|
+
() => menuItems.filter((item) => item.target === target),
|
|
26
|
+
[menuItems, target]
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { GlobalHeaderProvider, useGlobalHeaderComponents, useGlobalHeaderMenuItems };
|
|
31
|
+
//# sourceMappingURL=GlobalHeaderContext.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalHeaderContext.esm.js","sources":["../../../src/alpha/extensions/GlobalHeaderContext.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createContext, useContext, useMemo } from 'react';\n\nimport type {\n GlobalHeaderComponentData,\n GlobalHeaderMenuItemData,\n} from '../types';\n\ninterface GlobalHeaderContextValue {\n components: GlobalHeaderComponentData[];\n menuItems: GlobalHeaderMenuItemData[];\n}\n\nconst GlobalHeaderContext = createContext<GlobalHeaderContextValue>({\n components: [],\n menuItems: [],\n});\n\n/**\n * Provider that distributes collected header extension data to child components.\n * Used internally by the globalHeaderModule wrapper factory.\n *\n * @internal\n */\nexport const GlobalHeaderProvider = ({\n components,\n menuItems,\n children,\n}: GlobalHeaderContextValue & { children: React.ReactNode }) => {\n const value = useMemo(\n () => ({ components, menuItems }),\n [components, menuItems],\n );\n return (\n <GlobalHeaderContext.Provider value={value}>\n {children}\n </GlobalHeaderContext.Provider>\n );\n};\n\n/**\n * Returns all toolbar-level header components, sorted by priority (highest first).\n *\n * @alpha\n */\nexport function useGlobalHeaderComponents(): GlobalHeaderComponentData[] {\n return useContext(GlobalHeaderContext).components;\n}\n\n/**\n * Returns menu items for a specific dropdown target, sorted by priority (highest first).\n *\n * @alpha\n */\nexport function useGlobalHeaderMenuItems(\n target: string,\n): GlobalHeaderMenuItemData[] {\n const { menuItems } = useContext(GlobalHeaderContext);\n return useMemo(\n () => menuItems.filter(item => item.target === target),\n [menuItems, target],\n );\n}\n"],"names":[],"mappings":";;;AA4BA,MAAM,sBAAsB,aAAwC,CAAA;AAAA,EAClE,YAAY,EAAC;AAAA,EACb,WAAW;AACb,CAAC,CAAA;AAQM,MAAM,uBAAuB,CAAC;AAAA,EACnC,UAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAgE,KAAA;AAC9D,EAAA,MAAM,KAAQ,GAAA,OAAA;AAAA,IACZ,OAAO,EAAE,UAAA,EAAY,SAAU,EAAA,CAAA;AAAA,IAC/B,CAAC,YAAY,SAAS;AAAA,GACxB;AACA,EAAA,uBACG,GAAA,CAAA,mBAAA,CAAoB,QAApB,EAAA,EAA6B,OAC3B,QACH,EAAA,CAAA;AAEJ;AAOO,SAAS,yBAAyD,GAAA;AACvE,EAAO,OAAA,UAAA,CAAW,mBAAmB,CAAE,CAAA,UAAA;AACzC;AAOO,SAAS,yBACd,MAC4B,EAAA;AAC5B,EAAA,MAAM,EAAE,SAAA,EAAc,GAAA,UAAA,CAAW,mBAAmB,CAAA;AACpD,EAAO,OAAA,OAAA;AAAA,IACL,MAAM,SAAU,CAAA,MAAA,CAAO,CAAQ,IAAA,KAAA,IAAA,CAAK,WAAW,MAAM,CAAA;AAAA,IACrD,CAAC,WAAW,MAAM;AAAA,GACpB;AACF;;;;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createExtensionBlueprint } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import IconButton from '@mui/material/IconButton';
|
|
4
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
5
|
+
import { HeaderIconButton } from '../../components/HeaderIconButton/HeaderIconButton.esm.js';
|
|
6
|
+
import { HeaderIcon } from '../../components/HeaderIcon/HeaderIcon.esm.js';
|
|
7
|
+
import { useTranslation } from '../../hooks/useTranslation.esm.js';
|
|
8
|
+
import { translateWithFallback } from '../../utils/translationUtils.esm.js';
|
|
9
|
+
import { globalHeaderComponentDataRef, globalHeaderMenuItemDataRef } from './dataRefs.esm.js';
|
|
10
|
+
|
|
11
|
+
function createDataDrivenToolbarComponent(params) {
|
|
12
|
+
if (params.link) {
|
|
13
|
+
const LinkButton = () => /* @__PURE__ */ jsx(
|
|
14
|
+
HeaderIconButton,
|
|
15
|
+
{
|
|
16
|
+
title: params.title ?? "",
|
|
17
|
+
titleKey: params.titleKey,
|
|
18
|
+
icon: params.icon ?? "",
|
|
19
|
+
tooltip: params.tooltip,
|
|
20
|
+
to: params.link
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
return LinkButton;
|
|
24
|
+
}
|
|
25
|
+
const ActionButton = () => {
|
|
26
|
+
const { t } = useTranslation();
|
|
27
|
+
const displayTitle = translateWithFallback(
|
|
28
|
+
t,
|
|
29
|
+
params.titleKey,
|
|
30
|
+
params.title
|
|
31
|
+
);
|
|
32
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: params.tooltip ?? displayTitle ?? "", children: /* @__PURE__ */ jsx(
|
|
33
|
+
IconButton,
|
|
34
|
+
{
|
|
35
|
+
onClick: params.onClick,
|
|
36
|
+
color: "inherit",
|
|
37
|
+
size: "small",
|
|
38
|
+
"aria-label": displayTitle ?? "",
|
|
39
|
+
children: params.icon && /* @__PURE__ */ jsx(HeaderIcon, { icon: params.icon, size: "small" })
|
|
40
|
+
}
|
|
41
|
+
) });
|
|
42
|
+
};
|
|
43
|
+
return ActionButton;
|
|
44
|
+
}
|
|
45
|
+
const GlobalHeaderComponentBlueprint = createExtensionBlueprint({
|
|
46
|
+
kind: "gh-component",
|
|
47
|
+
attachTo: {
|
|
48
|
+
id: "app-root-wrapper:app/global-header",
|
|
49
|
+
input: "components"
|
|
50
|
+
},
|
|
51
|
+
output: [globalHeaderComponentDataRef],
|
|
52
|
+
dataRefs: { componentData: globalHeaderComponentDataRef },
|
|
53
|
+
config: {
|
|
54
|
+
schema: {
|
|
55
|
+
priority: (z) => z.number().optional()
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
*factory(params, { config }) {
|
|
59
|
+
const component = params.component ?? createDataDrivenToolbarComponent(params);
|
|
60
|
+
yield globalHeaderComponentDataRef({
|
|
61
|
+
component,
|
|
62
|
+
priority: config.priority ?? params.priority,
|
|
63
|
+
layout: params.layout
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const GlobalHeaderMenuItemBlueprint = createExtensionBlueprint({
|
|
68
|
+
kind: "gh-menu-item",
|
|
69
|
+
attachTo: {
|
|
70
|
+
id: "app-root-wrapper:app/global-header",
|
|
71
|
+
input: "menuItems"
|
|
72
|
+
},
|
|
73
|
+
output: [globalHeaderMenuItemDataRef],
|
|
74
|
+
dataRefs: { menuItemData: globalHeaderMenuItemDataRef },
|
|
75
|
+
config: {
|
|
76
|
+
schema: {
|
|
77
|
+
priority: (z) => z.number().optional(),
|
|
78
|
+
title: (z) => z.string().optional(),
|
|
79
|
+
titleKey: (z) => z.string().optional(),
|
|
80
|
+
icon: (z) => z.string().optional(),
|
|
81
|
+
link: (z) => z.string().optional(),
|
|
82
|
+
sectionLabel: (z) => z.string().optional(),
|
|
83
|
+
sectionLink: (z) => z.string().optional(),
|
|
84
|
+
sectionLinkLabel: (z) => z.string().optional()
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
*factory(params, { config }) {
|
|
88
|
+
const title = config.title ?? params.title;
|
|
89
|
+
const titleKey = config.titleKey ?? (config.title ? void 0 : params.titleKey);
|
|
90
|
+
const link = config.link ?? params.link;
|
|
91
|
+
const hasDataFields = !!(title || titleKey || link);
|
|
92
|
+
yield globalHeaderMenuItemDataRef({
|
|
93
|
+
target: params.target,
|
|
94
|
+
component: params.component,
|
|
95
|
+
type: params.component && !hasDataFields ? "component" : "data",
|
|
96
|
+
title,
|
|
97
|
+
titleKey,
|
|
98
|
+
icon: config.icon ?? params.icon,
|
|
99
|
+
link,
|
|
100
|
+
onClick: params.onClick,
|
|
101
|
+
subTitle: params.subTitle,
|
|
102
|
+
subTitleKey: params.subTitleKey,
|
|
103
|
+
sectionLabel: config.sectionLabel ?? params.sectionLabel,
|
|
104
|
+
sectionLink: config.sectionLink ?? params.sectionLink,
|
|
105
|
+
sectionLinkLabel: config.sectionLinkLabel ?? params.sectionLinkLabel,
|
|
106
|
+
priority: config.priority ?? params.priority
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export { GlobalHeaderComponentBlueprint, GlobalHeaderMenuItemBlueprint };
|
|
112
|
+
//# sourceMappingURL=blueprints.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprints.esm.js","sources":["../../../src/alpha/extensions/blueprints.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ComponentType } from 'react';\nimport { createExtensionBlueprint } from '@backstage/frontend-plugin-api';\n\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { HeaderIconButton } from '../../components/HeaderIconButton/HeaderIconButton';\nimport { HeaderIcon } from '../../components/HeaderIcon/HeaderIcon';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { translateWithFallback } from '../../utils/translationUtils';\n\nimport {\n globalHeaderComponentDataRef,\n globalHeaderMenuItemDataRef,\n} from './dataRefs';\n\n/**\n * Params accepted by {@link GlobalHeaderComponentBlueprint}.\n *\n * Supply `component` for full control (tier 2/3), or provide data fields\n * (`icon`, `title`, `link`/`onClick`) and let the framework render a\n * consistent `HeaderIconButton` automatically (tier 1).\n *\n * @alpha\n */\nexport interface ToolbarComponentParams {\n icon?: string;\n title?: string;\n titleKey?: string;\n tooltip?: string;\n link?: string;\n onClick?: () => void;\n component?: ComponentType<any>;\n priority?: number;\n /** MUI `sx`-compatible layout overrides applied by the header wrapper. */\n layout?: Record<string, unknown>;\n}\n\n/**\n * Params accepted by {@link GlobalHeaderMenuItemBlueprint}.\n *\n * Supply `component` for full control, or provide data fields\n * (`title`, `icon`, `link`) and let the framework render a\n * consistent `MenuItemLink` automatically.\n *\n * Items with a `component` but **no** data fields (`title`, `link`, etc.)\n * are rendered directly by the dropdown — the component controls its own\n * layout and `MenuItem` wrapping (e.g. `SoftwareTemplatesSection`,\n * `LogoutButton`).\n *\n * Items with data fields (with or without a custom component) are grouped\n * by `sectionLabel` and rendered inside `MenuSection`.\n *\n * @alpha\n */\nexport interface MenuItemParams {\n target: string;\n title?: string;\n titleKey?: string;\n subTitle?: string;\n subTitleKey?: string;\n icon?: string;\n link?: string;\n onClick?: () => void;\n component?: ComponentType<any>;\n priority?: number;\n /** Section label used as the grouping key and the displayed section header. */\n sectionLabel?: string;\n /** URL rendered as a clickable link in the section header row. */\n sectionLink?: string;\n /** Display text for the section header link. */\n sectionLinkLabel?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Data-driven component factories\n// ---------------------------------------------------------------------------\n\nfunction createDataDrivenToolbarComponent(\n params: ToolbarComponentParams,\n): ComponentType<any> {\n if (params.link) {\n const LinkButton = () => (\n <HeaderIconButton\n title={params.title ?? ''}\n titleKey={params.titleKey}\n icon={params.icon ?? ''}\n tooltip={params.tooltip}\n to={params.link!}\n />\n );\n return LinkButton;\n }\n\n const ActionButton = () => {\n const { t } = useTranslation();\n const displayTitle = translateWithFallback(\n t,\n params.titleKey,\n params.title,\n );\n return (\n <Tooltip title={params.tooltip ?? displayTitle ?? ''}>\n <IconButton\n onClick={params.onClick}\n color=\"inherit\"\n size=\"small\"\n aria-label={displayTitle ?? ''}\n >\n {params.icon && <HeaderIcon icon={params.icon} size=\"small\" />}\n </IconButton>\n </Tooltip>\n );\n };\n return ActionButton;\n}\n\n// ---------------------------------------------------------------------------\n// Blueprints\n// ---------------------------------------------------------------------------\n\n/**\n * Blueprint for contributing toolbar-level items to the global header.\n *\n * Supports three tiers:\n *\n * 1. **Data-driven** -- provide `icon`, `title`, `link` (or `onClick`) and the\n * framework renders a consistent `HeaderIconButton` automatically.\n * 2. **Building blocks** -- provide a `component` that uses the exported\n * `GlobalHeaderIconButton` / `GlobalHeaderDropdown` for consistent styling.\n * 3. **Fully custom** -- provide any arbitrary React component.\n *\n * The `priority` can be overridden by deployers via `app-config.yaml`:\n *\n * ```yaml\n * app:\n * extensions:\n * - gh-component:global-header/search:\n * config:\n * priority: 200\n * ```\n *\n * @alpha\n */\nexport const GlobalHeaderComponentBlueprint = createExtensionBlueprint({\n kind: 'gh-component',\n attachTo: {\n id: 'app-root-wrapper:app/global-header',\n input: 'components',\n },\n output: [globalHeaderComponentDataRef],\n dataRefs: { componentData: globalHeaderComponentDataRef },\n config: {\n schema: {\n priority: z => z.number().optional(),\n },\n },\n *factory(params: ToolbarComponentParams, { config }) {\n const component =\n params.component ?? createDataDrivenToolbarComponent(params);\n\n yield globalHeaderComponentDataRef({\n component,\n priority: config.priority ?? params.priority,\n layout: params.layout,\n });\n },\n});\n\n/**\n * Blueprint for contributing menu items to a header dropdown.\n *\n * The `target` field routes the item to the correct dropdown (e.g. `'create'`,\n * `'profile'`, `'help'`, `'app-launcher'`, or any custom target).\n *\n * **Custom components** (only `component`, no data fields) are rendered\n * directly by the dropdown — they control their own layout and wrapping.\n *\n * **Data-driven items** (at least `title`/`link`/`icon`) are grouped by\n * `sectionLabel` and rendered through `MenuSection` for consistent styling.\n *\n * Deployers can override any data field via `app-config.yaml`:\n *\n * ```yaml\n * app:\n * extensions:\n * - gh-menu-item:global-header/app-launcher-devhub:\n * config:\n * title: \"Custom Title\"\n * sectionLabel: mySection\n * ```\n *\n * @alpha\n */\nexport const GlobalHeaderMenuItemBlueprint = createExtensionBlueprint({\n kind: 'gh-menu-item',\n attachTo: {\n id: 'app-root-wrapper:app/global-header',\n input: 'menuItems',\n },\n output: [globalHeaderMenuItemDataRef],\n dataRefs: { menuItemData: globalHeaderMenuItemDataRef },\n config: {\n schema: {\n priority: z => z.number().optional(),\n title: z => z.string().optional(),\n titleKey: z => z.string().optional(),\n icon: z => z.string().optional(),\n link: z => z.string().optional(),\n sectionLabel: z => z.string().optional(),\n sectionLink: z => z.string().optional(),\n sectionLinkLabel: z => z.string().optional(),\n },\n },\n *factory(params: MenuItemParams, { config }) {\n const title = config.title ?? params.title;\n const titleKey =\n config.titleKey ?? (config.title ? undefined : params.titleKey);\n const link = config.link ?? params.link;\n const hasDataFields = !!(title || titleKey || link);\n\n yield globalHeaderMenuItemDataRef({\n target: params.target,\n component: params.component,\n type: params.component && !hasDataFields ? 'component' : 'data',\n title,\n titleKey,\n icon: config.icon ?? params.icon,\n link,\n onClick: params.onClick,\n subTitle: params.subTitle,\n subTitleKey: params.subTitleKey,\n sectionLabel: config.sectionLabel ?? params.sectionLabel,\n sectionLink: config.sectionLink ?? params.sectionLink,\n sectionLinkLabel: config.sectionLinkLabel ?? params.sectionLinkLabel,\n priority: config.priority ?? params.priority,\n });\n },\n});\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createExtensionDataRef } from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
const globalHeaderComponentDataRef = createExtensionDataRef().with({
|
|
4
|
+
id: "global-header.component"
|
|
5
|
+
});
|
|
6
|
+
const globalHeaderMenuItemDataRef = createExtensionDataRef().with({
|
|
7
|
+
id: "global-header.menu-item"
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { globalHeaderComponentDataRef, globalHeaderMenuItemDataRef };
|
|
11
|
+
//# sourceMappingURL=dataRefs.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataRefs.esm.js","sources":["../../../src/alpha/extensions/dataRefs.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createExtensionDataRef } from '@backstage/frontend-plugin-api';\n\nimport type {\n GlobalHeaderComponentData,\n GlobalHeaderMenuItemData,\n} from '../types';\n\n/**\n * Extension data ref carrying toolbar component data from a plugin to the\n * global header wrapper.\n *\n * @alpha\n */\nexport const globalHeaderComponentDataRef =\n createExtensionDataRef<GlobalHeaderComponentData>().with({\n id: 'global-header.component',\n });\n\n/**\n * Extension data ref carrying menu item data from a plugin to the\n * global header wrapper.\n *\n * @alpha\n */\nexport const globalHeaderMenuItemDataRef =\n createExtensionDataRef<GlobalHeaderMenuItemData>().with({\n id: 'global-header.menu-item',\n });\n"],"names":[],"mappings":";;AA6Ba,MAAA,4BAAA,GACX,sBAAkD,EAAA,CAAE,IAAK,CAAA;AAAA,EACvD,EAAI,EAAA;AACN,CAAC;AAQU,MAAA,2BAAA,GACX,sBAAiD,EAAA,CAAE,IAAK,CAAA;AAAA,EACtD,EAAI,EAAA;AACN,CAAC;;;;"}
|