@red-hat-developer-hub/backstage-plugin-global-header 1.2.0 → 1.4.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/HeaderDropdownComponent/ApplicationLauncherDropdown.esm.js +77 -0
  3. package/dist/components/HeaderDropdownComponent/ApplicationLauncherDropdown.esm.js.map +1 -0
  4. package/dist/components/HeaderDropdownComponent/DropdownEmptyState.esm.js +42 -0
  5. package/dist/components/HeaderDropdownComponent/DropdownEmptyState.esm.js.map +1 -0
  6. package/dist/components/HeaderDropdownComponent/StarredDropdown.esm.js +13 -32
  7. package/dist/components/HeaderDropdownComponent/StarredDropdown.esm.js.map +1 -1
  8. package/dist/components/HeaderIcon/HeaderIcon.esm.js +1 -1
  9. package/dist/components/HeaderIcon/HeaderIcon.esm.js.map +1 -1
  10. package/dist/components/LogoutButton/LogoutButton.esm.js +1 -1
  11. package/dist/components/LogoutButton/LogoutButton.esm.js.map +1 -1
  12. package/dist/components/MenuItemLink/MenuItemLink.esm.js +11 -2
  13. package/dist/components/MenuItemLink/MenuItemLink.esm.js.map +1 -1
  14. package/dist/components/MenuItemLink/MenuItemLinkContent.esm.js +32 -5
  15. package/dist/components/MenuItemLink/MenuItemLinkContent.esm.js.map +1 -1
  16. package/dist/components/SupportButton/SupportButton.esm.js +1 -1
  17. package/dist/components/SupportButton/SupportButton.esm.js.map +1 -1
  18. package/dist/defaultMountPoints/defaultMountPoints.esm.js +60 -1
  19. package/dist/defaultMountPoints/defaultMountPoints.esm.js.map +1 -1
  20. package/dist/hooks/useApplicationLauncherDropdownMountPoints.esm.js +14 -0
  21. package/dist/hooks/useApplicationLauncherDropdownMountPoints.esm.js.map +1 -0
  22. package/dist/index.d.ts +7 -1
  23. package/dist/index.esm.js +1 -1
  24. package/dist/plugin.esm.js +14 -3
  25. package/dist/plugin.esm.js.map +1 -1
  26. package/package.json +18 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-global-header
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ba8628d: Added a new application launcher dropdown to the global header which can be used to configure application links and quick links.
8
+
9
+ ## 1.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - d49d965: Backstage version bump to v1.36.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 9562fd9: changing `Logout` text to `Sign Out`
18
+
3
19
  ## 1.2.0
4
20
 
5
21
  ### Minor Changes
@@ -0,0 +1,77 @@
1
+ import React, { useMemo } from 'react';
2
+ import AppsIcon from '@mui/icons-material/Apps';
3
+ import AppRegistrationIcon from '@mui/icons-material/AppRegistration';
4
+ import { useApplicationLauncherDropdownMountPoints } from '../../hooks/useApplicationLauncherDropdownMountPoints.esm.js';
5
+ import { useDropdownManager } from '../../hooks/useDropdownManager.esm.js';
6
+ import { HeaderDropdownComponent } from './HeaderDropdownComponent.esm.js';
7
+ import { MenuSection } from './MenuSection.esm.js';
8
+ import { DropdownEmptyState } from './DropdownEmptyState.esm.js';
9
+
10
+ const ApplicationLauncherDropdown = () => {
11
+ const { anchorEl, handleOpen, handleClose } = useDropdownManager();
12
+ const mountPoints = useApplicationLauncherDropdownMountPoints();
13
+ const sectionsObject = useMemo(() => {
14
+ const groupedSections = {};
15
+ (mountPoints ?? []).forEach((mp) => {
16
+ const section = mp.config?.section ?? "";
17
+ const sectionLink = mp.config?.sectionLink ?? "";
18
+ const sectionLinkLabel = mp.config?.sectionLinkLabel ?? "";
19
+ if (!groupedSections[section]) {
20
+ groupedSections[section] = { sectionLink, sectionLinkLabel, items: [] };
21
+ }
22
+ groupedSections[section].items.push({
23
+ Component: mp.Component,
24
+ icon: mp.config?.props?.icon,
25
+ label: mp.config?.props?.title,
26
+ link: mp.config?.props?.link,
27
+ external: mp.config?.props?.external ?? false,
28
+ priority: mp.config?.priority ?? 0
29
+ });
30
+ });
31
+ Object.values(groupedSections).forEach((section) => {
32
+ section.items.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
33
+ });
34
+ return groupedSections;
35
+ }, [mountPoints]);
36
+ const sections = Object.entries(sectionsObject);
37
+ return /* @__PURE__ */ React.createElement(
38
+ HeaderDropdownComponent,
39
+ {
40
+ buttonContent: /* @__PURE__ */ React.createElement(AppsIcon, null),
41
+ tooltip: "Application launcher",
42
+ isIconButton: true,
43
+ onOpen: handleOpen,
44
+ onClose: handleClose,
45
+ anchorEl
46
+ },
47
+ sections.length > 0 ? sections.map(
48
+ ([section, { sectionLink, sectionLinkLabel, items }], index) => /* @__PURE__ */ React.createElement(
49
+ MenuSection,
50
+ {
51
+ key: section,
52
+ sectionLabel: section,
53
+ optionalLink: sectionLink,
54
+ optionalLinkLabel: sectionLinkLabel,
55
+ items,
56
+ handleClose,
57
+ hideDivider: index === sections.length - 1
58
+ }
59
+ )
60
+ ) : /* @__PURE__ */ React.createElement(
61
+ DropdownEmptyState,
62
+ {
63
+ title: "No application links configured",
64
+ subTitle: "Configure application links in dynamic plugin config for quick access from here.",
65
+ icon: /* @__PURE__ */ React.createElement(
66
+ AppRegistrationIcon,
67
+ {
68
+ sx: { fontSize: 64, color: "text.disabled" }
69
+ }
70
+ )
71
+ }
72
+ )
73
+ );
74
+ };
75
+
76
+ export { ApplicationLauncherDropdown };
77
+ //# sourceMappingURL=ApplicationLauncherDropdown.esm.js.map
@@ -0,0 +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 React, { 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';\n\nexport const ApplicationLauncherDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\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=\"Application launcher\"\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=\"No application links configured\"\n subTitle=\"Configure application links in dynamic plugin config for quick access from here.\"\n icon={\n <AppRegistrationIcon\n sx={{ fontSize: 64, color: 'text.disabled' }}\n />\n }\n />\n )}\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA0BO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,EAAE,QAAA,EAAU,UAAY,EAAA,WAAA,KAAgB,kBAAmB,EAAA;AAEjE,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;AAAA,QACzB,IAAA,EAAM,EAAG,CAAA,MAAA,EAAQ,KAAO,EAAA,IAAA;AAAA,Q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AAS,MAAS,GAAA;AAAA;AAAA;AAC3C,KAIJ,mBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,iCAAA;AAAA,QACN,QAAS,EAAA,kFAAA;AAAA,QACT,IACE,kBAAA,KAAA,CAAA,aAAA;AAAA,UAAC,mBAAA;AAAA,UAAA;AAAA,YACC,EAAI,EAAA,EAAE,QAAU,EAAA,EAAA,EAAI,OAAO,eAAgB;AAAA;AAAA;AAC7C;AAAA;AAEJ,GAEJ;AAEJ;;;;"}
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import Box from '@mui/material/Box';
3
+ import Typography from '@mui/material/Typography';
4
+ import { InfoCard } from '@backstage/core-components';
5
+
6
+ const DropdownEmptyState = ({
7
+ title,
8
+ subTitle,
9
+ icon
10
+ }) => {
11
+ return /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(
12
+ Box,
13
+ {
14
+ sx: {
15
+ display: "flex",
16
+ flexDirection: "column",
17
+ alignItems: "center",
18
+ justifyContent: "center",
19
+ textAlign: "center",
20
+ py: 4,
21
+ px: 2,
22
+ // Added padding to control width
23
+ maxWidth: 300,
24
+ // Set max width to constrain text expansion
25
+ mx: "auto"
26
+ }
27
+ },
28
+ icon,
29
+ /* @__PURE__ */ React.createElement(Typography, { variant: "h6", sx: { mt: 2, color: "text.primary" } }, title),
30
+ /* @__PURE__ */ React.createElement(
31
+ Typography,
32
+ {
33
+ variant: "body2",
34
+ sx: { mt: 1, color: "text.secondary", maxWidth: 250 }
35
+ },
36
+ subTitle
37
+ )
38
+ ));
39
+ };
40
+
41
+ export { DropdownEmptyState };
42
+ //# sourceMappingURL=DropdownEmptyState.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownEmptyState.esm.js","sources":["../../../src/components/HeaderDropdownComponent/DropdownEmptyState.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 React from 'react';\nimport Box from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport { InfoCard } from '@backstage/core-components';\n\n/**\n * @public\n * Props for dropdown empty state\n */\ninterface DropdownEmptyStateProps {\n title: string;\n subTitle: string;\n icon: React.ReactNode;\n}\n\nexport const DropdownEmptyState: React.FC<DropdownEmptyStateProps> = ({\n title,\n subTitle,\n icon,\n}) => {\n return (\n <InfoCard>\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n py: 4,\n px: 2, // Added padding to control width\n maxWidth: 300, // Set max width to constrain text expansion\n mx: 'auto',\n }}\n >\n {icon}\n <Typography variant=\"h6\" sx={{ mt: 2, color: 'text.primary' }}>\n {title}\n </Typography>\n <Typography\n variant=\"body2\"\n sx={{ mt: 1, color: 'text.secondary', maxWidth: 250 }}\n >\n {subTitle}\n </Typography>\n </Box>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;AA8BO,MAAM,qBAAwD,CAAC;AAAA,EACpE,KAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,2CACG,QACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,aAAe,EAAA,QAAA;AAAA,QACf,UAAY,EAAA,QAAA;AAAA,QACZ,cAAgB,EAAA,QAAA;AAAA,QAChB,SAAW,EAAA,QAAA;AAAA,QACX,EAAI,EAAA,CAAA;AAAA,QACJ,EAAI,EAAA,CAAA;AAAA;AAAA,QACJ,QAAU,EAAA,GAAA;AAAA;AAAA,QACV,EAAI,EAAA;AAAA;AACN,KAAA;AAAA,IAEC,IAAA;AAAA,oBACD,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,IAAK,EAAA,EAAA,EAAI,EAAE,EAAA,EAAI,CAAG,EAAA,KAAA,EAAO,cAAe,EAAA,EAAA,EACzD,KACH,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,OAAA;AAAA,QACR,IAAI,EAAE,EAAA,EAAI,GAAG,KAAO,EAAA,gBAAA,EAAkB,UAAU,GAAI;AAAA,OAAA;AAAA,MAEnD;AAAA;AACH,GAEJ,CAAA;AAEJ;;;;"}
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
2
  import { useStarredEntities, useEntityPresentation } from '@backstage/plugin-catalog-react';
