@red-hat-developer-hub/backstage-plugin-global-header 1.12.0 → 1.14.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-global-header
2
2
 
3
+ ## 1.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7eb9524: - Add suuport for closing Help dropdown on menu-item click and removed QuickstartButton to better align with quickstart context.
8
+
9
+ ## 1.13.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ba5e13c: Add dynamic profile link support to ProfileDropdown based on current user identity.
14
+
3
15
  ## 1.12.0
4
16
 
5
17
  ### Minor Changes
@@ -71,11 +71,6 @@ dynamicPlugins:
71
71
  config:
72
72
  priority: 80
73
73
 
74
- - mountPoint: global.header/help
75
- importName: QuickstartButton
76
- config:
77
- priority: 100
78
-
79
74
  - mountPoint: global.header/help
80
75
  importName: SupportButton
81
76
  config:
@@ -67,7 +67,16 @@ const MenuSection = ({
67
67
  sx: { py: 0.5 },
68
68
  component: link ? Link : Fragment$1,
69
69
  to: link,
70
- children: /* @__PURE__ */ jsx(Component, { icon, to: link, title: label, subTitle: subLabel })
70
+ children: /* @__PURE__ */ jsx(
71
+ Component,
72
+ {
73
+ icon,
74
+ to: link,
75
+ title: label,
76
+ subTitle: subLabel,
77
+ onClick: handleClose
78
+ }
79
+ )
71
80
  },
72
81
  `menu-item-${index.toString()}`
73
82
  )),
