@red-hat-developer-hub/backstage-plugin-global-header 1.17.3 → 1.18.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,11 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-global-header
2
2
 
3
+ ## 1.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 97011bd: Adding translation support for the string coming through configuration
8
+
3
9
  ## 1.17.3
4
10
 
5
11
  ### Patch Changes
@@ -2,40 +2,39 @@
2
2
  dynamicPlugins:
3
3
  frontend:
4
4
  red-hat-developer-hub.backstage-plugin-global-header:
5
+ translationResources:
6
+ - importName: globalHeaderTranslations
7
+ ref: globalHeaderTranslationRef
5
8
  mountPoints:
6
9
  - mountPoint: application/header
7
10
  importName: GlobalHeader
8
11
  config:
9
12
  position: above-sidebar # above-main-content | above-sidebar
10
-
11
13
  - mountPoint: global.header/component
12
14
  importName: CompanyLogo
13
15
  config:
14
16
  priority: 200
15
17
  props:
16
18
  to: '/'
17
-
18
19
  - mountPoint: global.header/component
19
20
  importName: SearchComponent
20
21
  config:
21
22
  priority: 100
22
-
23
23
  - mountPoint: global.header/component
24
24
  importName: Spacer
25
25
  config:
26
26
  priority: 99
27
27
  props:
28
28
  growFactor: 0
29
-
30
29
  - mountPoint: global.header/component
31
30
  importName: HeaderIconButton
32
31
  config:
33
32
  priority: 90
34
33
  props:
35
- title: Create...
34
+ title: Self-service
35
+ titleKey: create.title
36
36
  icon: add
37
37
  to: create
38
-
39
38
  - mountPoint: global.header/component
40
39
  importName: StarredDropdown
41
40
  config:
@@ -53,6 +52,7 @@ dynamicPlugins:
53
52
  priority: 150
54
53
  props:
55
54
  title: Developer Hub
55
+ titleKey: applicationLauncher.developerHub
56
56
  icon: developerHub
57
57
  link: https://docs.redhat.com/en/documentation/red_hat_developer_hub
58
58
 
@@ -63,6 +63,7 @@ dynamicPlugins:
63
63
  priority: 100
64
64
  props:
65
65
  title: RHDH Local
66
+ titleKey: applicationLauncher.rhdhLocal
66
67
  icon: developerHub
67
68
  link: https://github.com/redhat-developer/rhdh-local
68
69
 
@@ -80,26 +81,32 @@ dynamicPlugins:
80
81
  importName: NotificationButton
81
82
  config:
82
83
  priority: 70
83
-
84
84
  - mountPoint: global.header/component
85
85
  importName: Divider
86
86
  config:
87
87
  priority: 50
88
-
89
88
  - mountPoint: global.header/component
90
89
  importName: ProfileDropdown
91
90
  config:
92
91
  priority: 10
93
-
94
92
  - mountPoint: global.header/profile
95
93
  importName: MenuItemLink
96
94
  config:
97
95
  priority: 100
98
96
  props:
99
97
  title: Settings
98
+ titleKey: profile.settings
100
99
  link: /settings
101
100
  icon: manageAccounts
102
-
101
+ - mountPoint: global.header/profile
102
+ importName: MenuItemLink
103
+ config:
104
+ priority: 90
105
+ props:
106
+ title: My profile
107
+ titleKey: profile.myProfile
108
+ type: myProfile
109
+ icon: account
103
110
  - mountPoint: global.header/profile
104
111
  importName: LogoutButton
105
112
  config:
@@ -28,6 +28,7 @@ const ApplicationLauncherDropdown = () => {
28
28
  Component: mp.Component,
29
29
  icon: mp.config?.props?.icon,
30
30
  label: mp.config?.props?.title,
31
+ labelKey: mp.config?.props?.titleKey,
31
32
  link: mp.config?.props?.link,
32
33
  external: mp.config?.props?.external ?? false,
33
34
  priority: mp.config?.priority ?? 0
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationLauncherDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.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 { useMemo } from 'react';\n\nimport AppsIcon from '@mui/icons-material/Apps';\nimport AppRegistrationIcon from '@mui/icons-material/AppRegistration';\n\nimport { useApplicationLauncherDropdownMountPoints } from '../../hooks/useApplicationLauncherDropdownMountPoints';\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { MenuSection } from './MenuSection';\nimport { DropdownEmptyState } from './DropdownEmptyState';\nimport { useTranslation } from '../../hooks/useTranslation';\n\nexport const ApplicationLauncherDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const { t } = useTranslation();\n\n const mountPoints = useApplicationLauncherDropdownMountPoints();\n\n const sectionsObject = useMemo(() => {\n const groupedSections: Record<\n string,\n { sectionLink?: string; sectionLinkLabel?: string; items: any[] }\n > = {};\n\n (mountPoints ?? []).forEach(mp => {\n const section = mp.config?.section ?? '';\n const sectionLink = mp.config?.sectionLink ?? '';\n const sectionLinkLabel = mp.config?.sectionLinkLabel ?? '';\n\n if (!groupedSections[section]) {\n groupedSections[section] = { sectionLink, sectionLinkLabel, items: [] };\n }\n groupedSections[section].items.push({\n Component: mp.Component,\n icon: mp.config?.props?.icon,\n label: mp.config?.props?.title,\n link: mp.config?.props?.link,\n external: mp.config?.props?.external ?? false,\n priority: mp.config?.priority ?? 0,\n });\n });\n\n Object.values(groupedSections).forEach(section => {\n section.items.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n });\n\n return groupedSections;\n }, [mountPoints]);\n\n const sections = Object.entries(sectionsObject);\n\n return (\n <HeaderDropdownComponent\n buttonContent={<AppsIcon />}\n tooltip={t('applicationLauncher.tooltip')}\n isIconButton\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n >\n {sections.length > 0 ? (\n sections.map(\n ([section, { sectionLink, sectionLinkLabel, items }], index) => (\n <MenuSection\n key={section}\n sectionLabel={section}\n optionalLink={sectionLink}\n optionalLinkLabel={sectionLinkLabel}\n items={items}\n handleClose={handleClose}\n hideDivider={index === sections.length - 1}\n />\n ),\n )\n ) : (\n <DropdownEmptyState\n title={t('applicationLauncher.noLinksTitle')}\n subTitle={t('applicationLauncher.noLinksSubtitle')}\n icon={\n <AppRegistrationIcon\n sx={{ fontSize: 64, color: 'text.disabled' }}\n />\n }\n />\n )}\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA2BO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,EAAE,QAAA,EAAU,UAAY,EAAA,WAAA,KAAgB,kBAAmB,EAAA;AACjE,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAE7B,EAAA,MAAM,cAAc,yCAA0C,EAAA;AAE9D,EAAM,MAAA,cAAA,GAAiB,QAAQ,MAAM;AACnC,IAAA,MAAM,kBAGF,EAAC;AAEL,IAAA,CAAC,WAAe,IAAA,EAAI,EAAA,OAAA,CAAQ,CAAM,EAAA,KAAA;AAChC,MAAM,MAAA,OAAA,GAAU,EAAG,CAAA,MAAA,EAAQ,OAAW,IAAA,EAAA;AACtC,MAAM,MAAA,WAAA,GAAc,EAAG,CAAA,MAAA,EAAQ,WAAe,IAAA,EAAA;AAC9C,MAAM,MAAA,gBAAA,GAAmB,EAAG,CAAA,MAAA,EAAQ,gBAAoB,IAAA,EAAA;AAExD,MAAI,IAAA,CAAC,eAAgB,CAAA,OAAO,CAAG,EAAA;AAC7B,QAAA,eAAA,CAAgB,OAAO,CAAI,GAAA,EAAE,aAAa,gBAAkB,EAAA,KAAA,EAAO,EAAG,EAAA;AAAA;AAExE,MAAgB,eAAA,CAAA,OAAO,CAAE,CAAA,KAAA,CAAM,IAAK,CAAA;AAAA,QAClC,WAAW,EAAG,CAAA,SAAA;AAAA,QACd,IAAA,EAAM,EAAG,CAAA,MAAA,EAAQ,KAAO,EAAA,IAAA;AAAA,QACxB,KAAA,EAAO,EAAG,CAAA,MAAA,EAAQ,KAAO,EAAA,KAAA;AA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AA,YACA,WAAA,EAAa,KAAU,KAAA,QAAA,CAAS,MAAS,GAAA;AAAA,WAAA;AAAA,UANpC;AAAA;AAOP,OAIJ,mBAAA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,kCAAkC,CAAA;AAAA,UAC3C,QAAA,EAAU,EAAE,qCAAqC,CAAA;AAAA,UACjD,IACE,kBAAA,GAAA;AAAA,YAAC,mBAAA;AAAA,YAAA;AAAA,cACC,EAAI,EAAA,EAAE,QAAU,EAAA,EAAA,EAAI,OAAO,eAAgB;AAAA;AAAA;AAC7C;AAAA;AAEJ;AAAA,GAEJ;AAEJ;;;;"}
1
+ {"version":3,"file":"ApplicationLauncherDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/ApplicationLauncherDropdown.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 { useMemo } from 'react';\n\nimport AppsIcon from '@mui/icons-material/Apps';\nimport AppRegistrationIcon from '@mui/icons-material/AppRegistration';\n\nimport { useApplicationLauncherDropdownMountPoints } from '../../hooks/useApplicationLauncherDropdownMountPoints';\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { MenuSection } from './MenuSection';\nimport { DropdownEmptyState } from './DropdownEmptyState';\nimport { useTranslation } from '../../hooks/useTranslation';\n\nexport const ApplicationLauncherDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const { t } = useTranslation();\n\n const mountPoints = useApplicationLauncherDropdownMountPoints();\n\n const sectionsObject = useMemo(() => {\n const groupedSections: Record<\n string,\n { sectionLink?: string; sectionLinkLabel?: string; items: any[] }\n > = {};\n\n (mountPoints ?? []).forEach(mp => {\n const section = mp.config?.section ?? '';\n const sectionLink = mp.config?.sectionLink ?? '';\n const sectionLinkLabel = mp.config?.sectionLinkLabel ?? '';\n\n if (!groupedSections[section]) {\n groupedSections[section] = { sectionLink, sectionLinkLabel, items: [] };\n }\n groupedSections[section].items.push({\n Component: mp.Component,\n icon: mp.config?.props?.icon,\n label: mp.config?.props?.title,\n labelKey: mp.config?.props?.titleKey,\n link: mp.config?.props?.link,\n external: mp.config?.props?.external ?? false,\n priority: mp.config?.priority ?? 0,\n });\n });\n\n Object.values(groupedSections).forEach(section => {\n section.items.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n });\n\n return groupedSections;\n }, [mountPoints]);\n\n const sections = Object.entries(sectionsObject);\n\n return (\n <HeaderDropdownComponent\n buttonContent={<AppsIcon />}\n tooltip={t('applicationLauncher.tooltip')}\n isIconButton\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n >\n {sections.length > 0 ? (\n sections.map(\n ([section, { sectionLink, sectionLinkLabel, items }], index) => (\n <MenuSection\n key={section}\n sectionLabel={section}\n optionalLink={sectionLink}\n optionalLinkLabel={sectionLinkLabel}\n items={items}\n handleClose={handleClose}\n hideDivider={index === sections.length - 1}\n />\n ),\n )\n ) : (\n <DropdownEmptyState\n title={t('applicationLauncher.noLinksTitle')}\n subTitle={t('applicationLauncher.noLinksSubtitle')}\n icon={\n <AppRegistrationIcon\n sx={{ fontSize: 64, color: 'text.disabled' }}\n />\n }\n />\n )}\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA2BO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,EAAE,QAAA,EAAU,UAAY,EAAA,WAAA,KAAgB,kBAAmB,EAAA;AACjE,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAA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AAI,OAAO,eAAgB;AAAA;AAAA;AAC7C;AAAA;AAEJ;AAAA,GAEJ;AAEJ;;;;"}
@@ -61,28 +61,32 @@ const MenuSection = ({
61
61
  ]
62
62
  }
63
63
  ),
64
- items.map(({ icon, label, subLabel, link, Component }, index) => /* @__PURE__ */ jsx(
65
- MenuItem,
66
- {
67
- disableRipple: true,
68
- disableTouchRipple: true,
69
- onClick: handleClose,
70
- sx: { py: 0.5 },
71
- component: link ? Link : Fragment$1,
72
- to: link,
73
- children: /* @__PURE__ */ jsx(
74
- Component,
75
- {
76
- icon,
77
- to: link,
78
- title: label,
79
- subTitle: subLabel,
80
- onClick: handleClose
81
- }
82
- )
83
- },
84
- `menu-item-${index.toString()}`
85
- )),
64
+ items.map(
65
+ ({ icon, label, labelKey, subLabel, subLabelKey, link, Component }, index) => /* @__PURE__ */ jsx(
66
+ MenuItem,
67
+ {
68
+ disableRipple: true,
69
+ disableTouchRipple: true,
70
+ onClick: handleClose,
71
+ sx: { py: 0.5 },
72
+ component: link ? Link : Fragment$1,
73
+ to: link,
74
+ children: /* @__PURE__ */ jsx(
75
+ Component,
76
+ {
77
+ icon,
78
+ to: link,
79
+ title: label,
80
+ titleKey: labelKey,
81
+ subTitle: subLabel,
82
+ subTitleKey: subLabelKey,
83
+ onClick: handleClose
84
+ }
85
+ )
86
+ },
87
+ `menu-item-${index.toString()}`
88
+ )
89
+ ),
86
90
  !hideDivider && /* @__PURE__ */ jsx(Divider, { sx: { my: 0.5 } })
87
91
  ] });