3
- import { Link, InfoCard } from '@backstage/core-components';
3
+ import { Link } from '@backstage/core-components';
4
+ import { parseEntityRef } from '@backstage/catalog-model';
4
5
  import StarBorderIcon from '@mui/icons-material/StarBorder';
5
6
  import Star from '@mui/icons-material/Star';
6
7
  import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';
7
8
  import ListItemIcon from '@mui/material/ListItemIcon';
8
9
  import ListItemText from '@mui/material/ListItemText';
9
- import { useDropdownManager } from '../../hooks/useDropdownManager.esm.js';
10
- import { HeaderDropdownComponent } from './HeaderDropdownComponent.esm.js';
11
- import { parseEntityRef } from '@backstage/catalog-model';
12
10
  import { useTheme } from '@mui/material/styles';
13
11
  import MenuItem from '@mui/material/MenuItem';
14
12
  import Typography from '@mui/material/Typography';
15
13
  import IconButton from '@mui/material/IconButton';
16
14
  import Tooltip from '@mui/material/Tooltip';
17
- import Box from '@mui/material/Box';
15
+ import { useDropdownManager } from '../../hooks/useDropdownManager.esm.js';
16
+ import { HeaderDropdownComponent } from './HeaderDropdownComponent.esm.js';
17
+ import { DropdownEmptyState } from './DropdownEmptyState.esm.js';
18
18
 
19
19
  const StarredItem = ({
20
20
  entityRef,
@@ -55,32 +55,6 @@ const StarredItem = ({
55
55
  ))
56
56
  );
57
57
  };
58
- const NoStarredItems = () => {
59
- return /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(
60
- Box,
61
- {
62
- display: "flex",
63
- flexDirection: "column",
64
- alignItems: "center",
65
- justifyContent: "center",
66
- textAlign: "center",
67
- py: 4,
68
- px: 2,
69
- maxWidth: 300,
70
- mx: "auto"
71
- },
72
- /* @__PURE__ */ React.createElement(AutoAwesomeIcon, { sx: { fontSize: 64 }, color: "disabled" }),
73
- /* @__PURE__ */ React.createElement(Typography, { variant: "h6", sx: { mt: 2, color: "text.primary" } }, "No starred items yet"),
74
- /* @__PURE__ */ React.createElement(
75
- Typography,
76
- {
77
- variant: "body2",
78
- sx: { mt: 1, color: "text.secondary", maxWidth: 250 }
79
- },
80
- "Click the star icon next to an entity's name to save it here for quick access."
81
- )
82
- ));
83
- };
84
58
  const StarredDropdown = () => {
85
59
  const { anchorEl, handleOpen, handleClose } = useDropdownManager();
86
60
  const { starredEntities, toggleStarredEntity } = useStarredEntities();
@@ -109,7 +83,14 @@ const StarredDropdown = () => {
109
83
  toggleStarredEntity,
110
84
  handleClose
111
85
  }
112
- ))) : /* @__PURE__ */ React.createElement(NoStarredItems, null)
86
+ ))) : /* @__PURE__ */ React.createElement(
87
+ DropdownEmptyState,
88
+ {
89
+ title: "No starred items yet",
90
+ subTitle: "Click the star icon next to an entity's name to save it here for quick access.",
91
+ icon: /* @__PURE__ */ React.createElement(AutoAwesomeIcon, { sx: { fontSize: 64 }, color: "disabled" })
92
+ }
93
+ )
113
94
  );
114
95
  };
115
96
 
@@ -1 +1 @@
1
- {"version":3,"file":"StarredDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/StarredDropdown.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 React from 'react';\n\nimport {\n useEntityPresentation,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { InfoCard, Link } from '@backstage/core-components';\n\nimport StarBorderIcon from '@mui/icons-material/StarBorder';\nimport Star from '@mui/icons-material/Star';\nimport AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\n\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport {\n CompoundEntityRef,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport { useTheme } from '@mui/material/styles';\nimport MenuItem from '@mui/material/MenuItem';\nimport Typography from '@mui/material/Typography';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport Box from '@mui/material/Box';\n\n/**\n * @public\n * Props for each starred entitify item\n */\ninterface SectionComponentProps {\n entityRef: string | CompoundEntityRef | Entity;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n handleClose: () => void;\n}\n\nconst StarredItem: React.FC<SectionComponentProps> = ({\n entityRef,\n toggleStarredEntity,\n handleClose,\n}) => {\n const { Icon, primaryTitle, secondaryTitle } =\n useEntityPresentation(entityRef);\n const { name, kind, namespace } = parseEntityRef(entityRef as string);\n const theme = useTheme();\n\n return (\n <MenuItem\n component={Link}\n to={`/catalog/${namespace || 'default'}/${kind}/${name}`}\n onClick={handleClose}\n disableRipple\n disableTouchRipple\n >\n {Icon && (\n <ListItemIcon sx={{ minWidth: 36 }}>\n <Icon />\n </ListItemIcon>\n )}\n <ListItemText\n primary={\n <Typography sx={{ color: theme.palette.text.primary }}>\n {primaryTitle || secondaryTitle}\n </Typography>\n }\n secondary={kind.toLocaleUpperCase()}\n // inset={!Icon}\n sx={{ ml: 1, mr: 1 }}\n />\n <Tooltip title=\"Remove from list\">\n <IconButton\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n toggleStarredEntity(entityRef);\n }}\n >\n <Star color=\"warning\" />\n </IconButton>\n </Tooltip>\n </MenuItem>\n );\n};\n\nconst NoStarredItems = () => {\n return (\n <InfoCard>\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n alignItems=\"center\"\n justifyContent=\"center\"\n textAlign=\"center\"\n py={4}\n px={2} // Added padding to control width\n maxWidth={300} // Set max width to constrain text expansion\n mx=\"auto\"\n >\n <AutoAwesomeIcon sx={{ fontSize: 64 }} color=\"disabled\" />\n <Typography variant=\"h6\" sx={{ mt: 2, color: 'text.primary' }}>\n No starred items yet\n </Typography>\n <Typography\n variant=\"body2\"\n sx={{ mt: 1, color: 'text.secondary', maxWidth: 250 }}\n >\n Click the star icon next to an entity's name to save it here for quick\n access.\n </Typography>\n </Box>\n </InfoCard>\n );\n};\n\nexport const StarredDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n\n const entitiesArray = Array.from(starredEntities);\n\n return (\n <HeaderDropdownComponent\n buttonContent={<StarBorderIcon />}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n tooltip=\"Your starred items\"\n isIconButton\n >\n {entitiesArray.length > 0 ? (\n <>\n <ListItemText\n primary=\"Your starred items\"\n sx={{ pl: 2, mt: 1, fontWeight: 'bold', color: 'text.secondary' }}\n />\n {entitiesArray.map(enitityRef => (\n <StarredItem\n key={enitityRef}\n entityRef={enitityRef}\n toggleStarredEntity={toggleStarredEntity}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1
+ {"version":3,"file":"StarredDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/StarredDropdown.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 React from 'react';\n\nimport {\n useEntityPresentation,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Link } from '@backstage/core-components';\nimport {\n CompoundEntityRef,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport StarBorderIcon from '@mui/icons-material/StarBorder';\nimport Star from '@mui/icons-material/Star';\nimport AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\n\nimport { useTheme } from '@mui/material/styles';\nimport MenuItem from '@mui/material/MenuItem';\nimport Typography from '@mui/material/Typography';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { DropdownEmptyState } from './DropdownEmptyState';\n\n/**\n * @public\n * Props for each starred entitify item\n */\ninterface SectionComponentProps {\n entityRef: string | CompoundEntityRef | Entity;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n handleClose: () => void;\n}\n\nconst StarredItem: React.FC<SectionComponentProps> = ({\n entityRef,\n toggleStarredEntity,\n handleClose,\n}) => {\n const { Icon, primaryTitle, secondaryTitle } =\n useEntityPresentation(entityRef);\n const { name, kind, namespace } = parseEntityRef(entityRef as string);\n const theme = useTheme();\n\n return (\n <MenuItem\n component={Link}\n to={`/catalog/${namespace || 'default'}/${kind}/${name}`}\n onClick={handleClose}\n disableRipple\n disableTouchRipple\n >\n {Icon && (\n <ListItemIcon sx={{ minWidth: 36 }}>\n <Icon />\n </ListItemIcon>\n )}\n <ListItemText\n primary={\n <Typography sx={{ color: theme.palette.text.primary }}>\n {primaryTitle || secondaryTitle}\n </Typography>\n }\n secondary={kind.toLocaleUpperCase()}\n // inset={!Icon}\n sx={{ ml: 1, mr: 1 }}\n />\n <Tooltip title=\"Remove from list\">\n <IconButton\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n toggleStarredEntity(entityRef);\n }}\n >\n <Star color=\"warning\" />\n </IconButton>\n </Tooltip>\n </MenuItem>\n );\n};\n\nexport const StarredDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n\n const entitiesArray = Array.from(starredEntities);\n\n return (\n <HeaderDropdownComponent\n buttonContent={<StarBorderIcon />}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n tooltip=\"Your starred items\"\n isIconButton\n >\n {entitiesArray.length > 0 ? (\n <>\n <ListItemText\n primary=\"Your starred items\"\n sx={{ pl: 2, mt: 1, fontWeight: 'bold', color: 'text.secondary' }}\n />\n {entitiesArray.map(enitityRef => (\n <StarredItem\n key={enitityRef}\n entityRef={enitityRef}\n toggleStarredEntity={toggleStarredEntity}\n handleClose={handleClose}\n />\n ))}\n </>\n ) : (\n <DropdownEmptyState\n title=\"No starred items yet\"\n subTitle=\"Click the star icon next to an entity's name to save it here for quick access.\"\n icon={<AutoAwesomeIcon sx={{ fontSize: 64 }} color=\"disabled\" />}\n />\n )}\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAwDA,MAAM,cAA+C,CAAC;AAAA,EACpD,SAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAA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ACA;AAAA;AAAA,KAEH,CACH,CAEA,mBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,sBAAA;AAAA,QACN,QAAS,EAAA,gFAAA;AAAA,QACT,IAAA,sCAAO,eAAgB,EAAA,EAAA,EAAA,EAAI,EAAE,QAAU,EAAA,EAAA,EAAM,EAAA,KAAA,EAAM,UAAW,EAAA;AAAA;AAAA;AAChE,GAEJ;AAEJ;;;;"}
@@ -28,7 +28,7 @@ const HeaderIcon = ({
28
28
  baseClassName: "material-icons-outlined",
29
29
  sx: layout
30
30
  },
31
- /* @__PURE__ */ React.createElement("img", { src: icon, alt: "" })
31
+ /* @__PURE__ */ React.createElement("img", { src: icon, alt: "", height: "100%", width: "100%" })
32
32
  );
33
33
  }