@@ -1 +1 @@
1
- {"version":3,"file":"MenuSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/MenuSection.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 { Fragment } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport Divider from '@mui/material/Divider';\nimport Box from '@mui/material/Box';\nimport MenuItem from '@mui/material/MenuItem';\nimport { Link } from '@backstage/core-components';\nimport { MenuItemLinkProps } from '../MenuItemLink/MenuItemLink';\nimport ListSubheader from '@mui/material/ListSubheader';\n\n/**\n * Menu item configuration\n *\n * @public\n */\nexport interface MenuItemConfig {\n Component: ComponentType<MenuItemLinkProps | {}>;\n label: string;\n icon?: string;\n subLabel?: string;\n link?: string;\n}\n\nexport interface MenuSectionConfig {\n sectionLabel?: string;\n optionalLink?: string;\n optionalLinkLabel?: string;\n items: MenuItemConfig[];\n hideDivider?: boolean;\n handleClose: () => void;\n}\n\nexport const MenuSection: FC<MenuSectionConfig> = ({\n sectionLabel,\n optionalLink,\n optionalLinkLabel,\n items,\n hideDivider = false,\n handleClose,\n}) => {\n const hasClickableSubheader =\n optionalLink && optionalLinkLabel && items.length > 0;\n\n return (\n <>\n {sectionLabel && (\n <MenuItem\n sx={{\n p: 0,\n }}\n disableRipple\n disableTouchRipple\n component={hasClickableSubheader ? Link : Fragment}\n to={optionalLink}\n onClick={handleClose}\n >\n <ListSubheader\n sx={{\n backgroundColor: 'transparent',\n m: 0,\n color: 'text.disabled',\n lineHeight: 2,\n mt: '0.5rem',\n fontWeight: 400,\n }}\n >\n {sectionLabel}\n </ListSubheader>\n\n {optionalLinkLabel && (\n <Box\n sx={{\n fontSize: '0.875em',\n mr: 2,\n flexGrow: 1,\n textAlign: 'right',\n mt: '0.5rem',\n }}\n >\n {optionalLinkLabel}\n </Box>\n )}\n </MenuItem>\n )}\n\n {items.map(({ icon, label, subLabel, link, Component }, index) => (\n <MenuItem\n key={`menu-item-${index.toString()}`}\n disableRipple\n disableTouchRipple\n onClick={handleClose}\n sx={{ py: 0.5 }}\n component={link ? Link : Fragment}\n to={link}\n >\n <Component icon={icon} to={link!} title={label} subTitle={subLabel} />\n </MenuItem>\n ))}\n {!hideDivider && <Divider sx={{ my: 0.5 }} />}\n </>\n );\n};\n"],"names":["Fragment"],"mappings":";;;;;;;;AA+CO,MAAM,cAAqC,CAAC;AAAA,EACjD,YAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAc,GAAA,KAAA;AAAA,EACd;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,qBACJ,GAAA,YAAA,IAAgB,iBAAqB,IAAA,KAAA,CAAM,MAAS,GAAA,CAAA;AAEtD,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IACC,YAAA,oBAAA,IAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,CAAG,EAAA;AAAA,SACL;AAAA,QACA,aAAa,EAAA,IAAA;AAAA,QACb,kBAAkB,EAAA,IAAA;AAAA,QAClB,SAAA,EAAW,wBAAwB,IAAOA,GAAAA,UAAAA;AAAA,QAC1C,EAAI,EAAA,YAAA;AAAA,QACJ,OAAS,EAAA,WAAA;AAAA,QAET,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,aAAA;AAAA,YAAA;AAAA,cACC,EAAI,EAAA;AAAA,gBACF,eAAiB,EAAA,aAAA;AAAA,gBACjB,CAAG,EAAA,CAAA;AAAA,gBACH,KAAO,EAAA,eAAA;AAAA,gBACP,UAAY,EAAA,CAAA;AAAA,gBACZ,EAAI,EAAA,QAAA;AAAA,gBACJ,UAAY,EAAA;AAAA,eACd;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA,WACH;AAAA,UAEC,iBACC,oBAAA,GAAA;AAAA,YAAC,GAAA;AAAA,YAAA;AAAA,cACC,EAAI,EAAA;AAAA,gBACF,QAAU,EAAA,SAAA;AAAA,gBACV,EAAI,EAAA,CAAA;AAAA,gBACJ,QAAU,EAAA,CAAA;AAAA,gBACV,SAAW,EAAA,OAAA;AAAA,gBACX,EAAI,EAAA;AAAA,eACN;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,KAEJ;AAAA,IAGD,KAAA,CAAM,GAAI,CAAA,CAAC,EAAE,IAAA,EAAM,OAAO,QAAU,EAAA,IAAA,EAAM,SAAU,EAAA,EAAG,KACtD,qBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QAEC,aAAa,EAAA,IAAA;AAAA,QACb,kBAAkB,EAAA,IAAA;AAAA,QAClB,OAAS,EAAA,WAAA;AAAA,QACT,EAAA,EAAI,EAAE,EAAA,EAAI,GAAI,EAAA;AAAA,QACd,SAAA,EAAW,OAAO,IAAOA,GAAAA,UAAAA;AAAA,QACzB,EAAI,EAAA,IAAA;AAAA,QAEJ,QAAA,kBAAA,GAAA,CAAC,aAAU,IAAY,EAAA,EAAA,EAAI,MAAO,KAAO,EAAA,KAAA,EAAO,UAAU,QAAU,EAAA;AAAA,OAAA;AAAA,MAR/D,CAAA,UAAA,EAAa,KAAM,CAAA,QAAA,EAAU,CAAA;AAAA,KAUrC,CAAA;AAAA,IACA,CAAC,+BAAgB,GAAA,CAAA,OAAA,EAAA,EAAQ,IAAI,EAAE,EAAA,EAAI,KAAO,EAAA;AAAA,GAC7C,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"MenuSection.esm.js","sources":["../../../src/components/HeaderDropdownComponent/MenuSection.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 { Fragment } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport Divider from '@mui/material/Divider';\nimport Box from '@mui/material/Box';\nimport MenuItem, { MenuItemProps } from '@mui/material/MenuItem';\nimport { Link } from '@backstage/core-components';\nimport { MenuItemLinkProps } from '../MenuItemLink/MenuItemLink';\nimport ListSubheader from '@mui/material/ListSubheader';\n\n/**\n * Menu item configuration\n *\n * @public\n */\nexport interface MenuItemConfig {\n Component: ComponentType<MenuItemLinkProps | MenuItemProps | {}>;\n label: string;\n icon?: string;\n subLabel?: string;\n link?: string;\n}\n\nexport interface MenuSectionConfig {\n sectionLabel?: string;\n optionalLink?: string;\n optionalLinkLabel?: string;\n items: MenuItemConfig[];\n hideDivider?: boolean;\n handleClose: () => void;\n}\n\nexport const MenuSection: FC<MenuSectionConfig> = ({\n sectionLabel,\n optionalLink,\n optionalLinkLabel,\n items,\n hideDivider = false,\n handleClose,\n}) => {\n const hasClickableSubheader =\n optionalLink && optionalLinkLabel && items.length > 0;\n\n return (\n <>\n {sectionLabel && (\n <MenuItem\n sx={{\n p: 0,\n }}\n disableRipple\n disableTouchRipple\n component={hasClickableSubheader ? Link : Fragment}\n to={optionalLink}\n onClick={handleClose}\n >\n <ListSubheader\n sx={{\n backgroundColor: 'transparent',\n m: 0,\n color: 'text.disabled',\n lineHeight: 2,\n mt: '0.5rem',\n fontWeight: 400,\n }}\n >\n {sectionLabel}\n </ListSubheader>\n\n {optionalLinkLabel && (\n <Box\n sx={{\n fontSize: '0.875em',\n mr: 2,\n flexGrow: 1,\n textAlign: 'right',\n mt: '0.5rem',\n }}\n >\n {optionalLinkLabel}\n </Box>\n )}\n </MenuItem>\n )}\n\n {items.map(({ icon, label, subLabel, link, Component }, index) => (\n <MenuItem\n key={`menu-item-${index.toString()}`}\n disableRipple\n disableTouchRipple\n onClick={handleClose}\n sx={{ py: 0.5 }}\n component={link ? Link : Fragment}\n to={link}\n >\n <Component\n icon={icon}\n to={link!}\n title={label}\n subTitle={subLabel}\n onClick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AAA;AAAA,gBACX,EAAI,EAAA;AAAA,eACN;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,KAEJ;AAAA,IAGD,KAAA,CAAM,GAAI,CAAA,CAAC,EAAE,IAAA,EAAM,OAAO,QAAU,EAAA,IAAA,EAAM,SAAU,EAAA,EAAG,KACtD,qBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QAEC,aAAa,EAAA,IAAA;AAAA,QACb,kBAAkB,EAAA,IAAA;AAAA,QAClB,OAAS,EAAA,WAAA;AAAA,QACT,EAAA,EAAI,EAAE,EAAA,EAAI,GAAI,EAAA;AAAA,QACd,SAAA,EAAW,OAAO,IAAOA,GAAAA,UAAAA;AAAA,QACzB,EAAI,EAAA,IAAA;AAAA,QAEJ,QAAA,kBAAA,GAAA;AAAA,UAAC,SAAA;AAAA,UAAA;AAAA,YACC,IAAA;AAAA,YACA,EAAI,EAAA,IAAA;AAAA,YACJ,KAAO,EAAA,KAAA;AAAA,YACP,QAAU,EAAA,QAAA;AAAA,YACV,OAAS,EAAA;AAAA;AAAA;AACX,OAAA;AAAA,MAdK,CAAA,UAAA,EAAa,KAAM,CAAA,QAAA,EAAU,CAAA;AAAA,KAgBrC,CAAA;AAAA,IACA,CAAC,+BAAgB,GAAA,CAAA,OAAA,EAAA,EAAQ,IAAI,EAAE,EAAA,EAAI,KAAO,EAAA;AAAA,GAC7C,EAAA,CAAA;AAEJ;;;;"}
@@ -3,6 +3,7 @@ import { useState, useRef, useEffect, useMemo } from 'react';
3
3
  import { useUserProfile } from '@backstage/plugin-user-settings';
4
4
  import { useApi } from '@backstage/core-plugin-api';
5
5
  import { catalogApiRef } from '@backstage/plugin-catalog-react';
6
+ import { parseEntityRef } from '@backstage/catalog-model';
6
7
  import AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';
7
8
  import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
8
9
  import Avatar from '@mui/material/Avatar';
@@ -17,6 +18,7 @@ import { useDropdownManager } from '../../hooks/useDropdownManager.esm.js';
17
18
  const ProfileDropdown = ({ layout }) => {
18
19
  const { anchorEl, handleOpen, handleClose } = useDropdownManager();
19
20
  const [user, setUser] = useState();
21
+ const [profileLink, setProfileLink] = useState();
20
22
  const {
21
23
  displayName,
22
24
  backstageIdentity,
@@ -45,30 +47,52 @@ const ProfileDropdown = ({ layout }) => {
45
47
  useEffect(() => {
46
48
  const fetchUserEntity = async () => {
47
49
  let userProfile;
50
+ let profileUrl = null;
48
51
  try {
49
52
  if (backstageIdentity?.userEntityRef) {
53
+ const { namespace = "default", name } = parseEntityRef(
54
+ backstageIdentity.userEntityRef
55
+ );
56
+ profileUrl = `/catalog/${namespace}/user/${name}`;
50
57
  userProfile = await catalogApi.getEntityByRef(
51
58
  backstageIdentity.userEntityRef
52
59
  );
60
+ setUser(
61
+ userProfile?.spec?.profile?.displayName ?? userProfile?.metadata?.title
62
+ );
63
+ setProfileLink(profileUrl);
64
+ } else {
65
+ setUser(null);
66
+ setProfileLink(null);
53
67
  }
54
- setUser(
55
- userProfile?.spec?.profile?.displayName ?? userProfile?.metadata?.title
56
- );
57
68
  } catch (_err) {
58
69
  setUser(null);
70
+ setProfileLink(null);
59
71
  }
60
72
  };
61
73
  fetchUserEntity();
62
74
  }, [backstageIdentity, catalogApi]);
63
75
  const menuItems = useMemo(() => {
64
- return (profileDropdownMountPoints ?? []).map((mp) => ({
65
- Component: mp.Component,
66
- icon: mp.config?.props?.icon ?? "",
67
- label: mp.config?.props?.title ?? "",
68
- link: mp.config?.props?.link ?? "",
69
- priority: mp.config?.priority ?? 0
70
- })).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
71
- }, [profileDropdownMountPoints]);
76
+ return (profileDropdownMountPoints ?? []).map((mp) => {
77
+ const {
78
+ title = "",
79
+ icon = "",
80
+ link: staticLink = ""
81
+ } = mp.config?.props ?? {};
82
+ const isMyProfile = title.toLowerCase() === "my profile";
83
+ const link = isMyProfile ? profileLink ?? "" : staticLink;
84
+ if (!link && title) {
85
+ return null;
86
+ }
87
+ return {
88
+ Component: mp.Component,
89
+ label: title,
90
+ link,
91
+ priority: mp.config?.priority ?? 0,
92
+ ...icon && { icon }
93
+ };
94
+ }).filter((item) => item !== null).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
95
+ }, [profileDropdownMountPoints, profileLink]);
72
96
  if (menuItems.length === 0) {
73
97
  return null;
74
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/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, useMemo, useRef, useState } from 'react';\nimport type { CSSProperties } from 'react';\nimport { useUserProfile } from '@backstage/plugin-user-settings';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { UserEntity } from '@backstage/catalog-model';\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 { lighten } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport { MenuSection } from './MenuSection';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints';\nimport { useDropdownManager } from '../../hooks';\n\n/**\n * @public\n * Props for Profile Dropdown\n */\nexport interface ProfileDropdownProps {\n layout?: CSSProperties;\n}\n\nexport const ProfileDropdown = ({ layout }: ProfileDropdownProps) => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const [user, setUser] = useState<string | null>();\n const {\n displayName,\n backstageIdentity,\n profile,\n loading: profileLoading,\n } = useUserProfile();\n const catalogApi = useApi(catalogApiRef);\n\n const profileDropdownMountPoints = useProfileDropdownMountPoints();\n\n const headerRef = useRef<HTMLElement | null>(null);\n const [bgColor, setBgColor] = useState('#3C3F42');\n\n useEffect(() => {\n if (headerRef.current) {\n const computedStyle = window.getComputedStyle(headerRef.current);\n const baseColor = computedStyle.backgroundColor;\n setBgColor(lighten(baseColor, 0.2));\n }\n }, []);\n\n useEffect(() => {\n const container = document.getElementById('global-header');\n if (container) {\n const computedStyle = window.getComputedStyle(container);\n const baseColor = computedStyle.backgroundColor;\n setBgColor(lighten(baseColor, 0.2));\n }\n }, []);\n\n useEffect(() => {\n const fetchUserEntity = async () => {\n let userProfile;\n try {\n if (backstageIdentity?.userEntityRef) {\n userProfile = (await catalogApi.getEntityByRef(\n backstageIdentity.userEntityRef,\n )) as unknown as UserEntity;\n }\n setUser(\n userProfile?.spec?.profile?.displayName ??\n userProfile?.metadata?.title,\n );\n } catch (_err) {\n setUser(null);\n }\n };\n\n fetchUserEntity();\n }, [backstageIdentity, catalogApi]);\n\n const menuItems = useMemo(() => {\n return (profileDropdownMountPoints ?? [])\n .map(mp => ({\n Component: mp.Component,\n icon: mp.config?.props?.icon ?? '',\n label: mp.config?.props?.title ?? '',\n link: mp.config?.props?.link ?? '',\n priority: mp.config?.priority ?? 0,\n }))\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }, [profileDropdownMountPoints]);\n\n if (menuItems.length === 0) {\n return null;\n }\n\n const profileDisplayName = () => {\n const name = user ?? displayName;\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 <HeaderDropdownComponent\n buttonContent={\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n {!profileLoading && (\n <>\n {profile.picture ? (\n <Avatar\n src={profile.picture}\n sx={{ mr: 2, height: '32px', width: '32px' }}\n alt=\"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={{\n bgcolor: bgColor,\n borderRadius: '25%',\n }}\n />\n </Box>\n }\n buttonProps={{\n color: 'inherit',\n sx: {\n display: 'flex',\n alignItems: 'center',\n },\n }}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n >\n <MenuSection hideDivider items={menuItems} handleClose={handleClose} />\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0CO,MAAM,eAAkB,GAAA,CAAC,EAAE,MAAA,EAAmC,KAAA;AACnE,EAAA,MAAM,EAAE,QAAA,EAAU,UAAY,EAAA,WAAA,KAAgB,kBAAmB,EAAA;AACjE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAAwB,EAAA;AAChD,EAAM,MAAA;AAAA,IACJ,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAS,EAAA;AAAA,MACP,cAAe,EAAA;AACnB,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AAEvC,EAAA,MAAM,6BAA6B,6BAA8B,EAAA;AAEjE,EAAM,MAAA,SAAA,GAAY,OAA2B,IAAI,CAAA;AACjD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,SAAS,CA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,WAA0B,EAAA;AAAA;AAAA,GACvE;AAEJ;;;;"}
1
+ {"version":3,"file":"ProfileDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/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, useMemo, useRef, useState } from 'react';\nimport type { CSSProperties } from 'react';\nimport { useUserProfile } from '@backstage/plugin-user-settings';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { parseEntityRef, UserEntity } from '@backstage/catalog-model';\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 { lighten } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport { MenuItemConfig, MenuSection } from './MenuSection';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMountPoints';\nimport { useDropdownManager } from '../../hooks';\n\n/**\n * @public\n * Props for Profile Dropdown\n */\nexport interface ProfileDropdownProps {\n layout?: CSSProperties;\n}\n\nexport const ProfileDropdown = ({ layout }: ProfileDropdownProps) => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const [user, setUser] = useState<string | null>();\n const [profileLink, setProfileLink] = useState<string | null>();\n const {\n displayName,\n backstageIdentity,\n profile,\n loading: profileLoading,\n } = useUserProfile();\n const catalogApi = useApi(catalogApiRef);\n\n const profileDropdownMountPoints = useProfileDropdownMountPoints();\n\n const headerRef = useRef<HTMLElement | null>(null);\n const [bgColor, setBgColor] = useState('#3C3F42');\n\n useEffect(() => {\n if (headerRef.current) {\n const computedStyle = window.getComputedStyle(headerRef.current);\n const baseColor = computedStyle.backgroundColor;\n setBgColor(lighten(baseColor, 0.2));\n }\n }, []);\n\n useEffect(() => {\n const container = document.getElementById('global-header');\n if (container) {\n const computedStyle = window.getComputedStyle(container);\n const baseColor = computedStyle.backgroundColor;\n setBgColor(lighten(baseColor, 0.2));\n }\n }, []);\n\n useEffect(() => {\n const fetchUserEntity = async () => {\n let userProfile;\n let profileUrl: string | null = null;\n\n try {\n if (backstageIdentity?.userEntityRef) {\n const { namespace = 'default', name } = parseEntityRef(\n backstageIdentity.userEntityRef,\n );\n profileUrl = `/catalog/${namespace}/user/${name}`;\n\n 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 setProfileLink(profileUrl);\n } else {\n setUser(null);\n setProfileLink(null);\n }\n } catch (_err) {\n setUser(null);\n setProfileLink(null);\n }\n };\n\n fetchUserEntity();\n }, [backstageIdentity, catalogApi]);\n\n const menuItems = useMemo(() => {\n return (profileDropdownMountPoints ?? [])\n .map(mp => {\n const {\n title = '',\n icon = '',\n link: staticLink = '',\n } = mp.config?.props ?? {};\n const isMyProfile = title.toLowerCase() === 'my profile';\n const link = isMyProfile ? profileLink ?? '' : staticLink;\n\n if (!link && title) {\n return null;\n }\n\n return {\n Component: mp.Component,\n label: title,\n link,\n priority: mp.config?.priority ?? 0,\n ...(icon && { icon }),\n };\n })\n .filter((item: MenuItemConfig) => item !== null)\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }, [profileDropdownMountPoints, profileLink]);\n\n if (menuItems.length === 0) {\n return null;\n }\n\n const profileDisplayName = () => {\n const name = user ?? displayName;\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 <HeaderDropdownComponent\n buttonContent={\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n {!profileLoading && (\n <>\n {profile.picture ? (\n <Avatar\n src={profile.picture}\n sx={{ mr: 2, height: '32px', width: '32px' }}\n alt=\"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={{\n bgcolor: bgColor,\n borderRadius: '25%',\n }}\n />\n </Box>\n }\n buttonProps={{\n color: 'inherit',\n sx: {\n display: 'flex',\n alignItems: 'center',\n },\n }}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n >\n <MenuSection hideDivider items={menuItems} handleClose={handleClose} />\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA0CO,MAAM,eAAkB,GAAA,CAAC,EAAE,MAAA,EAAmC,KAAA;AACnE,EAAA,MAAM,EAAE,QAAA,EAAU,UAAY,EAAA,WAAA,KAAgB,kBAAmB,EAAA;AACjE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,QAAwB,EAAA;AAChD,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,QAAwB,EAAA;AAC9D,EAAM,MAAA;AAAA,IACJ,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAS,EAAA;AAAA,MACP,cAAe,EAAA;AACnB,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAA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yBAA0B,EAAA,EAAA,QAAA,EAAS,SAAQ,EAAI,EAAA,EAAE,EAAI,EAAA,CAAA,EAAK,EAAA,CAAA;AAAA,0BAE7D,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAQ,EAAA,OAAA;AAAA,cACR,EAAI,EAAA;AAAA,gBACF,OAAS,EAAA,EAAE,EAAI,EAAA,MAAA,EAAQ,IAAI,OAAQ,EAAA;AAAA,gBACnC,UAAY,EAAA,GAAA;AAAA,gBACZ,EAAI,EAAA;AAAA,eACN;AAAA,cAEC,QAAmB,EAAA,kBAAA;AAAA;AAAA;AACtB,SACF,EAAA,CAAA;AAAA,wBAEF,GAAA;AAAA,UAAC,6BAAA;AAAA,UAAA;AAAA,YACC,EAAI,EAAA;AAAA,cACF,OAAS,EAAA,OAAA;AAAA,cACT,YAAc,EAAA;AAAA;AAChB;AAAA;AACF,OACF,EAAA,CAAA;AAAA,MAEF,WAAa,EAAA;AAAA,QACX,KAAO,EAAA,SAAA;AAAA,QACP,EAAI,EAAA;AAAA,UACF,OAAS,EAAA,MAAA;AAAA,UACT,UAAY,EAAA;AAAA;AACd,OACF;AAAA,MACA,MAAQ,EAAA,UAAA;AAAA,MACR,OAAS,EAAA,WAAA;AAAA,MACT,QAAA;AAAA,MAEA,8BAAC,WAAY,EAAA,EAAA,WAAA,EAAW,IAAC,EAAA,KAAA,EAAO,WAAW,WAA0B,EAAA;AAAA;AAAA,GACvE;AAEJ;;;;"}
@@ -9,7 +9,9 @@ const SupportButton = ({
9
9
  to,
10
10
  icon = "support",
11
11
  tooltip,
12
- style
12
+ style,
13
+ onClick = () => {
14
+ }
13
15
  }) => {
14
16
  const apiHolder = useApiHolder();
15
17
  const config = apiHolder.get(configApiRef);
@@ -23,6 +25,7 @@ const SupportButton = ({
23
25
  to: supportUrl,
24
26
  component: Link,
25
27
  sx: { width: "100%", color: "inherit", ...style },
28
+ onClick,
26
29
  "data-testid": "support-button",
27
30
  children: /* @__PURE__ */ jsx(
28
31
  MenuItemLink,
@@ -1 +1 @@
1
- {"version":3,"file":"SupportButton.esm.js","sources":["../../../src/components/SupportButton/SupportButton.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 { configApiRef, useApiHolder } from '@backstage/core-plugin-api';\nimport { Link } from '@backstage/core-components';\nimport MenuItem from '@mui/material/MenuItem';\nimport { MenuItemLink } from '../MenuItemLink/MenuItemLink';\nimport { CSSProperties } from 'react';\n\n/**\n * @public\n */\nexport interface SupportButtonProps {\n icon?: string;\n title?: string;\n to?: string;\n tooltip?: string;\n style?: CSSProperties;\n}\n/**\n * @public\n */\nexport const SupportButton = ({\n title = 'Support',\n to,\n icon = 'support',\n tooltip,\n style,\n}: SupportButtonProps) => {\n const apiHolder = useApiHolder();\n const config = apiHolder.get(configApiRef);\n const supportUrl = to ?? config?.getOptionalString('app.support.url');\n\n if (!supportUrl) {\n return null;\n }\n\n return (\n <MenuItem\n to={supportUrl}\n component={Link}\n sx={{ width: '100%', color: 'inherit', ...style }}\n data-testid=\"support-button\"\n >\n <MenuItemLink\n to={supportUrl}\n title={title}\n icon={icon}\n tooltip={tooltip}\n />\n </MenuItem>\n );\n};\n"],"names":[],"mappings":";;;;;;AAmCO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAQ,GAAA,SAAA;AAAA,EACR,EAAA;AAAA,EACA,IAAO,GAAA,SAAA;AAAA,EACP,OAAA;AAAA,EACA;AACF,CAA0B,KAAA;AACxB,EAAA,MAAM,YAAY,YAAa,EAAA;AAC/B,EAAM,MAAA,MAAA,GAAS,SAAU,CAAA,GAAA,CAAI,YAAY,CAAA;AACzC,EAAA,MAAM,UAAa,GAAA,EAAA,IAAM,MAAQ,EAAA,iBAAA,CAAkB,iBAAiB,CAAA;AAEpE,EAAA,IAAI,CAAC,UAAY,EAAA;AACf,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAA,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA,UAAA;AAAA,MACJ,SAAW,EAAA,IAAA;AAAA,MACX,IAAI,EAAE,KAAA,EAAO,QAAQ,KAAO,EAAA,SAAA,EAAW,GAAG,KAAM,EAAA;AAAA,MAChD,aAAY,EAAA,gBAAA;AAAA,MAEZ,QAAA,kBAAA,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA,UAAA;AAAA,UACJ,KAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"SupportButton.esm.js","sources":["../../../src/components/SupportButton/SupportButton.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 { configApiRef, useApiHolder } from '@backstage/core-plugin-api';\nimport { Link } from '@backstage/core-components';\nimport MenuItem from '@mui/material/MenuItem';\nimport { MenuItemLink } from '../MenuItemLink/MenuItemLink';\nimport { CSSProperties } from 'react';\n\n/**\n * @public\n */\nexport interface SupportButtonProps {\n icon?: string;\n title?: string;\n to?: string;\n tooltip?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n/**\n * @public\n */\nexport const SupportButton = ({\n title = 'Support',\n to,\n icon = 'support',\n tooltip,\n style,\n onClick = () => {},\n}: SupportButtonProps) => {\n const apiHolder = useApiHolder();\n const config = apiHolder.get(configApiRef);\n const supportUrl = to ?? config?.getOptionalString('app.support.url');\n\n if (!supportUrl) {\n return null;\n }\n\n return (\n <MenuItem\n to={supportUrl}\n component={Link}\n sx={{ width: '100%', color: 'inherit', ...style }}\n onClick={onClick}\n data-testid=\"support-button\"\n >\n <MenuItemLink\n to={supportUrl}\n title={title}\n icon={icon}\n tooltip={tooltip}\n />\n </MenuItem>\n );\n};\n"],"names":[],"mappings":";;;;;;AAoCO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAQ,GAAA,SAAA;AAAA,EACR,EAAA;AAAA,EACA,IAAO,GAAA,SAAA;AAAA,EACP,OAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAU,MAAM;AAAA;AAClB,CAA0B,KAAA;AACxB,EAAA,MAAM,YAAY,YAAa,EAAA;AAC/B,EAAM,MAAA,MAAA,GAAS,SAAU,CAAA,GAAA,CAAI,YAAY,CAAA;AACzC,EAAA,MAAM,UAAa,GAAA,EAAA,IAAM,MAAQ,EAAA,iBAAA,CAAkB,iBAAiB,CAAA;AAEpE,EAAA,IAAI,CAAC,UAAY,EAAA;AACf,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAA,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA,UAAA;AAAA,MACJ,SAAW,EAAA,IAAA;AAAA,MACX,IAAI,EAAE,KAAA,EAAO,QAAQ,KAAO,EAAA,SAAA,EAAW,GAAG,KAAM,EAAA;AAAA,MAChD,OAAA;AAAA,MACA,aAAY,EAAA,gBAAA;AAAA,MAEZ,QAAA,kBAAA,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA,UAAA;AAAA,UACJ,KAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
@@ -13,7 +13,6 @@ import { StarredDropdown } from '../components/HeaderDropdownComponent/StarredDr
13
13
  import { ApplicationLauncherDropdown } from '../components/HeaderDropdownComponent/ApplicationLauncherDropdown.esm.js';
14
14
  import { CompanyLogo } from '../components/CompanyLogo/CompanyLogo.esm.js';
15
15
  import { HelpDropdown } from '../components/HeaderDropdownComponent/HelpDropdown.esm.js';
16
- import { QuickstartButton } from '../components/QuickstartButton/QuickstartButton.esm.js';
17
16
 
18
17
  const defaultGlobalHeaderComponentsMountPoints = [
19
18
  {
@@ -125,6 +124,16 @@ const defaultProfileDropdownMountPoints = [
125
124
  }
126
125
  }
127
126
  },
127
+ {
128
+ Component: MenuItemLink,
129
+ config: {
130
+ priority: 150,
131
+ props: {
132
+ title: "My profile",
133
+ icon: "account"
134
+ }
135
+ }
136
+ },
128
137
  {
129
138
  Component: LogoutButton,
130
139
  config: {
@@ -134,9 +143,14 @@ const defaultProfileDropdownMountPoints = [
134
143
  ];
135
144
  const defaultHelpDropdownMountPoints = [
136
145
  {
137
- Component: QuickstartButton,
146
+ Component: MenuItemLink,
138
147
  config: {
139
- priority: 100
148
+ priority: 100,
149
+ props: {
150
+ title: "Quick start",
151
+ icon: "quickstart",
152
+ link: "https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/"
153
+ }
140
154
  }
141
155
  },
142
156
  {
@@ -1 +1 @@
1
- {"version":3,"file":"defaultMountPoints.esm.js","sources":["../../src/defaultMountPoints/defaultMountPoints.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 */\nimport type { CSSProperties, ComponentType } from 'react';\nimport { LogoutButton } from '../components/LogoutButton/LogoutButton';\nimport { CreateDropdown } from '../components/HeaderDropdownComponent/CreateDropdown';\nimport { ProfileDropdown } from '../components/HeaderDropdownComponent/ProfileDropdown';\nimport { RegisterAComponentSection } from '../components/HeaderDropdownComponent/RegisterAComponentSection';\nimport { SoftwareTemplatesSection } from '../components/HeaderDropdownComponent/SoftwareTemplatesSection';\nimport { SearchComponent } from '../components/SearchComponent/SearchComponent';\nimport { SupportButton } from '../components/SupportButton/SupportButton';\nimport {\n ApplicationLauncherDropdownMountPoint,\n CreateDropdownMountPoint,\n GlobalHeaderComponentMountPoint,\n HelpDropdownMountPoint,\n ProfileDropdownMountPoint,\n} from '../types';\nimport { NotificationButton } from '../components/NotificationButton/NotificationButton';\nimport { Divider } from '../components/Divider/Divider';\nimport { MenuItemLink } from '../components/MenuItemLink/MenuItemLink';\nimport { Spacer } from '../components/Spacer/Spacer';\nimport { StarredDropdown } from '../components/HeaderDropdownComponent/StarredDropdown';\nimport { ApplicationLauncherDropdown } from '../components/HeaderDropdownComponent/ApplicationLauncherDropdown';\nimport { CompanyLogo } from '../components/CompanyLogo/CompanyLogo';\nimport { HelpDropdown } from '../components/HeaderDropdownComponent/HelpDropdown';\nimport { QuickstartButton } from '../components/QuickstartButton/QuickstartButton';\n\n/**\n * default Global Header Components mount points\n *\n * @public\n */\nexport const defaultGlobalHeaderComponentsMountPoints: GlobalHeaderComponentMountPoint[] =\n [\n {\n Component: CompanyLogo,\n config: {\n priority: 200,\n props: {\n to: '/catalog',\n logo: {\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 },\n },\n },\n {\n Component: SearchComponent,\n config: {\n priority: 100, // the greater the number, the more to the left it will be\n },\n },\n {\n Component: Spacer,\n config: {\n priority: 99, // the greater the number, the more to the left it will be\n props: {\n growFactor: 0,\n },\n },\n },\n // Notice: 1.5 ships with a Create link instead of a dropdown!!!\n {\n Component: CreateDropdown,\n config: {\n priority: 90,\n layout: {\n display: {\n sm: 'none',\n md: 'block',\n },\n mr: 1.5,\n } as any as CSSProperties, // I don't used MUI v5 specific `sx` types here to allow us changing the implementation later\n },\n },\n {\n Component: StarredDropdown,\n config: {\n priority: 85,\n },\n },\n {\n Component: ApplicationLauncherDropdown,\n config: {\n priority: 82,\n },\n },\n {\n Component: HelpDropdown,\n config: {\n priority: 80,\n },\n },\n {\n Component: NotificationButton,\n config: {\n priority: 70,\n },\n },\n {\n Component: Divider,\n config: {\n priority: 50,\n },\n },\n {\n Component: ProfileDropdown,\n config: {\n priority: 10, // the greater the number, the more to the left it will be\n },\n },\n ];\n\nexport const defaultCreateDropdownMountPoints: CreateDropdownMountPoint[] = [\n {\n Component: SoftwareTemplatesSection as ComponentType,\n config: {\n priority: 200,\n },\n },\n {\n Component: RegisterAComponentSection as ComponentType,\n config: {\n priority: 100,\n },\n },\n];\n\nexport const defaultProfileDropdownMountPoints: ProfileDropdownMountPoint[] = [\n {\n Component: MenuItemLink as ComponentType,\n config: {\n priority: 200,\n props: {\n title: 'Settings',\n icon: 'manageAccounts',\n link: '/settings',\n },\n },\n },\n {\n Component: LogoutButton,\n config: {\n priority: 100,\n },\n },\n];\n\nexport const defaultHelpDropdownMountPoints: HelpDropdownMountPoint[] = [\n {\n Component: QuickstartButton,\n config: {\n priority: 100,\n },\n },\n {\n Component: SupportButton,\n config: {\n priority: 10,\n },\n },\n];\n\nexport const defaultApplicationLauncherDropdownMountPoints: ApplicationLauncherDropdownMountPoint[] =\n [\n {\n Component: MenuItemLink as ComponentType,\n config: {\n section: 'Documentation',\n priority: 150,\n props: {\n title: 'Developer Hub',\n icon: 'developerHub',\n link: 'https://docs.redhat.com/en/documentation/red_hat_developer_hub',\n },\n },\n },\n {\n Component: MenuItemLink as ComponentType,\n config: {\n section: 'Developer Tools',\n priority: 130,\n props: {\n title: 'RHDH Local',\n icon: 'developerHub',\n link: 'https://github.com/redhat-developer/rhdh-local',\n },\n },\n },\n ];\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA6CO,MAAM,wCACX,GAAA;AAAA,EACE;AAAA,IACE,SAAW,EAAA,WAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,EAAI,EAAA,UAAA;AAAA,QACJ,IAAM,EAAA;AAAA,UACJ,KACE,EAAA,yuTAAA;AAAA,UACF,IAAM,EAAA;AAAA;AACR;AACF;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,eAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA;AAAA;AAAA;AACZ,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,MAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,Q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,iCAAiE,GAAA;AAAA,EAC5E;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,UAAA;AAAA,QACP,IAAM,EAAA,gBAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA;AAAA;AACZ;AAEJ;AAEO,MAAM,8BAA2D,GAAA;AAAA,EACtE;AAAA,IACE,SAAW,EAAA,gBAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,aAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA;AAAA;AACZ;AAEJ;AAEO,MAAM,6CACX,GAAA;AAAA,EACE;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,eAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,eAAA;AAAA,QACP,IAAM,EAAA,cAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,iBAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,YAAA;AAAA,QACP,IAAM,EAAA,cAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF;AAEJ;;;;"}
1
+ {"version":3,"file":"defaultMountPoints.esm.js","sources":["../../src/defaultMountPoints/defaultMountPoints.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 */\nimport type { CSSProperties, ComponentType } from 'react';\nimport { LogoutButton } from '../components/LogoutButton/LogoutButton';\nimport { CreateDropdown } from '../components/HeaderDropdownComponent/CreateDropdown';\nimport { ProfileDropdown } from '../components/HeaderDropdownComponent/ProfileDropdown';\nimport { RegisterAComponentSection } from '../components/HeaderDropdownComponent/RegisterAComponentSection';\nimport { SoftwareTemplatesSection } from '../components/HeaderDropdownComponent/SoftwareTemplatesSection';\nimport { SearchComponent } from '../components/SearchComponent/SearchComponent';\nimport { SupportButton } from '../components/SupportButton/SupportButton';\nimport {\n ApplicationLauncherDropdownMountPoint,\n CreateDropdownMountPoint,\n GlobalHeaderComponentMountPoint,\n HelpDropdownMountPoint,\n ProfileDropdownMountPoint,\n} from '../types';\nimport { NotificationButton } from '../components/NotificationButton/NotificationButton';\nimport { Divider } from '../components/Divider/Divider';\nimport { MenuItemLink } from '../components/MenuItemLink/MenuItemLink';\nimport { Spacer } from '../components/Spacer/Spacer';\nimport { StarredDropdown } from '../components/HeaderDropdownComponent/StarredDropdown';\nimport { ApplicationLauncherDropdown } from '../components/HeaderDropdownComponent/ApplicationLauncherDropdown';\nimport { CompanyLogo } from '../components/CompanyLogo/CompanyLogo';\nimport { HelpDropdown } from '../components/HeaderDropdownComponent/HelpDropdown';\n\n/**\n * default Global Header Components mount points\n *\n * @public\n */\nexport const defaultGlobalHeaderComponentsMountPoints: GlobalHeaderComponentMountPoint[] =\n [\n {\n Component: CompanyLogo,\n config: {\n priority: 200,\n props: {\n to: '/catalog',\n logo: {\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 },\n },\n },\n {\n Component: SearchComponent,\n config: {\n priority: 100, // the greater the number, the more to the left it will be\n },\n },\n {\n Component: Spacer,\n config: {\n priority: 99, // the greater the number, the more to the left it will be\n props: {\n growFactor: 0,\n },\n },\n },\n // Notice: 1.5 ships with a Create link instead of a dropdown!!!\n {\n Component: CreateDropdown,\n config: {\n priority: 90,\n layout: {\n display: {\n sm: 'none',\n md: 'block',\n },\n mr: 1.5,\n } as any as CSSProperties, // I don't used MUI v5 specific `sx` types here to allow us changing the implementation later\n },\n },\n {\n Component: StarredDropdown,\n config: {\n priority: 85,\n },\n },\n {\n Component: ApplicationLauncherDropdown,\n config: {\n priority: 82,\n },\n },\n {\n Component: HelpDropdown,\n config: {\n priority: 80,\n },\n },\n {\n Component: NotificationButton,\n config: {\n priority: 70,\n },\n },\n {\n Component: Divider,\n config: {\n priority: 50,\n },\n },\n {\n Component: ProfileDropdown,\n config: {\n priority: 10, // the greater the number, the more to the left it will be\n },\n },\n ];\n\nexport const defaultCreateDropdownMountPoints: CreateDropdownMountPoint[] = [\n {\n Component: SoftwareTemplatesSection as ComponentType,\n config: {\n priority: 200,\n },\n },\n {\n Component: RegisterAComponentSection as ComponentType,\n config: {\n priority: 100,\n },\n },\n];\n\nexport const defaultProfileDropdownMountPoints: ProfileDropdownMountPoint[] = [\n {\n Component: MenuItemLink as ComponentType,\n config: {\n priority: 200,\n props: {\n title: 'Settings',\n icon: 'manageAccounts',\n link: '/settings',\n },\n },\n },\n {\n Component: MenuItemLink as ComponentType,\n config: {\n priority: 150,\n props: {\n title: 'My profile',\n icon: 'account',\n },\n },\n },\n {\n Component: LogoutButton,\n config: {\n priority: 100,\n },\n },\n];\n\nexport const defaultHelpDropdownMountPoints: HelpDropdownMountPoint[] = [\n {\n Component: MenuItemLink as ComponentType,\n config: {\n priority: 100,\n props: {\n title: 'Quick start',\n icon: 'quickstart',\n link: 'https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/',\n },\n },\n },\n {\n Component: SupportButton,\n config: {\n priority: 10,\n },\n },\n];\n\nexport const defaultApplicationLauncherDropdownMountPoints: ApplicationLauncherDropdownMountPoint[] =\n [\n {\n Component: MenuItemLink as ComponentType,\n config: {\n section: 'Documentation',\n priority: 150,\n props: {\n title: 'Developer Hub',\n icon: 'developerHub',\n link: 'https://docs.redhat.com/en/documentation/red_hat_developer_hub',\n },\n },\n },\n {\n Component: MenuItemLink as ComponentType,\n config: {\n section: 'Developer Tools',\n priority: 130,\n props: {\n title: 'RHDH Local',\n icon: 'developerHub',\n link: 'https://github.com/redhat-developer/rhdh-local',\n },\n },\n },\n ];\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA4CO,MAAM,wCACX,GAAA;AAAA,EACE;AAAA,IACE,SAAW,EAAA,WAAA;AAAA,IACX,MAAQ,E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A;AAAA;AACZ;AAEJ;AAEO,MAAM,6CACX,GAAA;AAAA,EACE;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,eAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,eAAA;AAAA,QACP,IAAM,EAAA,cAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,iBAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,YAAA;AAAA,QACP,IAAM,EAAA,cAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF;AAEJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
3
3
  import { ComponentType, CSSProperties } from 'react';
4
+ import { MenuItemProps } from '@mui/material/MenuItem';
4
5
 
5
6
  /**
6
7
  * Global Header Config
@@ -83,12 +84,10 @@ interface ProfileDropdownProps {
83
84
 
84
85
  /**
85
86
  * @public
87
+ * Props for Help Dropdown
86
88
  */
87
- interface QuickstartButtonProps {
88
- icon?: string;
89
- title?: string;
90
- tooltip?: string;
91
- style?: CSSProperties;
89
+ interface HelpDropdownProps {
90
+ layout?: CSSProperties;
92
91
  }
93
92
 
94
93
  /**
@@ -137,7 +136,7 @@ interface HeaderIconButtonProps {
137
136
  * @public
138
137
  */
139
138
  interface MenuItemConfig {
140
- Component: ComponentType<MenuItemLinkProps | {}>;
139
+ Component: ComponentType<MenuItemLinkProps | MenuItemProps | {}>;
141
140
  label: string;
142
141
  icon?: string;
143
142
  subLabel?: string;
@@ -169,6 +168,7 @@ interface SupportButtonProps {
169
168
  to?: string;
170
169
  tooltip?: string;
171
170
  style?: CSSProperties;
171
+ onClick?: () => void;
172
172
  }
173
173
 
174
174
  /**
@@ -292,6 +292,12 @@ declare const CreateDropdown: ComponentType<CreateDropdownProps>;
292
292
  * @public
293
293
  */
294
294
  declare const ProfileDropdown: ComponentType<ProfileDropdownProps>;
295
+ /**
296
+ * Help Dropdown
297
+ *
298
+ * @public
299
+ */
300
+ declare const HelpDropdown: ComponentType<HelpDropdownProps>;
295
301
  /**
296
302
  * Software Templates List
297
303
  *
@@ -332,10 +338,6 @@ declare const Divider: ({ layout }: DividerProps) => react_jsx_runtime.JSX.Eleme
332
338
  * @public
333
339
  */
334
340
  declare const SupportButton: ComponentType<SupportButtonProps>;
335
- /**
336
- * @public
337
- */
338
- declare const QuickstartButton: ComponentType<QuickstartButtonProps>;
339
341
  /**
340
342
  * @public
341
343
  */
@@ -365,4 +367,4 @@ declare const ApplicationLauncherDropdown: () => react_jsx_runtime.JSX.Element;
365
367
  */
366
368
  declare const CompanyLogo: ({ logo, width, height, to, }: CompanyLogoProps) => react_jsx_runtime.JSX.Element;
367
369
 
368
- export { ApplicationLauncherDropdown, CompanyLogo, type CompanyLogoProps, CreateDropdown, type CreateDropdownProps, Divider, type DividerProps, GlobalHeader, GlobalHeaderComponent, type GlobalHeaderComponentMountPoint, type GlobalHeaderComponentMountPointConfig, type GlobalHeaderComponentProps, HeaderButton, type HeaderButtonProps, HeaderIcon, HeaderIconButton, type HeaderIconButtonProps, type HeaderIconProps, type LogoURLs, LogoutButton, type MenuItemConfig, MenuItemLink, type MenuItemLinkProps, NotificationBanner, type NotificationBannerDismiss, type NotificationBannerProps, NotificationButton, type NotificationButtonProps, ProfileDropdown, type ProfileDropdownProps, QuickstartButton, type QuickstartButtonProps, RegisterAComponentSection, type RegisterAComponentSectionProps, SearchComponent, SoftwareTemplatesSection, type SoftwareTemplatesSectionProps, Spacer, type SpacerProps, StarredDropdown, SupportButton, type SupportButtonProps, defaultGlobalHeaderComponentsMountPoints, globalHeaderPlugin };
370
+ export { ApplicationLauncherDropdown, CompanyLogo, type CompanyLogoProps, CreateDropdown, type CreateDropdownProps, Divider, type DividerProps, GlobalHeader, GlobalHeaderComponent, type GlobalHeaderComponentMountPoint, type GlobalHeaderComponentMountPointConfig, type GlobalHeaderComponentProps, HeaderButton, type HeaderButtonProps, HeaderIcon, HeaderIconButton, type HeaderIconButtonProps, type HeaderIconProps, HelpDropdown, type HelpDropdownProps, type LogoURLs, LogoutButton, type MenuItemConfig, MenuItemLink, type MenuItemLinkProps, NotificationBanner, type NotificationBannerDismiss, type NotificationBannerProps, NotificationButton, type NotificationButtonProps, ProfileDropdown, type ProfileDropdownProps, RegisterAComponentSection, type RegisterAComponentSectionProps, SearchComponent, SoftwareTemplatesSection, type SoftwareTemplatesSectionProps, Spacer, type SpacerProps, StarredDropdown, SupportButton, type SupportButtonProps, defaultGlobalHeaderComponentsMountPoints, globalHeaderPlugin };
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unstable_ClassNameGenerator } from '@mui/material/className';
2
- export { ApplicationLauncherDropdown, CompanyLogo, CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, QuickstartButton, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin } from './plugin.esm.js';
2
+ export { ApplicationLauncherDropdown, CompanyLogo, CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, HelpDropdown, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin } from './plugin.esm.js';
3
3
  export { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints.esm.js';
4
4
 
5
5
  unstable_ClassNameGenerator.configure((componentName) => {
@@ -15,6 +15,7 @@ import '@mui/material/IconButton';
15
15
  import '@mui/material/Tooltip';
16
16
  import '@backstage/plugin-user-settings';
17
17
  import '@backstage/plugin-catalog-react';
18
+ import '@backstage/catalog-model';
18
19
  import '@mui/icons-material/AccountCircleOutlined';
19
20
  import '@mui/icons-material/KeyboardArrowDownOutlined';
20
21
  import '@mui/material/Avatar';
@@ -33,7 +34,6 @@ import '@mui/material/Badge';
33
34
  import '@mui/icons-material/NotificationsOutlined';
34
35
  import '@backstage/plugin-notifications';
35
36
  import '@backstage/plugin-signals-react';
36
- import '@backstage/catalog-model';
37
37
  import '@mui/icons-material/StarBorder';
38
38
  import '@mui/icons-material/Star';
39
39
  import '@mui/icons-material/AutoAwesome';
@@ -42,7 +42,6 @@ import '@mui/material/ListItemText';
42
42
  import '@mui/icons-material/Apps';
43
43
  import '@mui/icons-material/AppRegistration';
44
44
  import '@mui/icons-material/HelpOutline';
45
- import 'react-use';
46
45
 
47
46
  const globalHeaderPlugin = createPlugin({
48
47
  id: "global-header"
@@ -123,6 +122,16 @@ const ProfileDropdown = globalHeaderPlugin.provide(
123
122
  }
124
123
  })
125
124
  );
125
+ const HelpDropdown = globalHeaderPlugin.provide(
126
+ createComponentExtension({
127
+ name: "HelpDropdown",
128
+ component: {
129
+ lazy: () => import('./components/HeaderDropdownComponent/HelpDropdown.esm.js').then(
130
+ (m) => m.HelpDropdown
131
+ )
132
+ }
133
+ })
134
+ );
126
135
  const SoftwareTemplatesSection = globalHeaderPlugin.provide(
127
136
  createComponentExtension({
128
137
  name: "SoftwareTemplatesSection",
@@ -185,16 +194,6 @@ const SupportButton = globalHeaderPlugin.provide(
185
194
  }
186
195
  })
187
196
  );
188
- const QuickstartButton = globalHeaderPlugin.provide(
189
- createComponentExtension({
190
- name: "QuickstartButton",
191
- component: {
192
- lazy: () => import('./components/QuickstartButton/QuickstartButton.esm.js').then(
193
- (m) => m.QuickstartButton
194
- )
195
- }
196
- })
197
- );
198
197
  const NotificationButton = globalHeaderPlugin.provide(
199
198
  createComponentExtension({
200
199
  name: "NotificationButton",
@@ -242,5 +241,5 @@ const CompanyLogo = globalHeaderPlugin.provide(
242
241
  })
243
242
  );
244
243
 
245
- export { ApplicationLauncherDropdown, CompanyLogo, CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, QuickstartButton, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin };
244
+ export { ApplicationLauncherDropdown, CompanyLogo, CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, HelpDropdown, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin };
246
245
  //# sourceMappingURL=plugin.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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 type { ComponentType } from 'react';\n\nimport {\n createPlugin,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\n\nimport { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\nimport { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nimport { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nimport { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nimport { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';\nimport { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\nimport { QuickstartButtonProps } from './components/QuickstartButton/QuickstartButton';\nimport { SupportButtonProps } from './plugin';\n\nexport type { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\n\nexport type { HeaderButtonProps } from './components/HeaderButton/HeaderButton';\nexport type { HeaderIconProps } from './components/HeaderIcon/HeaderIcon';\nexport type { HeaderIconButtonProps } from './components/HeaderIconButton/HeaderIconButton';\nexport type { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';\nexport type { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\n\nexport type { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nexport type { MenuItemConfig } from './components/HeaderDropdownComponent/MenuSection';\nexport type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nexport type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nexport type { DividerProps } from './components/Divider/Divider';\nexport type { SpacerProps } from './components/Spacer/Spacer';\nexport type { SupportButtonProps } from './components/SupportButton/SupportButton';\nexport type { QuickstartButtonProps } from './components/QuickstartButton/QuickstartButton';\nexport type { NotificationButtonProps } from './components/NotificationButton/NotificationButton';\nexport type {\n LogoURLs,\n CompanyLogoProps,\n} from './components/CompanyLogo/CompanyLogo';\n\nexport type {\n NotificationBannerProps,\n NotificationBannerDismiss,\n} from './components/NotificationBanner';\n\nexport type {\n GlobalHeaderComponentMountPoint,\n GlobalHeaderComponentMountPointConfig,\n} from './types';\n\nexport { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints';\n\n/**\n * Global Header Plugin\n *\n * @public\n */\nexport const globalHeaderPlugin = createPlugin({\n id: 'global-header',\n});\n\n/**\n * Global Header\n *\n * @public\n */\nexport const GlobalHeader = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'GlobalHeader',\n component: {\n lazy: () => import('./components/GlobalHeader').then(m => m.GlobalHeader),\n },\n }),\n);\n\n/**\n * Global Header Component\n *\n * @public\n */\nexport const GlobalHeaderComponent: ComponentType<GlobalHeaderComponentProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'GlobalHeaderComponent',\n component: {\n lazy: () =>\n import('./components/GlobalHeaderComponent').then(\n m => m.GlobalHeaderComponent,\n ),\n },\n }),\n );\n\n/**\n * @public\n */\nexport const HeaderButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderButton',\n component: {\n lazy: () =>\n import('./components/HeaderButton/HeaderButton').then(\n m => m.HeaderButton,\n ),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const HeaderIcon = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderIcon',\n component: {\n lazy: () =>\n import('./components/HeaderIcon/HeaderIcon').then(m => m.HeaderIcon),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const HeaderIconButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderIconButton',\n component: {\n lazy: () =>\n import('./components/HeaderIconButton/HeaderIconButton').then(\n m => m.HeaderIconButton,\n ),\n },\n }),\n);\n\n/**\n * Search Component\n *\n * @public\n */\nexport const SearchComponent: ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SearchComponent',\n component: {\n lazy: () =>\n import('./components/SearchComponent/SearchComponent').then(\n m => m.SearchComponent,\n ),\n },\n }),\n);\n\n/**\n * Create Dropdown\n *\n * @public\n */\nexport const CreateDropdown: ComponentType<CreateDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'CreateDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/CreateDropdown').then(\n m => m.CreateDropdown,\n ),\n },\n }),\n );\n\n/**\n * Profile Dropdown\n *\n * @public\n */\nexport const ProfileDropdown: ComponentType<ProfileDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ProfileDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/ProfileDropdown').then(\n m => m.ProfileDropdown,\n ),\n },\n }),\n );\n\n/**\n * Software Templates List\n *\n * @public\n */\nexport const SoftwareTemplatesSection: ComponentType<SoftwareTemplatesSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SoftwareTemplatesSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/SoftwareTemplatesSection'\n ).then(m => m.SoftwareTemplatesSection),\n },\n }),\n );\n\n/**\n * Register A Component Link\n *\n * @public\n */\nexport const RegisterAComponentSection: ComponentType<RegisterAComponentSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'RegisterAComponentSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/RegisterAComponentSection'\n ).then(m => m.RegisterAComponentSection),\n },\n }),\n );\n\n/**\n * Header Link\n *\n * @public\n */\nexport const MenuItemLink: ComponentType<MenuItemLinkProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'MenuItemLink',\n component: {\n lazy: () =>\n import('./components/MenuItemLink/MenuItemLink').then(\n m => m.MenuItemLink,\n ),\n },\n }),\n );\n\n/**\n * Header Logout Button\n *\n * @public\n */\nexport const LogoutButton: ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'LogoutButton',\n component: {\n lazy: () =>\n import('./components/LogoutButton/LogoutButton').then(\n m => m.LogoutButton,\n ),\n },\n }),\n);\n\n/**\n * Spacer component that allow users to add a flexible spacing between components.\n *\n * Supports two props: `growFactor` with default 1 and `minWidth` width default 8 pixels.\n *\n * @public\n */\nexport const Spacer = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'Spacer',\n component: {\n lazy: () => import('./components/Spacer/Spacer').then(m => m.Spacer),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const Divider = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'Divider',\n component: {\n lazy: () => import('./components/Divider/Divider').then(m => m.Divider),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const SupportButton: ComponentType<SupportButtonProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SupportButton',\n component: {\n lazy: () =>\n import('./components/SupportButton/SupportButton').then(\n m => m.SupportButton,\n ),\n },\n }),\n );\n\n/**\n * @public\n */\nexport const QuickstartButton: ComponentType<QuickstartButtonProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'QuickstartButton',\n component: {\n lazy: () =>\n import('./components/QuickstartButton/QuickstartButton').then(\n m => m.QuickstartButton,\n ),\n },\n }),\n );\n\n/**\n * @public\n */\nexport const NotificationButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'NotificationButton',\n component: {\n lazy: () =>\n import('./components/NotificationButton/NotificationButton').then(\n m => m.NotificationButton,\n ),\n },\n }),\n);\n\n/**\n * NotificationBanner\n *\n * @public\n */\nexport const NotificationBanner = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'NotificationBanner',\n component: {\n lazy: () =>\n import('./components/NotificationBanner').then(\n m => m.NotificationBanner,\n ),\n },\n }),\n);\n\n/**\n * Starred Dropdown\n *\n * @public\n */\nexport const StarredDropdown = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'StarredDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/StarredDropdown').then(\n m => m.StarredDropdown,\n ),\n },\n }),\n);\n\n/**\n * Application Launcher Dropdown\n *\n * @public\n */\nexport const ApplicationLauncherDropdown = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ApplicationLauncherDropdown',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/ApplicationLauncherDropdown'\n ).then(m => m.ApplicationLauncherDropdown),\n },\n }),\n);\n\n/**\n * Company Logo\n *\n * @public\n */\nexport const CompanyLogo = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'CompanyLogo',\n component: {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GACD;AACH;AAOO,MAAM,cAAc,kBAAmB,CAAA,OAAA;AAAA,EAC5C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,aAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,6CAAsC,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,WAAW;AAAA;AAC1E,GACD;AACH;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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 type { ComponentType } from 'react';\n\nimport {\n createPlugin,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\n\nimport { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\nimport { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nimport { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nimport { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nimport { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';\nimport { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\nimport { SupportButtonProps } from './plugin';\nimport { HelpDropdownProps } from './components/HeaderDropdownComponent/HelpDropdown';\n\nexport type { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\n\nexport type { HeaderButtonProps } from './components/HeaderButton/HeaderButton';\nexport type { HeaderIconProps } from './components/HeaderIcon/HeaderIcon';\nexport type { HeaderIconButtonProps } from './components/HeaderIconButton/HeaderIconButton';\nexport type { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';\nexport type { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\nexport type { HelpDropdownProps } from './components/HeaderDropdownComponent/HelpDropdown';\n\nexport type { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nexport type { MenuItemConfig } from './components/HeaderDropdownComponent/MenuSection';\nexport type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nexport type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nexport type { DividerProps } from './components/Divider/Divider';\nexport type { SpacerProps } from './components/Spacer/Spacer';\nexport type { SupportButtonProps } from './components/SupportButton/SupportButton';\nexport type { NotificationButtonProps } from './components/NotificationButton/NotificationButton';\nexport type {\n LogoURLs,\n CompanyLogoProps,\n} from './components/CompanyLogo/CompanyLogo';\n\nexport type {\n NotificationBannerProps,\n NotificationBannerDismiss,\n} from './components/NotificationBanner';\n\nexport type {\n GlobalHeaderComponentMountPoint,\n GlobalHeaderComponentMountPointConfig,\n} from './types';\n\nexport { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints';\n\n/**\n * Global Header Plugin\n *\n * @public\n */\nexport const globalHeaderPlugin = createPlugin({\n id: 'global-header',\n});\n\n/**\n * Global Header\n *\n * @public\n */\nexport const GlobalHeader = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'GlobalHeader',\n component: {\n lazy: () => import('./components/GlobalHeader').then(m => m.GlobalHeader),\n },\n }),\n);\n\n/**\n * Global Header Component\n *\n * @public\n */\nexport const GlobalHeaderComponent: ComponentType<GlobalHeaderComponentProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'GlobalHeaderComponent',\n component: {\n lazy: () =>\n import('./components/GlobalHeaderComponent').then(\n m => m.GlobalHeaderComponent,\n ),\n },\n }),\n );\n\n/**\n * @public\n */\nexport const HeaderButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderButton',\n component: {\n lazy: () =>\n import('./components/HeaderButton/HeaderButton').then(\n m => m.HeaderButton,\n ),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const HeaderIcon = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderIcon',\n component: {\n lazy: () =>\n import('./components/HeaderIcon/HeaderIcon').then(m => m.HeaderIcon),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const HeaderIconButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HeaderIconButton',\n component: {\n lazy: () =>\n import('./components/HeaderIconButton/HeaderIconButton').then(\n m => m.HeaderIconButton,\n ),\n },\n }),\n);\n\n/**\n * Search Component\n *\n * @public\n */\nexport const SearchComponent: ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SearchComponent',\n component: {\n lazy: () =>\n import('./components/SearchComponent/SearchComponent').then(\n m => m.SearchComponent,\n ),\n },\n }),\n);\n\n/**\n * Create Dropdown\n *\n * @public\n */\nexport const CreateDropdown: ComponentType<CreateDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'CreateDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/CreateDropdown').then(\n m => m.CreateDropdown,\n ),\n },\n }),\n );\n\n/**\n * Profile Dropdown\n *\n * @public\n */\nexport const ProfileDropdown: ComponentType<ProfileDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ProfileDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/ProfileDropdown').then(\n m => m.ProfileDropdown,\n ),\n },\n }),\n );\n\n/**\n * Help Dropdown\n *\n * @public\n */\nexport const HelpDropdown: ComponentType<HelpDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'HelpDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/HelpDropdown').then(\n m => m.HelpDropdown,\n ),\n },\n }),\n );\n\n/**\n * Software Templates List\n *\n * @public\n */\nexport const SoftwareTemplatesSection: ComponentType<SoftwareTemplatesSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SoftwareTemplatesSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/SoftwareTemplatesSection'\n ).then(m => m.SoftwareTemplatesSection),\n },\n }),\n );\n\n/**\n * Register A Component Link\n *\n * @public\n */\nexport const RegisterAComponentSection: ComponentType<RegisterAComponentSectionProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'RegisterAComponentSection',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/RegisterAComponentSection'\n ).then(m => m.RegisterAComponentSection),\n },\n }),\n );\n\n/**\n * Header Link\n *\n * @public\n */\nexport const MenuItemLink: ComponentType<MenuItemLinkProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'MenuItemLink',\n component: {\n lazy: () =>\n import('./components/MenuItemLink/MenuItemLink').then(\n m => m.MenuItemLink,\n ),\n },\n }),\n );\n\n/**\n * Header Logout Button\n *\n * @public\n */\nexport const LogoutButton: ComponentType = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'LogoutButton',\n component: {\n lazy: () =>\n import('./components/LogoutButton/LogoutButton').then(\n m => m.LogoutButton,\n ),\n },\n }),\n);\n\n/**\n * Spacer component that allow users to add a flexible spacing between components.\n *\n * Supports two props: `growFactor` with default 1 and `minWidth` width default 8 pixels.\n *\n * @public\n */\nexport const Spacer = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'Spacer',\n component: {\n lazy: () => import('./components/Spacer/Spacer').then(m => m.Spacer),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const Divider = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'Divider',\n component: {\n lazy: () => import('./components/Divider/Divider').then(m => m.Divider),\n },\n }),\n);\n\n/**\n * @public\n */\nexport const SupportButton: ComponentType<SupportButtonProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'SupportButton',\n component: {\n lazy: () =>\n import('./components/SupportButton/SupportButton').then(\n m => m.SupportButton,\n ),\n },\n }),\n );\n\n/**\n * @public\n */\nexport const NotificationButton = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'NotificationButton',\n component: {\n lazy: () =>\n import('./components/NotificationButton/NotificationButton').then(\n m => m.NotificationButton,\n ),\n },\n }),\n);\n\n/**\n * NotificationBanner\n *\n * @public\n */\nexport const NotificationBanner = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'NotificationBanner',\n component: {\n lazy: () =>\n import('./components/NotificationBanner').then(\n m => m.NotificationBanner,\n ),\n },\n }),\n);\n\n/**\n * Starred Dropdown\n *\n * @public\n */\nexport const StarredDropdown = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'StarredDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/StarredDropdown').then(\n m => m.StarredDropdown,\n ),\n },\n }),\n);\n\n/**\n * Application Launcher Dropdown\n *\n * @public\n */\nexport const ApplicationLauncherDropdown = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ApplicationLauncherDropdown',\n component: {\n lazy: () =>\n import(\n './components/HeaderDropdownComponent/ApplicationLauncherDropdown'\n ).then(m => m.ApplicationLauncherDropdown),\n },\n }),\n);\n\n/**\n * Company Logo\n *\n * @public\n */\nexport const CompanyLogo = globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'CompanyLogo',\n component: {\n lazy: () =>\n import('./components/CompanyLogo/CompanyLogo').then(m => m.CompanyLogo),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA;AACN,CAAC;AAOM,MAAM,eAAe,kBAAmB,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,cAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,kCAA2B,EAAE,IAAK,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AAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,2DAAoD,CAAE,CAAA,IAAA;AAAA,QAC3D,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAOO,MAAM,qBAAqB,kBAAmB,CAAA,OAAA;AAAA,EACnD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,oBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,wCAAiC,CAAE,CAAA,IAAA;AAAA,QACxC,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAOO,MAAM,kBAAkB,kBAAmB,CAAA,OAAA;AAAA,EAChD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,iBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,6DAAsD,CAAE,CAAA,IAAA;AAAA,QAC7D,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAOO,MAAM,8BAA8B,kBAAmB,CAAA,OAAA;AAAA,EAC5D,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,6BAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OACE,yEACF,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,2BAA2B;AAAA;AAC7C,GACD;AACH;AAOO,MAAM,cAAc,kBAAmB,CAAA,OAAA;AAAA,EAC5C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,aAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,6CAAsC,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,WAAW;AAAA;AAC1E,GACD;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-global-header",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -1,34 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { useCallback } from 'react';
3
- import MenuItem from '@mui/material/MenuItem';
4
- import { MenuItemLink } from '../MenuItemLink/MenuItemLink.esm.js';
5
- import { QUICKSTART_DRAWER_OPEN_KEY } from './const.esm.js';
6
- import { useQuickstartButtonPermission } from './useQuickstartButtonPermission.esm.js';
7
-
8
- const QuickstartButton = ({
9
- icon = "quickstart",
10
- title = "Quick start",
11
- tooltip,
12
- style
13
- }) => {
14
- const isAllowed = useQuickstartButtonPermission();
15
- const toggleDrawer = useCallback(() => {
16
- const isDrawerOpen = localStorage.getItem(QUICKSTART_DRAWER_OPEN_KEY) === "true";
17
- localStorage.setItem(
18
- QUICKSTART_DRAWER_OPEN_KEY,
19
- (!isDrawerOpen).toString()
20
- );
21
- }, []);
22
- return isAllowed ? /* @__PURE__ */ jsx(
23
- MenuItem,
24
- {
25
- sx: { width: "100%", color: "inherit", ...style },
26
- "data-testid": "quickstart-button",
27
- onClick: toggleDrawer,
28
- children: /* @__PURE__ */ jsx(MenuItemLink, { to: "", title, icon, tooltip })
29
- }
30
- ) : null;
31
- };
32
-
33
- export { QuickstartButton };
34
- //# sourceMappingURL=QuickstartButton.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuickstartButton.esm.js","sources":["../../../src/components/QuickstartButton/QuickstartButton.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 { CSSProperties, useCallback } from 'react';\nimport MenuItem from '@mui/material/MenuItem';\nimport { MenuItemLink } from '../MenuItemLink/MenuItemLink';\nimport { QUICKSTART_DRAWER_OPEN_KEY } from './const';\nimport { useQuickstartButtonPermission } from './useQuickstartButtonPermission';\n\n/**\n * @public\n */\nexport interface QuickstartButtonProps {\n icon?: string;\n title?: string;\n tooltip?: string;\n style?: CSSProperties;\n}\n\n/**\n * @public\n */\nexport const QuickstartButton = ({\n icon = 'quickstart',\n title = 'Quick start',\n tooltip,\n style,\n}: QuickstartButtonProps) => {\n const isAllowed = useQuickstartButtonPermission();\n const toggleDrawer = useCallback(() => {\n const isDrawerOpen =\n localStorage.getItem(QUICKSTART_DRAWER_OPEN_KEY) === 'true';\n localStorage.setItem(\n QUICKSTART_DRAWER_OPEN_KEY,\n (!isDrawerOpen).toString(),\n );\n }, []);\n\n return isAllowed ? (\n <MenuItem\n sx={{ width: '100%', color: 'inherit', ...style }}\n data-testid=\"quickstart-button\"\n onClick={toggleDrawer}\n >\n <MenuItemLink to=\"\" title={title} icon={icon} tooltip={tooltip} />\n </MenuItem>\n ) : null;\n};\n"],"names":[],"mappings":";;;;;;;AAmCO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,IAAO,GAAA,YAAA;AAAA,EACP,KAAQ,GAAA,aAAA;AAAA,EACR,OAAA;AAAA,EACA;AACF,CAA6B,KAAA;AAC3B,EAAA,MAAM,YAAY,6BAA8B,EAAA;AAChD,EAAM,MAAA,YAAA,GAAe,YAAY,MAAM;AACrC,IAAA,MAAM,YACJ,GAAA,YAAA,CAAa,OAAQ,CAAA,0BAA0B,CAAM,KAAA,MAAA;AACvD,IAAa,YAAA,CAAA,OAAA;AAAA,MACX,0BAAA;AAAA,MACC,CAAA,CAAC,cAAc,QAAS;AAAA,KAC3B;AAAA,GACF,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,SACL,mBAAA,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAI,EAAE,KAAA,EAAO,QAAQ,KAAO,EAAA,SAAA,EAAW,GAAG,KAAM,EAAA;AAAA,MAChD,aAAY,EAAA,mBAAA;AAAA,MACZ,OAAS,EAAA,YAAA;AAAA,MAET,8BAAC,YAAa,EAAA,EAAA,EAAA,EAAG,EAAG,EAAA,KAAA,EAAc,MAAY,OAAkB,EAAA;AAAA;AAAA,GAEhE,GAAA,IAAA;AACN;;;;"}
@@ -1,4 +0,0 @@
1
- const QUICKSTART_DRAWER_OPEN_KEY = "quickstart-drawer-open";
2
-
3
- export { QUICKSTART_DRAWER_OPEN_KEY };
4
- //# sourceMappingURL=const.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"const.esm.js","sources":["../../../src/components/QuickstartButton/const.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 const QUICKSTART_DRAWER_OPEN_KEY = 'quickstart-drawer-open';\n"],"names":[],"mappings":"AAgBO,MAAM,0BAA6B,GAAA;;;;"}
@@ -1,27 +0,0 @@
1
- import { useApi, identityApiRef, configApiRef } from '@backstage/core-plugin-api';
2
- import { useAsync } from 'react-use';
3
-
4
- const useQuickstartButtonPermission = () => {
5
- const identityApi = useApi(identityApiRef);
6
- const configApi = useApi(configApiRef);
7
- const getUserAuthorization = async () => {
8
- const { token: idToken } = await identityApi.getCredentials();
9
- const backendUrl = configApi.getString("backend.baseUrl");
10
- const jsonResponse = await fetch(`${backendUrl}/api/permission/`, {
11
- headers: {
12
- ...idToken && { Authorization: `Bearer ${idToken}` }
13
- }
14
- });
15
- return jsonResponse.json();
16
- };
17
- const { loading: isUserLoading, value: result } = useAsync(
18
- async () => await getUserAuthorization(),
19
- []
20
- );
21
- const isRBACPluginEnabled = configApi.getOptionalBoolean("permission.enabled");
22
- if (!isRBACPluginEnabled) return true;
23
- return !isUserLoading && result.status === "Authorized";
24
- };
25
-
26
- export { useQuickstartButtonPermission };
27
- //# sourceMappingURL=useQuickstartButtonPermission.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useQuickstartButtonPermission.esm.js","sources":["../../../src/components/QuickstartButton/useQuickstartButtonPermission.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 {\n configApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { useAsync } from 'react-use';\n\nexport const useQuickstartButtonPermission = () => {\n const identityApi = useApi(identityApiRef);\n const configApi = useApi(configApiRef);\n\n const getUserAuthorization = async () => {\n const { token: idToken } = await identityApi.getCredentials();\n const backendUrl = configApi.getString('backend.baseUrl');\n const jsonResponse = await fetch(`${backendUrl}/api/permission/`, {\n headers: {\n ...(idToken && { Authorization: `Bearer ${idToken}` }),\n },\n });\n return jsonResponse.json();\n };\n const { loading: isUserLoading, value: result } = useAsync(\n async () => await getUserAuthorization(),\n [],\n );\n\n const isRBACPluginEnabled =\n configApi.getOptionalBoolean('permission.enabled');\n\n if (!isRBACPluginEnabled) return true;\n\n return !isUserLoading && result.status === 'Authorized';\n};\n"],"names":[],"mappings":";;;AAuBO,MAAM,gCAAgC,MAAM;AACjD,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,MAAM,uBAAuB,YAAY;AACvC,IAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAY,GAAA,MAAM,YAAY,cAAe,EAAA;AAC5D,IAAM,MAAA,UAAA,GAAa,SAAU,CAAA,SAAA,CAAU,iBAAiB,CAAA;AACxD,IAAA,MAAM,YAAe,GAAA,MAAM,KAAM,CAAA,CAAA,EAAG,UAAU,CAAoB,gBAAA,CAAA,EAAA;AAAA,MAChE,OAAS,EAAA;AAAA,QACP,GAAI,OAAW,IAAA,EAAE,aAAe,EAAA,CAAA,OAAA,EAAU,OAAO,CAAG,CAAA;AAAA;AACtD,KACD,CAAA;AACD,IAAA,OAAO,aAAa,IAAK,EAAA;AAAA,GAC3B;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,aAAe,EAAA,KAAA,EAAO,QAAW,GAAA,QAAA;AAAA,IAChD,YAAY,MAAM,oBAAqB,EAAA;AAAA,IACvC;AAAC,GACH;AAEA,EAAM,MAAA,mBAAA,GACJ,SAAU,CAAA,kBAAA,CAAmB,oBAAoB,CAAA;AAEnD,EAAI,IAAA,CAAC,qBAA4B,OAAA,IAAA;AAEjC,EAAO,OAAA,CAAC,aAAiB,IAAA,MAAA,CAAO,MAAW,KAAA,YAAA;AAC7C;;;;"}