@techdocs/cli 1.10.7-next.1 → 1.10.7

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 (82) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/embedded-app/.config-schema.json +64 -31
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/index.html.tmpl +1 -1
  5. package/dist/embedded-app/static/123.5e36a0db.chunk.js +2 -0
  6. package/dist/embedded-app/static/123.5e36a0db.chunk.js.map +1 -0
  7. package/dist/embedded-app/static/1659.76caecab.chunk.js +2 -0
  8. package/dist/embedded-app/static/1659.76caecab.chunk.js.map +1 -0
  9. package/dist/embedded-app/static/1733.d8004241.chunk.js +2 -0
  10. package/dist/embedded-app/static/1733.d8004241.chunk.js.map +1 -0
  11. package/dist/embedded-app/static/1749.3ab65683.chunk.js +2 -0
  12. package/dist/embedded-app/static/1749.3ab65683.chunk.js.map +1 -0
  13. package/dist/embedded-app/static/1994.78304f99.chunk.js +2 -0
  14. package/dist/embedded-app/static/1994.78304f99.chunk.js.map +1 -0
  15. package/dist/embedded-app/static/2295.a94805e5.chunk.js +5 -0
  16. package/dist/embedded-app/static/2295.a94805e5.chunk.js.map +1 -0
  17. package/dist/embedded-app/static/{3554.0ce35bc3.chunk.js → 3554.d745ad43.chunk.js} +2 -2
  18. package/dist/embedded-app/static/{3554.0ce35bc3.chunk.js.map → 3554.d745ad43.chunk.js.map} +1 -1
  19. package/dist/embedded-app/static/{4384.ae7b53b0.chunk.js → 4384.dc692f4f.chunk.js} +2 -2
  20. package/dist/embedded-app/static/{4384.ae7b53b0.chunk.js.map → 4384.dc692f4f.chunk.js.map} +1 -1
  21. package/dist/embedded-app/static/4587.85b7cf82.chunk.js +2 -0
  22. package/dist/embedded-app/static/4587.85b7cf82.chunk.js.map +1 -0
  23. package/dist/embedded-app/static/4648.e939339d.chunk.js +2 -0
  24. package/dist/embedded-app/static/4648.e939339d.chunk.js.map +1 -0
  25. package/dist/embedded-app/static/6138.d8ae40ee.chunk.js +2 -0
  26. package/dist/embedded-app/static/6138.d8ae40ee.chunk.js.map +1 -0
  27. package/dist/embedded-app/static/7203.1bd24814.chunk.js +2 -0
  28. package/dist/embedded-app/static/7203.1bd24814.chunk.js.map +1 -0
  29. package/dist/embedded-app/static/{7226.9f87f67d.chunk.js → 7226.bb48ee34.chunk.js} +2 -2
  30. package/dist/embedded-app/static/{7226.9f87f67d.chunk.js.map → 7226.bb48ee34.chunk.js.map} +1 -1
  31. package/dist/embedded-app/static/{8461.d5fe0648.chunk.js → 8461.0c3f2ac0.chunk.js} +3 -3
  32. package/dist/embedded-app/static/{8461.d5fe0648.chunk.js.map → 8461.0c3f2ac0.chunk.js.map} +1 -1
  33. package/dist/embedded-app/static/{8877.3f864531.chunk.js → 8877.a7ffabd9.chunk.js} +2 -2
  34. package/dist/embedded-app/static/{8877.3f864531.chunk.js.map → 8877.a7ffabd9.chunk.js.map} +1 -1
  35. package/dist/embedded-app/static/9050.69b458a6.chunk.js +2 -0
  36. package/dist/embedded-app/static/9050.69b458a6.chunk.js.map +1 -0
  37. package/dist/embedded-app/static/9230.23c1d5e0.chunk.js +2 -0
  38. package/dist/embedded-app/static/9230.23c1d5e0.chunk.js.map +1 -0
  39. package/dist/embedded-app/static/{main.161a9ecc.css → main.0657d08d.css} +2 -2
  40. package/dist/embedded-app/static/{main.161a9ecc.css.map → main.0657d08d.css.map} +1 -1
  41. package/dist/embedded-app/static/main.c9b00fd0.js +523 -0
  42. package/dist/embedded-app/static/main.c9b00fd0.js.map +1 -0
  43. package/dist/embedded-app/static/{module-react-aria-components.67232dc3.js → module-react-aria-components.c61f9ab4.js} +2 -2
  44. package/dist/embedded-app/static/{module-react-aria-components.67232dc3.js.map → module-react-aria-components.c61f9ab4.js.map} +1 -1
  45. package/dist/embedded-app/static/module-zod.b3376822.js +38 -0
  46. package/dist/embedded-app/static/module-zod.b3376822.js.map +1 -0
  47. package/dist/embedded-app/static/{runtime.c39b96cc.js → runtime.9896d1d9.js} +2 -2
  48. package/dist/embedded-app/static/{runtime.c39b96cc.js.map → runtime.9896d1d9.js.map} +1 -1
  49. package/dist/embedded-app/static/vendor.ff5541f5.js +6 -0
  50. package/dist/embedded-app/static/vendor.ff5541f5.js.map +1 -0
  51. package/dist/package.json.cjs.js +1 -1
  52. package/package.json +7 -7
  53. package/dist/embedded-app/static/123.97a62a60.chunk.js +0 -2
  54. package/dist/embedded-app/static/123.97a62a60.chunk.js.map +0 -1
  55. package/dist/embedded-app/static/1659.7dd5287b.chunk.js +0 -2
  56. package/dist/embedded-app/static/1659.7dd5287b.chunk.js.map +0 -1
  57. package/dist/embedded-app/static/1733.14c06ac4.chunk.js +0 -2
  58. package/dist/embedded-app/static/1733.14c06ac4.chunk.js.map +0 -1
  59. package/dist/embedded-app/static/1749.745aaeeb.chunk.js +0 -2
  60. package/dist/embedded-app/static/1749.745aaeeb.chunk.js.map +0 -1
  61. package/dist/embedded-app/static/1994.1f294712.chunk.js +0 -2
  62. package/dist/embedded-app/static/1994.1f294712.chunk.js.map +0 -1
  63. package/dist/embedded-app/static/2295.765b9f2e.chunk.js +0 -5
  64. package/dist/embedded-app/static/2295.765b9f2e.chunk.js.map +0 -1
  65. package/dist/embedded-app/static/4587.bf73bd77.chunk.js +0 -2
  66. package/dist/embedded-app/static/4587.bf73bd77.chunk.js.map +0 -1
  67. package/dist/embedded-app/static/4648.bd152b54.chunk.js +0 -2
  68. package/dist/embedded-app/static/4648.bd152b54.chunk.js.map +0 -1
  69. package/dist/embedded-app/static/6138.2560a5ba.chunk.js +0 -2
  70. package/dist/embedded-app/static/6138.2560a5ba.chunk.js.map +0 -1
  71. package/dist/embedded-app/static/7203.1ec93f6f.chunk.js +0 -2
  72. package/dist/embedded-app/static/7203.1ec93f6f.chunk.js.map +0 -1
  73. package/dist/embedded-app/static/9050.bab0c5db.chunk.js +0 -2
  74. package/dist/embedded-app/static/9050.bab0c5db.chunk.js.map +0 -1
  75. package/dist/embedded-app/static/9230.b3e5d612.chunk.js +0 -2
  76. package/dist/embedded-app/static/9230.b3e5d612.chunk.js.map +0 -1
  77. package/dist/embedded-app/static/main.cb460d15.js +0 -523
  78. package/dist/embedded-app/static/main.cb460d15.js.map +0 -1
  79. package/dist/embedded-app/static/module-zod.dd7f5a90.js +0 -2
  80. package/dist/embedded-app/static/module-zod.dd7f5a90.js.map +0 -1
  81. package/dist/embedded-app/static/vendor.65e7f165.js +0 -6
  82. package/dist/embedded-app/static/vendor.65e7f165.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/1733.d8004241.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/FavoriteToggle/FavoriteToggle.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/HeaderLabel/HeaderLabel.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonIcon/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonIcon/ButtonIcon.module.css?cd9c","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonIcon/ButtonIcon.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/types.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useStarredEntity.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/FavoriteEntity/FavoriteEntity.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/DefaultNode.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/Node.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/constants.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/DefaultLabel.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/Edge.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/DependencyGraph.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/EntityKindIcon.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/AncestryPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/common.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/ColocatedPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/util.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/JsonPage.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/TagGroup/TagGroup.module.css?dc18","webpack://techdocs-cli-embedded-app/../ui/src/components/TagGroup/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/TagGroup/TagGroup.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/YamlPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/InspectEntityDialog.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityLabels/EntityLabels.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityContextMenu/UnregisterEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/context/EntityContextMenuContext.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityHeader/EntityHeader.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabsPanel.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabsGroup.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabsList.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabs.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityLayout/EntityLayout.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 { ComponentProps } from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport { StarIcon, UnstarredIcon } from '../../icons';\n\nconst useStyles = makeStyles<Theme>(\n () => ({\n icon: {\n color: '#f3ba37',\n cursor: 'pointer',\n display: 'inline-flex',\n },\n iconBorder: {\n color: 'inherit',\n cursor: 'pointer',\n display: 'inline-flex',\n },\n }),\n { name: 'BackstageFavoriteToggleIcon' },\n);\n\n/**\n * @public\n */\nexport type FavoriteToggleIconClassKey = 'icon' | 'iconBorder';\n\n/**\n * Icon used in FavoriteToggle component.\n *\n * Can be used independently, useful when used as {@link @material-table/core#MaterialTableProps.actions} in {@link @material-table/core#MaterialTable}\n *\n * @public\n */\nexport function FavoriteToggleIcon(props: { isFavorite: boolean }) {\n const { isFavorite } = props;\n const classes = useStyles();\n\n return (\n <Typography\n component=\"span\"\n className={isFavorite ? classes.icon : classes.iconBorder}\n >\n {isFavorite ? <StarIcon /> : <UnstarredIcon />}\n </Typography>\n );\n}\n\n/**\n * Props for the {@link FavoriteToggle} component.\n *\n * @public\n */\nexport type FavoriteToggleProps = ComponentProps<typeof IconButton> & {\n id: string;\n title: string;\n isFavorite: boolean;\n onToggle: (value: boolean) => void;\n};\n\n/**\n * Toggle encapsulating logic for marking something as favorite,\n * primarily used in various instances of entity lists and cards but can be used elsewhere.\n *\n * This component can only be used in as a controlled toggle and does not keep internal state.\n *\n * @public\n */\nexport function FavoriteToggle(props: FavoriteToggleProps) {\n const {\n id,\n title,\n isFavorite: value,\n onToggle: onChange,\n ...iconButtonProps\n } = props;\n return (\n <Tooltip id={id} title={title}>\n <IconButton\n aria-label={title}\n id={id}\n onClick={() => onChange(!value)}\n color=\"inherit\"\n {...iconButtonProps}\n >\n <FavoriteToggleIcon isFavorite={value} />\n </IconButton>\n </Tooltip>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\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 Grid from '@material-ui/core/Grid';\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport { ReactNode, PropsWithChildren } from 'react';\nimport { Link } from '../../components/Link';\n\n/** @public */\nexport type HeaderLabelClassKey = 'root' | 'label' | 'value';\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n textAlign: 'left',\n },\n label: {\n color: theme.page.fontColor,\n fontWeight: theme.typography.fontWeightBold,\n letterSpacing: 0,\n fontSize: theme.typography.fontSize,\n marginBottom: theme.spacing(1) / 2,\n lineHeight: 1,\n },\n value: {\n color: alpha(theme.page.fontColor, 0.8),\n fontSize: theme.typography.fontSize,\n lineHeight: 1,\n },\n }),\n { name: 'BackstageHeaderLabel' },\n);\n\ntype HeaderLabelContentProps = PropsWithChildren<{\n value: ReactNode;\n className: string;\n typographyRootComponent?: keyof JSX.IntrinsicElements;\n}>;\n\nconst HeaderLabelContent = ({\n value,\n className,\n typographyRootComponent,\n}: HeaderLabelContentProps) => {\n return (\n <Typography\n component={\n typographyRootComponent ?? (typeof value === 'string' ? 'p' : 'span')\n }\n className={className}\n >\n {value}\n </Typography>\n );\n};\n\ntype HeaderLabelProps = {\n label: string;\n value?: HeaderLabelContentProps['value'];\n contentTypograpyRootComponent?: HeaderLabelContentProps['typographyRootComponent'];\n url?: string;\n};\n\n/**\n * Additional label to main {@link Header}\n *\n * @public\n *\n */\nexport function HeaderLabel(props: HeaderLabelProps) {\n const { label, value, url, contentTypograpyRootComponent } = props;\n const classes = useStyles();\n const content = (\n <HeaderLabelContent\n className={classes.value}\n value={value || '<Unknown>'}\n typographyRootComponent={contentTypograpyRootComponent}\n />\n );\n return (\n <Grid item>\n <Typography component=\"span\" className={classes.root}>\n <Typography className={classes.label}>{label}</Typography>\n {url ? <Link to={url}>{content}</Link> : content}\n </Typography>\n </Grid>\n );\n}\n","/*\n * Copyright 2024 The Backstage Authors\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 { defineComponent } from '../../hooks/useDefinition';\nimport type { ButtonIconOwnProps } from './types';\nimport styles from './ButtonIcon.module.css';\n\n/**\n * Component definition for ButtonIcon\n * @public\n */\nexport const ButtonIconDefinition = defineComponent<ButtonIconOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonIcon',\n content: 'bui-ButtonIconContent',\n spinner: 'bui-ButtonIconSpinner',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n loading: { dataAttribute: true },\n icon: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-ButtonIcon\":\"oswl8eimGwGMv65g\",\"bui-ButtonIconContent\":\"nupI988ZoWQXN2ow\",\"bui-ButtonIconSpinner\":\"S0ip8O7B0EhQCtAt\",\"bui-spin\":\"wvp018_1ftcIUJUQ\"};","/*\n * Copyright 2024 The Backstage Authors\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 { forwardRef, Ref } from 'react';\nimport { Button as RAButton, ProgressBar } from 'react-aria-components';\nimport { RiLoader4Line } from '@remixicon/react';\nimport type { ButtonIconProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ButtonIconDefinition } from './definition';\n\n/**\n * An icon-only button that supports a loading state and requires an accessible label.\n *\n * @public\n */\nexport const ButtonIcon = forwardRef(\n (props: ButtonIconProps, ref: Ref<HTMLButtonElement>) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n ButtonIconDefinition,\n props,\n );\n const { classes, icon, loading } = ownProps;\n\n return (\n <RAButton\n className={classes.root}\n ref={ref}\n isPending={loading}\n {...dataAttributes}\n {...restProps}\n >\n {({ isPending }) => (\n <>\n <span className={classes.content}>{icon}</span>\n\n {isPending && (\n <ProgressBar\n aria-label=\"Loading\"\n isIndeterminate\n className={classes.spinner}\n >\n <RiLoader4Line aria-hidden=\"true\" />\n </ProgressBar>\n )}\n </>\n )}\n </RAButton>\n );\n },\n);\n\nButtonIcon.displayName = 'ButtonIcon';\n","/*\n * Copyright 2020 The Backstage Authors\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/* We want to maintain the same information as an enum, so we disable the redeclaration warning */\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/**\n * Types used to customize and provide data to {@link DependencyGraph}\n *\n * @packageDocumentation\n */\n\nimport { ReactNode } from 'react';\n\n/**\n * Types for the {@link DependencyGraph} component.\n *\n * @public\n */\nexport namespace DependencyGraphTypes {\n /**\n * Edge of {@link DependencyGraph}\n *\n * @public\n */\n export type DependencyEdge<T = {}> = T & {\n /**\n * ID of {@link DependencyNode} from where the Edge start\n */\n from: string;\n /**\n * ID of {@link DependencyNode} to where the Edge goes to\n */\n to: string;\n /**\n * Label assigned and rendered with the Edge\n */\n label?: string;\n /**\n * Distance to a root entity\n */\n distance?: number;\n };\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderLabelFunction} for {@link DependencyGraphTypes.DependencyEdge}\n *\n * @public\n */\n export type RenderLabelProps<T = unknown> = { edge: DependencyEdge<T> };\n\n /**\n * Custom React component for edge labels\n *\n * @public\n */\n export type RenderLabelFunction<T = {}> = (\n props: RenderLabelProps<T>,\n ) => ReactNode;\n\n /**\n * Node of {@link DependencyGraph}\n *\n * @public\n */\n export type DependencyNode<T = {}> = T & {\n id: string;\n };\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderNodeFunction} for {@link DependencyGraphTypes.DependencyNode}\n *\n * @public\n */\n export type RenderNodeProps<T = unknown> = { node: DependencyNode<T> };\n\n /**\n * Custom React component for graph {@link DependencyGraphTypes.DependencyNode}\n *\n * @public\n */\n export type RenderNodeFunction<T = {}> = (\n props: RenderNodeProps<T>,\n ) => ReactNode;\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderEdgeFunction} for {@link DependencyGraphTypes.DependencyEdge}\n *\n * @public\n */\n export type RenderEdgeProps<T = {}> = {\n edge: T & {\n points: { x: number; y: number }[];\n label?: string;\n labeloffset?: number;\n labelpos?: string;\n width?: number;\n height?: number;\n weight?: number;\n minlen?: number;\n showArrowHeads?: boolean;\n from?: string;\n to?: string;\n relations?: string[];\n };\n id: {\n v: string;\n w: string;\n name?: string | undefined;\n };\n };\n\n /**\n * Custom React component for graph {@link DependencyGraphTypes.DependencyEdge}\n *\n * @public\n */\n export type RenderEdgeFunction<T = {}> = (\n props: RenderEdgeProps<T>,\n ) => ReactNode;\n\n /**\n * Graph direction\n *\n * @public\n */\n export const Direction = {\n /**\n * Top to Bottom\n */\n TOP_BOTTOM: 'TB',\n /**\n * Bottom to Top\n */\n BOTTOM_TOP: 'BT',\n /**\n * Left to Right\n */\n LEFT_RIGHT: 'LR',\n /**\n * Right to Left\n */\n RIGHT_LEFT: 'RL',\n } as const;\n\n /**\n * @public\n */\n export type Direction = (typeof Direction)[keyof typeof Direction];\n\n /**\n * @public\n */\n export namespace Direction {\n export type TOP_BOTTOM = typeof Direction.TOP_BOTTOM;\n export type BOTTOM_TOP = typeof Direction.BOTTOM_TOP;\n export type LEFT_RIGHT = typeof Direction.LEFT_RIGHT;\n export type RIGHT_LEFT = typeof Direction.RIGHT_LEFT;\n }\n\n /**\n * Node alignment\n *\n * @public\n */\n export const Alignment = {\n /**\n * Up Left\n */\n UP_LEFT: 'UL',\n /**\n * Up Right\n */\n UP_RIGHT: 'UR',\n /**\n * Down Left\n */\n DOWN_LEFT: 'DL',\n /**\n * Down Right\n */\n DOWN_RIGHT: 'DR',\n } as const;\n\n /**\n * @public\n */\n export type Alignment = (typeof Alignment)[keyof typeof Alignment];\n\n /**\n * @public\n */\n export namespace Alignment {\n export type UP_LEFT = typeof Alignment.UP_LEFT;\n export type UP_RIGHT = typeof Alignment.UP_RIGHT;\n export type DOWN_LEFT = typeof Alignment.DOWN_LEFT;\n export type DOWN_RIGHT = typeof Alignment.DOWN_RIGHT;\n }\n\n /**\n * Algorithm used to rand nodes in graph\n *\n * @public\n */\n export const Ranker = {\n /**\n * {@link https://en.wikipedia.org/wiki/Network_simplex_algorithm | Network Simplex} algorithm\n */\n NETWORK_SIMPLEX: 'network-simplex',\n /**\n * Tight Tree algorithm\n */\n TIGHT_TREE: 'tight-tree',\n /**\n * Longest path algorithm\n *\n * @remarks\n *\n * Simplest and fastest\n */\n LONGEST_PATH: 'longest-path',\n } as const;\n\n /**\n * @public\n */\n export type Ranker = (typeof Ranker)[keyof typeof Ranker];\n\n /**\n * @public\n */\n export namespace Ranker {\n export type NETWORK_SIMPLEX = typeof Ranker.NETWORK_SIMPLEX;\n export type TIGHT_TREE = typeof Ranker.TIGHT_TREE;\n export type LONGEST_PATH = typeof Ranker.LONGEST_PATH;\n }\n\n /**\n * Position of label in relation to the edge\n *\n * @public\n */\n export const LabelPosition = {\n LEFT: 'l',\n RIGHT: 'r',\n CENTER: 'c',\n } as const;\n\n /**\n * @public\n */\n export type LabelPosition =\n (typeof LabelPosition)[keyof typeof LabelPosition];\n\n /**\n * @public\n */\n export namespace LabelPosition {\n export type LEFT = typeof LabelPosition.LEFT;\n export type RIGHT = typeof LabelPosition.RIGHT;\n export type CENTER = typeof LabelPosition.CENTER;\n }\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useCallback, useEffect, useState } from 'react';\nimport { starredEntitiesApiRef } from '../apis';\n\nfunction getEntityRef(\n entityOrRef: Entity | CompoundEntityRef | string,\n): string {\n return typeof entityOrRef === 'string'\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n}\n\n/** @public */\nexport function useStarredEntity(\n entityOrRef: Entity | CompoundEntityRef | string,\n): {\n toggleStarredEntity: () => void;\n isStarredEntity: boolean;\n} {\n const starredEntitiesApi = useApi(starredEntitiesApiRef);\n\n const [isStarredEntity, setIsStarredEntity] = useState(false);\n\n useEffect(() => {\n const subscription = starredEntitiesApi.starredEntitie$().subscribe({\n next(starredEntities: Set<string>) {\n setIsStarredEntity(starredEntities.has(getEntityRef(entityOrRef)));\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [entityOrRef, starredEntitiesApi]);\n\n const toggleStarredEntity = useCallback(\n () => starredEntitiesApi.toggleStarred(getEntityRef(entityOrRef)).then(),\n [entityOrRef, starredEntitiesApi],\n );\n\n return {\n toggleStarredEntity,\n isStarredEntity,\n };\n}\n","/*\n * Copyright 2020 The Backstage Authors\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 { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport IconButton from '@material-ui/core/IconButton';\nimport { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { FavoriteToggle } from '@backstage/core-components';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const title = isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites');\n\n const id = `favorite-${stringifyEntityRef(props.entity).replace(\n /[^a-zA-Z0-9-_]/g,\n '-',\n )}`;\n\n return (\n <FavoriteToggle\n title={title}\n id={id}\n isFavorite={isStarredEntity}\n onToggle={toggleStarredEntity}\n {...props}\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\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 { useState, useRef, useLayoutEffect } from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { DependencyGraphTypes as Types } from './types';\n\n/** @public */\nexport type DependencyGraphDefaultNodeClassKey = 'node' | 'text';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n text: {\n fill: theme.palette.primary.contrastText,\n },\n }),\n { name: 'BackstageDependencyGraphDefaultNode' },\n);\n\n/** @public */\nexport function DefaultNode({ node: { id } }: Types.RenderNodeProps) {\n const classes = useStyles();\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const padding = 10;\n const paddedWidth = width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n return (\n <g>\n <rect\n className={classes.node}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n <text\n ref={idRef}\n className={classes.text}\n y={paddedHeight / 2}\n x={paddedWidth / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {id}\n </text>\n </g>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\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 { useRef, useLayoutEffect } from 'react';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { DefaultNode } from './DefaultNode';\nimport { DependencyGraphTypes as Types } from './types';\nimport { NODE_TEST_ID } from './constants';\nimport dagre from '@dagrejs/dagre';\n\n/** @public */\nexport type DependencyGraphNodeClassKey = 'node';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n transition: `${theme.transitions.duration.shortest}ms`,\n },\n }),\n { name: 'BackstageDependencyGraphNode' },\n);\n\nexport type GraphNode<T> = dagre.Node<Types.DependencyNode<T>>;\n\nexport type NodeComponentProps<T> = {\n node: GraphNode<T>;\n render?: Types.RenderNodeFunction<T>;\n setNode: dagre.graphlib.Graph['setNode'];\n};\n\nconst renderDefault = (props: Types.RenderNodeProps) => (\n <DefaultNode {...props} />\n);\n\nexport function Node<T>({\n render = renderDefault,\n setNode,\n node,\n}: NodeComponentProps<T>) {\n const { width, height, x = 0, y = 0 } = node;\n const nodeProps: Types.DependencyNode<T> = node;\n const classes = useStyles();\n const nodeRef = useRef<SVGGElement | null>(null);\n\n useLayoutEffect(() => {\n // set the node width to the actual rendered width to properly layout graph\n if (nodeRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n nodeRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setNode(node.id, {\n ...node,\n height: renderedHeight,\n width: renderedWidth,\n });\n }\n }\n }, [node, width, height, setNode]);\n\n return (\n <g\n ref={nodeRef}\n data-testid={NODE_TEST_ID}\n className={classes.node}\n transform={`translate(${x - width / 2},${y - height / 2})`}\n >\n {render({ node: nodeProps })}\n </g>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ARROW_MARKER_ID = 'arrow-marker';\n\nexport const NODE_TEST_ID = 'node';\nexport const EDGE_TEST_ID = 'edge';\nexport const LABEL_TEST_ID = 'label';\n","/*\n * Copyright 2020 The Backstage Authors\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 makeStyles from '@material-ui/core/styles/makeStyles';\nimport { DependencyGraphTypes as Types } from './types';\n\n/** @public */\nexport type DependencyGraphDefaultLabelClassKey = 'text';\n\nconst useStyles = makeStyles(\n theme => ({\n text: {\n fill: theme.palette.textContrast,\n },\n }),\n { name: 'BackstageDependencyGraphDefaultLabel' },\n);\n\n/** @public */\nexport function DefaultLabel({ edge: { label } }: Types.RenderLabelProps) {\n const classes = useStyles();\n return (\n <text className={classes.text} textAnchor=\"middle\">\n {label}\n </text>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\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 { useRef, useLayoutEffect, useMemo } from 'react';\nimport * as d3Shape from 'd3-shape';\nimport isFinite from 'lodash/isFinite';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { DependencyGraphTypes as Types } from './types';\nimport { ARROW_MARKER_ID, EDGE_TEST_ID, LABEL_TEST_ID } from './constants';\nimport { DefaultLabel } from './DefaultLabel';\nimport dagre from '@dagrejs/dagre';\n\n/* Based on: https://github.com/dagrejs/dagre/wiki#configuring-the-layout */\nexport type EdgeProperties = {\n label?: string;\n width?: number;\n height?: number;\n labeloffset?: number;\n labelpos?: Types.LabelPosition;\n minlen?: number;\n weight?: number;\n};\nexport type GraphEdge<T> = Types.DependencyEdge<T> &\n dagre.GraphEdge &\n EdgeProperties;\n\n/** @public */\nexport type DependencyGraphEdgeClassKey = 'path' | 'label';\n\nconst useStyles = makeStyles(\n theme => ({\n path: {\n strokeWidth: 1.3,\n stroke: theme.palette.textSubtle,\n fill: 'none',\n transition: `${theme.transitions.duration.shortest}ms`,\n },\n label: {\n transition: `${theme.transitions.duration.shortest}ms`,\n },\n }),\n { name: 'BackstageDependencyGraphEdge' },\n);\n\ntype EdgePoint = dagre.GraphEdge['points'][0];\n\n/** @public */\nexport type EdgeComponentProps<T = unknown> = {\n id: dagre.Edge;\n edge: GraphEdge<T>;\n render?: Types.RenderLabelFunction<T>;\n setEdge: (\n id: dagre.Edge,\n edge: Types.DependencyEdge<T>,\n ) => dagre.graphlib.Graph<{}>;\n curve: 'curveStepBefore' | 'curveMonotoneX';\n showArrowHeads?: boolean;\n};\n\nconst renderDefault = (props: Types.RenderLabelProps<unknown>) => (\n <DefaultLabel {...props} />\n);\n\nexport function Edge<EdgeData>({\n render = renderDefault,\n setEdge,\n id,\n edge,\n curve,\n showArrowHeads,\n}: EdgeComponentProps<EdgeData>) {\n const { x = 0, y = 0, width, height, points } = edge;\n const labelProps: Types.DependencyEdge<EdgeData> = edge;\n const classes = useStyles();\n\n const labelRef = useRef<SVGGElement>(null);\n\n useLayoutEffect(() => {\n // set the label width to the actual rendered width to properly layout graph\n if (labelRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n labelRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setEdge(id, {\n ...edge,\n height: renderedHeight,\n width: renderedWidth,\n });\n }\n }\n }, [edge, height, width, setEdge, id]);\n\n let path: string = '';\n\n const createPath = useMemo(\n () =>\n d3Shape\n .line<EdgePoint>()\n .x(d => d.x)\n .y(d => d.y)\n .curve(d3Shape[curve]),\n [curve],\n );\n\n if (points) {\n const finitePoints = points.filter(\n (point: EdgePoint) => isFinite(point.x) && isFinite(point.y),\n );\n path = createPath(finitePoints) || '';\n }\n\n return (\n <>\n {path && (\n <path\n data-testid={EDGE_TEST_ID}\n className={classes.path}\n markerEnd={showArrowHeads ? `url(#${ARROW_MARKER_ID})` : undefined}\n d={path}\n />\n )}\n {labelProps.label ? (\n <g\n ref={labelRef}\n data-testid={LABEL_TEST_ID}\n className={classes.label}\n transform={`translate(${x},${y})`}\n >\n {render({ edge: labelProps })}\n </g>\n ) : null}\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n SVGProps,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport useMeasure from 'react-use/esm/useMeasure';\nimport classNames from 'classnames';\nimport { once } from 'lodash';\nimport * as d3Zoom from 'd3-zoom';\nimport * as d3Selection from 'd3-selection';\nimport useTheme from '@material-ui/core/styles/useTheme';\nimport dagre from '@dagrejs/dagre';\nimport debounce from 'lodash/debounce';\nimport { DependencyGraphTypes as Types } from './types';\nimport { Node } from './Node';\nimport { Edge, GraphEdge } from './Edge';\nimport { ARROW_MARKER_ID } from './constants';\nimport IconButton from '@material-ui/core/IconButton';\nimport FullscreenIcon from '@material-ui/icons/Fullscreen';\nimport FullscreenExitIcon from '@material-ui/icons/FullscreenExit';\nimport { FullScreen, useFullScreenHandle } from 'react-full-screen';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { coreComponentsTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n fullscreenButton: {\n position: 'absolute',\n right: 0,\n },\n root: {\n overflow: 'hidden',\n minHeight: '100%',\n minWidth: '100%',\n },\n fixedHeight: {\n maxHeight: '100%',\n },\n fullscreen: {\n backgroundColor: theme.palette.background.paper,\n },\n}));\n\n/**\n * Properties of {@link DependencyGraph}\n *\n * @public\n * @remarks\n * `<NodeData>` and `<EdgeData>` are useful when rendering custom or edge labels\n */\nexport interface DependencyGraphProps<NodeData, EdgeData>\n extends SVGProps<SVGSVGElement> {\n /**\n * Edges of graph\n */\n edges: Types.DependencyEdge<EdgeData>[];\n /**\n * Nodes of Graph\n */\n nodes: Types.DependencyNode<NodeData>[];\n /**\n * Graph {@link DependencyGraphTypes.(Direction:namespace) | direction}\n *\n * @remarks\n *\n * Default: `DependencyGraphTypes.Direction.TOP_BOTTOM`\n */\n direction?: Types.Direction;\n /**\n * Node {@link DependencyGraphTypes.(Alignment:namespace) | alignment}\n */\n align?: Types.Alignment;\n /**\n * Margin between nodes on each rank\n *\n * @remarks\n *\n * Default: 50\n */\n nodeMargin?: number;\n /**\n * Margin between edges\n *\n * @remarks\n *\n * Default: 10\n */\n edgeMargin?: number;\n /**\n * Margin between each rank\n *\n * @remarks\n *\n * Default: 50\n */\n rankMargin?: number;\n /**\n * Margin on left and right of whole graph\n *\n * @remarks\n *\n * Default: 0\n */\n paddingX?: number;\n /**\n * Margin on top and bottom of whole graph\n *\n * @remarks\n *\n * Default: 0\n */\n paddingY?: number;\n /**\n * Heuristic used to find set of edges that will make graph acyclic\n */\n acyclicer?: 'greedy';\n /**\n * {@link DependencyGraphTypes.(Ranker:namespace) | Algorithm} used to rank nodes\n *\n * @remarks\n *\n * Default: `DependencyGraphTypes.Ranker.NETWORK_SIMPLEX`\n */\n ranker?: Types.Ranker;\n /**\n * {@link DependencyGraphTypes.(LabelPosition:namespace) | Position} of label in relation to edge\n *\n * @remarks\n *\n * Default: `DependencyGraphTypes.LabelPosition.RIGHT`\n */\n labelPosition?: Types.LabelPosition;\n /**\n * How much to move label away from edge\n *\n * @remarks\n *\n * Applies only when {@link DependencyGraphProps.labelPosition} is `DependencyGraphTypes.LabelPosition.LEFT` or\n * `DependencyGraphTypes.LabelPosition.RIGHT`\n */\n labelOffset?: number;\n /**\n * Minimum number of ranks to keep between connected nodes\n */\n edgeRanks?: number;\n /**\n * Weight applied to edges in graph\n */\n edgeWeight?: number;\n /**\n * Custom edge rendering component\n */\n renderEdge?: Types.RenderEdgeFunction<EdgeData>;\n /**\n * Custom node rendering component\n */\n renderNode?: Types.RenderNodeFunction<NodeData>;\n /**\n * Custom label rendering component\n */\n renderLabel?: Types.RenderLabelFunction<EdgeData>;\n /**\n * {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs | Defs} shared by rendered SVG to be used by\n * {@link DependencyGraphProps.renderNode} and/or {@link DependencyGraphProps.renderLabel}\n */\n defs?: JSX.Element | JSX.Element[];\n /**\n * Controls zoom behavior of graph\n *\n * @remarks\n *\n * Default: `enabled`\n */\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n /**\n * A factory for curve generators addressing both lines and areas.\n *\n * @remarks\n *\n * Default: 'curveMonotoneX'\n */\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n /**\n * Controls if the arrow heads should be rendered or not.\n *\n * Default: false\n */\n showArrowHeads?: boolean;\n /**\n * Controls if the graph should be contained or grow\n *\n * @remarks\n *\n * Default: 'grow'\n */\n fit?: 'grow' | 'contain';\n /**\n * Controls if user can toggle fullscreen mode\n *\n * @remarks\n *\n * Default: true\n */\n allowFullscreen?: boolean;\n}\n\nconst WORKSPACE_ID = 'workspace';\nconst DEPENDENCY_GRAPH_SVG = 'dependency-graph';\n\n/**\n * Graph component used to visualize relations between entities\n *\n * @public\n */\nexport function DependencyGraph<NodeData, EdgeData>(\n props: DependencyGraphProps<NodeData, EdgeData>,\n) {\n const {\n edges,\n nodes,\n renderNode,\n direction = Types.Direction.TOP_BOTTOM,\n align,\n nodeMargin = 50,\n edgeMargin = 10,\n rankMargin = 50,\n paddingX = 0,\n paddingY = 0,\n acyclicer,\n ranker = Types.Ranker.NETWORK_SIMPLEX,\n labelPosition = Types.LabelPosition.RIGHT,\n labelOffset = 10,\n edgeRanks = 1,\n edgeWeight = 1,\n renderEdge,\n renderLabel,\n defs,\n zoom = 'enabled',\n curve = 'curveMonotoneX',\n showArrowHeads = false,\n fit = 'grow',\n allowFullscreen = true,\n ...svgProps\n } = props;\n const theme = useTheme();\n const [containerWidth, setContainerWidth] = useState<number>(100);\n const [containerHeight, setContainerHeight] = useState<number>(100);\n const fullScreenHandle = useFullScreenHandle();\n const styles = useStyles();\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const graph = useRef<dagre.graphlib.Graph<Types.DependencyNode<NodeData>>>(\n new dagre.graphlib.Graph(),\n );\n const [graphWidth, setGraphWidth] = useState<number>(\n graph.current.graph()?.width || 0,\n );\n const [graphHeight, setGraphHeight] = useState<number>(\n graph.current.graph()?.height || 0,\n );\n const [graphNodes, setGraphNodes] = useState<string[]>([]);\n const [graphEdges, setGraphEdges] = useState<dagre.Edge[]>([]);\n\n const maxWidth = Math.max(graphWidth, containerWidth);\n const maxHeight = Math.max(graphHeight, containerHeight);\n\n const [_measureRef] = useMeasure();\n const measureRef = once(_measureRef);\n\n const scalableHeight =\n fit === 'grow' && !fullScreenHandle.active ? maxHeight : '100%';\n\n const containerRef = useMemo(\n () =>\n debounce((root: HTMLDivElement) => {\n if (!root) {\n return;\n }\n measureRef(root);\n\n // Set up zooming + panning\n const node: SVGSVGElement = root.querySelector(\n `svg#${DEPENDENCY_GRAPH_SVG}`,\n ) as SVGSVGElement;\n if (!node) {\n return;\n }\n const container = d3Selection.select<SVGSVGElement, null>(node);\n const workspace = d3Selection.select(node.getElementById(WORKSPACE_ID));\n\n function enableZoom() {\n container.call(\n d3Zoom\n .zoom<SVGSVGElement, null>()\n .scaleExtent([1, Infinity])\n .on('zoom', event => {\n event.transform.x = Math.min(\n 0,\n Math.max(\n event.transform.x,\n maxWidth - maxWidth * event.transform.k,\n ),\n );\n event.transform.y = Math.min(\n 0,\n Math.max(\n event.transform.y,\n maxHeight - maxHeight * event.transform.k,\n ),\n );\n workspace.attr('transform', event.transform);\n }),\n );\n }\n\n if (zoom === 'enabled') {\n enableZoom();\n } else if (zoom === 'enable-on-click') {\n container.on('click', () => enableZoom());\n }\n\n const { width: newContainerWidth, height: newContainerHeight } =\n root.getBoundingClientRect();\n if (\n containerWidth !== newContainerWidth &&\n newContainerWidth <= maxWidth\n ) {\n setContainerWidth(newContainerWidth);\n }\n if (\n containerHeight !== newContainerHeight &&\n newContainerHeight <= maxHeight\n ) {\n setContainerHeight(newContainerHeight);\n }\n }, 100),\n [measureRef, containerHeight, containerWidth, maxWidth, maxHeight, zoom],\n );\n\n const setNodesAndEdges = useCallback(() => {\n // Cleaning up lingering nodes and edges\n const currentGraphNodes = graph.current.nodes();\n const currentGraphEdges = graph.current.edges();\n\n currentGraphNodes.forEach(nodeId => {\n const remainingNode = nodes.some(node => node.id === nodeId);\n if (!remainingNode) {\n graph.current.removeNode(nodeId);\n }\n });\n\n currentGraphEdges.forEach(e => {\n const remainingEdge = edges.some(\n edge => edge.from === e.v && edge.to === e.w,\n );\n if (!remainingEdge) {\n graph.current.removeEdge(e.v, e.w);\n }\n });\n\n // Adding/updating nodes and edges\n nodes.forEach(node => {\n const existingNode = graph.current\n .nodes()\n .find(nodeId => node.id === nodeId);\n\n if (existingNode && graph.current.node(existingNode)) {\n const { width, height, x, y } = graph.current.node(existingNode);\n graph.current.setNode(existingNode, { ...node, width, height, x, y });\n } else {\n graph.current.setNode(node.id, { ...node, width: 0, height: 0 });\n }\n });\n\n edges.forEach(e => {\n graph.current.setEdge(e.from, e.to, {\n ...e,\n label: e.label,\n width: 0,\n height: 0,\n labelpos: labelPosition,\n labeloffset: labelOffset,\n weight: edgeWeight,\n minlen: edgeRanks,\n });\n });\n }, [edges, nodes, labelPosition, labelOffset, edgeWeight, edgeRanks]);\n\n const updateGraph = useMemo(\n () =>\n debounce(\n () => {\n dagre.layout(graph.current);\n const { height, width } = graph.current.graph();\n const newHeight = Math.max(0, height || 0);\n const newWidth = Math.max(0, width || 0);\n setGraphWidth(newWidth);\n setGraphHeight(newHeight);\n\n setGraphNodes(graph.current.nodes());\n setGraphEdges(graph.current.edges());\n },\n 250,\n { leading: true },\n ),\n [],\n );\n\n useEffect(() => {\n graph.current.setGraph({\n rankdir: direction,\n align,\n nodesep: nodeMargin,\n edgesep: edgeMargin,\n ranksep: rankMargin,\n marginx: paddingX,\n marginy: paddingY,\n acyclicer,\n ranker,\n });\n\n setNodesAndEdges();\n updateGraph();\n\n return updateGraph.cancel;\n }, [\n acyclicer,\n align,\n direction,\n edgeMargin,\n paddingX,\n paddingY,\n nodeMargin,\n rankMargin,\n ranker,\n setNodesAndEdges,\n updateGraph,\n ]);\n\n const setNode = useCallback(\n (id: string, node: Types.DependencyNode<NodeData>) => {\n graph.current.setNode(id, node);\n updateGraph();\n return graph.current;\n },\n [updateGraph],\n );\n\n const setEdge = useCallback(\n (id: dagre.Edge, edge: Types.DependencyEdge<EdgeData>) => {\n graph.current.setEdge(id, edge);\n updateGraph();\n return graph.current;\n },\n [updateGraph],\n );\n\n return (\n <FullScreen\n handle={fullScreenHandle}\n className={classNames(\n fullScreenHandle.active ? styles.fullscreen : styles.root,\n )}\n >\n {allowFullscreen && (\n <Tooltip title={t('dependencyGraph.fullscreenTooltip')}>\n <IconButton\n className={styles.fullscreenButton}\n onClick={\n fullScreenHandle.active\n ? fullScreenHandle.exit\n : fullScreenHandle.enter\n }\n >\n {fullScreenHandle.active ? (\n <FullscreenExitIcon />\n ) : (\n <FullscreenIcon />\n )}\n </IconButton>\n </Tooltip>\n )}\n\n <div ref={containerRef} style={{ width: '100%', height: '100%' }}>\n <svg\n {...svgProps}\n width=\"100%\"\n height={scalableHeight}\n viewBox={`0 0 ${maxWidth} ${maxHeight}`}\n id={DEPENDENCY_GRAPH_SVG}\n >\n <defs>\n <marker\n id={ARROW_MARKER_ID}\n viewBox=\"0 0 24 24\"\n markerWidth=\"14\"\n markerHeight=\"14\"\n refX=\"16\"\n refY=\"12\"\n orient=\"auto\"\n markerUnits=\"strokeWidth\"\n >\n <path\n fill={theme.palette.textSubtle}\n d=\"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z\"\n />\n </marker>\n {defs}\n </defs>\n <g id={WORKSPACE_ID}>\n <svg\n width={graphWidth}\n height={graphHeight}\n y={maxHeight / 2 - graphHeight / 2}\n x={maxWidth / 2 - graphWidth / 2}\n viewBox={`0 0 ${graphWidth} ${graphHeight}`}\n >\n {graphEdges.map(e => {\n const edge = graph.current.edge(e) as GraphEdge<EdgeData>;\n if (!edge) return null;\n if (renderEdge) return renderEdge({ edge, id: e });\n\n return (\n <Edge\n key={`${e.v}-${e.w}`}\n id={e}\n setEdge={setEdge}\n render={renderLabel}\n edge={edge}\n curve={curve}\n showArrowHeads={showArrowHeads}\n />\n );\n })}\n {graphNodes.map((id: string) => {\n const node = graph.current.node(id);\n if (!node) return null;\n return (\n <Node\n key={id}\n setNode={setNode}\n render={renderNode}\n node={node}\n />\n );\n })}\n </svg>\n </g>\n </svg>\n </div>\n </FullScreen>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\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 { parseEntityRef } from '@backstage/catalog-model';\nimport { useApp } from '@backstage/core-plugin-api';\nimport SvgIcon from '@material-ui/core/SvgIcon';\n\nconst DEFAULT_ICON = SvgIcon;\n\nfunction getKind(\n kind: string | undefined,\n entityRef: string | undefined,\n): string | undefined {\n if (kind) {\n return kind.toLocaleLowerCase('en-US');\n }\n\n if (entityRef) {\n try {\n return parseEntityRef(entityRef).kind.toLocaleLowerCase('en-US');\n } catch {\n return undefined;\n }\n }\n\n return undefined;\n}\n\nfunction useIcon(kind: string | undefined, entityRef: string | undefined) {\n const app = useApp();\n\n const actualKind = getKind(kind, entityRef);\n if (!actualKind) {\n return DEFAULT_ICON;\n }\n\n const icon = app.getSystemIcon(`kind:${actualKind}`);\n return icon || DEFAULT_ICON;\n}\n\nexport function EntityKindIcon(props: {\n kind?: string;\n entityRef?: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const { kind, entityRef, ...otherProps } = props;\n const Icon = useIcon(kind, entityRef);\n return <Icon {...otherProps} />;\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi, useApp, useRouteRef } from '@backstage/core-plugin-api';\nimport { Text, Box } from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { useLayoutEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { entityRouteRef } from '../../../routes';\nimport { useEntityPresentation } from '../../../apis';\nimport { EntityKindIcon } from './EntityKindIcon';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles(theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n\ntype NodeType = Entity & { root: boolean };\n\nfunction useAncestry(root: Entity): {\n loading: boolean;\n error?: Error;\n nodes: DependencyGraphTypes.DependencyNode<NodeType>[];\n edges: DependencyGraphTypes.DependencyEdge[];\n} {\n const catalogClient = useApi(catalogApiRef);\n const entityRef = stringifyEntityRef(root);\n\n const { loading, error, value } = useAsync(async () => {\n const response = await catalogClient.getEntityAncestors({ entityRef });\n const nodes = new Array<DependencyGraphTypes.DependencyNode<NodeType>>();\n const edges = new Array<DependencyGraphTypes.DependencyEdge>();\n for (const current of response.items) {\n const currentRef = stringifyEntityRef(current.entity);\n const isRootNode = currentRef === response.rootEntityRef;\n nodes.push({ id: currentRef, root: isRootNode, ...current.entity });\n for (const parentRef of current.parentEntityRefs) {\n edges.push({ from: currentRef, to: parentRef });\n }\n }\n return { nodes, edges };\n }, [entityRef]);\n\n return {\n loading,\n error,\n nodes: value?.nodes || [],\n edges: value?.edges || [],\n };\n}\n\nfunction CustomNode({ node }: DependencyGraphTypes.RenderNodeProps<NodeType>) {\n const classes = useStyles();\n const navigate = useNavigate();\n const entityRoute = useRouteRef(entityRouteRef);\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const app = useApp();\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const hasKindIcon = app.getSystemIcon(\n `kind:${node.kind.toLocaleLowerCase('en-US')}`,\n );\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = hasKindIcon ? iconSize + padding : 0;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const { primaryTitle: displayTitle } = useEntityPresentation(node);\n\n const onClick = () => {\n navigate(\n entityRoute({\n kind: node.kind,\n namespace: node.metadata.namespace || DEFAULT_NAMESPACE,\n name: node.metadata.name,\n }),\n );\n };\n\n return (\n <g onClick={onClick} className={classes.clickable}>\n <rect\n className={classNames(\n classes.node,\n node.root ? 'secondary' : 'primary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n {hasKindIcon && (\n <EntityKindIcon\n kind={node.kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n />\n )}\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n\nexport function AncestryPage(props: { entity: Entity }) {\n const { loading, error, nodes, edges } = useAncestry(props.entity);\n const { t } = useTranslationRef(catalogReactTranslationRef);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <>\n <Box mb=\"2\">\n <Text as=\"p\">\n {t('inspectEntityDialog.ancestryPage.description', {\n processorsLink: (\n <Link to=\"https://backstage.io/docs/features/software-catalog/life-of-an-entity\">\n {t('inspectEntityDialog.ancestryPage.processorsLink')}\n </Link>\n ),\n })}\n </Text>\n </Box>\n <Box mt=\"8\">\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={CustomNode}\n direction={DependencyGraphTypes.Direction.BOTTOM_TOP}\n zoom=\"enable-on-click\"\n />\n </Box>\n </>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\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 { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { ReactNode } from 'react';\n\nconst useStyles = makeStyles({\n list: {\n listStyle: 'none',\n margin: 0,\n padding: 0,\n },\n indented: {\n paddingLeft: 'var(--bui-space-4)',\n },\n listItem: {\n display: 'flex',\n alignItems: 'flex-start',\n marginTop: 'var(--bui-space-1)',\n paddingLeft: 'var(--bui-space-4)',\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n '&:first-child': {\n marginTop: 0,\n },\n },\n});\n\nexport function ListSection(props: {\n children: ReactNode;\n indent?: boolean;\n className?: string;\n 'aria-label'?: string;\n}) {\n const classes = useStyles();\n return (\n <ul\n className={classNames(\n classes.list,\n props.indent && classes.indented,\n props.className,\n )}\n aria-label={props['aria-label']}\n >\n {props.children}\n </ul>\n );\n}\n\n/**\n * A dense monospace list item.\n */\nexport function ListItemRow(props: { children: ReactNode }) {\n const classes = useStyles();\n return <li className={classes.listItem}>{props.children}</li>;\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Native HTML elements like <p> and <header> are used intentionally for\n// semantic markup. The react/forbid-elements rule predates the BUI migration.\n/* eslint-disable react/forbid-elements */\n\nimport {\n Entity,\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Text, Alert } from '@backstage/ui';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ListSection, ListItemRow } from './common';\n\nimport { catalogReactTranslationRef } from '../../../translation';\n\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles({\n header: {\n paddingLeft: 'var(--bui-space-4)',\n marginTop: 'var(--bui-space-4)',\n marginBottom: 'var(--bui-space-4)',\n },\n headerLabel: {\n margin: 0,\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n fontWeight: 'var(--bui-font-weight-regular)' as any,\n },\n entityList: {\n marginTop: 'var(--bui-space-4)',\n },\n headerValue: {\n margin: 0,\n marginTop: 'var(--bui-space-1)',\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n});\n\nfunction useColocated(entity: Entity): {\n loading: boolean;\n error?: Error;\n location?: string;\n originLocation?: string;\n colocatedEntities?: Entity[];\n} {\n const catalogApi = useApi(catalogApiRef);\n const currentEntityRef = stringifyEntityRef(entity);\n const location = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n const origin = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n\n const { loading, error, value } = useAsync(async () => {\n if (!location && !origin) {\n return [];\n }\n const response = await catalogApi.getEntities({\n filter: [\n ...(location\n ? [{ [`metadata.annotations.${ANNOTATION_LOCATION}`]: location }]\n : []),\n ...(origin\n ? [\n {\n [`metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`]: origin,\n },\n ]\n : []),\n ],\n });\n return response.items;\n }, [location, origin]);\n\n return {\n loading,\n error,\n location,\n originLocation: origin,\n colocatedEntities: value?.filter(\n colocated => stringifyEntityRef(colocated) !== currentEntityRef,\n ),\n };\n}\n\nfunction EntityList(props: { entities: Entity[]; header?: [string, string] }) {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n {props.header && (\n <header className={classes.header}>\n <h4 className={classes.headerLabel}>{props.header[0]}</h4>\n <p className={classes.headerValue}>{props.header[1]}</p>\n </header>\n )}\n <ListSection\n aria-label={t('inspectEntityDialog.colocatedPage.entityListAriaLabel')}\n className={classes.entityList}\n >\n {props.entities.map(entity => (\n <ListItemRow key={stringifyEntityRef(entity)}>\n <EntityRefLink entityRef={entity} />\n </ListItemRow>\n ))}\n </ListSection>\n </>\n );\n}\n\nfunction Contents(props: { entity: Entity }) {\n const { entity } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const { loading, error, location, originLocation, colocatedEntities } =\n useColocated(entity);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!location && !originLocation) {\n return (\n <Alert\n status=\"warning\"\n description={t('inspectEntityDialog.colocatedPage.alertNoLocation')}\n mt=\"4\"\n />\n );\n } else if (!colocatedEntities?.length) {\n return (\n <Alert\n status=\"info\"\n description={t('inspectEntityDialog.colocatedPage.alertNoEntity')}\n mt=\"4\"\n />\n );\n }\n\n if (location === originLocation) {\n return <EntityList entities={colocatedEntities} />;\n }\n\n const atLocation = colocatedEntities.filter(\n e => e.metadata.annotations?.[ANNOTATION_LOCATION] === location,\n );\n const atOrigin = colocatedEntities.filter(\n e =>\n e.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION] === originLocation,\n );\n\n return (\n <>\n {atLocation.length > 0 && (\n <EntityList\n entities={atLocation}\n header={[\n t('inspectEntityDialog.colocatedPage.locationHeader'),\n location!,\n ]}\n />\n )}\n {atOrigin.length > 0 && (\n <EntityList\n entities={atOrigin}\n header={[\n t('inspectEntityDialog.colocatedPage.originHeader'),\n originLocation!,\n ]}\n />\n )}\n </>\n );\n}\n\nexport function ColocatedPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <Text as=\"p\">{t('inspectEntityDialog.colocatedPage.description')}</Text>\n <Contents entity={props.entity} />\n </>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\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 { JsonObject } from '@backstage/types';\n\nexport function sortKeys(data: JsonObject): JsonObject {\n // we could do something custom, but lexicographical sorting is actually a\n // good choice at least for the default set of keys\n return Object.fromEntries(\n [...Object.entries(data)].sort((a, b) => (a[0] < b[0] ? -1 : 1)),\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\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 { Entity } from '@backstage/catalog-model';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { Text } from '@backstage/ui';\nimport { sortKeys } from './util';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport function JsonPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <Text as=\"p\">{t('inspectEntityDialog.jsonPage.description')}</Text>\n <div data-testid=\"code-snippet\">\n <CodeSnippet\n text={JSON.stringify(sortKeys(props.entity), undefined, 2)}\n language=\"json\"\n showCopyCodeButton\n />\n </div>\n </>\n );\n}\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-TagList\":\"RH6vZOMUe3ozH13w\",\"bui-Tag\":\"RbVv4ECvOgnU1Dwb\",\"bui-TagRemoveButton\":\"l9zJlYdsd_AvoCWG\",\"bui-TagIcon\":\"APxTgEybjsYQrIC6\"};","/*\n * Copyright 2024 The Backstage Authors\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 { defineComponent } from '../../hooks/useDefinition';\nimport type { TagGroupOwnProps, TagOwnProps } from './types';\nimport styles from './TagGroup.module.css';\n\n/**\n * Component definition for TagGroup\n * @public\n */\nexport const TagGroupDefinition = defineComponent<TagGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TagGroup',\n list: 'bui-TagList',\n },\n propDefs: {\n items: {},\n children: {},\n renderEmptyState: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const TagDefinition = defineComponent<TagOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Tag',\n icon: 'bui-TagIcon',\n removeButton: 'bui-TagRemoveButton',\n },\n analytics: true,\n propDefs: {\n noTrack: {},\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n href: {},\n children: {},\n className: {},\n },\n});\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { TagProps, TagGroupProps } from './types';\nimport {\n TagGroup as ReactAriaTagGroup,\n TagList as ReactAriaTagList,\n Tag as ReactAriaTag,\n Button as ReactAriaButton,\n} from 'react-aria-components';\nimport { forwardRef, type ReactNode } from 'react';\nimport { RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { TagGroupDefinition, TagDefinition } from './definition';\nimport { getNodeText } from '../../analytics/getNodeText';\n\n/**\n * A component that renders a list of tags.\n *\n * @public\n */\nexport const TagGroup = <T extends object>(props: TagGroupProps<T>) => {\n const { ownProps, restProps } = useDefinition(TagGroupDefinition, props);\n const { classes, items, children, renderEmptyState } = ownProps;\n\n return (\n <ReactAriaTagGroup className={classes.root} {...restProps}>\n <ReactAriaTagList\n className={classes.list}\n items={items}\n renderEmptyState={renderEmptyState}\n >\n {children}\n </ReactAriaTagList>\n </ReactAriaTagGroup>\n );\n};\n\n/**\n * A component that renders a tag.\n *\n * @public\n */\nexport const Tag = forwardRef<HTMLDivElement, TagProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n TagDefinition,\n props,\n );\n const { classes, children, icon, href } = ownProps;\n const textValue = typeof children === 'string' ? children : undefined;\n\n const handlePress = () => {\n if (href) {\n const text =\n (props as React.AriaAttributes)['aria-label'] ??\n textValue ??\n getNodeText(children) ??\n String(href);\n analytics.captureEvent('click', text, {\n attributes: { to: String(href) },\n });\n }\n };\n\n return (\n <ReactAriaTag\n ref={ref}\n textValue={textValue}\n className={classes.root}\n href={href}\n {...dataAttributes}\n {...restProps}\n onPress={e => {\n restProps.onPress?.(e);\n handlePress();\n }}\n >\n {({ allowsRemoving }) => (\n <>\n {icon && <span className={classes.icon}>{icon}</span>}\n {children as ReactNode}\n {allowsRemoving && (\n <ReactAriaButton className={classes.removeButton} slot=\"remove\">\n <RiCloseCircleLine size={16} />\n </ReactAriaButton>\n )}\n </>\n )}\n </ReactAriaTag>\n );\n});\n","/*\n * Copyright 2022 The Backstage Authors\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 { AlphaEntity } from '@backstage/catalog-model/alpha';\nimport { Link } from '@backstage/core-components';\nimport {\n Text,\n Box,\n Flex,\n Card,\n CardHeader,\n CardBody,\n TagGroup,\n Tag,\n ButtonIcon,\n ButtonLink,\n VisuallyHidden,\n} from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { RiFileCopyLine, RiCheckLine, RiQuestionLine } from '@remixicon/react';\nimport groupBy from 'lodash/groupBy';\nimport sortBy from 'lodash/sortBy';\nimport { ReactNode, useEffect, useRef, useState } from 'react';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport { ListSection, ListItemRow } from './common';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles({\n headingWithIcon: {\n display: 'flex',\n alignItems: 'center',\n },\n definitionList: {\n margin: 0,\n padding: 0,\n },\n definitionItem: {\n display: 'flex',\n alignItems: 'flex-start',\n marginTop: 'var(--bui-space-4)',\n paddingLeft: 'var(--bui-space-4)',\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n '&:first-child': {\n marginTop: 0,\n },\n },\n definitionContent: {\n flex: 1,\n minWidth: 0,\n },\n definitionKey: {\n fontWeight: 'bold',\n },\n definitionValue: {\n margin: 0,\n marginTop: 'var(--bui-space-1)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n copyAction: {\n marginLeft: 'var(--bui-space-2)',\n flexShrink: 0,\n },\n relationGroup: {\n '& + &': {\n marginTop: 'var(--bui-space-4)',\n },\n },\n monospace: {\n fontFamily: 'monospace',\n },\n sectionHeading: {\n marginTop: 'var(--bui-space-3)',\n },\n metadataList: {\n marginTop: 'var(--bui-space-2)',\n },\n relationList: {\n marginTop: 'var(--bui-space-2)',\n },\n tagGroup: {\n marginTop: 'var(--bui-space-3)',\n paddingLeft: 'var(--bui-space-4)',\n },\n});\n\n// Extracts a link from a value, if possible\nfunction findLink(value: string): string | undefined {\n if (value.match(/^url:https?:\\/\\//)) {\n return value.slice('url:'.length);\n }\n if (value.match(/^https?:\\/\\//)) {\n return value;\n }\n return undefined;\n}\n\nfunction entriesToItems(entries: [string, string][]) {\n return entries.map(([key, value]) => {\n const link = findLink(value);\n return {\n key,\n value: link ? <Link to={link}>{value}</Link> : value,\n };\n });\n}\n\nfunction CopyButton({ text, label }: { text: string; label: string }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const [copied, setCopied] = useState(false);\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n const handlePress = async () => {\n try {\n await window.navigator.clipboard.writeText(text);\n setCopied(true);\n timerRef.current = setTimeout(() => setCopied(false), 2000);\n } catch {\n // Clipboard access denied or unavailable\n }\n };\n\n return (\n <>\n <ButtonIcon\n icon={copied ? <RiCheckLine /> : <RiFileCopyLine />}\n aria-label={t('inspectEntityDialog.overviewPage.copyAriaLabel', {\n label,\n })}\n variant=\"tertiary\"\n size=\"small\"\n onPress={handlePress}\n />\n <VisuallyHidden role=\"status\">\n {copied ? t('inspectEntityDialog.overviewPage.copiedStatus') : ''}\n </VisuallyHidden>\n </>\n );\n}\n\nfunction HelpIcon(props: { to: string }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <ButtonLink\n href={props.to}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n variant=\"tertiary\"\n size=\"small\"\n iconStart={<RiQuestionLine />}\n aria-label={t('inspectEntityDialog.overviewPage.helpLinkAriaLabel')}\n />\n );\n}\n\nfunction Container(props: {\n title: ReactNode;\n helpLink?: string;\n children: ReactNode;\n}) {\n const classes = useStyles();\n return (\n <Card>\n <CardHeader>\n <Text\n variant=\"title-x-small\"\n as=\"h3\"\n className={props.helpLink ? classes.headingWithIcon : undefined}\n >\n {props.title}\n {props.helpLink && <HelpIcon to={props.helpLink} />}\n </Text>\n </CardHeader>\n <CardBody>{props.children}</CardBody>\n </Card>\n );\n}\n\nfunction ListSubheader(props: { children: ReactNode; className?: string }) {\n const classes = useStyles();\n return (\n <Text\n variant=\"body-large\"\n as=\"h4\"\n className={classNames(classes.headingWithIcon, props.className)}\n >\n {props.children}\n </Text>\n );\n}\n\nfunction KeyValueList(props: {\n items: { key: string; value: ReactNode; copyable?: boolean }[];\n className?: string;\n 'aria-label'?: string;\n}) {\n const classes = useStyles();\n return (\n <dl\n className={classNames(classes.definitionList, props.className)}\n aria-label={props['aria-label']}\n >\n {props.items.map(item => (\n <div key={item.key} className={classes.definitionItem}>\n <div className={classes.definitionContent}>\n <dt className={classes.definitionKey}>{item.key}</dt>\n <dd className={classes.definitionValue}>{item.value}</dd>\n </div>\n {item.copyable && typeof item.value === 'string' && (\n <div className={classes.copyAction}>\n <CopyButton text={item.value} label={item.key} />\n </div>\n )}\n </div>\n ))}\n </dl>\n );\n}\n\nexport function OverviewPage(props: { entity: AlphaEntity }) {\n const classes = useStyles();\n const {\n apiVersion,\n kind,\n metadata,\n spec,\n relations = [],\n status = {},\n } = props.entity;\n\n const groupedRelations = groupBy(\n sortBy(relations, r => r.targetRef),\n 'type',\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const entityRef = stringifyEntityRef(props.entity);\n return (\n <Flex direction=\"column\" gap=\"4\">\n <Container title={t('inspectEntityDialog.overviewPage.identity.title')}>\n <KeyValueList\n aria-label={t('inspectEntityDialog.overviewPage.identity.title')}\n items={[\n { key: 'apiVersion', value: apiVersion },\n { key: 'kind', value: kind },\n ...(spec?.type\n ? [{ key: 'spec.type', value: spec.type.toString() }]\n : []),\n ...(metadata.uid\n ? [{ key: 'uid', value: metadata.uid, copyable: true }]\n : []),\n ...(metadata.etag\n ? [{ key: 'etag', value: metadata.etag, copyable: true }]\n : []),\n { key: 'entityRef', value: entityRef, copyable: true },\n ]}\n />\n </Container>\n\n <Container title={t('inspectEntityDialog.overviewPage.metadata.title')}>\n {!!Object.keys(metadata.annotations || {}).length && (\n <>\n <ListSubheader>\n {t('inspectEntityDialog.overviewPage.annotations')}\n <HelpIcon to=\"https://backstage.io/docs/features/software-catalog/well-known-annotations\" />\n </ListSubheader>\n <KeyValueList\n items={entriesToItems(Object.entries(metadata.annotations!))}\n aria-label={t('inspectEntityDialog.overviewPage.annotations')}\n className={classes.metadataList}\n />\n </>\n )}\n {!!Object.keys(metadata.labels || {}).length && (\n <>\n <ListSubheader className={classes.sectionHeading}>\n {t('inspectEntityDialog.overviewPage.labels')}\n </ListSubheader>\n <KeyValueList\n items={entriesToItems(Object.entries(metadata.labels!))}\n aria-label={t('inspectEntityDialog.overviewPage.labels')}\n className={classes.metadataList}\n />\n </>\n )}\n {!!metadata.tags?.length && (\n <>\n <ListSubheader className={classes.sectionHeading}>\n {t('inspectEntityDialog.overviewPage.tags')}\n </ListSubheader>\n <TagGroup\n aria-label={t('inspectEntityDialog.overviewPage.tags')}\n className={classes.tagGroup}\n >\n {metadata.tags.map(tag => (\n <Tag key={tag} id={tag}>\n {tag}\n </Tag>\n ))}\n </TagGroup>\n </>\n )}\n </Container>\n\n {!!relations.length && (\n <Container\n title={t('inspectEntityDialog.overviewPage.relation.title')}\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-relations\"\n >\n {Object.entries(groupedRelations).map(([type, groupRelations]) => (\n <div key={type} className={classes.relationGroup}>\n <ListSubheader className={classes.monospace}>\n {type}\n </ListSubheader>\n <ListSection aria-label={type} className={classes.relationList}>\n {groupRelations.map(group => (\n <ListItemRow key={group.targetRef}>\n <EntityRefLink entityRef={group.targetRef} />\n </ListItemRow>\n ))}\n </ListSection>\n </div>\n ))}\n </Container>\n )}\n\n {!!status.items?.length && (\n <Container\n title={t('inspectEntityDialog.overviewPage.status.title')}\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-statuses\"\n >\n {status.items.map((item, index) => (\n <div key={index}>\n <Text>\n {item.level}: {item.type}\n </Text>\n <Box ml=\"4\">{item.message}</Box>\n </div>\n ))}\n </Container>\n )}\n </Flex>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\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 { Entity } from '@backstage/catalog-model';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { Text } from '@backstage/ui';\nimport YAML from 'yaml';\nimport { sortKeys } from './util';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport function YamlPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <Text as=\"p\">{t('inspectEntityDialog.yamlPage.description')}</Text>\n <div data-testid=\"code-snippet\">\n <CodeSnippet\n text={YAML.stringify(sortKeys(props.entity))}\n language=\"yaml\"\n showCopyCodeButton\n />\n </div>\n </>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\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 { Entity } from '@backstage/catalog-model';\nimport {\n Dialog,\n DialogHeader,\n DialogBody,\n Tabs,\n TabList,\n Tab,\n TabPanel,\n} from '@backstage/ui';\nimport { useMemo } from 'react';\nimport { AncestryPage } from './components/AncestryPage';\nimport { ColocatedPage } from './components/ColocatedPage';\nimport { JsonPage } from './components/JsonPage';\nimport { OverviewPage } from './components/OverviewPage';\nimport { YamlPage } from './components/YamlPage';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype TabKey = 'overview' | 'ancestry' | 'colocated' | 'json' | 'yaml';\n\nconst TAB_KEYS: TabKey[] = [\n 'overview',\n 'ancestry',\n 'colocated',\n 'json',\n 'yaml',\n];\n\nfunction DialogContents(props: {\n entity: Entity;\n initialTab?: TabKey;\n onSelect?: (tab: string) => void;\n}) {\n const { entity, initialTab, onSelect } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const tabNames = useMemo(\n () => ({\n overview: t('inspectEntityDialog.tabNames.overview'),\n ancestry: t('inspectEntityDialog.tabNames.ancestry'),\n colocated: t('inspectEntityDialog.tabNames.colocated'),\n json: t('inspectEntityDialog.tabNames.json'),\n yaml: t('inspectEntityDialog.tabNames.yaml'),\n }),\n [t],\n );\n\n const tabContent: Record<TabKey, JSX.Element> = {\n overview: <OverviewPage entity={entity} />,\n ancestry: <AncestryPage entity={entity} />,\n colocated: <ColocatedPage entity={entity} />,\n json: <JsonPage entity={entity} />,\n yaml: <YamlPage entity={entity} />,\n };\n\n return (\n <>\n <DialogHeader>{t('inspectEntityDialog.title')}</DialogHeader>\n <DialogBody>\n <Tabs\n defaultSelectedKey={initialTab || 'overview'}\n onSelectionChange={key => onSelect?.(key as string)}\n >\n <TabList aria-label={t('inspectEntityDialog.tabsAriaLabel')}>\n {TAB_KEYS.map(tab => (\n <Tab key={tab} id={tab}>\n {tabNames[tab]}\n </Tab>\n ))}\n </TabList>\n {TAB_KEYS.map(tab => (\n <TabPanel key={tab} id={tab}>\n {tabContent[tab]}\n </TabPanel>\n ))}\n </Tabs>\n </DialogBody>\n </>\n );\n}\n\n/**\n * A dialog that lets users inspect the low level details of their entities.\n *\n * @public\n */\nexport function InspectEntityDialog(props: {\n open: boolean;\n entity: Entity;\n initialTab?: 'overview' | 'ancestry' | 'colocated' | 'json' | 'yaml';\n onClose: () => void;\n onSelect?: (tab: string) => void;\n}) {\n const { open, entity, initialTab, onClose, onSelect } = props;\n\n if (!entity) {\n return null;\n }\n\n return (\n <Dialog\n isOpen={open}\n onOpenChange={isOpen => !isOpen && onClose()}\n width=\"940px\"\n height=\"100vh\"\n >\n {open && (\n <DialogContents\n entity={entity}\n initialTab={initialTab}\n onSelect={onSelect}\n />\n )}\n </Dialog>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\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 { HeaderLabel } from '@backstage/core-components';\nimport { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../translation';\n\ntype EntityLabelsProps = {\n entity: Entity;\n};\n\nexport function EntityLabels(props: EntityLabelsProps) {\n const { entity } = props;\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n const { t } = useTranslationRef(catalogTranslationRef);\n return (\n <>\n {ownedByRelations.length > 0 && (\n <HeaderLabel\n label={t('entityLabels.ownerLabel')}\n contentTypograpyRootComponent=\"p\"\n value={\n <EntityRefLinks\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n color=\"inherit\"\n />\n }\n />\n )}\n {entity.spec?.lifecycle && (\n <HeaderLabel\n label={t('entityLabels.lifecycleLabel')}\n value={entity.spec.lifecycle?.toString()}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\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 ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { forwardRef } from 'react';\n\ntype VisibleType = 'visible' | 'hidden' | 'disable';\n\nexport type UnregisterEntityOptions = {\n disableUnregister: boolean | VisibleType;\n};\n\ninterface UnregisterEntityProps {\n unregisterEntityOptions?: UnregisterEntityOptions;\n isUnregisterAllowed: boolean;\n onUnregisterEntity: () => void;\n onClose: () => void;\n}\n\n// TODO: When Backstage supports only React 19+, remove the forwardRef\nexport const UnregisterEntity = forwardRef<\n HTMLLIElement,\n UnregisterEntityProps\n>((props, ref) => {\n const {\n unregisterEntityOptions,\n isUnregisterAllowed,\n onUnregisterEntity,\n onClose,\n } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const isBoolean =\n typeof unregisterEntityOptions?.disableUnregister === 'boolean';\n\n const isDisabled =\n (!isUnregisterAllowed ||\n (isBoolean\n ? !!unregisterEntityOptions?.disableUnregister\n : unregisterEntityOptions?.disableUnregister === 'disable')) ??\n false;\n\n if (unregisterEntityOptions?.disableUnregister !== 'hidden') {\n return (\n <MenuItem\n ref={ref}\n onClick={() => {\n onClose();\n onUnregisterEntity();\n }}\n disabled={isDisabled}\n {...props}\n >\n <ListItemIcon>\n <CancelIcon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={t('entityContextMenu.unregisterMenuTitle')} />\n </MenuItem>\n );\n }\n\n return null;\n});\n","/*\n * Copyright 2025 The Backstage Authors\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 {\n createVersionedContext,\n createVersionedValueMap,\n} from '@backstage/version-bridge';\nimport { ReactNode } from 'react';\n\n/** @internal */\nexport type EntityContextMenuContextValue = {\n onMenuClose: () => void;\n};\n\nconst EntityContextMenuContext = createVersionedContext<{\n 1: EntityContextMenuContextValue;\n}>('entity-context-menu-context');\n\n/** @internal */\nexport interface EntityContextMenuProviderProps {\n children: ReactNode;\n onMenuClose: () => void;\n}\n\n/** @internal */\nexport const EntityContextMenuProvider = (\n props: EntityContextMenuProviderProps,\n) => {\n const { children, onMenuClose } = props;\n const value = { onMenuClose };\n\n return (\n <EntityContextMenuContext.Provider\n value={createVersionedValueMap({ 1: value })}\n >\n {children}\n </EntityContextMenuContext.Provider>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\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 Divider from '@material-ui/core/Divider';\nimport FileCopyTwoToneIcon from '@material-ui/icons/FileCopyTwoTone';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MenuList from '@material-ui/core/MenuList';\nimport Popover from '@material-ui/core/Popover';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport BugReportIcon from '@material-ui/icons/BugReport';\nimport MoreVert from '@material-ui/icons/MoreVert';\nimport { SyntheticEvent, useEffect, useState } from 'react';\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { UnregisterEntity, UnregisterEntityOptions } from './UnregisterEntity';\nimport { useApi, alertApiRef } from '@backstage/core-plugin-api';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { EntityContextMenuProvider } from '../../context';\n\n/** @public */\nexport type EntityContextMenuClassKey = 'button';\n\nconst useStyles = makeStyles(\n (theme: Theme) => {\n return {\n button: {\n color: theme.page.fontColor,\n },\n };\n },\n { name: 'PluginCatalogEntityContextMenu' },\n);\n\n// NOTE(freben): Intentionally not exported at this point, since it's part of\n// the unstable extra context menu items concept below\ninterface ExtraContextMenuItem {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n}\n\ninterface EntityContextMenuProps {\n UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[];\n UNSTABLE_contextMenuOptions?: UnregisterEntityOptions;\n contextMenuItems?: React.JSX.Element[];\n onUnregisterEntity: () => void;\n onInspectEntity: () => void;\n}\n\nexport function EntityContextMenu(props: EntityContextMenuProps) {\n const {\n UNSTABLE_extraContextMenuItems,\n UNSTABLE_contextMenuOptions,\n contextMenuItems,\n onUnregisterEntity,\n onInspectEntity,\n } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement>();\n const classes = useStyles();\n const unregisterPermission = useEntityPermission(\n catalogEntityDeletePermission,\n );\n const isAllowed = unregisterPermission.allowed;\n\n const onOpen = (event: SyntheticEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const onClose = () => {\n setAnchorEl(undefined);\n };\n\n const alertApi = useApi(alertApiRef);\n const [copyState, copyToClipboard] = useCopyToClipboard();\n useEffect(() => {\n if (!copyState.error && copyState.value) {\n alertApi.post({\n message: t('entityContextMenu.copiedMessage'),\n severity: 'info',\n display: 'transient',\n });\n }\n }, [copyState, alertApi, t]);\n\n const extraItems = UNSTABLE_extraContextMenuItems?.length\n ? [\n ...UNSTABLE_extraContextMenuItems.map(item => (\n <MenuItem\n key={item.title}\n onClick={() => {\n onClose();\n item.onClick();\n }}\n >\n <ListItemIcon>\n <item.Icon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={item.title} />\n </MenuItem>\n )),\n <Divider key=\"the divider is here!\" />,\n ]\n : null;\n\n const defaultMenuItems = [\n <UnregisterEntity\n unregisterEntityOptions={UNSTABLE_contextMenuOptions}\n isUnregisterAllowed={isAllowed}\n onUnregisterEntity={onUnregisterEntity}\n onClose={onClose}\n key=\"unregister-entity\"\n />,\n <MenuItem\n onClick={() => {\n onClose();\n onInspectEntity();\n }}\n key=\"inspect-entity\"\n >\n <ListItemIcon>\n <BugReportIcon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={t('entityContextMenu.inspectMenuTitle')} />\n </MenuItem>,\n <MenuItem\n onClick={() => {\n onClose();\n copyToClipboard(window.location.toString());\n }}\n key=\"copy-url\"\n >\n <ListItemIcon>\n <FileCopyTwoToneIcon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={t('entityContextMenu.copyURLMenuTitle')} />\n </MenuItem>,\n ];\n\n return (\n <>\n <Tooltip title={t('entityContextMenu.moreButtonTitle')} arrow>\n <IconButton\n aria-label={t('entityContextMenu.moreButtonAriaLabel')}\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n aria-expanded={!!anchorEl}\n role=\"button\"\n onClick={onOpen}\n data-testid=\"menu-button\"\n className={classes.button}\n id=\"long-menu\"\n >\n <MoreVert />\n </IconButton>\n </Tooltip>\n <Popover\n open={Boolean(anchorEl)}\n onClose={onClose}\n anchorEl={anchorEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n aria-labelledby=\"long-menu\"\n PaperProps={{\n style: { minWidth: 200 },\n }}\n >\n <MenuList autoFocusItem={Boolean(anchorEl)}>\n {extraItems}\n {contextMenuItems === undefined ? (\n defaultMenuItems\n ) : (\n <EntityContextMenuProvider onMenuClose={onClose}>\n {contextMenuItems}\n </EntityContextMenuProvider>\n )}\n </MenuList>\n </Popover>\n </>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n useState,\n useCallback,\n useEffect,\n ComponentProps,\n ReactNode,\n} from 'react';\nimport { useNavigate, useLocation, useSearchParams } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport Box from '@material-ui/core/Box';\n\nimport { Header, Breadcrumbs } from '@backstage/core-components';\nimport {\n useApi,\n useRouteRef,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { IconComponent } from '@backstage/frontend-plugin-api';\n\nimport {\n Entity,\n EntityRelation,\n DEFAULT_NAMESPACE,\n} from '@backstage/catalog-model';\n\nimport {\n useAsyncEntity,\n entityRouteRef,\n catalogApiRef,\n EntityRefLink,\n InspectEntityDialog,\n UnregisterEntityDialog,\n EntityDisplayName,\n FavoriteEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { EntityLabels } from '../EntityLabels';\nimport { EntityContextMenu } from '../../../components/EntityContextMenu';\nimport { rootRouteRef, unregisterRedirectRouteRef } from '../../../routes';\n\nfunction headerProps(\n paramKind: string | undefined,\n paramNamespace: string | undefined,\n paramName: string | undefined,\n entity: Entity | undefined,\n): { headerTitle: string; headerType: string } {\n const kind = paramKind ?? entity?.kind ?? '';\n const namespace = paramNamespace ?? entity?.metadata.namespace ?? '';\n const name =\n entity?.metadata.title ?? paramName ?? entity?.metadata.name ?? '';\n\n return {\n headerTitle: `${name}${\n namespace && namespace !== DEFAULT_NAMESPACE ? ` in ${namespace}` : ''\n }`,\n headerType: (() => {\n let t = kind.toLocaleLowerCase('en-US');\n if (entity && entity.spec && 'type' in entity.spec) {\n t += ' — ';\n t += (entity.spec as { type: string }).type.toLocaleLowerCase('en-US');\n }\n return t;\n })(),\n };\n}\n\nfunction findParentRelation(\n entityRelations: EntityRelation[] = [],\n relationTypes: string[] = [],\n) {\n for (const type of relationTypes) {\n const foundRelation = entityRelations.find(\n relation => relation.type === type,\n );\n if (foundRelation) {\n return foundRelation; // Return the first found relation and stop\n }\n }\n return null;\n}\n\nconst useStyles = makeStyles(theme => ({\n breadcrumbs: {\n color: theme.page.fontColor,\n fontSize: theme.typography.caption.fontSize,\n textTransform: 'uppercase',\n marginTop: theme.spacing(1),\n opacity: 0.8,\n '& span ': {\n color: theme.page.fontColor,\n textDecoration: 'underline',\n textUnderlineOffset: '3px',\n },\n },\n}));\n\nfunction EntityHeaderTitle() {\n const { entity } = useAsyncEntity();\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const { headerTitle: title } = headerProps(kind, namespace, name, entity);\n return (\n <Box display=\"inline-flex\" alignItems=\"center\" height=\"1em\" maxWidth=\"100%\">\n <Box\n component=\"span\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n overflow=\"hidden\"\n >\n {entity ? <EntityDisplayName entityRef={entity} hideIcon /> : title}\n </Box>\n {entity && <FavoriteEntity entity={entity} />}\n </Box>\n );\n}\n\nfunction EntityHeaderSubtitle(props: { parentEntityRelations?: string[] }) {\n const { parentEntityRelations } = props;\n const classes = useStyles();\n const { entity } = useAsyncEntity();\n const { name } = useRouteRefParams(entityRouteRef);\n const parentEntity = findParentRelation(\n entity?.relations ?? [],\n parentEntityRelations ?? [],\n );\n\n const catalogApi = useApi(catalogApiRef);\n\n const { value: ancestorEntity } = useAsync(async () => {\n if (parentEntity) {\n return findParentRelation(\n (await catalogApi.getEntityByRef(parentEntity?.targetRef))?.relations,\n parentEntityRelations,\n );\n }\n return null;\n }, [parentEntity, catalogApi]);\n\n return parentEntity ? (\n <Breadcrumbs separator=\">\" className={classes.breadcrumbs}>\n {ancestorEntity && (\n <EntityRefLink entityRef={ancestorEntity.targetRef} disableTooltip />\n )}\n <EntityRefLink entityRef={parentEntity.targetRef} disableTooltip />\n {name}\n </Breadcrumbs>\n ) : null;\n}\n\n/** @alpha */\nexport function EntityHeader(props: {\n // NOTE(freben): Intentionally not exported at this point, since it's part of\n // the unstable extra context menu items concept below\n UNSTABLE_extraContextMenuItems?: {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n }[];\n // NOTE(blam): Intentionally not exported at this point, since it's part of\n // unstable context menu option, eg: disable the unregister entity menu\n UNSTABLE_contextMenuOptions?: {\n disableUnregister: boolean | 'visible' | 'hidden' | 'disable';\n };\n contextMenuItems?: React.JSX.Element[];\n /**\n * An array of relation types used to determine the parent entities in the hierarchy.\n * These relations are prioritized in the order provided, allowing for flexible\n * navigation through entity relationships.\n *\n * For example, use relation types like `[\"partOf\", \"memberOf\", \"ownedBy\"]` to define how the entity is related to\n * its parents in the Entity Catalog.\n *\n * It adds breadcrumbs in the Entity page to enhance user navigation and context awareness.\n */\n parentEntityRelations?: string[];\n title?: ReactNode;\n subtitle?: ReactNode;\n}) {\n const {\n UNSTABLE_extraContextMenuItems,\n UNSTABLE_contextMenuOptions,\n contextMenuItems,\n parentEntityRelations,\n title,\n subtitle,\n } = props;\n const { entity } = useAsyncEntity();\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const { headerTitle: entityFallbackText, headerType: type } = headerProps(\n kind,\n namespace,\n name,\n entity,\n );\n\n const location = useLocation();\n const navigate = useNavigate();\n const catalogRoute = useRouteRef(rootRouteRef);\n const unregisterRedirectRoute = useRouteRef(unregisterRedirectRouteRef);\n\n const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);\n\n const openUnregisterEntityDialog = useCallback(\n () => setConfirmationDialogOpen(true),\n [setConfirmationDialogOpen],\n );\n\n const closeUnregisterEntityDialog = useCallback(\n () => setConfirmationDialogOpen(false),\n [setConfirmationDialogOpen],\n );\n\n const cleanUpAfterUnregisterConfirmation = useCallback(async () => {\n setConfirmationDialogOpen(false);\n navigate(\n unregisterRedirectRoute ? unregisterRedirectRoute() : catalogRoute(),\n );\n }, [\n navigate,\n catalogRoute,\n unregisterRedirectRoute,\n setConfirmationDialogOpen,\n ]);\n\n // Make sure to close the dialog if the user clicks links in it that navigate\n // to another entity.\n useEffect(() => {\n setConfirmationDialogOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [location.pathname]);\n\n const [searchParams, setSearchParams] = useSearchParams();\n const selectedInspectEntityDialogTab = searchParams.get('inspect');\n\n const setInspectEntityDialogTab = useCallback(\n (newTab: string) => setSearchParams(`inspect=${newTab}`),\n [setSearchParams],\n );\n\n const openInspectEntityDialog = useCallback(\n () => setSearchParams('inspect'),\n [setSearchParams],\n );\n\n const closeInspectEntityDialog = useCallback(\n () => setSearchParams(),\n [setSearchParams],\n );\n\n const inspectDialogOpen = typeof selectedInspectEntityDialogTab === 'string';\n\n return (\n <Header\n pageTitleOverride={entityFallbackText}\n type={type}\n title={title ?? <EntityHeaderTitle />}\n subtitle={\n subtitle ?? (\n <EntityHeaderSubtitle parentEntityRelations={parentEntityRelations} />\n )\n }\n >\n {entity && (\n <>\n <EntityLabels entity={entity} />\n <EntityContextMenu\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n contextMenuItems={contextMenuItems}\n onInspectEntity={openInspectEntityDialog}\n onUnregisterEntity={openUnregisterEntityDialog}\n />\n <InspectEntityDialog\n entity={entity!}\n initialTab={\n (selectedInspectEntityDialogTab as ComponentProps<\n typeof InspectEntityDialog\n >['initialTab']) || undefined\n }\n open={inspectDialogOpen}\n onClose={closeInspectEntityDialog}\n onSelect={setInspectEntityDialogTab}\n />\n <UnregisterEntityDialog\n entity={entity!}\n open={confirmationDialogOpen}\n onClose={closeUnregisterEntityDialog}\n onConfirm={cleanUpAfterUnregisterConfirmation}\n />\n </>\n )}\n </Header>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\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 classNames from 'classnames';\nimport { PropsWithChildren } from 'react';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\n\n/** @public */\nexport type EntityTabsPanelClassKey = 'root' | 'stretch' | 'noPadding';\n\nconst useStyles = makeStyles(\n (theme: Theme) => ({\n root: {\n gridArea: 'pageContent',\n minWidth: 0,\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n },\n stretch: {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n },\n noPadding: {\n padding: 0,\n },\n }),\n { name: 'EntityTabsPanel' },\n);\n\ntype EntityTabsPanelProps = PropsWithChildren<{\n stretch?: boolean;\n noPadding?: boolean;\n className?: string;\n}>;\n\nexport function EntityTabsPanel(props: EntityTabsPanelProps) {\n const { className, stretch, noPadding, children, ...restProps } = props;\n\n const classes = useStyles();\n return (\n <article\n {...restProps}\n className={classNames(classes.root, className, {\n [classes.stretch]: stretch,\n [classes.noPadding]: noPadding,\n })}\n >\n {children}\n </article>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\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 {\n ReactNode,\n forwardRef,\n useState,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n} from 'react';\nimport { Link } from 'react-router-dom';\nimport classnames from 'classnames';\n\nimport Typography from '@material-ui/core/Typography';\nimport Popover from '@material-ui/core/Popover';\nimport { TabProps, TabClassKey } from '@material-ui/core/Tab';\nimport { capitalize } from '@material-ui/core/utils';\nimport { createStyles, Theme, withStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Button from '@material-ui/core/Button';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport List from '@material-ui/core/List';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { IconsApi, iconsApiRef } from '@backstage/frontend-plugin-api';\n\nconst styles = (theme: Theme) =>\n createStyles({\n /* Styles applied to the root element. */\n root: {\n ...theme.typography.button,\n maxWidth: 264,\n minWidth: 72,\n position: 'relative',\n boxSizing: 'border-box',\n minHeight: 48,\n flexShrink: 0,\n padding: '6px 12px',\n [theme.breakpoints.up('sm')]: {\n padding: '6px 24px',\n },\n overflow: 'hidden',\n whiteSpace: 'normal',\n textAlign: 'center',\n [theme.breakpoints.up('sm')]: {\n minWidth: 160,\n },\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n /* Styles applied to the root element if both `icon` and `label` are provided. */\n labelIcon: {\n minHeight: 72,\n paddingTop: 9,\n '& $wrapper > *:first-child': {\n marginBottom: 6,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"inherit\"`. */\n textColorInherit: {\n color: 'inherit',\n opacity: 0.7,\n '&$selected': {\n opacity: 1,\n },\n '&$disabled': {\n opacity: 0.5,\n },\n },\n selectedButton: {\n color: `${theme.palette.text.primary}`,\n opacity: `${1}`,\n },\n unselectedButton: {\n color: `${theme.palette.text.secondary}`,\n opacity: `${0.7}`,\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"primary\"`. */\n textColorPrimary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.primary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"secondary\"`. */\n textColorSecondary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.secondary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Pseudo-class applied to the root element if `selected={true}` (controlled by the Tabs component). */\n selected: {},\n /* Pseudo-class applied to the root element if `disabled={true}` (controlled by the Tabs component). */\n disabled: {},\n /* Styles applied to the root element if `fullWidth={true}` (controlled by the Tabs component). */\n fullWidth: {\n flexShrink: 1,\n flexGrow: 1,\n flexBasis: 0,\n maxWidth: 'none',\n },\n /* Styles applied to the root element if `wrapped={true}`. */\n wrapped: {\n fontSize: theme.typography.pxToRem(12),\n lineHeight: 1.5,\n },\n /* Styles applied to the `icon` and `label`'s wrapper element. */\n wrapper: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n flexDirection: 'row',\n },\n });\n\ntype EntityTabsGroupItem = {\n id: string;\n label: string;\n path: string;\n icon?: string | ReactElement;\n};\n\ntype EntityTabsGroupProps = TabProps & {\n classes?: Partial<ReturnType<typeof styles>>;\n indicator?: ReactNode;\n highlightedButton?: string;\n items: EntityTabsGroupItem[];\n onSelectTab?: MouseEventHandler<HTMLAnchorElement>;\n showIcons?: boolean;\n};\n\nfunction resolveIcon(\n icon: string | ReactElement | undefined,\n iconsApi: IconsApi,\n showIcons: boolean,\n) {\n if (!showIcons) {\n return undefined;\n }\n if (typeof icon === 'string') {\n const Icon = iconsApi.getIcon(icon);\n if (Icon) {\n return <Icon />;\n }\n return undefined;\n }\n return icon;\n}\n\nconst Tab = forwardRef(function Tab(props: EntityTabsGroupProps, ref: any) {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const iconsApi = useApi(iconsApiRef);\n\n const open = Boolean(anchorEl);\n const submenuId = open ? 'tabbed-submenu' : undefined;\n\n const {\n classes,\n className,\n disabled = false,\n disableFocusRipple = false,\n items,\n fullWidth,\n indicator,\n label,\n onSelectTab,\n selected,\n textColor = 'inherit',\n wrapped = false,\n highlightedButton,\n showIcons = false,\n } = props;\n\n const groupIcon = resolveIcon(props.icon, iconsApi, showIcons);\n const testId = 'data-testid' in props && props['data-testid'];\n\n const handleMenuClose = () => {\n setAnchorEl(null);\n };\n\n const handleMenuClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const classArray = [\n classes?.root,\n classes?.[`textColor${capitalize(textColor)}` as TabClassKey],\n classes && {\n [classes.disabled!]: disabled,\n [classes.selected!]: selected,\n [classes.labelIcon!]: label && groupIcon,\n [classes.fullWidth!]: fullWidth,\n [classes.wrapped!]: wrapped,\n },\n className,\n ];\n\n if (items.length === 1) {\n return (\n <Button\n focusRipple={!disableFocusRipple}\n data-testid={testId}\n className={classnames(\n classArray,\n classes && {\n [classes.labelIcon!]: label && (items[0].icon ?? groupIcon),\n },\n )}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n component={Link}\n onClick={onSelectTab}\n to={items[0]?.path}\n startIcon={resolveIcon(items[0].icon, iconsApi, showIcons)}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {items[0].label}\n </Typography>\n {indicator}\n </Button>\n );\n }\n const hasIcons = showIcons && items.some(i => i.icon);\n return (\n <>\n <Button\n data-testid={testId}\n focusRipple={!disableFocusRipple}\n className={classnames(classArray)}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n onClick={handleMenuClick}\n startIcon={groupIcon}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {label}\n </Typography>\n <ExpandMoreIcon />\n </Button>\n <Popover\n id={submenuId}\n open={open}\n anchorEl={anchorEl}\n onClose={handleMenuClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}\n >\n <List component=\"nav\">\n {items.map(i => {\n const itemIcon = resolveIcon(i.icon, iconsApi, showIcons);\n return (\n <ListItem\n key={`popover_item_${i.id}`}\n button\n focusRipple={!disableFocusRipple}\n classes={{\n selected: classnames(classes?.selectedButton),\n default: classnames(classes?.unselectedButton),\n disabled: classnames(classes?.disabled),\n }}\n ref={ref}\n aria-selected={selected}\n disabled={disabled}\n selected={highlightedButton === i.id}\n component={Link}\n onClick={e => {\n handleMenuClose();\n onSelectTab?.(e);\n }}\n to={i.path}\n >\n {itemIcon && <ListItemIcon>{itemIcon}</ListItemIcon>}\n <ListItemText\n inset={!itemIcon && hasIcons}\n primary={\n <>\n <Typography variant=\"button\">{i.label}</Typography>\n {indicator}\n </>\n }\n />\n </ListItem>\n );\n })}\n </List>\n </Popover>\n </>\n );\n});\n\n// @ts-ignore\nexport const EntityTabsGroup = withStyles(styles, { name: 'MuiTab' })(Tab);\n","/*\n * Copyright 2025 The Backstage Authors\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 { ReactElement, useMemo } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Tabs from '@material-ui/core/Tabs';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nimport { EntityTabsGroup } from './EntityTabsGroup';\nimport { catalogTranslationRef } from '../../translation';\n\n/** @public */\nexport type HeaderTabsClassKey =\n | 'tabsWrapper'\n | 'defaultTab'\n | 'selected'\n | 'tabRoot';\n\nconst useStyles = makeStyles(\n theme => ({\n tabsWrapper: {\n gridArea: 'pageSubheader',\n backgroundColor: theme.palette.background.paper,\n paddingLeft: theme.spacing(3),\n minWidth: 0,\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n selected: {\n color: theme.palette.text.primary,\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n color: theme.palette.text.primary,\n },\n },\n }),\n { name: 'BackstageHeaderTabs' },\n);\n\ntype Tab = {\n id: string;\n label: string;\n path: string;\n group?: string;\n icon?: string | ReactElement;\n};\n\ntype TabGroup = {\n group?: {\n title: string;\n icon?: string | ReactElement;\n };\n items: Array<Omit<Tab, 'group'>>;\n};\n\ntype EntityTabsListProps = {\n tabs: Tab[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showIcons?: boolean;\n selectedIndex?: number;\n};\n\nfunction resolveGroupId(\n tabGroup: string | undefined,\n groupDefinitions: EntityContentGroupDefinitions,\n aliasToGroup: Record<string, string>,\n): string | undefined {\n if (!tabGroup) {\n return undefined;\n }\n if (groupDefinitions[tabGroup]) {\n return tabGroup;\n }\n return aliasToGroup[tabGroup];\n}\n\nexport function EntityTabsList(props: EntityTabsListProps) {\n const styles = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const {\n tabs: items,\n selectedIndex = 0,\n showIcons,\n groupDefinitions,\n defaultContentOrder = 'title',\n } = props;\n\n const aliasToGroup = useMemo(\n () =>\n Object.entries(groupDefinitions).reduce((map, [groupId, def]) => {\n for (const alias of def.aliases ?? []) {\n map[alias] = groupId;\n }\n return map;\n }, {} as Record<string, string>),\n [groupDefinitions],\n );\n\n const groups = useMemo(() => {\n const byKey = items.reduce((result, tab) => {\n const resolvedGroupId = resolveGroupId(\n tab.group,\n groupDefinitions,\n aliasToGroup,\n );\n const group = resolvedGroupId\n ? groupDefinitions[resolvedGroupId]\n : undefined;\n const groupOrId = group && resolvedGroupId ? resolvedGroupId : tab.id;\n result[groupOrId] = result[groupOrId] ?? {\n group,\n items: [],\n };\n result[groupOrId].items.push(tab);\n return result;\n }, {} as Record<string, TabGroup>);\n\n const groupOrder = Object.keys(groupDefinitions);\n const sorted = Object.entries(byKey).sort(([a], [b]) => {\n const ai = groupOrder.indexOf(a);\n const bi = groupOrder.indexOf(b);\n if (ai !== -1 && bi !== -1) {\n return ai - bi;\n }\n if (ai !== -1) {\n return -1;\n }\n if (bi !== -1) {\n return 1;\n }\n return 0;\n });\n\n for (const [id, tabGroup] of sorted) {\n const groupDef = groupDefinitions[id];\n if (groupDef) {\n const order = groupDef.contentOrder ?? defaultContentOrder;\n if (order === 'title') {\n tabGroup.items.sort((a, b) =>\n a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }),\n );\n }\n }\n }\n\n return sorted;\n }, [items, groupDefinitions, aliasToGroup, defaultContentOrder]);\n\n const selectedItem = items[selectedIndex];\n const selectedGroup = resolveGroupId(\n selectedItem?.group,\n groupDefinitions,\n aliasToGroup,\n );\n return (\n <Box className={styles.tabsWrapper}>\n <Tabs\n selectionFollowsFocus\n indicatorColor=\"primary\"\n textColor=\"inherit\"\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label={t('entityTabs.tabsAriaLabel')}\n value={selectedGroup ?? selectedItem?.id}\n >\n {groups.map(([id, tabGroup]) => (\n <EntityTabsGroup\n data-testid={`header-tab-${id}`}\n className={styles.defaultTab}\n classes={{ selected: styles.selected, root: styles.tabRoot }}\n key={id}\n label={tabGroup.group?.title}\n icon={tabGroup.group?.icon}\n value={id}\n items={tabGroup.items}\n highlightedButton={selectedItem?.id}\n showIcons={showIcons}\n />\n ))}\n </Tabs>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\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 { ReactElement, useMemo } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { matchRoutes, useParams, useRoutes } from 'react-router-dom';\nimport { EntityTabsPanel } from './EntityTabsPanel';\nimport { EntityTabsList } from './EntityTabsList';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\ntype SubRoute = {\n group?: string;\n path: string;\n title: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n};\n\nexport function useSelectedSubRoute(subRoutes: SubRoute[]): {\n index: number;\n route?: SubRoute;\n element?: JSX.Element;\n} {\n const params = useParams();\n\n const routes = subRoutes.map(({ path, children }) => ({\n caseSensitive: false,\n path: `${path}/*`,\n element: children,\n }));\n\n // TODO: remove once react-router updated\n const sortedRoutes = routes.sort((a, b) =>\n // remove \"/*\" symbols from path end before comparing\n b.path.replace(/\\/\\*$/, '').localeCompare(a.path.replace(/\\/\\*$/, '')),\n );\n\n const element = useRoutes(sortedRoutes) ?? subRoutes[0]?.children;\n\n // TODO(Rugvip): Once we only support v6 stable we can always prefix\n // This avoids having a double / prefix for react-router v6 beta, which in turn breaks\n // the tab highlighting when using relative paths for the tabs.\n let currentRoute = params['*'] ?? '';\n if (!currentRoute.startsWith('/')) {\n currentRoute = `/${currentRoute}`;\n }\n\n const [matchedRoute] = matchRoutes(sortedRoutes, currentRoute) ?? [];\n const foundIndex = matchedRoute\n ? subRoutes.findIndex(t => `${t.path}/*` === matchedRoute.route.path)\n : 0;\n\n return {\n index: foundIndex === -1 ? 0 : foundIndex,\n element,\n route: subRoutes[foundIndex] ?? subRoutes[0],\n };\n}\n\ntype EntityTabsProps = {\n routes: SubRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showIcons?: boolean;\n};\n\nexport function EntityTabs(props: EntityTabsProps) {\n const { routes, groupDefinitions, defaultContentOrder, showIcons } = props;\n\n const { index, route, element } = useSelectedSubRoute(routes);\n\n const tabs = useMemo(\n () =>\n routes.map(t => {\n const { path, title, group, icon } = t;\n let to = path;\n // Remove trailing /*\n to = to.replace(/\\/\\*$/, '');\n // And remove leading / for relative navigation\n to = to.replace(/^\\//, '');\n return {\n group,\n id: path,\n path: to,\n label: title,\n icon,\n };\n }),\n [routes],\n );\n\n return (\n <>\n <EntityTabsList\n tabs={tabs}\n selectedIndex={index}\n showIcons={showIcons}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={defaultContentOrder}\n />\n <EntityTabsPanel>\n <Helmet title={route?.title} />\n {element}\n </EntityTabsPanel>\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\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 { ComponentProps, ReactNode, ReactElement } from 'react';\n\nimport Alert from '@material-ui/lab/Alert';\n\nimport {\n attachComponentData,\n useElementFilter,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n Content,\n Link,\n Page,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n entityRouteRef,\n useAsyncEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { catalogTranslationRef } from '../../translation';\nimport { EntityHeader } from '../EntityHeader';\nimport { EntityTabs } from '../EntityTabs';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n group?: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n};\n\nconst dataKey = 'plugin.catalog.entityLayoutRoute';\nconst Route: (props: EntityLayoutRouteProps) => null = () => null;\nattachComponentData(Route, dataKey, true);\nattachComponentData(Route, 'core.gatherMountPoints', true); // This causes all mount points that are discovered within this route to use the path of the route itself\n\n/** @public */\nexport interface EntityLayoutProps {\n UNSTABLE_contextMenuOptions?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_contextMenuOptions'];\n UNSTABLE_extraContextMenuItems?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_extraContextMenuItems'];\n contextMenuItems?: ComponentProps<typeof EntityHeader>['contextMenuItems'];\n children?: ReactNode;\n header?: JSX.Element;\n NotFoundComponent?: ReactNode;\n /**\n * An array of relation types used to determine the parent entities in the hierarchy.\n * These relations are prioritized in the order provided, allowing for flexible\n * navigation through entity relationships.\n *\n * For example, use relation types like `[\"partOf\", \"memberOf\", \"ownedBy\"]` to define how the entity is related to\n * its parents in the Entity Catalog.\n *\n * It adds breadcrumbs in the Entity page to enhance user navigation and context awareness.\n */\n parentEntityRelations?: string[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showNavItemIcons?: boolean;\n}\n\n/**\n * EntityLayout is a compound component, which allows you to define a layout for\n * entities using a sub-navigation mechanism.\n *\n * Consists of two parts: EntityLayout and EntityLayout.Route\n *\n * @example\n * ```jsx\n * <EntityLayout>\n * <EntityLayout.Route path=\"/example\" title=\"Example tab\">\n * <div>This is rendered under /example/anything-here route</div>\n * </EntityLayout.Route>\n * </EntityLayout>\n * ```\n *\n * @public\n */\nexport const EntityLayout = (props: EntityLayoutProps) => {\n const {\n UNSTABLE_extraContextMenuItems,\n UNSTABLE_contextMenuOptions,\n contextMenuItems,\n children,\n header,\n NotFoundComponent,\n parentEntityRelations,\n groupDefinitions,\n defaultContentOrder,\n showNavItemIcons,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const routes = useElementFilter(\n children,\n elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of EntityLayout must be an EntityLayout.Route',\n })\n .getElements<EntityLayoutRouteProps>() // all nodes, element data, maintain structure or not?\n .flatMap(({ props: elementProps }) => {\n if (!entity) {\n return [];\n }\n if (elementProps.if && !elementProps.if(entity)) {\n return [];\n }\n return [\n {\n path: elementProps.path,\n title: elementProps.title,\n group: elementProps.group,\n children: elementProps.children,\n icon: elementProps.icon,\n },\n ];\n }),\n [entity],\n );\n\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n {header ?? (\n <EntityHeader\n parentEntityRelations={parentEntityRelations}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n )}\n\n {loading && <Progress />}\n\n {entity && (\n <EntityTabs\n routes={routes}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={defaultContentOrder}\n showIcons={showNavItemIcons}\n />\n )}\n\n {error && (\n <Content>\n <Alert severity=\"error\">{error.toString()}</Alert>\n </Content>\n )}\n\n {!loading && !error && !entity && (\n <Content>\n {NotFoundComponent ? (\n NotFoundComponent\n ) : (\n <WarningPanel title={t('entityLabels.warningPanelTitle')}>\n {t('entityPage.notFoundMessage', {\n kind,\n link: (\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n {t('entityPage.notFoundLinkText')}\n </Link>\n ),\n })}\n </WarningPanel>\n )}\n </Content>\n )}\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n"],"names":["useStyles","makeStyles","FavoriteToggleIcon","props","isFavorite","classes","Typography","StarIcon","UnstarredIcon","FavoriteToggle","id","title","value","onChange","iconButtonProps","Tooltip","IconButton","theme","alpha","HeaderLabelContent","className","typographyRootComponent","HeaderLabel","label","url","contentTypograpyRootComponent","content","Grid","Link","ButtonIconDefinition","defineComponent","styles","ButtonIcon","forwardRef","ref","ownProps","restProps","dataAttributes","useDefinition","icon","loading","RAButton","isPending","ProgressBar","RiLoader4Line","DependencyGraphTypes","getEntityRef","entityOrRef","stringifyEntityRef","FavoriteEntity","toggleStarredEntity","isStarredEntity","useStarredEntity","starredEntitiesApi","useApi","starredEntitiesApiRef","setIsStarredEntity","useState","useEffect","subscription","starredEntities","useCallback","t","useTranslationRef","catalogReactTranslationRef","DefaultNode","width","setWidth","height","setHeight","idRef","useRef","useLayoutEffect","renderedHeight","renderedWidth","Math","paddedWidth","padding","paddedHeight","renderDefault","Node","render","setNode","node","x","y","nodeRef","NODE_TEST_ID","ARROW_MARKER_ID","DefaultLabel","Edge","setEdge","edge","curve","showArrowHeads","points","labelRef","path","createPath","useMemo","d3Shape","d","point","isFinite","EDGE_TEST_ID","undefined","labelProps","LABEL_TEST_ID","WORKSPACE_ID","DEPENDENCY_GRAPH_SVG","DependencyGraph","edges","nodes","renderNode","direction","Types","align","nodeMargin","edgeMargin","rankMargin","paddingX","paddingY","acyclicer","ranker","labelPosition","labelOffset","edgeRanks","edgeWeight","renderEdge","renderLabel","defs","zoom","fit","allowFullscreen","svgProps","useTheme","containerWidth","setContainerWidth","containerHeight","setContainerHeight","fullScreenHandle","useFullScreenHandle","coreComponentsTranslationRef","graph","dagre","graphWidth","setGraphWidth","graphHeight","setGraphHeight","graphNodes","setGraphNodes","graphEdges","setGraphEdges","maxWidth","maxHeight","_measureRef","useMeasure","measureRef","once","scalableHeight","containerRef","debounce","root","container","d3Selection","workspace","enableZoom","d3Zoom","Infinity","event","newContainerWidth","newContainerHeight","setNodesAndEdges","currentGraphNodes","currentGraphEdges","nodeId","e","existingNode","updateGraph","newHeight","FullScreen","classNames","FullscreenExitIcon","FullscreenIcon","DEFAULT_ICON","SvgIcon","EntityKindIcon","app","actualKind","kind","entityRef","otherProps","Icon","useApp","getKind","parseEntityRef","CustomNode","navigate","useNavigate","entityRoute","useRouteRef","entityRouteRef","hasKindIcon","paddedIconWidth","iconSize","displayTitle","useEntityPresentation","DEFAULT_NAMESPACE","AncestryPage","error","useAncestry","catalogClient","catalogApiRef","useAsync","response","Array","current","currentRef","isRootNode","parentRef","Progress","ResponseErrorPanel","Box","Text","ListSection","ListItemRow","EntityList","entity","EntityRefLink","Contents","location","originLocation","colocatedEntities","useColocated","catalogApi","currentEntityRef","ANNOTATION_LOCATION","origin","ANNOTATION_ORIGIN_LOCATION","colocated","Alert","atLocation","atOrigin","ColocatedPage","sortKeys","data","Object","a","b","JsonPage","CodeSnippet","JSON","TagGroupDefinition","TagDefinition","TagGroup","items","children","renderEmptyState","ReactAriaTagGroup","ReactAriaTagList","Tag","analytics","href","textValue","ReactAriaTag","text","getNodeText","String","allowsRemoving","ReactAriaButton","RiCloseCircleLine","entriesToItems","entries","key","link","CopyButton","copied","setCopied","timerRef","clearTimeout","handlePress","window","setTimeout","RiCheckLine","RiFileCopyLine","VisuallyHidden","HelpIcon","ButtonLink","RiQuestionLine","Container","Card","CardHeader","CardBody","ListSubheader","KeyValueList","item","OverviewPage","apiVersion","metadata","spec","relations","status","groupedRelations","groupBy","sortBy","r","Flex","tag","type","groupRelations","group","index","YamlPage","YAML","TAB_KEYS","DialogContents","initialTab","onSelect","tabNames","tabContent","DialogHeader","DialogBody","Tabs","TabList","tab","Tab","TabPanel","InspectEntityDialog","open","onClose","Dialog","isOpen","EntityLabels","ownedByRelations","getEntityRelations","RELATION_OWNED_BY","catalogTranslationRef","EntityRefLinks","UnregisterEntity","unregisterEntityOptions","isUnregisterAllowed","onUnregisterEntity","isBoolean","isDisabled","MenuItem","ListItemIcon","CancelIcon","ListItemText","EntityContextMenuContext","createVersionedContext","EntityContextMenuProvider","onMenuClose","createVersionedValueMap","EntityContextMenu","UNSTABLE_extraContextMenuItems","UNSTABLE_contextMenuOptions","contextMenuItems","onInspectEntity","anchorEl","setAnchorEl","isAllowed","unregisterPermission","useEntityPermission","catalogEntityDeletePermission","alertApi","alertApiRef","copyState","copyToClipboard","useCopyToClipboard","extraItems","Divider","defaultMenuItems","BugReportIcon","FileCopyTwoToneIcon","MoreVert","Popover","Boolean","MenuList","headerProps","paramKind","paramNamespace","paramName","namespace","name","findParentRelation","entityRelations","relationTypes","foundRelation","relation","EntityHeaderTitle","useAsyncEntity","useRouteRefParams","EntityDisplayName","EntityHeaderSubtitle","parentEntityRelations","parentEntity","ancestorEntity","Breadcrumbs","EntityHeader","subtitle","entityFallbackText","useLocation","catalogRoute","rootRouteRef","unregisterRedirectRoute","unregisterRedirectRouteRef","confirmationDialogOpen","setConfirmationDialogOpen","openUnregisterEntityDialog","closeUnregisterEntityDialog","cleanUpAfterUnregisterConfirmation","searchParams","setSearchParams","useSearchParams","selectedInspectEntityDialogTab","setInspectEntityDialogTab","newTab","openInspectEntityDialog","closeInspectEntityDialog","Header","UnregisterEntityDialog","EntityTabsPanel","stretch","noPadding","resolveIcon","iconsApi","showIcons","iconsApiRef","disabled","disableFocusRipple","fullWidth","indicator","onSelectTab","selected","textColor","wrapped","highlightedButton","groupIcon","testId","handleMenuClose","classArray","capitalize","Button","classnames","hasIcons","i","ExpandMoreIcon","List","itemIcon","ListItem","EntityTabsGroup","withStyles","createStyles","resolveGroupId","tabGroup","groupDefinitions","aliasToGroup","EntityTabsList","selectedIndex","defaultContentOrder","map","groupId","def","alias","groups","byKey","result","resolvedGroupId","groupOrId","groupOrder","sorted","ai","bi","groupDef","order","selectedItem","selectedGroup","EntityTabs","routes","route","element","useSelectedSubRoute","subRoutes","params","useParams","sortedRoutes","useRoutes","currentRoute","matchedRoute","matchRoutes","foundIndex","tabs","to","Helmet","dataKey","Route","attachComponentData","EntityLayout","header","NotFoundComponent","showNavItemIcons","useElementFilter","elements","elementProps","Page","Content","WarningPanel"],"mappings":"mOAsBA,IAAMA,EAAYC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,EAChB,IAAO,EACL,KAAM,CACJ,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