34
34
  return /* @__PURE__ */ React.createElement(
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderIcon.esm.js","sources":["../../../src/components/HeaderIcon/HeaderIcon.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 React from 'react';\nimport { useApp } from '@backstage/core-plugin-api';\nimport MuiIcon from '@mui/material/Icon';\nimport Box from '@mui/material/Box';\n\n/**\n * @public\n */\nexport interface HeaderIconProps {\n icon: string;\n size?: 'small' | 'medium' | 'large';\n layout?: React.CSSProperties;\n}\n\n/**\n * @public\n */\nexport const HeaderIcon = ({\n icon,\n size = 'small',\n layout,\n}: HeaderIconProps) => {\n const app = useApp();\n if (!icon) {\n return null;\n }\n\n const SystemIcon = app.getSystemIcon(icon);\n if (SystemIcon) {\n return (\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n <SystemIcon fontSize={size} />\n </Box>\n );\n }\n\n if (icon.startsWith('<svg')) {\n const svgDataUri = `data:image/svg+xml;base64,${btoa(icon)}`;\n return (\n <MuiIcon fontSize={size} sx={layout}>\n <img src={svgDataUri} alt=\"\" />\n </MuiIcon>\n );\n }\n\n if (\n icon.startsWith('https://') ||\n icon.startsWith('http://') ||\n icon.startsWith('/')\n ) {\n return (\n <MuiIcon\n fontSize={size}\n baseClassName=\"material-icons-outlined\"\n sx={layout}\n >\n <img src={icon} alt=\"\" />\n </MuiIcon>\n );\n }\n\n return (\n <MuiIcon\n fontSize={size}\n baseClassName=\"material-icons-outlined\"\n sx={layout}\n >\n {icon}\n </MuiIcon>\n );\n};\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,aAAa,CAAC;AAAA,EACzB,IAAA;AAAA,EACA,IAAO,GAAA,OAAA;AAAA,EACP;AACF,CAAuB,KAAA;AACrB,EAAA,MAAM,MAAM,MAAO,EAAA;AACnB,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,IAAA;AAAA;AAGT,EAAM,MAAA,UAAA,GAAa,GAAI,CAAA,aAAA,CAAc,IAAI,CAAA;AACzC,EAAA,IAAI,UAAY,EAAA;AACd,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,EAAE,SAAS,MAAQ,EAAA,UAAA,EAAY,QAAU,EAAA,GAAG,QACnD,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,QAAA,EAAU,MAAM,CAC9B,CAAA;AAAA;AAIJ,EAAI,IAAA,IAAA,CAAK,UAAW,CAAA,MAAM,CAAG,EAAA;AAC3B,IAAA,MAAM,UAAa,GAAA,CAAA,0BAAA,EAA6B,IAAK,CAAA,IAAI,CAAC,CAAA,CAAA;AAC1D,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,QAAU,EAAA,IAAA,EAAM,EAAI,EAAA,MAAA,EAAA,kBAC1B,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,GAAK,EAAA,UAAA,EAAY,GAAI,EAAA,EAAA,EAAG,CAC/B,CAAA;AAAA;AAIJ,EACE,IAAA,IAAA,CAAK,UAAW,CAAA,UAAU,CAC1B,IAAA,IAAA,CAAK,UAAW,CAAA,SAAS,CACzB,IAAA,IAAA,CAAK,UAAW,CAAA,GAAG,CACnB,EAAA;AACA,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,QAAU,EAAA,IAAA;AAAA,QACV,aAAc,EAAA,yBAAA;AAAA,QACd,EAAI,EAAA;AAAA,OAAA;AAAA,sBAEH,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,GAAK,EAAA,IAAA,EAAM,KAAI,EAAG,EAAA;AAAA,KACzB;AAAA;AAIJ,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA,IAAA;AAAA,MACV,aAAc,EAAA,yBAAA;AAAA,MACd,EAAI,EAAA;AAAA,KAAA;AAAA,IAEH;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"HeaderIcon.esm.js","sources":["../../../src/components/HeaderIcon/HeaderIcon.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 React from 'react';\nimport { useApp } from '@backstage/core-plugin-api';\nimport MuiIcon from '@mui/material/Icon';\nimport Box from '@mui/material/Box';\n\n/**\n * @public\n */\nexport interface HeaderIconProps {\n icon: string;\n size?: 'small' | 'medium' | 'large';\n layout?: React.CSSProperties;\n}\n\n/**\n * @public\n */\nexport const HeaderIcon = ({\n icon,\n size = 'small',\n layout,\n}: HeaderIconProps) => {\n const app = useApp();\n if (!icon) {\n return null;\n }\n\n const SystemIcon = app.getSystemIcon(icon);\n if (SystemIcon) {\n return (\n <Box sx={{ display: 'flex', alignItems: 'center', ...layout }}>\n <SystemIcon fontSize={size} />\n </Box>\n );\n }\n\n if (icon.startsWith('<svg')) {\n const svgDataUri = `data:image/svg+xml;base64,${btoa(icon)}`;\n return (\n <MuiIcon fontSize={size} sx={layout}>\n <img src={svgDataUri} alt=\"\" />\n </MuiIcon>\n );\n }\n\n if (\n icon.startsWith('https://') ||\n icon.startsWith('http://') ||\n icon.startsWith('/')\n ) {\n return (\n <MuiIcon\n fontSize={size}\n baseClassName=\"material-icons-outlined\"\n sx={layout}\n >\n <img src={icon} alt=\"\" height=\"100%\" width=\"100%\" />\n </MuiIcon>\n );\n }\n\n return (\n <MuiIcon\n fontSize={size}\n baseClassName=\"material-icons-outlined\"\n sx={layout}\n >\n {icon}\n </MuiIcon>\n );\n};\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,aAAa,CAAC;AAAA,EACzB,IAAA;AAAA,EACA,IAAO,GAAA,OAAA;AAAA,EACP;AACF,CAAuB,KAAA;AACrB,EAAA,MAAM,MAAM,MAAO,EAAA;AACnB,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,IAAA;AAAA;AAGT,EAAM,MAAA,UAAA,GAAa,GAAI,CAAA,aAAA,CAAc,IAAI,CAAA;AACzC,EAAA,IAAI,UAAY,EAAA;AACd,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,EAAE,SAAS,MAAQ,EAAA,UAAA,EAAY,QAAU,EAAA,GAAG,QACnD,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,QAAA,EAAU,MAAM,CAC9B,CAAA;AAAA;AAIJ,EAAI,IAAA,IAAA,CAAK,UAAW,CAAA,MAAM,CAAG,EAAA;AAC3B,IAAA,MAAM,UAAa,GAAA,CAAA,0BAAA,EAA6B,IAAK,CAAA,IAAI,CAAC,CAAA,CAAA;AAC1D,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,QAAU,EAAA,IAAA,EAAM,EAAI,EAAA,MAAA,EAAA,kBAC1B,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,GAAK,EAAA,UAAA,EAAY,GAAI,EAAA,EAAA,EAAG,CAC/B,CAAA;AAAA;AAIJ,EACE,IAAA,IAAA,CAAK,UAAW,CAAA,UAAU,CAC1B,IAAA,IAAA,CAAK,UAAW,CAAA,SAAS,CACzB,IAAA,IAAA,CAAK,UAAW,CAAA,GAAG,CACnB,EAAA;AACA,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,QAAU,EAAA,IAAA;AAAA,QACV,aAAc,EAAA,yBAAA;AAAA,QACd,EAAI,EAAA;AAAA,OAAA;AAAA,sBAEJ,KAAA,CAAA,aAAA,CAAC,SAAI,GAAK,EAAA,IAAA,EAAM,KAAI,EAAG,EAAA,MAAA,EAAO,MAAO,EAAA,KAAA,EAAM,MAAO,EAAA;AAAA,KACpD;AAAA;AAIJ,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA,IAAA;AAAA,MACV,aAAc,EAAA,yBAAA;AAAA,MACd,EAAI,EAAA;AAAA,KAAA;AAAA,IAEH;AAAA,GACH;AAEJ;;;;"}
@@ -15,7 +15,7 @@ const LogoutButton = () => {
15
15
  onClick: handleLogout,
16
16
  sx: { cursor: "pointer", width: "100%", color: "inherit" }
17
17
  },
18
- /* @__PURE__ */ React.createElement(MenuItemLinkContent, { icon: "logout", label: "Logout" })
18
+ /* @__PURE__ */ React.createElement(MenuItemLinkContent, { icon: "logout", label: "Sign out" })
19
19
  );
20
20
  };
21
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"LogoutButton.esm.js","sources":["../../../src/components/LogoutButton/LogoutButton.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 React from 'react';\n\nimport {\n errorApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n\nimport Box from '@mui/material/Box';\n\nimport { MenuItemLinkContent } from '../MenuItemLink/MenuItemLinkContent';\n\nexport const LogoutButton = () => {\n const errorApi = useApi(errorApiRef);\n const identityApi = useApi(identityApiRef);\n\n const handleLogout = () => {\n identityApi.signOut().catch(error => errorApi.post(error));\n };\n\n // TODO switch to Button\n return (\n <Box\n onClick={handleLogout}\n sx={{ cursor: 'pointer', width: '100%', color: 'inherit' }}\n >\n <MenuItemLinkContent icon=\"logout\" label=\"Logout\" />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AAEzC,EAAA,MAAM,eAAe,MAAM;AACzB,IAAA,WAAA,CAAY,SAAU,CAAA,KAAA,CAAM,WAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,GAC3D;AAGA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,IAAI,EAAE,MAAA,EAAQ,WAAW,KAAO,EAAA,MAAA,EAAQ,OAAO,SAAU;AAAA,KAAA;AAAA,oBAExD,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,EAAoB,IAAK,EAAA,QAAA,EAAS,OAAM,QAAS,EAAA;AAAA,GACpD;AAEJ;;;;"}
1
+ {"version":3,"file":"LogoutButton.esm.js","sources":["../../../src/components/LogoutButton/LogoutButton.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 React from 'react';\n\nimport {\n errorApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n\nimport Box from '@mui/material/Box';\n\nimport { MenuItemLinkContent } from '../MenuItemLink/MenuItemLinkContent';\n\nexport const LogoutButton = () => {\n const errorApi = useApi(errorApiRef);\n const identityApi = useApi(identityApiRef);\n\n const handleLogout = () => {\n identityApi.signOut().catch(error => errorApi.post(error));\n };\n\n // TODO switch to Button\n return (\n <Box\n onClick={handleLogout}\n sx={{ cursor: 'pointer', width: '100%', color: 'inherit' }}\n >\n <MenuItemLinkContent icon=\"logout\" label=\"Sign out\" />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AAEzC,EAAA,MAAM,eAAe,MAAM;AACzB,IAAA,WAAA,CAAY,SAAU,CAAA,KAAA,CAAM,WAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,GAC3D;AAGA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,IAAI,EAAE,MAAA,EAAQ,WAAW,KAAO,EAAA,MAAA,EAAQ,OAAO,SAAU;AAAA,KAAA;AAAA,oBAExD,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,EAAoB,IAAK,EAAA,QAAA,EAAS,OAAM,UAAW,EAAA;AAAA,GACtD;AAEJ;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Tooltip from '@mui/material/Tooltip';
3
- import { Link } from 'react-router-dom';
3
+ import { Link } from '@backstage/core-components';
4
4
  import { MenuItemLinkContent } from './MenuItemLinkContent.esm.js';
5
5
 
6
6
  const MenuItemLink = ({
@@ -10,6 +10,7 @@ const MenuItemLink = ({
10
10
  icon,
11
11
  tooltip
12
12
  }) => {
13
+ const isExternalLink = to.startsWith("http://") || to.startsWith("https://");
13
14
  const headerLinkContent = () => /* @__PURE__ */ React.createElement(
14
15
  Link,
15
16
  {
@@ -20,7 +21,15 @@ const MenuItemLink = ({
20
21
  width: "100%"
21
22
  }
22
23
  },
23
- /* @__PURE__ */ React.createElement(MenuItemLinkContent, { icon, label: title, subLabel: subTitle })
24
+ /* @__PURE__ */ React.createElement(
25
+ MenuItemLinkContent,
26
+ {
27
+ icon,
28
+ label: title,
29
+ subLabel: subTitle,
30
+ isExternalLink
31
+ }
32
+ )
24
33
  );
25
34
  return /* @__PURE__ */ React.createElement(React.Fragment, null, tooltip && /* @__PURE__ */ React.createElement(Tooltip, { title: tooltip }, /* @__PURE__ */ React.createElement("div", null, headerLinkContent())), !tooltip && headerLinkContent());
26
35
  };
@@ -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 React from 'react';\nimport Tooltip from '@mui/material/Tooltip';\nimport { Link } from 'react-router-dom';\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 headerLinkContent = () => (\n <Link\n to={to}\n style={{\n color: 'inherit',\n textDecoration: 'none',\n width: '100%',\n }}\n >\n <MenuItemLinkContent icon={icon} label={title} subLabel={subTitle} />\n </Link>\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":";;;;;AAiCO,MAAM,eAAe,CAAC;AAAA,EAC3B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAyB,KAAA;AACvB,EAAA,MAAM,oBAAoB,sBACxB,KAAA,CAAA,aAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,SAAA;AAAA,QACP,cAAgB,EAAA,MAAA;AAAA,QAChB,KAAO,EAAA;AAAA;AACT,KAAA;AAAA,wCAEC,mBAAoB,EAAA,EAAA,IAAA,EAAY,KAAO,EAAA,KAAA,EAAO,UAAU,QAAU,EAAA;AAAA,GACrE;AAEF,EAAA,uBAEK,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,OAAA,oBACE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,OAAO,OACd,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA,EAAA,iBAAA,EAAoB,CAC5B,CAAA,EAED,CAAC,OAAA,IAAW,mBACf,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 React from 'react';\nimport Tooltip from '@mui/material/Tooltip';\nimport { Link } from '@backstage/core-components';\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 isExternalLink = to.startsWith('http://') || to.startsWith('https://');\n\n const headerLinkContent = () => (\n <Link\n to={to}\n style={{\n color: 'inherit',\n textDecoration: 'none',\n width: '100%',\n }}\n >\n <MenuItemLinkContent\n icon={icon}\n label={title}\n subLabel={subTitle}\n isExternalLink={isExternalLink}\n />\n </Link>\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":";;;;;AAiCO,MAAM,eAAe,CAAC;AAAA,EAC3B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAyB,KAAA;AACvB,EAAA,MAAM,iBAAiB,EAAG,CAAA,UAAA,CAAW,SAAS,CAAK,IAAA,EAAA,CAAG,WAAW,UAAU,CAAA;AAE3E,EAAA,MAAM,oBAAoB,sBACxB,KAAA,CAAA,aAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,SAAA;AAAA,QACP,cAAgB,EAAA,MAAA;AAAA,QAChB,KAAO,EAAA;AAAA;AACT,KAAA;AAAA,oBAEA,KAAA,CAAA,aAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,KAAO,EAAA,KAAA;AAAA,QACP,QAAU,EAAA,QAAA;AAAA,QACV;AAAA;AAAA;AACF,GACF;AAEF,EAAA,uBAEK,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,OAAA,oBACE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,OAAO,OACd,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA,EAAA,iBAAA,EAAoB,CAC5B,CAAA,EAED,CAAC,OAAA,IAAW,mBACf,CAAA;AAEJ;;;;"}
@@ -3,11 +3,13 @@ import Typography from '@mui/material/Typography';
3
3
  import Box from '@mui/material/Box';
4
4
  import { HeaderIcon } from '../HeaderIcon/HeaderIcon.esm.js';
5
5
  import { useTheme } from '@mui/material/styles';
6
+ import LaunchIcon from '@mui/icons-material/Launch';
6
7
 
7
8
  const MenuItemLinkContent = ({
8
9
  icon,
9
10
  label,
10
- subLabel
11
+ subLabel,
12
+ isExternalLink = false
11
13
  }) => {
12
14
  const theme = useTheme();
13
15
  return /* @__PURE__ */ React.createElement(
@@ -16,11 +18,13 @@ const MenuItemLinkContent = ({
16
18
  sx: {
17
19
  display: "flex",
18
20
  alignItems: "center",
21
+ justifyContent: "space-between",
19
22
  margin: "8px 0",
20
- color: "inherit"
23
+ color: "inherit",
24
+ width: "100%"
21
25
  }
22
26
  },
23
- icon && /* @__PURE__ */ React.createElement(
27
+ /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex", alignItems: "center" } }, icon && /* @__PURE__ */ React.createElement(
24
28
  HeaderIcon,
25
29
  {
26
30
  icon,
@@ -28,11 +32,34 @@ const MenuItemLinkContent = ({
28
32
  layout: label ? {
29
33
  marginRight: "0.5rem",
30
34
  flexShrink: 0,
35
+ display: "flex",
36
+ alignItems: "center",
37
+ // Ensure the icon is centered
31
38
  color: theme.palette.mode === "dark" ? theme.palette.text.primary : theme.palette.text.disabled
32
39
  } : {}
33
40
  }
34
- ),
35
- /* @__PURE__ */ React.createElement(Box, null, label && /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: theme.palette.text.primary }, label), subLabel && /* @__PURE__ */ React.createElement(Typography, { variant: "caption", color: "text.secondary" }, subLabel))
41
+ ), /* @__PURE__ */ React.createElement(
42
+ Box,
43
+ {
44
+ sx: {
45
+ display: "flex",
46
+ flexDirection: "column",
47
+ justifyContent: "center"
48
+ }
49
+ },
50
+ label && /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: theme.palette.text.primary }, label),
51
+ subLabel && /* @__PURE__ */ React.createElement(Typography, { variant: "caption", color: theme.palette.text.secondary }, subLabel)
52
+ )),
53
+ isExternalLink && /* @__PURE__ */ React.createElement(
54
+ LaunchIcon,
55
+ {
56
+ sx: {
57
+ fontSize: 16,
58
+ color: theme.palette.text.secondary,
59
+ ml: 1
60
+ }
61
+ }
62
+ )
36
63
  );
37
64
  };
38
65
 
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItemLinkContent.esm.js","sources":["../../../src/components/MenuItemLink/MenuItemLinkContent.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 React from 'react';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport { HeaderIcon } from '../HeaderIcon/HeaderIcon';\nimport { useTheme } from '@mui/material/styles';\n\ninterface MenuItemLinkContentProps {\n icon?: string;\n label?: string;\n subLabel?: string;\n}\n\nexport const MenuItemLinkContent: React.FC<MenuItemLinkContentProps> = ({\n icon,\n label,\n subLabel,\n}) => {\n const theme = useTheme();\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n margin: '8px 0',\n color: 'inherit',\n }}\n >\n {icon && (\n <HeaderIcon\n icon={icon}\n size=\"small\"\n layout={\n label\n ? {\n marginRight: '0.5rem',\n flexShrink: 0,\n color:\n theme.palette.mode === 'dark'\n ? theme.palette.text.primary\n : theme.palette.text.disabled,\n }\n : {}\n }\n />\n )}\n <Box>\n {label && (\n <Typography variant=\"body2\" color={theme.palette.text.primary}>\n {label}\n </Typography>\n )}\n {subLabel && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {subLabel}\n </Typography>\n )}\n </Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;AA4BO,MAAM,sBAA0D,CAAC;AAAA,EACtE,IAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,UAAY,EAAA,QAAA;AAAA,QACZ,MAAQ,EAAA,OAAA;AAAA,QACR,KAAO,EAAA;AAAA;AACT,KAAA;AAAA,IAEC,IACC,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,IAAK,EAAA,OAAA;AAAA,QACL,QACE,KACI,GAAA;AAAA,UACE,WAAa,EAAA,QAAA;AAAA,UACb,UAAY,EAAA,CAAA;AAAA,UACZ,KAAA,EACE,KAAM,CAAA,OAAA,CAAQ,IAAS,KAAA,MAAA,GACnB,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA,GACnB,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA;AAAA,YAE3B;AAAC;AAAA,KAET;AAAA,oBAEF,KAAA,CAAA,aAAA,CAAC,WACE,KACC,oBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,OAAQ,EAAA,OAAA,EAAQ,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,WACnD,KACH,CAAA,EAED,4BACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,SAAU,EAAA,KAAA,EAAM,gBACjC,EAAA,EAAA,QACH,CAEJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"MenuItemLinkContent.esm.js","sources":["../../../src/components/MenuItemLink/MenuItemLinkContent.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 React from 'react';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport { HeaderIcon } from '../HeaderIcon/HeaderIcon';\nimport { useTheme } from '@mui/material/styles';\nimport LaunchIcon from '@mui/icons-material/Launch';\n\ninterface MenuItemLinkContentProps {\n icon?: string;\n label?: string;\n subLabel?: string;\n isExternalLink?: boolean;\n}\n\nexport const MenuItemLinkContent: React.FC<MenuItemLinkContentProps> = ({\n icon,\n label,\n subLabel,\n isExternalLink = false,\n}) => {\n const theme = useTheme();\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n margin: '8px 0',\n color: 'inherit',\n width: '100%',\n }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n {icon && (\n <HeaderIcon\n icon={icon}\n size=\"small\"\n layout={\n label\n ? {\n marginRight: '0.5rem',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center', // Ensure the icon is centered\n color:\n theme.palette.mode === 'dark'\n ? theme.palette.text.primary\n : theme.palette.text.disabled,\n }\n : {}\n }\n />\n )}\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n }}\n >\n {label && (\n <Typography variant=\"body2\" color={theme.palette.text.primary}>\n {label}\n </Typography>\n )}\n {subLabel && (\n <Typography variant=\"caption\" color={theme.palette.text.secondary}>\n {subLabel}\n </Typography>\n )}\n </Box>\n </Box>\n {isExternalLink && (\n <LaunchIcon\n sx={{\n fontSize: 16,\n color: theme.palette.text.secondary,\n ml: 1,\n }}\n />\n )}\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA6BO,MAAM,sBAA0D,CAAC;AAAA,EACtE,IAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAiB,GAAA;AACnB,CAAM,KAAA;AACJ,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,OAAS,E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;AAAA,KAGN,CAAA;AAAA,IACC,cACC,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,QAAU,EAAA,EAAA;AAAA,UACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA;AAAA,UAC1B,EAAI,EAAA;AAAA;AACN;AAAA;AACF,GAEJ;AAEJ;;;;"}
@@ -21,7 +21,7 @@ const SupportButton = ({
21
21
  if (!supportUrl) {
22
22
  return null;
23
23
  }
24
- const isExternalLink = supportUrl.startsWith("http") || supportUrl.startsWith("https");
24
+ const isExternalLink = supportUrl.startsWith("http://") || supportUrl.startsWith("https://");
25
25
  return /* @__PURE__ */ React.createElement(Box, { sx: layout }, /* @__PURE__ */ React.createElement(
26
26
  Tooltip,
27
27
  {
@@ -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 React from 'react';\n\nimport { configApiRef, useApiHolder } from '@backstage/core-plugin-api';\nimport { Link as BackstageLink } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport HelpIcon from '@mui/icons-material/HelpOutline';\n\n/**\n * @public\n */\nexport interface SupportButtonProps {\n title?: string;\n tooltip?: string;\n color?:\n | 'inherit'\n | 'default'\n | 'primary'\n | 'secondary'\n | 'error'\n | 'info'\n | 'success'\n | 'warning';\n size?: 'small' | 'medium' | 'large';\n to?: string;\n layout?: React.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\n/**\n * @public\n */\nexport const SupportButton = ({\n title = 'Support',\n tooltip,\n color = 'inherit',\n size = 'small',\n to,\n layout,\n}: SupportButtonProps) => {\n const apiHolder = useApiHolder();\n const config = apiHolder.get(configApiRef);\n const supportUrl = to ?? config?.getOptionalString('app.support.url');\n\n if (!supportUrl) {\n return null;\n }\n\n const isExternalLink =\n supportUrl.startsWith('http') || supportUrl.startsWith('https');\n\n return (\n <Box sx={layout}>\n <Tooltip\n title={tooltip ?? `${title}${isExternalLink ? ' (external link)' : ''}`}\n >\n <div>\n <IconButton\n component={Link}\n color={color}\n size={size}\n to={supportUrl}\n aria-label={title}\n >\n <HelpIcon fontSize={size} />\n </IconButton>\n </div>\n </Tooltip>\n </Box>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;AA+CA,MAAM,IAAA,GAAO,CAAC,KAAA,qBACX,KAAA,CAAA,aAAA,CAAAA,MAAA,EAAA,EAAe,GAAG,KAAO,EAAA,KAAA,EAAM,SAAU,EAAA,gBAAA,EAAkB,KAAO,EAAA,CAAA;AAM9D,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAQ,GAAA,SAAA;AAAA,EACR,OAAA;AAAA,EACA,KAAQ,GAAA,SAAA;AAAA,EACR,IAAO,GAAA,OAAA;AAAA,EACP,EAAA;AAAA,EACA;AACF,CAA0B,KAAA;AACxB,EAAA,MAAM,YAAY,YAAa,EAAA;AAC/B,EAAM,MAAA,MAAA,GAAS,SAAU,CAAA,GAAA,CAAI,YAAY,CAAA;AACzC,EAAA,MAAM,UAAa,GAAA,EAAA,IAAM,MAAQ,EAAA,iBAAA,CAAkB,iBAAiB,CAAA;AAEpE,EAAA,IAAI,CAAC,UAAY,EAAA;AACf,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,MAAM,iBACJ,UAAW,CAAA,UAAA,CAAW,MAAM,CAAK,IAAA,UAAA,CAAW,WAAW,OAAO,CAAA;AAEhE,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,MACP,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,OAAO,OAAW,IAAA,CAAA,EAAG,KAAK,CAAG,EAAA,cAAA,GAAiB,qBAAqB,EAAE,CAAA;AAAA,KAAA;AAAA,wCAEpE,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,SAAW,EAAA,IAAA;AAAA,QACX,KAAA;AAAA,QACA,IAAA;AAAA,QACA,EAAI,EAAA,UAAA;AAAA,QACJ,YAAY,EAAA;AAAA,OAAA;AAAA,sBAEZ,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAU,IAAM,EAAA;AAAA,KAE9B;AAAA,GAEJ,CAAA;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 React from 'react';\n\nimport { configApiRef, useApiHolder } from '@backstage/core-plugin-api';\nimport { Link as BackstageLink } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport HelpIcon from '@mui/icons-material/HelpOutline';\n\n/**\n * @public\n */\nexport interface SupportButtonProps {\n title?: string;\n tooltip?: string;\n color?:\n | 'inherit'\n | 'default'\n | 'primary'\n | 'secondary'\n | 'error'\n | 'info'\n | 'success'\n | 'warning';\n size?: 'small' | 'medium' | 'large';\n to?: string;\n layout?: React.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\n/**\n * @public\n */\nexport const SupportButton = ({\n title = 'Support',\n tooltip,\n color = 'inherit',\n size = 'small',\n to,\n layout,\n}: SupportButtonProps) => {\n const apiHolder = useApiHolder();\n const config = apiHolder.get(configApiRef);\n const supportUrl = to ?? config?.getOptionalString('app.support.url');\n\n if (!supportUrl) {\n return null;\n }\n\n const isExternalLink =\n supportUrl.startsWith('http://') || supportUrl.startsWith('https://');\n\n return (\n <Box sx={layout}>\n <Tooltip\n title={tooltip ?? `${title}${isExternalLink ? ' (external link)' : ''}`}\n >\n <div>\n <IconButton\n component={Link}\n color={color}\n size={size}\n to={supportUrl}\n aria-label={title}\n >\n <HelpIcon fontSize={size} />\n </IconButton>\n </div>\n </Tooltip>\n </Box>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;AA+CA,MAAM,IAAA,GAAO,CAAC,KAAA,qBACX,KAAA,CAAA,aAAA,CAAAA,MAAA,EAAA,EAAe,GAAG,KAAO,EAAA,KAAA,EAAM,SAAU,EAAA,gBAAA,EAAkB,KAAO,EAAA,CAAA;AAM9D,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAQ,GAAA,SAAA;AAAA,EACR,OAAA;AAAA,EACA,KAAQ,GAAA,SAAA;AAAA,EACR,IAAO,GAAA,OAAA;AAAA,EACP,EAAA;AAAA,EACA;AACF,CAA0B,KAAA;AACxB,EAAA,MAAM,YAAY,YAAa,EAAA;AAC/B,EAAM,MAAA,MAAA,GAAS,SAAU,CAAA,GAAA,CAAI,YAAY,CAAA;AACzC,EAAA,MAAM,UAAa,GAAA,EAAA,IAAM,MAAQ,EAAA,iBAAA,CAAkB,iBAAiB,CAAA;AAEpE,EAAA,IAAI,CAAC,UAAY,EAAA;AACf,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,MAAM,iBACJ,UAAW,CAAA,UAAA,CAAW,SAAS,CAAK,IAAA,UAAA,CAAW,WAAW,UAAU,CAAA;AAEtE,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,MACP,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,OAAO,OAAW,IAAA,CAAA,EAAG,KAAK,CAAG,EAAA,cAAA,GAAiB,qBAAqB,EAAE,CAAA;AAAA,KAAA;AAAA,wCAEpE,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,SAAW,EAAA,IAAA;AAAA,QACX,KAAA;AAAA,QACA,IAAA;AAAA,QACA,EAAI,EAAA,UAAA;AAAA,QACJ,YAAY,EAAA;AAAA,OAAA;AAAA,sBAEZ,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAU,IAAM,EAAA;AAAA,KAE9B;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -10,6 +10,7 @@ import { Divider } from '../components/Divider/Divider.esm.js';
10
10
  import { MenuItemLink } from '../components/MenuItemLink/MenuItemLink.esm.js';
11
11
  import { Spacer } from '../components/Spacer/Spacer.esm.js';
12
12
  import { StarredDropdown } from '../components/HeaderDropdownComponent/StarredDropdown.esm.js';
13
+ import { ApplicationLauncherDropdown } from '../components/HeaderDropdownComponent/ApplicationLauncherDropdown.esm.js';
13
14
 
14
15
  const defaultGlobalHeaderComponentsMountPoints = [
15
16
  {
@@ -50,6 +51,12 @@ const defaultGlobalHeaderComponentsMountPoints = [
50
51
  priority: 85
51
52
  }
52
53
  },
54
+ {
55
+ Component: ApplicationLauncherDropdown,
56
+ config: {
57
+ priority: 82
58
+ }
59
+ },
53
60
  {
54
61
  Component: SupportButton,
55
62
  config: {
@@ -109,6 +116,58 @@ const defaultProfileDropdownMountPoints = [
109
116
  }
110
117
  }
111
118
  ];
119
+ const defaultApplicationLauncherDropdownMountPoints = [
120
+ {
121
+ Component: MenuItemLink,
122
+ config: {
123
+ section: "Red Hat AI",
124
+ sectionLink: "https://www.redhat.com/en/products/ai",
125
+ sectionLinkLabel: "Read more",
126
+ priority: 200,
127
+ props: {
128
+ title: "Podman Desktop",
129
+ icon: "https://podman-desktop.io/img/logo.svg",
130
+ link: "https://podman-desktop.io/"
131
+ }
132
+ }
133
+ },
134
+ {
135
+ Component: MenuItemLink,
136
+ config: {
137
+ section: "Red Hat AI",
138
+ priority: 180,
139
+ props: {
140
+ title: "OpenShift AI",
141
+ icon: "https://upload.wikimedia.org/wikipedia/commons/d/d8/Red_Hat_logo.svg",
142
+ link: "https://www.redhat.com/en/technologies/cloud-computing/openshift/openshift-ai"
143
+ }
144
+ }
145
+ },
146
+ {
147
+ Component: MenuItemLink,
148
+ config: {
149
+ section: "Quick Links",
150
+ priority: 150,
151
+ props: {
152
+ title: "Slack",
153
+ icon: "https://upload.wikimedia.org/wikipedia/commons/d/d5/Slack_icon_2019.svg",
154
+ link: "https://slack.com/"
155
+ }
156
+ }
157
+ },
158
+ {
159
+ Component: MenuItemLink,
160
+ config: {
161
+ section: "Quick Links",
162
+ priority: 130,
163
+ props: {
164
+ title: "ArgoCD",
165
+ icon: "https://argo-cd.readthedocs.io/en/stable/assets/logo.png",
166
+ link: "https://argo-cd.readthedocs.io/en/stable/"
167
+ }
168
+ }
169
+ }
170
+ ];
112
171
 
113
- export { defaultCreateDropdownMountPoints, defaultGlobalHeaderComponentsMountPoints, defaultProfileDropdownMountPoints };
172
+ export { defaultApplicationLauncherDropdownMountPoints, defaultCreateDropdownMountPoints, defaultGlobalHeaderComponentsMountPoints, defaultProfileDropdownMountPoints };
114
173
  //# sourceMappingURL=defaultMountPoints.esm.js.map
@@ -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 { 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 CreateDropdownMountPoint,\n GlobalHeaderComponentMountPoint,\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';\n\n/**\n * default Global Header Components mount points\n *\n * @public\n */\nexport const defaultGlobalHeaderComponentsMountPoints: GlobalHeaderComponentMountPoint[] =\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 React.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: SupportButton,\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 React.ComponentType,\n config: {\n priority: 200,\n },\n },\n {\n Component: RegisterAComponentSection as React.ComponentType,\n config: {\n priority: 100,\n },\n },\n];\n\nexport const defaultProfileDropdownMountPoints: ProfileDropdownMountPoint[] = [\n {\n Component: MenuItemLink as React.ComponentType,\n config: {\n priority: 200,\n props: {\n title: 'Settings',\n icon: 'manageAccounts',\n link: '/settings',\n },\n },\n },\n {\n Component: LogoutButton,\n config: {\n priority: 100,\n },\n },\n];\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsCO,MAAM,wCACX,GAAA;AAAA,EACE;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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;AAEJ;;;;"}
1
+ {"version":3,"file":"defaultMountPoints.esm.js","sources":["../../src/defaultMountPoints/defaultMountPoints.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { 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 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';\n\n/**\n * default Global Header Components mount points\n *\n * @public\n */\nexport const defaultGlobalHeaderComponentsMountPoints: GlobalHeaderComponentMountPoint[] =\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 React.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: SupportButton,\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 React.ComponentType,\n config: {\n priority: 200,\n },\n },\n {\n Component: RegisterAComponentSection as React.ComponentType,\n config: {\n priority: 100,\n },\n },\n];\n\nexport const defaultProfileDropdownMountPoints: ProfileDropdownMountPoint[] = [\n {\n Component: MenuItemLink as React.ComponentType,\n config: {\n priority: 200,\n props: {\n title: 'Settings',\n icon: 'manageAccounts',\n link: '/settings',\n },\n },\n },\n {\n Component: LogoutButton,\n config: {\n priority: 100,\n },\n },\n];\n\nexport const defaultApplicationLauncherDropdownMountPoints: ApplicationLauncherDropdownMountPoint[] =\n [\n {\n Component: MenuItemLink as React.ComponentType,\n config: {\n section: 'Red Hat AI',\n sectionLink: 'https://www.redhat.com/en/products/ai',\n sectionLinkLabel: 'Read more',\n priority: 200,\n props: {\n title: 'Podman Desktop',\n icon: 'https://podman-desktop.io/img/logo.svg',\n link: 'https://podman-desktop.io/',\n },\n },\n },\n {\n Component: MenuItemLink as React.ComponentType,\n config: {\n section: 'Red Hat AI',\n priority: 180,\n props: {\n title: 'OpenShift AI',\n icon: 'https://upload.wikimedia.org/wikipedia/commons/d/d8/Red_Hat_logo.svg',\n link: 'https://www.redhat.com/en/technologies/cloud-computing/openshift/openshift-ai',\n },\n },\n },\n {\n Component: MenuItemLink as React.ComponentType,\n config: {\n section: 'Quick Links',\n priority: 150,\n props: {\n title: 'Slack',\n icon: 'https://upload.wikimedia.org/wikipedia/commons/d/d5/Slack_icon_2019.svg',\n link: 'https://slack.com/',\n },\n },\n },\n {\n Component: MenuItemLink as React.ComponentType,\n config: {\n section: 'Quick Links',\n priority: 130,\n props: {\n title: 'ArgoCD',\n icon: 'https://argo-cd.readthedocs.io/en/stable/assets/logo.png',\n link: 'https://argo-cd.readthedocs.io/en/stable/',\n },\n },\n },\n ];\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAwCO,MAAM,wCACX,GAAA;AAAA,EACE;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,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AAA,QACL,KAAO,EAAA,gBAAA;AAAA,QACP,IAAM,EAAA,wCAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,YAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,cAAA;AAAA,QACP,IAAM,EAAA,sEAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,aAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,OAAA;AAAA,QACP,IAAM,EAAA,yEAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF,GACF;AAAA,EACA;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,aAAA;AAAA,MACT,QAAU,EAAA,GAAA;AAAA,MACV,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,QAAA;AAAA,QACP,IAAM,EAAA,0DAAA;AAAA,QACN,IAAM,EAAA;AAAA;AACR;AACF;AAEJ;;;;"}
@@ -0,0 +1,14 @@
1
+ import { defaultApplicationLauncherDropdownMountPoints } from '../defaultMountPoints/defaultMountPoints.esm.js';
2
+ import { useScalprum } from '@scalprum/react-core';
3
+
4
+ const useApplicationLauncherDropdownMountPoints = () => {
5
+ const scalprum = useScalprum();
6
+ const applicationLauncherDropdownMountPoints = scalprum?.api?.dynamicRootConfig?.mountPoints?.["global.header/application-launcher"];
7
+ if (Object.keys(scalprum?.api || {}).length === 0) {
8
+ return defaultApplicationLauncherDropdownMountPoints;
9
+ }
10
+ return applicationLauncherDropdownMountPoints ?? [];
11
+ };
12
+
13
+ export { useApplicationLauncherDropdownMountPoints };
14
+ //# sourceMappingURL=useApplicationLauncherDropdownMountPoints.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useApplicationLauncherDropdownMountPoints.esm.js","sources":["../../src/hooks/useApplicationLauncherDropdownMountPoints.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 { defaultApplicationLauncherDropdownMountPoints } from '../defaultMountPoints/defaultMountPoints';\nimport { ApplicationLauncherDropdownMountPoint, ScalprumState } from '../types';\nimport { useScalprum } from '@scalprum/react-core';\n\nexport const useApplicationLauncherDropdownMountPoints = ():\n | ApplicationLauncherDropdownMountPoint[]\n | undefined => {\n const scalprum = useScalprum<ScalprumState>();\n\n const applicationLauncherDropdownMountPoints =\n scalprum?.api?.dynamicRootConfig?.mountPoints?.[\n 'global.header/application-launcher'\n ];\n\n // default application launcher dropdown components for dev env\n if (Object.keys(scalprum?.api || {}).length === 0) {\n return defaultApplicationLauncherDropdownMountPoints;\n }\n\n return applicationLauncherDropdownMountPoints ?? [];\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,4CAA4C,MAExC;AACf,EAAA,MAAM,WAAW,WAA2B,EAAA;AAE5C,EAAA,MAAM,sCACJ,GAAA,QAAA,EAAU,GAAK,EAAA,iBAAA,EAAmB,cAChC,oCACF,CAAA;AAGF,EAAI,IAAA,MAAA,CAAO,KAAK,QAAU,EAAA,GAAA,IAAO,EAAE,CAAA,CAAE,WAAW,CAAG,EAAA;AACjD,IAAO,OAAA,6CAAA;AAAA;AAGT,EAAA,OAAO,0CAA0C,EAAC;AACpD;;;;"}
package/dist/index.d.ts CHANGED
@@ -305,5 +305,11 @@ declare const NotificationBanner: (props: NotificationBannerProps) => React$1.JS
305
305
  * @public
306
306
  */
307
307
  declare const StarredDropdown: () => React$1.JSX.Element;
308
+ /**
309
+ * Application Launcher Dropdown
310
+ *
311
+ * @public
312
+ */
313
+ declare const ApplicationLauncherDropdown: () => React$1.JSX.Element;
308
314
 
309
- export { CreateDropdown, type CreateDropdownProps, Divider, type DividerProps, GlobalHeader, GlobalHeaderComponent, type GlobalHeaderComponentMountPoint, type GlobalHeaderComponentMountPointConfig, type GlobalHeaderComponentProps, HeaderButton, type HeaderButtonProps, HeaderIcon, HeaderIconButton, type HeaderIconButtonProps, type HeaderIconProps, LogoutButton, type MenuItemConfig, MenuItemLink, type MenuItemLinkProps, NotificationBanner, type NotificationBannerDismiss, type NotificationBannerProps, NotificationButton, type NotificationButtonProps, ProfileDropdown, type ProfileDropdownProps, RegisterAComponentSection, type RegisterAComponentSectionProps, SearchComponent, SoftwareTemplatesSection, type SoftwareTemplatesSectionProps, Spacer, type SpacerProps, StarredDropdown, SupportButton, type SupportButtonProps, defaultGlobalHeaderComponentsMountPoints, globalHeaderPlugin };
315
+ export { ApplicationLauncherDropdown, CreateDropdown, type CreateDropdownProps, Divider, type DividerProps, GlobalHeader, GlobalHeaderComponent, type GlobalHeaderComponentMountPoint, type GlobalHeaderComponentMountPointConfig, type GlobalHeaderComponentProps, HeaderButton, type HeaderButtonProps, HeaderIcon, HeaderIconButton, type HeaderIconButtonProps, type HeaderIconProps, LogoutButton, type MenuItemConfig, MenuItemLink, type MenuItemLinkProps, NotificationBanner, type NotificationBannerDismiss, type NotificationBannerProps, NotificationButton, type NotificationButtonProps, ProfileDropdown, type ProfileDropdownProps, RegisterAComponentSection, type RegisterAComponentSectionProps, SearchComponent, SoftwareTemplatesSection, type SoftwareTemplatesSectionProps, Spacer, type SpacerProps, StarredDropdown, SupportButton, type SupportButtonProps, defaultGlobalHeaderComponentsMountPoints, globalHeaderPlugin };
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unstable_ClassNameGenerator } from '@mui/material/className';
2
- export { CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin } from './plugin.esm.js';
2
+ export { ApplicationLauncherDropdown, CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin } from './plugin.esm.js';
3
3
  export { defaultGlobalHeaderComponentsMountPoints } from './defaultMountPoints/defaultMountPoints.esm.js';
4
4
 
5
5
  unstable_ClassNameGenerator.configure((componentName) => {
@@ -4,6 +4,7 @@ import '@mui/material/Box';
4
4
  import '@mui/material/Typography';
5
5
  import '@mui/material/Icon';
6
6
  import '@mui/material/styles';
7
+ import '@mui/icons-material/Launch';
7
8
  import '@mui/icons-material/ArrowDropDownOutlined';
8
9
  import '@scalprum/react-core';
9
10
  import './components/HeaderDropdownComponent/HeaderDropdownComponent.esm.js';
@@ -13,10 +14,10 @@ import '@mui/material/Divider';
13
14
  import '@mui/material/MenuItem';
14
15
  import '@backstage/core-components';
15
16
  import '@mui/material/Tooltip';
16
- import 'react-router-dom';
17
17
  import '@backstage/plugin-catalog-react';
18
18
  import '@backstage/plugin-search-react';
19
19
  import '@mui/material/Autocomplete';
20
+ import 'react-router-dom';
20
21
  import '@mui/material/TextField';
21
22
  import '@mui/material/InputAdornment';
22
23
  import '@mui/icons-material/Search';
@@ -28,12 +29,14 @@ import '@mui/material/Badge';
28
29
  import '@mui/icons-material/NotificationsOutlined';
29
30
  import '@backstage/plugin-notifications';
30
31
  import '@backstage/plugin-signals-react';
32
+ import '@backstage/catalog-model';
31
33
  import '@mui/icons-material/StarBorder';
32
34
  import '@mui/icons-material/Star';
33
35
  import '@mui/icons-material/AutoAwesome';
34
36
  import '@mui/material/ListItemIcon';
35
37
  import '@mui/material/ListItemText';
36
- import '@backstage/catalog-model';
38
+ import '@mui/icons-material/Apps';
39
+ import '@mui/icons-material/AppRegistration';
37
40
 
38
41
  const globalHeaderPlugin = createPlugin({
39
42
  id: "global-header"
@@ -206,6 +209,14 @@ const StarredDropdown = globalHeaderPlugin.provide(
206
209
  }
207
210
  })
208
211
  );
212
+ const ApplicationLauncherDropdown = globalHeaderPlugin.provide(
213
+ createComponentExtension({
214
+ name: "ApplicationLauncherDropdown",
215
+ component: {
216
+ lazy: () => import('./components/HeaderDropdownComponent/ApplicationLauncherDropdown.esm.js').then((m) => m.ApplicationLauncherDropdown)
217
+ }
218
+ })
219
+ );
209
220
 
210
- export { CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin };
221
+ export { ApplicationLauncherDropdown, CreateDropdown, Divider, GlobalHeader, GlobalHeaderComponent, HeaderButton, HeaderIcon, HeaderIconButton, LogoutButton, MenuItemLink, NotificationBanner, NotificationButton, ProfileDropdown, RegisterAComponentSection, SearchComponent, SoftwareTemplatesSection, Spacer, StarredDropdown, SupportButton, globalHeaderPlugin };
211
222
  //# sourceMappingURL=plugin.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React 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';\n\nexport type { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\n\nexport type { HeaderButtonProps } from './components/HeaderButton/HeaderButton';\nexport type { HeaderIconProps } from './components/HeaderIcon/HeaderIcon';\nexport type { HeaderIconButtonProps } from './components/HeaderIconButton/HeaderIconButton';\nexport type { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';\nexport type { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\n\nexport type { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nexport type { MenuItemConfig } from './components/HeaderDropdownComponent/MenuSection';\nexport type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nexport type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nexport type { DividerProps } from './components/Divider/Divider';\nexport type { SpacerProps } from './components/Spacer/Spacer';\nexport type { SupportButtonProps } from './components/SupportButton/SupportButton';\nexport type { NotificationButtonProps } from './components/NotificationButton/NotificationButton';\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: React.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: React.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: React.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: React.ComponentType<ProfileDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ProfileDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/ProfileDropdown').then(\n m => m.ProfileDropdown,\n ),\n },\n }),\n );\n\n/**\n * Software Templates List\n *\n * @public\n */\nexport const SoftwareTemplatesSection: React.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: React.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: React.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: React.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 flexibel 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 = 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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA;AACN,CAAC;AAOM,MAAM,eAAe,kBAAmB,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,cAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,kCAA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,IAAM,EAAA,oBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,wCAAiC,CAAE,CAAA,IAAA;AAAA,QACxC,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAOO,MAAM,kBAAkB,kBAAmB,CAAA,OAAA;AAAA,EAChD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,iBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,6DAAsD,CAAE,CAAA,IAAA;AAAA,QAC7D,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;;;;"}
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 React 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';\n\nexport type { GlobalHeaderComponentProps } from './components/GlobalHeaderComponent';\n\nexport type { HeaderButtonProps } from './components/HeaderButton/HeaderButton';\nexport type { HeaderIconProps } from './components/HeaderIcon/HeaderIcon';\nexport type { HeaderIconButtonProps } from './components/HeaderIconButton/HeaderIconButton';\nexport type { CreateDropdownProps } from './components/HeaderDropdownComponent/CreateDropdown';\nexport type { ProfileDropdownProps } from './components/HeaderDropdownComponent/ProfileDropdown';\n\nexport type { MenuItemLinkProps } from './components/MenuItemLink/MenuItemLink';\nexport type { MenuItemConfig } from './components/HeaderDropdownComponent/MenuSection';\nexport type { SoftwareTemplatesSectionProps } from './components/HeaderDropdownComponent/SoftwareTemplatesSection';\nexport type { RegisterAComponentSectionProps } from './components/HeaderDropdownComponent/RegisterAComponentSection';\nexport type { DividerProps } from './components/Divider/Divider';\nexport type { SpacerProps } from './components/Spacer/Spacer';\nexport type { SupportButtonProps } from './components/SupportButton/SupportButton';\nexport type { NotificationButtonProps } from './components/NotificationButton/NotificationButton';\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: React.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: React.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: React.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: React.ComponentType<ProfileDropdownProps> =\n globalHeaderPlugin.provide(\n createComponentExtension({\n name: 'ProfileDropdown',\n component: {\n lazy: () =>\n import('./components/HeaderDropdownComponent/ProfileDropdown').then(\n m => m.ProfileDropdown,\n ),\n },\n }),\n );\n\n/**\n * Software Templates List\n *\n * @public\n */\nexport const SoftwareTemplatesSection: React.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: React.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: React.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: React.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 flexibel 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 = 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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEO,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA;AACN,CAAC;AAOM,MAAM,eAAe,kBAAmB,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,cAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,kCAA2B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,YAAY;AAAA;AAC1E,GACD;AACH;AAOO,MAAM,wBACX,kBAAmB,CAAA,OAAA;AAAA,EACjB,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,2CAAoC,CAAE,CAAA,IAAA;AAAA,QAC3C,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAKK,MAAM,eAAe,kBAAmB,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,cAAA;AAAA,IACN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8B,kBAAmB,CAAA,OAAA;AAAA,EAC5D,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,6BAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OACE,yEACF,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,2BAA2B;AAAA;AAC7C,GACD;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-global-header",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -34,20 +34,20 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@backstage/catalog-model": "^1.7.3",
37
- "@backstage/core-components": "^0.16.3",
38
- "@backstage/core-plugin-api": "^1.10.3",
39
- "@backstage/plugin-catalog-react": "^1.15.1",
40
- "@backstage/plugin-notifications": "^0.5.1",
37
+ "@backstage/core-components": "^0.16.4",
38
+ "@backstage/core-plugin-api": "^1.10.4",
39
+ "@backstage/plugin-catalog-react": "^1.15.2",
40
+ "@backstage/plugin-notifications": "^0.5.2",
41
41
  "@backstage/plugin-notifications-common": "^0.0.8",
42
- "@backstage/plugin-search": "^1.4.22",
43
- "@backstage/plugin-search-backend": "^1.8.1",
44
- "@backstage/plugin-search-backend-module-catalog": "^0.3.0",
45
- "@backstage/plugin-search-backend-module-pg": "^0.5.40",
46
- "@backstage/plugin-search-backend-module-techdocs": "^0.3.5",
42
+ "@backstage/plugin-search": "^1.4.23",
43
+ "@backstage/plugin-search-backend": "^1.8.2",
44
+ "@backstage/plugin-search-backend-module-catalog": "^0.3.1",
45
+ "@backstage/plugin-search-backend-module-pg": "^0.5.41",
46
+ "@backstage/plugin-search-backend-module-techdocs": "^0.3.6",
47
47
  "@backstage/plugin-search-common": "^1.2.17",
48
- "@backstage/plugin-search-react": "^1.8.5",
49
- "@backstage/plugin-signals-react": "^0.0.9",
50
- "@backstage/theme": "^0.6.3",
48
+ "@backstage/plugin-search-react": "^1.8.6",
49
+ "@backstage/plugin-signals-react": "^0.0.10",
50
+ "@backstage/theme": "^0.6.4",
51
51
  "@mui/icons-material": "5.16.14",
52
52
  "@mui/material": "5.16.14",
53
53
  "@mui/styled-engine": "5.16.14",
@@ -59,12 +59,12 @@
59
59
  "react-router-dom": "^6.0.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@backstage/cli": "^0.29.5",
63
- "@backstage/core-app-api": "^1.15.4",
64
- "@backstage/dev-utils": "^1.1.6",
65
- "@backstage/frontend-test-utils": "^0.2.5",
62
+ "@backstage/cli": "^0.30.0",
63
+ "@backstage/core-app-api": "^1.15.5",
64
+ "@backstage/dev-utils": "^1.1.7",
65
+ "@backstage/frontend-test-utils": "^0.2.6",
66
66
  "@backstage/plugin-search-common": "^1.2.17",
67
- "@backstage/test-utils": "^1.7.4",
67
+ "@backstage/test-utils": "^1.7.5",
68
68
  "@openshift/dynamic-plugin-sdk": "^5.0.1",
69
69
  "@redhat-developer/red-hat-developer-hub-theme": "^0.5.0",
70
70
  "@testing-library/jest-dom": "^6.0.0",