88
92
  };
@@ -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, { MenuItemProps } from '@mui/material/MenuItem';\nimport { Link } from '@backstage/core-components';\nimport { MenuItemLinkProps } from '../MenuItemLink/MenuItemLink';\nimport ListSubheader from '@mui/material/ListSubheader';\nimport { useTranslation } from '../../hooks/useTranslation';\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 { t } = useTranslation();\n const hasClickableSubheader =\n optionalLink && optionalLinkLabel && items.length > 0;\n\n // Check if sectionLabel looks like a translation key (contains dots)\n const translatedSectionLabel =\n sectionLabel && sectionLabel.includes('.')\n ? t(sectionLabel as any, {}) || sectionLabel // Fallback to original if translation fails\n : sectionLabel;\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 {translatedSectionLabel}\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={handleClose}\n />\n </MenuItem>\n ))}\n {!hideDivider && <Divider sx={{ my: 0.5 }} />}\n </>\n );\n};\n"],"names":["Fragment"],"mappings":";;;;;;;;;AAgDO,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,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,qBACJ,GAAA,YAAA,IAAgB,iBAAqB,IAAA,KAAA,CAAM,MAAS,GAAA,CAAA;AAGtD,EAAM,MAAA,sBAAA,GACJ,YAAgB,IAAA,YAAA,CAAa,QAAS,CAAA,GAAG,CACrC,GAAA,CAAA,CAAE,YAAqB,EAAA,EAAE,CAAA,IAAK,YAC9B,GAAA,YAAA;AAEN,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,YA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AAAA,KAgBrC,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';\nimport { useTranslation } from '../../hooks/useTranslation';\n\n/**\n * Menu item configuration\n *\n * @public\n */\nexport interface MenuItemConfig {\n Component: ComponentType<MenuItemLinkProps | MenuItemProps | {}>;\n label: string;\n labelKey?: string;\n icon?: string;\n subLabel?: string;\n subLabelKey?: 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 { t } = useTranslation();\n const hasClickableSubheader =\n optionalLink && optionalLinkLabel && items.length > 0;\n\n // Check if sectionLabel looks like a translation key (contains dots)\n const translatedSectionLabel =\n sectionLabel && sectionLabel.includes('.')\n ? t(sectionLabel as any, {}) || sectionLabel // Fallback to original if translation fails\n : sectionLabel;\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 {translatedSectionLabel}\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(\n (\n { icon, label, labelKey, subLabel, subLabelKey, link, Component },\n index,\n ) => (\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 titleKey={labelKey}\n subTitle={subLabel}\n subTitleKey={subLabelKey}\n onClick={handleClose}\n />\n </MenuItem>\n ),\n )}\n {!hideDivider && <Divider sx={{ my: 0.5 }} />}\n </>\n );\n};\n"],"names":["Fragment"],"mappings":";;;;;;;;;AAkDO,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,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,qBACJ,GAAA,YAAA,IAAgB,iBAAqB,IAAA,KAAA,CAAM,MAAS,GAAA,CAAA;AAGtD,EAAM,MAAA,sBAAA,GACJ,YA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KAEA,qBAAA,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UAEC,aAAa,EAAA,IAAA;AAAA,UACb,kBAAkB,EAAA,IAAA;AAAA,UAClB,OAAS,EAAA,WAAA;AAAA,UACT,EAAA,EAAI,EAAE,EAAA,EAAI,GAAI,EAAA;AAAA,UACd,SAAA,EAAW,OAAO,IAAOA,GAAAA,UAAAA;AAAA,UACzB,EAAI,EAAA,IAAA;AAAA,UAEJ,QAAA,kBAAA,GAAA;AAAA,YAAC,SAAA;AAAA,YAAA;AAAA,cACC,IAAA;AAAA,cACA,EAAI,EAAA,IAAA;AAAA,cACJ,KAAO,EAAA,KAAA;AAAA,cACP,QAAU,EAAA,QAAA;AAAA,cACV,QAAU,EAAA,QAAA;AAAA,cACV,WAAa,EAAA,WAAA;AAAA,cACb,OAAS,EAAA;AAAA;AAAA;AACX,SAAA;AAAA,QAhBK,CAAA,UAAA,EAAa,KAAM,CAAA,QAAA,EAAU,CAAA;AAAA;AAiBpC,KAEJ;AAAA,IACC,CAAC,+BAAgB,GAAA,CAAA,OAAA,EAAA,EAAQ,IAAI,EAAE,EAAA,EAAI,KAAO,EAAA;AAAA,GAC7C,EAAA,CAAA;AAEJ;;;;"}
@@ -16,6 +16,7 @@ import { useProfileDropdownMountPoints } from '../../hooks/useProfileDropdownMou
16
16
  import { useDropdownManager } from '../../hooks/useDropdownManager.esm.js';
17
17
  import { useTranslation } from '../../hooks/useTranslation.esm.js';
18
18
  import '@backstage/core-plugin-api/alpha';
19
+ import { translateWithFallback } from '../../utils/translationUtils.esm.js';
19
20
 
20
21
  const ProfileDropdown = ({ layout }) => {
21
22
  const { anchorEl, handleOpen, handleClose } = useDropdownManager();
@@ -80,6 +81,7 @@ const ProfileDropdown = ({ layout }) => {
80
81
  return (profileDropdownMountPoints ?? []).map((mp) => {
81
82
  const {
82
83
  title = "",
84
+ titleKey = "",
83
85
  icon = "",
84
86
  link: staticLink = "",
85
87
  type = ""
@@ -92,7 +94,7 @@ const ProfileDropdown = ({ layout }) => {
92
94
  if (!link && title && !isMyProfile) {
93
95
  return null;
94
96
  }
95
- const translatedTitle = title?.includes(".") ? t(title, {}) || title : title;
97
+ const translatedTitle = translateWithFallback(t, titleKey, title);
96
98
  return {
97
99
  Component: mp.Component,
98
100
  label: translatedTitle,
@@ -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 { 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';\nimport { useTranslation } from '../../hooks/useTranslation';\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 { t } = useTranslation();\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 // User entity doesn't exist in catalog (e.g., guest user)\n setUser(null);\n setProfileLink(null);\n }\n };\n\n fetchUserEntity();\n }, [backstageIdentity, catalogApi]);\n\n const menuItems = useMemo(() => {\n // Check if user is a guest (guest user has userEntityRef like \"user:development/guest\" or \"user:default/guest\")\n const isGuestUser =\n backstageIdentity?.userEntityRef?.includes('/guest') ||\n profileLink === null;\n\n return (profileDropdownMountPoints ?? [])\n .map(mp => {\n const {\n title = '',\n icon = '',\n link: staticLink = '',\n type = '',\n } = mp.config?.props ?? {};\n const isMyProfile = type === 'myProfile';\n const link = isMyProfile ? profileLink ?? '' : staticLink;\n\n // Hide \"My Profile\" for guest users or when user doesn't exist in catalog\n if (isMyProfile && isGuestUser) {\n return null;\n }\n\n // Hide items without links (but allow \"My Profile\" to pass through for authenticated users)\n if (!link && title && !isMyProfile) {\n return null;\n }\n\n // Check if title looks like a translation key (contains dots)\n const translatedTitle = title?.includes('.')\n ? t(title as any, {}) || title // Fallback to original title if translation fails\n : title;\n\n return {\n Component: mp.Component,\n label: translatedTitle,\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, backstageIdentity, t]);\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={t('profile.picture')}\n />\n ) : (\n <AccountCircleOutlinedIcon fontSize=\"small\" sx={{ mr: 1 }} />\n )}\n <Typography\n variant=\"body2\"\n sx={{\n display: { xs: 'none', md: 'block' },\n fontWeight: 500,\n mr: '1rem',\n }}\n >\n {profileDisplayName()}\n </Typography>\n </>\n )}\n <KeyboardArrowDownOutlinedIcon\n sx={{\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":";;;;;;;;;;;;;;;;;;;AA2CO,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,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,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,CAAA;AAEhD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,UAAU,OAAS,EAAA;AACrB,MAAA,MAAM,aAAgB,GAAA,MAAA,CAAO,gBAAiB,CAAA,SAAA,CAAU,OAAO,CAAA;AAC/D,MAAA,MAAM,YAAY,aAAc,CAAA,eAAA;AAChC,MAAW,UAAA,CAAA,OAAA,CAAQ,SAAW,EAAA,GAAG,CAAC,CAAA;AAAA;AACpC,GACF,EAAG,EAAE,CAAA;AAEL,EAAA,SAAA,CAAU,MAAM;AACd,IAAM,MAAA,SAAA,GAAY,QAAS,CAAA,cAAA,CAAe,eAAe,CAAA;AACzD,IAAA,IAAI,SAAW,EAAA;AACb,MAAM,MAAA,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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;;;;"}
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';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { translateWithFallback } from '../../utils/translationUtils';\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 { t } = useTranslation();\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 // User entity doesn't exist in catalog (e.g., guest user)\n setUser(null);\n setProfileLink(null);\n }\n };\n\n fetchUserEntity();\n }, [backstageIdentity, catalogApi]);\n\n const menuItems = useMemo(() => {\n // Check if user is a guest (guest user has userEntityRef like \"user:development/guest\" or \"user:default/guest\")\n const isGuestUser =\n backstageIdentity?.userEntityRef?.includes('/guest') ||\n profileLink === null;\n\n return (profileDropdownMountPoints ?? [])\n .map(mp => {\n const {\n title = '',\n titleKey = '',\n icon = '',\n link: staticLink = '',\n type = '',\n } = mp.config?.props ?? {};\n const isMyProfile = type === 'myProfile';\n const link = isMyProfile ? profileLink ?? '' : staticLink;\n\n // Hide \"My Profile\" for guest users or when user doesn't exist in catalog\n if (isMyProfile && isGuestUser) {\n return null;\n }\n\n // Hide items without links (but allow \"My Profile\" to pass through for authenticated users)\n if (!link && title && !isMyProfile) {\n return null;\n }\n\n const translatedTitle = translateWithFallback(t, titleKey, title);\n\n return {\n Component: mp.Component,\n label: translatedTitle,\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, backstageIdentity, t]);\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={t('profile.picture')}\n />\n ) : (\n <AccountCircleOutlinedIcon fontSize=\"small\" sx={{ mr: 1 }} />\n )}\n <Typography\n variant=\"body2\"\n sx={{\n display: { xs: 'none', md: 'block' },\n fontWeight: 500,\n mr: '1rem',\n }}\n >\n {profileDisplayName()}\n </Typography>\n </>\n )}\n <KeyboardArrowDownOutlinedIcon\n sx={{\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":";;;;;;;;;;;;;;;;;;;;AA4CO,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,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,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,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AA;AAAA,cACC,KAAK,OAAQ,CAAA,OAAA;AAAA,cACb,IAAI,EAAE,EAAA,EAAI,GAAG,MAAQ,EAAA,MAAA,EAAQ,OAAO,MAAO,EAAA;AAAA,cAC3C,GAAA,EAAK,EAAE,iBAAiB;AAAA;AAAA,WAC1B,uBAEC,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;;;;"}
@@ -4,10 +4,13 @@ import Box from '@mui/material/Box';
4
4
  import IconButton from '@mui/material/IconButton';
5
5
  import Tooltip from '@mui/material/Tooltip';
6
6
  import { HeaderIcon } from '../HeaderIcon/HeaderIcon.esm.js';
7
+ import { useTranslation } from '../../hooks/useTranslation.esm.js';
8
+ import { translateWithFallback } from '../../utils/translationUtils.esm.js';
7
9
 
8
10
  const Link = (props) => /* @__PURE__ */ jsx(Link$1, { ...props, color: "inherit", externalLinkIcon: false });
9
11
  const HeaderIconButton = ({
10
12
  title,
13
+ titleKey,
11
14
  icon,
12
15
  tooltip,
13
16
  color = "inherit",
@@ -16,17 +19,19 @@ const HeaderIconButton = ({
16
19
  to,
17
20
  layout
18
21
  }) => {
19
- if (!title) {
22
+ const { t } = useTranslation();
23
+ const displayTitle = translateWithFallback(t, titleKey, title);
24
+ if (!displayTitle) {
20
25
  console.warn("HeaderIconButton has no title:", { icon, to });
21
26
  }
22
27
  const linkProps = { to };
23
- return /* @__PURE__ */ jsx(Box, { sx: layout, children: /* @__PURE__ */ jsx(Tooltip, { title: tooltip ?? title, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
28
+ return /* @__PURE__ */ jsx(Box, { sx: layout, children: /* @__PURE__ */ jsx(Tooltip, { title: tooltip ?? displayTitle, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
24
29
  IconButton,
25
30
  {
26
31
  LinkComponent: Link,
27
32
  color,
28
33
  size,
29
- "aria-label": ariaLabel ?? title,
34
+ "aria-label": ariaLabel ?? displayTitle,
30
35
  ...linkProps,
31
36
  children: /* @__PURE__ */ jsx(HeaderIcon, { icon, size })
32
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderIconButton.esm.js","sources":["../../../src/components/HeaderIconButton/HeaderIconButton.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { CSSProperties } from 'react';\nimport { Link as BackstageLink } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport IconButton, { IconButtonProps } from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { HeaderIcon } from '../HeaderIcon/HeaderIcon';\n\n/**\n * @public\n */\nexport interface HeaderIconButtonProps {\n title: string;\n icon: string;\n tooltip?: string;\n color?: 'inherit' | 'primary' | 'secondary' | 'default';\n size?: 'small' | 'medium' | 'large';\n ariaLabel?: string;\n to: string;\n layout?: CSSProperties;\n}\n\n// Backstage Link automatically detects external links and emits analytic events.\nconst Link = (props: any) => (\n <BackstageLink {...props} color=\"inherit\" externalLinkIcon={false} />\n);\n\nexport const HeaderIconButton = ({\n title,\n icon,\n tooltip,\n color = 'inherit',\n size = 'small',\n ariaLabel,\n to,\n layout,\n}: HeaderIconButtonProps) => {\n if (!title) {\n // eslint-disable-next-line no-console\n console.warn('HeaderIconButton has no title:', { icon, to });\n }\n\n const linkProps = { to } as IconButtonProps;\n\n return (\n <Box sx={layout}>\n <Tooltip title={tooltip ?? title}>\n <div>\n <IconButton\n LinkComponent={Link}\n color={color}\n size={size}\n aria-label={ariaLabel ?? title}\n {...linkProps} // to={to} isn't supported\n >\n <HeaderIcon icon={icon} size={size} />\n </IconButton>\n </div>\n </Tooltip>\n </Box>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;AAwCA,MAAM,IAAA,GAAO,CAAC,KAAA,qBACX,GAAA,CAAAA,MAAA,EAAA,EAAe,GAAG,KAAO,EAAA,KAAA,EAAM,SAAU,EAAA,gBAAA,EAAkB,KAAO,EAAA,CAAA;AAG9D,MAAM,mBAAmB,CAAC;AAAA,EAC/B,KAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAQ,GAAA,SAAA;AAAA,EACR,IAAO,GAAA,OAAA;AAAA,EACP,SAAA;AAAA,EACA,EAAA;AAAA,EACA;AACF,CAA6B,KAAA;AAC3B,EAAA,IAAI,CAAC,KAAO,EAAA;AAEV,IAAA,OAAA,CAAQ,IAAK,CAAA,gCAAA,EAAkC,EAAE,IAAA,EAAM,IAAI,CAAA;AAAA;AAG7D,EAAM,MAAA,SAAA,GAAY,EAAE,EAAG,EAAA;AAEvB,EACE,uBAAA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,MACP,EAAA,QAAA,kBAAA,GAAA,CAAC,WAAQ,KAAO,EAAA,OAAA,IAAW,KACzB,EAAA,QAAA,kBAAA,GAAA,CAAC,KACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,aAAe,EAAA,IAAA;AAAA,MACf,KAAA;AAAA,MACA,IAAA;AAAA,MACA,cAAY,SAAa,IAAA,KAAA;AAAA,MACxB,GAAG,SAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAY,IAAY,EAAA;AAAA;AAAA,GACtC,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"HeaderIconButton.esm.js","sources":["../../../src/components/HeaderIconButton/HeaderIconButton.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { CSSProperties } from 'react';\nimport { Link as BackstageLink } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport IconButton, { IconButtonProps } from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { HeaderIcon } from '../HeaderIcon/HeaderIcon';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { translateWithFallback } from '../../utils/translationUtils';\n\n/**\n * @public\n */\nexport interface HeaderIconButtonProps {\n title: string;\n titleKey?: string;\n icon: string;\n tooltip?: string;\n color?: 'inherit' | 'primary' | 'secondary' | 'default';\n size?: 'small' | 'medium' | 'large';\n ariaLabel?: string;\n to: string;\n layout?: CSSProperties;\n}\n\n// Backstage Link automatically detects external links and emits analytic events.\nconst Link = (props: any) => (\n <BackstageLink {...props} color=\"inherit\" externalLinkIcon={false} />\n);\n\nexport const HeaderIconButton = ({\n title,\n titleKey,\n icon,\n tooltip,\n color = 'inherit',\n size = 'small',\n ariaLabel,\n to,\n layout,\n}: HeaderIconButtonProps) => {\n const { t } = useTranslation();\n const displayTitle = translateWithFallback(t, titleKey, title);\n if (!displayTitle) {\n // eslint-disable-next-line no-console\n console.warn('HeaderIconButton has no title:', { icon, to });\n }\n\n const linkProps = { to } as IconButtonProps;\n\n return (\n <Box sx={layout}>\n <Tooltip title={tooltip ?? displayTitle}>\n <div>\n <IconButton\n LinkComponent={Link}\n color={color}\n size={size}\n aria-label={ariaLabel ?? displayTitle}\n {...linkProps} // to={to} isn't supported\n >\n <HeaderIcon icon={icon} size={size} />\n </IconButton>\n </div>\n </Tooltip>\n </Box>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;;AA2CA,MAAM,IAAA,GAAO,CAAC,KAAA,qBACX,GAAA,CAAAA,MAAA,EAAA,EAAe,GAAG,KAAO,EAAA,KAAA,EAAM,SAAU,EAAA,gBAAA,EAAkB,KAAO,EAAA,CAAA;AAG9D,MAAM,mBAAmB,CAAC;AAAA,EAC/B,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAQ,GAAA,SAAA;AAAA,EACR,IAAO,GAAA,OAAA;AAAA,EACP,SAAA;AAAA,EACA,EAAA;AAAA,EACA;AACF,CAA6B,KAAA;AAC3B,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,YAAe,GAAA,qBAAA,CAAsB,CAAG,EAAA,QAAA,EAAU,KAAK,CAAA;AAC7D,EAAA,IAAI,CAAC,YAAc,EAAA;AAEjB,IAAA,OAAA,CAAQ,IAAK,CAAA,gCAAA,EAAkC,EAAE,IAAA,EAAM,IAAI,CAAA;AAAA;AAG7D,EAAM,MAAA,SAAA,GAAY,EAAE,EAAG,EAAA;AAEvB,EACE,uBAAA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,MACP,EAAA,QAAA,kBAAA,GAAA,CAAC,WAAQ,KAAO,EAAA,OAAA,IAAW,YACzB,EAAA,QAAA,kBAAA,GAAA,CAAC,KACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,aAAe,EAAA,IAAA;AAAA,MACf,KAAA;AAAA,MACA,IAAA;AAAA,MACA,cAAY,SAAa,IAAA,YAAA;AAAA,MACxB,GAAG,SAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAY,IAAY,EAAA;AAAA;AAAA,GACtC,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
@@ -2,11 +2,14 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import Tooltip from '@mui/material/Tooltip';
3
3
  import { useTranslation } from '../../hooks/useTranslation.esm.js';
4
4
  import { MenuItemLinkContent } from './MenuItemLinkContent.esm.js';
5
+ import { translateWithFallback } from '../../utils/translationUtils.esm.js';
5
6
 
6
7
  const MenuItemLink = ({
7
8
  to,
8
9
  title,
10
+ titleKey,
9
11
  subTitle,
12
+ subTitleKey,
10
13
  icon,
11
14
  tooltip
12
15
  }) => {
@@ -14,13 +17,14 @@ const MenuItemLink = ({
14
17
  const isExternalLink = Boolean(
15
18
  to && (to.startsWith("http://") || to.startsWith("https://"))
16
19
  );
17
- const translatedTitle = title?.includes(".") ? t(title, {}) || title : title;
20
+ const translatedTitle = translateWithFallback(t, titleKey, title);
21
+ const translatedSubTitle = translateWithFallback(t, subTitleKey, subTitle);
18
22
  const headerLinkContent = () => /* @__PURE__ */ jsx(
19
23
  MenuItemLinkContent,
20
24
  {
21
25
  icon,
22
26
  label: translatedTitle,
23
- subLabel: subTitle,
27
+ subLabel: translatedSubTitle,
24
28
  isExternalLink
25
29
  }
26
30
  );
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItemLink.esm.js","sources":["../../../src/components/MenuItemLink/MenuItemLink.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 Tooltip from '@mui/material/Tooltip';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { MenuItemLinkContent } from './MenuItemLinkContent';\n\n/**\n * Header Icon Button properties\n * @public\n */\nexport interface MenuItemLinkProps {\n to: string;\n title?: string;\n subTitle?: string;\n icon?: string;\n tooltip?: string;\n}\n\nexport const MenuItemLink = ({\n to,\n title,\n subTitle,\n icon,\n tooltip,\n}: MenuItemLinkProps) => {\n const { t } = useTranslation();\n const isExternalLink = Boolean(\n to && (to.startsWith('http://') || to.startsWith('https://')),\n );\n\n // Check if title looks like a translation key (contains dots)\n const translatedTitle = title?.includes('.')\n ? t(title as any, {}) || title // Fallback to original title if translation fails\n : title;\n\n const headerLinkContent = () => (\n <MenuItemLinkContent\n icon={icon}\n label={translatedTitle}\n subLabel={subTitle}\n isExternalLink={isExternalLink}\n />\n );\n\n return (\n <>\n {tooltip && (\n <Tooltip title={tooltip}>\n <div>{headerLinkContent()}</div>\n </Tooltip>\n )}\n {!tooltip && headerLinkContent()}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,eAAe,CAAC;AAAA,EAC3B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAyB,KAAA;AACvB,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,cAAiB,GAAA,OAAA;AAAA,IACrB,OAAO,EAAG,CAAA,UAAA,CAAW,SAAS,CAAK,IAAA,EAAA,CAAG,WAAW,UAAU,CAAA;AAAA,GAC7D;AAGA,EAAM,MAAA,eAAA,GAAkB,KAAO,EAAA,QAAA,CAAS,GAAG,CAAA,GACvC,EAAE,KAAc,EAAA,EAAE,CAAA,IAAK,KACvB,GAAA,KAAA;AAEJ,EAAA,MAAM,oBAAoB,sBACxB,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,KAAO,EAAA,eAAA;AAAA,MACP,QAAU,EAAA,QAAA;AAAA,MACV;AAAA;AAAA,GACF;AAGF,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IACC,OAAA,oBAAA,GAAA,CAAC,WAAQ,KAAO,EAAA,OAAA,EACd,8BAAC,KAAK,EAAA,EAAA,QAAA,EAAA,iBAAA,IAAoB,CAC5B,EAAA,CAAA;AAAA,IAED,CAAC,WAAW,iBAAkB;AAAA,GACjC,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"MenuItemLink.esm.js","sources":["../../../src/components/MenuItemLink/MenuItemLink.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 Tooltip from '@mui/material/Tooltip';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { MenuItemLinkContent } from './MenuItemLinkContent';\nimport { translateWithFallback } from '../../utils/translationUtils';\n\n/**\n * Header Icon Button properties\n * @public\n */\nexport interface MenuItemLinkProps {\n to: string;\n title?: string;\n titleKey?: string;\n subTitle?: string;\n subTitleKey?: string;\n icon?: string;\n tooltip?: string;\n}\n\nexport const MenuItemLink = ({\n to,\n title,\n titleKey,\n subTitle,\n subTitleKey,\n icon,\n tooltip,\n}: MenuItemLinkProps) => {\n const { t } = useTranslation();\n const isExternalLink = Boolean(\n to && (to.startsWith('http://') || to.startsWith('https://')),\n );\n\n const translatedTitle = translateWithFallback(t, titleKey, title);\n const translatedSubTitle = translateWithFallback(t, subTitleKey, subTitle);\n\n const headerLinkContent = () => (\n <MenuItemLinkContent\n icon={icon}\n label={translatedTitle}\n subLabel={translatedSubTitle}\n isExternalLink={isExternalLink}\n />\n );\n\n return (\n <>\n {tooltip && (\n <Tooltip title={tooltip}>\n <div>{headerLinkContent()}</div>\n </Tooltip>\n )}\n {!tooltip && headerLinkContent()}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAmCO,MAAM,eAAe,CAAC;AAAA,EAC3B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAyB,KAAA;AACvB,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,cAAiB,GAAA,OAAA;AAAA,IACrB,OAAO,EAAG,CAAA,UAAA,CAAW,SAAS,CAAK,IAAA,EAAA,CAAG,WAAW,UAAU,CAAA;AAAA,GAC7D;AAEA,EAAA,MAAM,eAAkB,GAAA,qBAAA,CAAsB,CAAG,EAAA,QAAA,EAAU,KAAK,CAAA;AAChE,EAAA,MAAM,kBAAqB,GAAA,qBAAA,CAAsB,CAAG,EAAA,WAAA,EAAa,QAAQ,CAAA;AAEzE,EAAA,MAAM,oBAAoB,sBACxB,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,KAAO,EAAA,eAAA;AAAA,MACP,QAAU,EAAA,kBAAA;AAAA,MACV;AAAA;AAAA,GACF;AAGF,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IACC,OAAA,oBAAA,GAAA,CAAC,WAAQ,KAAO,EAAA,OAAA,EACd,8BAAC,KAAK,EAAA,EAAA,QAAA,EAAA,iBAAA,IAAoB,CAC5B,EAAA,CAAA;AAAA,IAED,CAAC,WAAW,iBAAkB;AAAA,GACjC,EAAA,CAAA;AAEJ;;;;"}
@@ -4,9 +4,11 @@ import { Link } from '@backstage/core-components';
4
4
  import MenuItem from '@mui/material/MenuItem';
5
5
  import { MenuItemLink } from '../MenuItemLink/MenuItemLink.esm.js';
6
6
  import { useTranslation } from '../../hooks/useTranslation.esm.js';
7
+ import { translateWithFallback } from '../../utils/translationUtils.esm.js';
7
8
 
8
9
  const SupportButton = ({
9
- title,
10
+ title = "Support",
11
+ titleKey = "help.supportTitle",
10
12
  to,
11
13
  icon = "support",
12
14
  tooltip,
@@ -17,7 +19,7 @@ const SupportButton = ({
17
19
  const apiHolder = useApiHolder();
18
20
  const config = apiHolder.get(configApiRef);
19
21
  const { t } = useTranslation();
20
- const displayTitle = title || t("help.supportTitle");
22
+ const displayTitle = translateWithFallback(t, titleKey, title);
21
23
  const supportUrl = to ?? config?.getOptionalString("app.support.url");
22
24
  if (!supportUrl) {
23
25
  return null;
@@ -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';\nimport { useTranslation } from '../../hooks/useTranslation';\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,\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 { t } = useTranslation();\n\n const displayTitle = title || t('help.supportTitle');\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={displayTitle}\n icon={icon}\n tooltip={tooltip}\n />\n </MenuItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAqCO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAA;AAAA,EACA,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,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAE7B,EAAM,MAAA,YAAA,GAAe,KAAS,IAAA,CAAA,CAAE,mBAAmB,CAAA;AACnD,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,KAAO,EAAA,YAAA;AAAA,UACP,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';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { translateWithFallback } from '../../utils/translationUtils';\n\n/**\n * @public\n */\nexport interface SupportButtonProps {\n icon?: string;\n title?: string;\n titleKey?: 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 titleKey = 'help.supportTitle',\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 { t } = useTranslation();\n\n const displayTitle = translateWithFallback(t, titleKey, title);\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={displayTitle}\n icon={icon}\n tooltip={tooltip}\n />\n </MenuItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAuCO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAQ,GAAA,SAAA;AAAA,EACR,QAAW,GAAA,mBAAA;AAAA,EACX,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,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAE7B,EAAA,MAAM,YAAe,GAAA,qBAAA,CAAsB,CAAG,EAAA,QAAA,EAAU,KAAK,CAAA;AAC7D,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,KAAO,EAAA,YAAA;AAAA,UACP,IAAA;AAAA,UACA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
@@ -118,9 +118,10 @@ const defaultProfileDropdownMountPoints = [
118
118
  config: {
119
119
  priority: 200,
120
120
  props: {
121
- title: "profile.settings",
122
- icon: "manageAccounts",
123
- link: "/settings"
121
+ title: "Settings",
122
+ titleKey: "profile.settings",
123
+ link: "/settings",
124
+ icon: "manageAccounts"
124
125
  }
125
126
  }
126
127
  },
@@ -129,7 +130,8 @@ const defaultProfileDropdownMountPoints = [
129
130
  config: {
130
131
  priority: 150,
131
132
  props: {
132
- title: "profile.myProfile",
133
+ title: "My profile",
134
+ titleKey: "profile.myProfile",
133
135
  icon: "account",
134
136
  type: "myProfile"
135
137
  // Semantic identifier
@@ -149,7 +151,8 @@ const defaultHelpDropdownMountPoints = [
149
151
  config: {
150
152
  priority: 100,
151
153
  props: {
152
- title: "help.quickStart",
154
+ title: "Quick start",
155
+ titleKey: "help.quickStart",
153
156
  icon: "quickstart",
154
157
  link: "https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/"
155
158
  }
@@ -169,7 +172,8 @@ const defaultApplicationLauncherDropdownMountPoints = [
169
172
  section: "applicationLauncher.sections.documentation",
170
173
  priority: 150,
171
174
  props: {
172
- title: "applicationLauncher.developerHub",
175
+ title: "Developer Hub",
176
+ titleKey: "applicationLauncher.developerHub",
173
177
  icon: "developerHub",
174
178
  link: "https://docs.redhat.com/en/documentation/red_hat_developer_hub"
175
179
  }
@@ -181,7 +185,8 @@ const defaultApplicationLauncherDropdownMountPoints = [
181
185
  section: "applicationLauncher.sections.developerTools",
182
186
  priority: 130,
183
187
  props: {
184
- title: "applicationLauncher.rhdhLocal",
188
+ title: "RHDH Local",
189
+ titleKey: "applicationLauncher.rhdhLocal",
185
190
  icon: "developerHub",
186
191
  link: "https://github.com/redhat-developer/rhdh-local"
187
192
  }
@@ -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';\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: 'profile.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: 'profile.myProfile',\n icon: 'account',\n type: 'myProfile', // Semantic identifier\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: 'help.quickStart',\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: 'applicationLauncher.sections.documentation',\n priority: 150,\n props: {\n title: 'applicationLauncher.developerHub',\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: 'applicationLauncher.sections.developerTools',\n priority: 130,\n props: {\n title: 'applicationLauncher.rhdhLocal',\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,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,QAAU,EAAA,EAAA;AAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,UAAY,EAAA;AAAA;AACd;AACF,GACF;AAAA;AAAA,EAEA;AAAA,IACE,SAAW,EAAA,cAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,EAAA;AAAA,MACV,MAAQ,EAAA;AAAA,QACN,OAAS,EAAA;AAAA,UACP,EAAI,E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../../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 titleKey: 'profile.settings',\n link: '/settings',\n icon: 'manageAccounts',\n },\n },\n },\n {\n Component: MenuItemLink as ComponentType,\n config: {\n priority: 150,\n props: {\n title: 'My profile',\n titleKey: 'profile.myProfile',\n icon: 'account',\n type: 'myProfile', // Semantic identifier\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 titleKey: 'help.quickStart',\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: 'applicationLauncher.sections.documentation',\n priority: 150,\n props: {\n title: 'Developer Hub',\n titleKey: 'applicationLauncher.developerHub',\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: 'applicationLauncher.sections.developerTools',\n priority: 130,\n props: {\n title: 'RHDH Local',\n titleKey: 'applicationLauncher.rhdhLocal',\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,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,QAAU,EAAA,EAAA;AAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,UAAY,EAAA;AAAA;AACd;AACF,GACF;AAAA;AAAA,EAEA;AAAA,IACE,SAAW,EAAA,cAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,EAAA;AAAA,MACV,MAAQ,EAAA;AAAA,QACN,OAAS,EAAA;AAAA,UACP,EAAI,EAAA,MAAA;AAAA,UACJ,EAAI,EAAA;AAAA,SACN;AAAA,QACA,EAAI,EAAA;AAAA;AACN;AAAA;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,eAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,2BAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MA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AACZ;AAEJ;AAEO,MAAM,8BAA2D,GAAA;AAAA,EACtE;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,aAAA;AAAA,QACP,QAAU,EAAA,iBAAA;AAAA,QACV,IAAM,EAAA,YAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF,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,4CAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,eAAA;AAAA,QACP,QAAU,EAAA,kCAAA;AAAA,QACV,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,6CAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,YAAA;AAAA,QACP,QAAU,EAAA,+BAAA;AAAA,QACV,IAAM,EAAA,cAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF;AAEJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -42,7 +42,9 @@ interface GlobalHeaderComponentProps {
42
42
  interface MenuItemLinkProps {
43
43
  to: string;
44
44
  title?: string;
45
+ titleKey?: string;
45
46
  subTitle?: string;
47
+ subTitleKey?: string;
46
48
  icon?: string;
47
49
  tooltip?: string;
48
50
  }
@@ -121,6 +123,7 @@ interface HeaderIconProps {
121
123
  */
122
124
  interface HeaderIconButtonProps {
123
125
  title: string;
126
+ titleKey?: string;
124
127
  icon: string;
125
128
  tooltip?: string;
126
129
  color?: 'inherit' | 'primary' | 'secondary' | 'default';
@@ -138,8 +141,10 @@ interface HeaderIconButtonProps {
138
141
  interface MenuItemConfig {
139
142
  Component: ComponentType<MenuItemLinkProps | MenuItemProps | {}>;
140
143
  label: string;
144
+ labelKey?: string;
141
145
  icon?: string;
142
146
  subLabel?: string;
147
+ subLabelKey?: string;
143
148
  link?: string;
144
149
  }
145
150
 
@@ -165,6 +170,7 @@ interface SpacerProps {
165
170
  interface SupportButtonProps {
166
171
  icon?: string;
167
172
  title?: string;
173
+ titleKey?: string;
168
174
  to?: string;
169
175
  tooltip?: string;
170
176
  style?: CSSProperties;
@@ -320,7 +326,7 @@ declare const HeaderIcon: ({ icon, size, layout, }: HeaderIconProps) => react_js
320
326
  /**
321
327
  * @public
322
328
  */
323
- declare const HeaderIconButton: ({ title, icon, tooltip, color, size, ariaLabel, to, layout, }: HeaderIconButtonProps) => react_jsx_runtime.JSX.Element;
329
+ declare const HeaderIconButton: ({ title, titleKey, icon, tooltip, color, size, ariaLabel, to, layout, }: HeaderIconButtonProps) => react_jsx_runtime.JSX.Element;
324
330
  /**
325
331
  * Search Component
326
332
  *
@@ -1,4 +1,5 @@
1
1
  import { createPlugin, createComponentExtension } from '@backstage/core-plugin-api';
2
+ export { globalHeaderTranslations } from './translations/index.esm.js';
2
3
  import 'react/jsx-runtime';
3
4
  import '@mui/material/MenuItem';
4
5
  import '@mui/material/Divider';
@@ -8,7 +9,6 @@ import '@mui/material/Icon';
8
9
  import '@mui/material/styles';
9
10
  import '@mui/icons-material/Launch';
10
11
  import '@backstage/core-plugin-api/alpha';
11
- export { globalHeaderTranslations } from './translations/index.esm.js';
12
12
  import 'react';
13
13
  import '@mui/icons-material/ArrowDropDownOutlined';
14
14
  import '@scalprum/react-core';
@@ -45,9 +45,14 @@ import '@mui/icons-material/Apps';
45
45
  import '@mui/icons-material/AppRegistration';
46
46
  import '@mui/icons-material/HelpOutline';
47
47
  import '@mui/icons-material/SupportAgent';
48
+ import { globalHeaderTranslationRef } from './translations/ref.esm.js';
48
49
 
49
50
  const globalHeaderPlugin = createPlugin({
50
- id: "global-header"
51
+ id: "global-header",
52
+ __experimentalTranslations: {
53
+ availableLanguages: ["en", "de", "es", "fr", "it"],
54
+ resources: [globalHeaderTranslationRef]
55
+ }
51
56
  });
52
57
  const GlobalHeader = globalHeaderPlugin.provide(
53
58
  createComponentExtension({
@@ -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 { 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\n/**\n * Translation resource for the global header plugin\n *\n * @public\n */\nexport { globalHeaderTranslations } from './translations';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA;AACN,CAAC;AAOM,MAAM,eAAe,kBAAmB,CAAA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;;;;"}
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';\nimport { globalHeaderTranslationRef } from './translations';\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 __experimentalTranslations: {\n availableLanguages: ['en', 'de', 'es', 'fr', 'it'],\n resources: [globalHeaderTranslationRef],\n },\n} as any);\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\n/**\n * Translation resource for the global header plugin\n *\n * @public\n */\nexport { globalHeaderTranslations } from './translations';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA,eAAA;AAAA,EACJ,0BAA4B,EAAA;AAAA,IAC1B,oBAAoB,CAAC,IAAA,EAAM,IAAM,EAAA,IAAA,EAAM,MAAM,IAAI,CAAA;AAAA,IACjD,SAAA,EAAW,CAAC,0BAA0B;AAAA;AAE1C,CAAQ;AAOD,MAAM,eAAe,kBAAmB,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IAC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(t, translationKey, fallbackText) => {
2
+ if (!translationKey) {
3
+ return fallbackText || "";
4
+ }
5
+ const translation = t(translationKey, {});
6
+ return translation !== translationKey ? translation : fallbackText || "";
7
+ };
8
+
9
+ export { translateWithFallback };
10
+ //# sourceMappingURL=translationUtils.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translationUtils.esm.js","sources":["../../src/utils/translationUtils.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 */\nimport { TranslationFunction } from '@backstage/core-plugin-api/alpha';\nimport { globalHeaderTranslationRef } from '../translations';\n\n/**\n * Translates text using a dedicated translation key or fallback logic\n * @param t - Translation function\n * @param titleKey - Dedicated translation key (e.g., \"profile.settings\")\n * @param title - Fallback title text (e.g., \"Settings\")\n * @returns Translated text or fallback\n */\n\nexport const translateWithFallback = (\n t: TranslationFunction<typeof globalHeaderTranslationRef.T>,\n translationKey?: string,\n fallbackText?: string,\n): string => {\n if (!translationKey) {\n return fallbackText || '';\n }\n const translation = t(translationKey as keyof typeof t, {});\n return translation !== translationKey ? translation : fallbackText || '';\n};\n"],"names":[],"mappings":"AA0BO,MAAM,qBAAwB,GAAA,CACnC,CACA,EAAA,cAAA,EACA,YACW,KAAA;AACX,EAAA,IAAI,CAAC,cAAgB,EAAA;AACnB,IAAA,OAAO,YAAgB,IAAA,EAAA;AAAA;AAEzB,EAAA,MAAM,WAAc,GAAA,CAAA,CAAE,cAAkC,EAAA,EAAE,CAAA;AAC1D,EAAO,OAAA,WAAA,KAAgB,cAAiB,GAAA,WAAA,GAAc,YAAgB,IAAA,EAAA;AACxE;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-global-header",
3
- "version": "1.17.3",
3
+ "version": "1.18.0",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",