@backstage/plugin-catalog 2.0.9-next.2 → 2.0.10-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/alpha/DefaultEntityContentLayout.esm.js.map +1 -1
  3. package/dist/alpha/apis.esm.js.map +1 -1
  4. package/dist/alpha/components/CatalogEntityPage.esm.js.map +1 -1
  5. package/dist/alpha/components/CatalogOverviewPage.esm.js.map +1 -1
  6. package/dist/alpha/components/EntityContextMenu/EntityContextMenu.esm.js.map +1 -1
  7. package/dist/alpha/components/EntityHeader/EntityHeader.esm.js +2 -2
  8. package/dist/alpha/components/EntityHeader/EntityHeader.esm.js.map +1 -1
  9. package/dist/alpha/components/EntityHeader/EntityHeaderBui.esm.js +1 -1
  10. package/dist/alpha/components/EntityHeader/EntityHeaderBui.esm.js.map +1 -1
  11. package/dist/alpha/components/EntityLabels/EntityLabels.esm.js.map +1 -1
  12. package/dist/alpha/components/EntityLayout/EntityLayout.esm.js.map +1 -1
  13. package/dist/alpha/components/EntityLayout/EntityLayoutBui.esm.js.map +1 -1
  14. package/dist/alpha/components/EntityLayout/entityLayoutRoutes.esm.js.map +1 -1
  15. package/dist/alpha/components/EntityTabs/EntityTabs.esm.js.map +1 -1
  16. package/dist/alpha/components/EntityTabs/EntityTabsGroup.esm.js.map +1 -1
  17. package/dist/alpha/components/EntityTabs/EntityTabsList.esm.js.map +1 -1
  18. package/dist/alpha/components/EntityTabs/EntityTabsPanel.esm.js.map +1 -1
  19. package/dist/alpha/components/EntityTabs/useEntityTabs.esm.js.map +1 -1
  20. package/dist/alpha/contextMenuItems.esm.js.map +1 -1
  21. package/dist/alpha/entityCards.esm.js +21 -17
  22. package/dist/alpha/entityCards.esm.js.map +1 -1
  23. package/dist/alpha/entityContents.esm.js.map +1 -1
  24. package/dist/alpha/entityIconLinks.esm.js.map +1 -1
  25. package/dist/alpha/filter/FilterWrapper.esm.js.map +1 -1
  26. package/dist/alpha/filter/matchers/createHasMatcher.esm.js +1 -1
  27. package/dist/alpha/filter/matchers/createHasMatcher.esm.js.map +1 -1
  28. package/dist/alpha/filter/matchers/createIsMatcher.esm.js +1 -1
  29. package/dist/alpha/filter/matchers/createIsMatcher.esm.js.map +1 -1
  30. package/dist/alpha/filter/matchers/createKindMatcher.esm.js +2 -2
  31. package/dist/alpha/filter/matchers/createKindMatcher.esm.js.map +1 -1
  32. package/dist/alpha/filter/matchers/createTypeMatcher.esm.js +2 -2
  33. package/dist/alpha/filter/matchers/createTypeMatcher.esm.js.map +1 -1
  34. package/dist/alpha/filter/parseFilterExpression.esm.js.map +1 -1
  35. package/dist/alpha/filters.esm.js.map +1 -1
  36. package/dist/alpha/pages.esm.js.map +1 -1
  37. package/dist/alpha/plugin.esm.js.map +1 -1
  38. package/dist/alpha/searchResultItems.esm.js.map +1 -1
  39. package/dist/alpha/translation.esm.js.map +1 -1
  40. package/dist/alpha.d.ts +2 -2
  41. package/dist/alpha.esm.js.map +1 -1
  42. package/dist/apis/EntityPresentationApi/DefaultEntityPresentationApi.esm.js +3 -3
  43. package/dist/apis/EntityPresentationApi/DefaultEntityPresentationApi.esm.js.map +1 -1
  44. package/dist/apis/EntityPresentationApi/defaults.esm.js.map +1 -1
  45. package/dist/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.esm.js.map +1 -1
  46. package/dist/apis/StarredEntitiesApi/migration.esm.js.map +1 -1
  47. package/dist/components/AboutCard/AboutCard.esm.js +3 -3
  48. package/dist/components/AboutCard/AboutCard.esm.js.map +1 -1
  49. package/dist/components/AboutCard/AboutContent.esm.js +7 -7
  50. package/dist/components/AboutCard/AboutContent.esm.js.map +1 -1
  51. package/dist/components/AboutCard/AboutField.esm.js +2 -1
  52. package/dist/components/AboutCard/AboutField.esm.js.map +1 -1
  53. package/dist/components/AboutCard/hooks.esm.js.map +1 -1
  54. package/dist/components/AboutCard/useCatalogSourceIconLinkProps.esm.js.map +1 -1
  55. package/dist/components/CatalogEntityPage/CatalogEntityPage.esm.js.map +1 -1
  56. package/dist/components/CatalogEntityPage/useEntityFromUrl.esm.js.map +1 -1
  57. package/dist/components/CatalogExportButton/CatalogExportButton.esm.js.map +1 -1
  58. package/dist/components/CatalogExportButton/CatalogExportType.esm.js.map +1 -1
  59. package/dist/components/CatalogExportButton/file-download/downloadFile.esm.js.map +1 -1
  60. package/dist/components/CatalogExportButton/file-download/serializeEntities.esm.js.map +1 -1
  61. package/dist/components/CatalogExportButton/file-download/toStreamRequest.esm.js.map +1 -1
  62. package/dist/components/CatalogExportButton/file-download/useStreamingExport.esm.js.map +1 -1
  63. package/dist/components/CatalogKindHeader/CatalogKindHeader.esm.js +2 -2
  64. package/dist/components/CatalogKindHeader/CatalogKindHeader.esm.js.map +1 -1
  65. package/dist/components/CatalogKindHeader/kindFilterUtils.esm.js +3 -5
  66. package/dist/components/CatalogKindHeader/kindFilterUtils.esm.js.map +1 -1
  67. package/dist/components/CatalogPage/CatalogPage.esm.js.map +1 -1
  68. package/dist/components/CatalogPage/DefaultCatalogPage.esm.js +1 -1
  69. package/dist/components/CatalogPage/DefaultCatalogPage.esm.js.map +1 -1
  70. package/dist/components/CatalogPage/DefaultCatalogPage.module.css.esm.js.map +1 -1
  71. package/dist/components/CatalogSearchResultListItem/CatalogSearchResultListItem.esm.js.map +1 -1
  72. package/dist/components/CatalogTable/CatalogTable.esm.js +3 -3
  73. package/dist/components/CatalogTable/CatalogTable.esm.js.map +1 -1
  74. package/dist/components/CatalogTable/CatalogTableToolbar.esm.js.map +1 -1
  75. package/dist/components/CatalogTable/CursorPaginatedCatalogTable.esm.js.map +1 -1
  76. package/dist/components/CatalogTable/OffsetPaginatedCatalogTable.esm.js.map +1 -1
  77. package/dist/components/CatalogTable/columns.esm.js +3 -3
  78. package/dist/components/CatalogTable/columns.esm.js.map +1 -1
  79. package/dist/components/CatalogTable/defaultCatalogTableColumnsFunc.esm.js +1 -1
  80. package/dist/components/CatalogTable/defaultCatalogTableColumnsFunc.esm.js.map +1 -1
  81. package/dist/components/DependencyOfComponentsCard/DependencyOfComponentsCard.esm.js.map +1 -1
  82. package/dist/components/DependsOnComponentsCard/DependsOnComponentsCard.esm.js.map +1 -1
  83. package/dist/components/DependsOnResourcesCard/DependsOnResourcesCard.esm.js.map +1 -1
  84. package/dist/components/EntityContextMenu/EntityContextMenu.esm.js.map +1 -1
  85. package/dist/components/EntityContextMenu/UnregisterEntity.esm.js.map +1 -1
  86. package/dist/components/EntityLabelsCard/EntityLabelsCard.esm.js.map +1 -1
  87. package/dist/components/EntityLabelsCard/EntityLabelsEmptyState.esm.js.map +1 -1
  88. package/dist/components/EntityLabelsCard/conditions.esm.js.map +1 -1
  89. package/dist/components/EntityLayout/EntityLayout.esm.js +2 -2
  90. package/dist/components/EntityLayout/EntityLayout.esm.js.map +1 -1
  91. package/dist/components/EntityLinksCard/EntityLinksCard.esm.js.map +1 -1
  92. package/dist/components/EntityLinksCard/EntityLinksEmptyState.esm.js.map +1 -1
  93. package/dist/components/EntityLinksCard/IconLink.esm.js.map +1 -1
  94. package/dist/components/EntityLinksCard/LinksGridList.esm.js.map +1 -1
  95. package/dist/components/EntityLinksCard/useDynamicColumns.esm.js.map +1 -1
  96. package/dist/components/EntityOrphanWarning/DeleteEntityDialog.esm.js.map +1 -1
  97. package/dist/components/EntityOrphanWarning/EntityOrphanWarning.esm.js.map +1 -1
  98. package/dist/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.esm.js.map +1 -1
  99. package/dist/components/EntityRelationWarning/EntityRelationWarning.esm.js.map +1 -1
  100. package/dist/components/EntitySwitch/EntitySwitch.esm.js +1 -1
  101. package/dist/components/EntitySwitch/EntitySwitch.esm.js.map +1 -1
  102. package/dist/components/EntitySwitch/conditions.esm.js +1 -1
  103. package/dist/components/EntitySwitch/conditions.esm.js.map +1 -1
  104. package/dist/components/FilteredEntityLayout/index.esm.js.map +1 -1
  105. package/dist/components/HasComponentsCard/HasComponentsCard.esm.js.map +1 -1
  106. package/dist/components/HasResourcesCard/HasResourcesCard.esm.js.map +1 -1
  107. package/dist/components/HasSubcomponentsCard/HasSubcomponentsCard.esm.js.map +1 -1
  108. package/dist/components/HasSubdomainsCard/HasSubdomainsCard.esm.js.map +1 -1
  109. package/dist/components/HasSystemsCard/HasSystemsCard.esm.js.map +1 -1
  110. package/dist/components/RelatedEntitiesCard/RelatedEntitiesCard.esm.js.map +1 -1
  111. package/dist/components/RelatedEntitiesCard/presets.esm.js.map +1 -1
  112. package/dist/context/EntityContextMenuContext.esm.js.map +1 -1
  113. package/dist/index.d.ts +60 -60
  114. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -1
  115. package/dist/plugin.esm.js.map +1 -1
  116. package/dist/plugins/catalog/package.json.esm.js +1 -1
  117. package/dist/plugins/catalog/package.json.esm.js.map +1 -1
  118. package/dist/routes.esm.js.map +1 -1
  119. package/package.json +23 -23
  120. package/dist/types/{DefaultCatalogPage.d-BuCpeSQx.d.ts → DefaultCatalogPage.d-Ch_19T_y.d.ts} +19 -19
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @backstage/plugin-catalog
2
2
 
3
+ ## 2.0.10-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/errors@1.3.2-next.0
9
+ - @backstage/integration-react@1.2.23-next.0
10
+ - @backstage/plugin-scaffolder-common@2.3.1-next.0
11
+ - @backstage/core-components@0.18.15-next.0
12
+ - @backstage/core-plugin-api@1.12.11-next.0
13
+ - @backstage/frontend-plugin-api@0.18.2-next.0
14
+ - @backstage/plugin-permission-react@0.5.6-next.0
15
+ - @backstage/plugin-techdocs-react@1.3.16-next.0
16
+ - @backstage/catalog-client@1.16.3-next.0
17
+ - @backstage/catalog-model@1.10.2-next.0
18
+ - @backstage/core-compat-api@0.5.16-next.0
19
+ - @backstage/plugin-catalog-react@3.2.4-next.0
20
+ - @backstage/plugin-catalog-common@1.2.1-next.0
21
+ - @backstage/plugin-search-common@1.2.26-next.0
22
+ - @backstage/plugin-search-react@1.11.9-next.0
23
+
24
+ ## 2.0.9
25
+
26
+ ### Patch Changes
27
+
28
+ - 8e0e3c4: Fixed a regression where the About card's field labels (OWNER, SYSTEM, TAGS, etc.) lost their vertical gap above the value.
29
+ - e3781a3: Fixed circular dependency warnings when building the catalog plugin.
30
+ - d9a949e: Fixed the About card to safely show and hide filtered icon links when navigating between entities, without initializing hidden links.
31
+ - 736d84e: Use locale-insensitive Unicode casing for consistent string handling across environments.
32
+ - 4611178: Add support for legacy props in catalog entity card exports by widening the public TypeScript prop types. This ensures compatibility for consumers still using legacy properties such as `variant` and `columns`.
33
+ - d421187: Reduced the initial app bundle size by loading page and optional UI implementations only when their extensions render.
34
+ - acc6666: Fixed entity context menus to report errors from contributed items without disrupting the menu.
35
+ - Updated dependencies
36
+ - @backstage/core-components@0.18.14
37
+ - @backstage/plugin-catalog-common@1.2.0
38
+ - @backstage/plugin-scaffolder-common@2.3.0
39
+ - @backstage/ui@0.18.0
40
+ - @backstage/catalog-client@1.16.2
41
+ - @backstage/catalog-model@1.10.1
42
+ - @backstage/plugin-catalog-react@3.2.3
43
+ - @backstage/plugin-techdocs-react@1.3.15
44
+ - @backstage/frontend-plugin-api@0.18.1
45
+ - @backstage/core-compat-api@0.5.15
46
+ - @backstage/core-plugin-api@1.12.10
47
+ - @backstage/integration-react@1.2.22
48
+ - @backstage/plugin-permission-react@0.5.5
49
+ - @backstage/plugin-search-common@1.2.25
50
+ - @backstage/plugin-search-react@1.11.8
51
+
3
52
  ## 2.0.9-next.2
4
53
 
5
54
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultEntityContentLayout.esm.js","sources":["../../src/alpha/DefaultEntityContentLayout.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { Fragment } from 'react';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { EntityContentLayoutProps } from '@backstage/plugin-catalog-react/alpha';\nimport { EntitySwitch } from '../components/EntitySwitch';\nimport {\n EntityOrphanWarning,\n isOrphan,\n} from '../components/EntityOrphanWarning';\nimport {\n EntityRelationWarning,\n hasRelationWarnings,\n} from '../components/EntityRelationWarning';\nimport {\n EntityProcessingErrorsPanel,\n hasCatalogProcessingErrors,\n} from '../components/EntityProcessingErrorsPanel';\nimport { HorizontalScrollGrid } from '@backstage/core-components';\n\n// Module-level flag to ensure deprecation warning is only logged once\nlet hasLoggedSummaryWarning = false;\n\nconst useStyles = makeStyles<\n Theme,\n { infoCards: boolean; summaryCards: boolean; contentCards: boolean }\n>(theme => ({\n root: {\n display: 'flex',\n flexFlow: 'column nowrap',\n gap: theme.spacing(3),\n },\n warningArea: {\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n marginBottom: theme.spacing(3),\n '&:empty': {\n marginBottom: 0,\n display: 'none',\n },\n },\n mainContent: {\n display: 'flex',\n flexFlow: 'column',\n gap: theme.spacing(3),\n alignItems: 'stretch',\n minWidth: 0,\n },\n infoArea: {\n display: 'flex',\n flexFlow: 'column nowrap',\n alignItems: 'stretch',\n gap: theme.spacing(3),\n minWidth: 0,\n '& > *': {\n flexShrink: 0,\n flexGrow: 0,\n },\n },\n summaryArea: {\n minWidth: 0,\n margin: theme.spacing(1), // To counteract MUI negative grid margin\n },\n summaryCard: {\n flex: '0 0 auto',\n width: '100%',\n '& + &': {\n marginLeft: theme.spacing(3),\n },\n },\n contentArea: {\n display: 'flex',\n flexFlow: 'column',\n gap: theme.spacing(3),\n alignItems: 'stretch',\n minWidth: 0,\n },\n [theme.breakpoints.up('md')]: {\n root: {\n display: 'grid',\n gap: theme.spacing(3),\n gridTemplateAreas: ({ summaryCards }) => `\n \"${summaryCards ? 'summary' : 'content'} info\"\n \"content info\"\n `,\n gridTemplateColumns: ({ infoCards }) => (infoCards ? '2fr 1fr' : '1fr'),\n alignItems: 'start',\n },\n mainContent: {\n display: 'contents',\n },\n contentArea: {\n gridArea: 'content',\n },\n summaryArea: {\n gridArea: 'summary',\n margin: theme.spacing(1), // To counteract MUI negative grid margin\n },\n infoArea: {\n gridArea: 'info',\n position: 'sticky',\n top: theme.spacing(3),\n // this is a little unfortunate, but it's required to make the info cards scrollable\n // in a fixed container of the full height when it's stuck.\n // 100% doesn't work as that's the height of the entire layout, which is what powers the card scrolling.\n maxHeight: '100vh',\n overflowY: 'auto',\n alignSelf: 'start',\n alignItems: 'stretch',\n // Hide the scrollbar for the inner info cards\n // kind of an accessibility nightmare, but we see.\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n '&::-webkit-scrollbar': {\n display: 'none',\n },\n },\n summaryCard: {\n width: 'auto',\n },\n },\n}));\n\nexport function DefaultEntityContentLayout(props: EntityContentLayoutProps) {\n const { cards } = props;\n\n const infoCards = cards.filter(card => card.type === 'info');\n // Keep support for 'summary' type at runtime for backward compatibility\n // even though it's been removed from the type system\n const summaryCards = cards.filter(card => card.type === ('summary' as any));\n const contentCards = cards.filter(\n card => !card.type || card.type === 'content',\n );\n\n if (summaryCards.length > 0 && !hasLoggedSummaryWarning) {\n hasLoggedSummaryWarning = true;\n // eslint-disable-next-line no-console\n console.warn(\n \"The 'summary' entity card type has been removed. Please update your cards to use 'content' or 'info' types instead.\",\n );\n }\n\n const classes = useStyles({\n infoCards: !!infoCards.length,\n summaryCards: !!summaryCards.length,\n contentCards: !!contentCards.length,\n });\n\n return (\n <>\n <div className={classes.warningArea}>\n <EntitySwitch>\n <EntitySwitch.Case if={isOrphan}>\n <EntityOrphanWarning />\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasRelationWarnings}>\n <EntityRelationWarning />\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasCatalogProcessingErrors}>\n <EntityProcessingErrorsPanel />\n </EntitySwitch.Case>\n </EntitySwitch>\n </div>\n <div className={classes.root}>\n {infoCards.length > 0 ? (\n <div className={classes.infoArea}>\n {infoCards.map((card, index) => (\n <Fragment key={card.element.key ?? index}>\n {card.element}\n </Fragment>\n ))}\n </div>\n ) : null}\n <div className={classes.mainContent}>\n {summaryCards.length > 0 ? (\n <div className={classes.summaryArea}>\n <HorizontalScrollGrid scrollStep={400} scrollSpeed={100}>\n {summaryCards.map((card, index) => (\n <div\n key={card.element.key ?? index}\n className={classes.summaryCard}\n >\n {card.element}\n </div>\n ))}\n </HorizontalScrollGrid>\n </div>\n ) : null}\n {contentCards.length > 0 ? (\n <div className={classes.contentArea}>\n {contentCards.map((card, index) => (\n <Fragment key={card.element.key ?? index}>\n {card.element}\n </Fragment>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n </>\n );\n}\n"],"names":["Fragment"],"mappings":";;;;;;;;;AAmCA,IAAI,uBAAA,GAA0B,KAAA;AAE9B,MAAM,SAAA,GAAY,WAGhB,CAAA,KAAA,MAAU;AAAA,EACV,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,MAAA;AAAA,IACT,QAAA,EAAU,eAAA;AAAA,IACV,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,GACtB;AAAA,EACA,WAAA,EAAa;AAAA,IACX,OAAA,EAAS,MAAA;AAAA,IACT,aAAA,EAAe,QAAA;AAAA,IACf,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,IACpB,YAAA,EAAc,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC7B,SAAA,EAAW;AAAA,MACT,YAAA,EAAc,CAAA;AAAA,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,OAAA,EAAA,EADO,IAAA,CAAK,QAAQ,GAAA,IAAO,KAEnC,CACD,CAAA,EACH,CAAA,GACE;AAAA,OAAA,EACN;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultEntityContentLayout.esm.js","sources":["../../src/alpha/DefaultEntityContentLayout.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { Fragment } from 'react';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { EntityContentLayoutProps } from '@backstage/plugin-catalog-react/alpha';\nimport { EntitySwitch } from '../components/EntitySwitch';\nimport {\n EntityOrphanWarning,\n isOrphan,\n} from '../components/EntityOrphanWarning';\nimport {\n EntityRelationWarning,\n hasRelationWarnings,\n} from '../components/EntityRelationWarning';\nimport {\n EntityProcessingErrorsPanel,\n hasCatalogProcessingErrors,\n} from '../components/EntityProcessingErrorsPanel';\nimport { HorizontalScrollGrid } from '@backstage/core-components';\n\n// Module-level flag to ensure deprecation warning is only logged once\nlet hasLoggedSummaryWarning = false;\n\nconst useStyles = makeStyles<\n Theme,\n { infoCards: boolean; summaryCards: boolean; contentCards: boolean }\n>(theme => ({\n root: {\n display: 'flex',\n flexFlow: 'column nowrap',\n gap: theme.spacing(3),\n },\n warningArea: {\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n marginBottom: theme.spacing(3),\n '&:empty': {\n marginBottom: 0,\n display: 'none',\n },\n },\n mainContent: {\n display: 'flex',\n flexFlow: 'column',\n gap: theme.spacing(3),\n alignItems: 'stretch',\n minWidth: 0,\n },\n infoArea: {\n display: 'flex',\n flexFlow: 'column nowrap',\n alignItems: 'stretch',\n gap: theme.spacing(3),\n minWidth: 0,\n '& > *': {\n flexShrink: 0,\n flexGrow: 0,\n },\n },\n summaryArea: {\n minWidth: 0,\n margin: theme.spacing(1), // To counteract MUI negative grid margin\n },\n summaryCard: {\n flex: '0 0 auto',\n width: '100%',\n '& + &': {\n marginLeft: theme.spacing(3),\n },\n },\n contentArea: {\n display: 'flex',\n flexFlow: 'column',\n gap: theme.spacing(3),\n alignItems: 'stretch',\n minWidth: 0,\n },\n [theme.breakpoints.up('md')]: {\n root: {\n display: 'grid',\n gap: theme.spacing(3),\n gridTemplateAreas: ({ summaryCards }) => `\n \"${summaryCards ? 'summary' : 'content'} info\"\n \"content info\"\n `,\n gridTemplateColumns: ({ infoCards }) => (infoCards ? '2fr 1fr' : '1fr'),\n alignItems: 'start',\n },\n mainContent: {\n display: 'contents',\n },\n contentArea: {\n gridArea: 'content',\n },\n summaryArea: {\n gridArea: 'summary',\n margin: theme.spacing(1), // To counteract MUI negative grid margin\n },\n infoArea: {\n gridArea: 'info',\n position: 'sticky',\n top: theme.spacing(3),\n // this is a little unfortunate, but it's required to make the info cards scrollable\n // in a fixed container of the full height when it's stuck.\n // 100% doesn't work as that's the height of the entire layout, which is what powers the card scrolling.\n maxHeight: '100vh',\n overflowY: 'auto',\n alignSelf: 'start',\n alignItems: 'stretch',\n // Hide the scrollbar for the inner info cards\n // kind of an accessibility nightmare, but we see.\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n '&::-webkit-scrollbar': {\n display: 'none',\n },\n },\n summaryCard: {\n width: 'auto',\n },\n },\n}));\n\nexport function DefaultEntityContentLayout(props: EntityContentLayoutProps) {\n const { cards } = props;\n\n const infoCards = cards.filter(card => card.type === 'info');\n // Keep support for 'summary' type at runtime for backward compatibility\n // even though it's been removed from the type system\n const summaryCards = cards.filter(card => card.type === ('summary' as any));\n const contentCards = cards.filter(\n card => !card.type || card.type === 'content',\n );\n\n if (summaryCards.length > 0 && !hasLoggedSummaryWarning) {\n hasLoggedSummaryWarning = true;\n // eslint-disable-next-line no-console\n console.warn(\n \"The 'summary' entity card type has been removed. Please update your cards to use 'content' or 'info' types instead.\",\n );\n }\n\n const classes = useStyles({\n infoCards: !!infoCards.length,\n summaryCards: !!summaryCards.length,\n contentCards: !!contentCards.length,\n });\n\n return (\n <>\n <div className={classes.warningArea}>\n <EntitySwitch>\n <EntitySwitch.Case if={isOrphan}>\n <EntityOrphanWarning />\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasRelationWarnings}>\n <EntityRelationWarning />\n </EntitySwitch.Case>\n </EntitySwitch>\n\n <EntitySwitch>\n <EntitySwitch.Case if={hasCatalogProcessingErrors}>\n <EntityProcessingErrorsPanel />\n </EntitySwitch.Case>\n </EntitySwitch>\n </div>\n <div className={classes.root}>\n {infoCards.length > 0 ? (\n <div className={classes.infoArea}>\n {infoCards.map((card, index) => (\n <Fragment key={card.element.key ?? index}>\n {card.element}\n </Fragment>\n ))}\n </div>\n ) : null}\n <div className={classes.mainContent}>\n {summaryCards.length > 0 ? (\n <div className={classes.summaryArea}>\n <HorizontalScrollGrid scrollStep={400} scrollSpeed={100}>\n {summaryCards.map((card, index) => (\n <div\n key={card.element.key ?? index}\n className={classes.summaryCard}\n >\n {card.element}\n </div>\n ))}\n </HorizontalScrollGrid>\n </div>\n ) : null}\n {contentCards.length > 0 ? (\n <div className={classes.contentArea}>\n {contentCards.map((card, index) => (\n <Fragment key={card.element.key ?? index}>\n {card.element}\n </Fragment>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n </>\n );\n}\n"],"names":["Fragment"],"mappings":";;;;;;;;;AAmCA,IAAI,uBAAA,GAA0B,KAAA;AAE9B,MAAM,SAAA,GAAY,WAGhB,CAAA,KAAA,MAAU;AAAA,EACV,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,MAAA;AAA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AAA,EAAA,IAAA,CAAK;AAAA,WAAA;AAAA,UAHD,IAAA,CAAK,QAAQ,GAAA,IAAO;AAAA,SAK5B,CAAA,EACH,CAAA,EACF,CAAA,GACE,IAAA;AAAA,QACH,YAAA,CAAa,MAAA,GAAS,CAAA,mBACrB,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,OAAA,CAAQ,WAAA,EACrB,QAAA,EAAA,YAAA,CAAa,GAAA,CAAI,CAAC,IAAA,EAAM,0BACvB,GAAA,CAACA,UAAAA,EAAA,EACE,QAAA,EAAA,IAAA,CAAK,OAAA,EAAA,EADO,IAAA,CAAK,QAAQ,GAAA,IAAO,KAEnC,CACD,CAAA,EACH,CAAA,GACE;AAAA,OAAA,EACN;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { ApiBlueprint } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n DefaultEntityPresentationApi,\n DefaultStarredEntitiesApi,\n} from '../apis';\n\nexport const catalogApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n});\n\nexport const catalogStarredEntitiesApi = ApiBlueprint.make({\n name: 'starred-entities',\n params: defineParams =>\n defineParams({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n});\n\nexport const entityPresentationApi = ApiBlueprint.make({\n name: 'entity-presentation',\n params: defineParams =>\n defineParams({\n api: entityPresentationApiRef,\n deps: { catalogApiImp: catalogApiRef },\n factory: ({ catalogApiImp }) =>\n DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),\n }),\n});\n\nexport default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];\n"],"names":[],"mappings":";;;;;;;AAiCO,MAAM,UAAA,GAAa,aAAa,IAAA,CAAK;AAAA,EAC1C,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,aAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,QAAA,EAAS,KACjC,IAAI,aAAA,CAAc,EAAE,YAAA,EAAc,QAAA,EAAU;AAAA,GAC/C;AACL,CAAC;AAEM,MAAM,yBAAA,GAA4B,aAAa,IAAA,CAAK;AAAA,EACzD,IAAA,EAAM,kBAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,qBAAA;AAAA,IACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAA,EAAc;AAAA,IAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY;AAAA,GAC/C;AACL,CAAC;AAEM,MAAM,qBAAA,GAAwB,aAAa,IAAA,CAAK;AAAA,EACrD,IAAA,EAAM,qBAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,wBAAA;AAAA,IACL,IAAA,EAAM,EAAE,aAAA,EAAe,aAAA,EAAc;AAAA,IACrC,OAAA,EAAS,CAAC,EAAE,aAAA,EAAc,KACxB,6BAA6B,MAAA,CAAO,EAAE,UAAA,EAAY,aAAA,EAAe;AAAA,GACpE;AACL,CAAC;AAED,WAAe,CAAC,UAAA,EAAY,yBAAA,EAA2B,qBAAqB,CAAA;;;;"}
1
+ {"version":3,"file":"apis.esm.js","sources":["../../src/alpha/apis.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { ApiBlueprint } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n DefaultEntityPresentationApi,\n DefaultStarredEntitiesApi,\n} from '../apis';\n\nexport const catalogApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n});\n\nexport const catalogStarredEntitiesApi = ApiBlueprint.make({\n name: 'starred-entities',\n params: defineParams =>\n defineParams({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n});\n\nexport const entityPresentationApi = ApiBlueprint.make({\n name: 'entity-presentation',\n params: defineParams =>\n defineParams({\n api: entityPresentationApiRef,\n deps: { catalogApiImp: catalogApiRef },\n factory: ({ catalogApiImp }) =>\n DefaultEntityPresentationApi.create({ catalogApi: catalogApiImp }),\n }),\n});\n\nexport default [catalogApi, catalogStarredEntitiesApi, entityPresentationApi];\n"],"names":[],"mappings":";;;;;;;AAiCO,MAAM,UAAA,GAAa,aAAa,IAAA,CAAK;AAAA,EAC1C,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,aAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,QAAA,EAAS,KACjC,IAAI,aAAA,CAAc,EAAE,YAAA,EAAc,QAAA,EAAU;AAAA,GAC/C;AACL,CAAC;AAEM,MAAM,yBAAA,GAA4B,aAAa,IAAA,CAAK;AAAA,EACzD,IAAA,EAAM,kBAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,qBAAA;AAAA,IACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAA,EAAc;AAAA,IAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY;AAAA,GAC/C;AACL,CAAC;AAEM,MAAM,qBAAA,GAAwB,aAAa,IAAA,CAAK;AAAA,EACrD,IAAA,EAAM,qBAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,wBAAA;AAAA,IACL,IAAA,EAAM,EAAE,aAAA,EAAe,aAAA,EAAc;AAAA,IACrC,OAAA,EAAS,CAAC,EAAE,aAAA,EAAc,KACxB,6BAA6B,MAAA,CAAO,EAAE,UAAA,EAAY,aAAA,EAAe;AAAA,GACpE;AACL,CAAC;AAED,WAAe,CAAC,UAAA,EAAY,yBAAA,EAA2B,qBAAqB,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogEntityPage.esm.js","sources":["../../../src/alpha/components/CatalogEntityPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType, ReactElement } from 'react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n type EntityContentGroupDefinitions,\n type EntityHeaderLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { useEntityFromUrl } from '../../components/CatalogEntityPage/useEntityFromUrl';\nimport { EntityLayout } from './EntityLayout';\nimport { EntityLayoutBui } from './EntityLayout/EntityLayoutBui';\nimport type { EntityLayoutRoute } from './EntityLayout/entityLayoutRoutes';\nimport type { EntityContextMenuItemDataWithNode } from './EntityContextMenu';\n\nexport interface CatalogEntityPageProps {\n menuItems: Array<\n EntityContextMenuItemDataWithNode & { filter: (entity: Entity) => boolean }\n >;\n headerLayouts: Array<{\n Component: ComponentType<EntityHeaderLayoutProps>;\n filter: (entity: Entity) => boolean;\n }>;\n headers: Array<{\n element?: ReactElement;\n filter: (entity: Entity) => boolean;\n }>;\n routes: EntityLayoutRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n showNavItemIcons: boolean;\n}\n\nexport function CatalogEntityPage(props: CatalogEntityPageProps) {\n const routeParams = useRouteRefParams(entityRouteRef);\n const entityFromUrl = useEntityFromUrl();\n const matchesRoute =\n !!entityFromUrl.entity &&\n stringifyEntityRef(entityFromUrl.entity) ===\n stringifyEntityRef(routeParams);\n const entity = matchesRoute ? entityFromUrl.entity : undefined;\n const entityProviderProps = {\n ...entityFromUrl,\n entity,\n loading: entityFromUrl.loading || (!!entityFromUrl.entity && !matchesRoute),\n };\n const filteredMenuItems = entity\n ? props.menuItems\n .filter(item => item.filter(entity))\n .map(({ data, node }) => ({ data, node }))\n : [];\n\n const HeaderComponent = entity\n ? props.headerLayouts.find(layout => layout.filter(entity))?.Component\n : undefined;\n const legacyHeader = entity\n ? props.headers.find(header => header.filter(entity))?.element\n : undefined;\n\n const layout =\n HeaderComponent || !legacyHeader ? (\n <EntityLayoutBui\n routes={props.routes}\n HeaderComponent={HeaderComponent}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n />\n ) : (\n <EntityLayout\n routes={props.routes}\n header={legacyHeader}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n showNavItemIcons={props.showNavItemIcons}\n />\n );\n\n return (\n <AsyncEntityProvider {...entityProviderProps}>{layout}</AsyncEntityProvider>\n );\n}\n"],"names":["layout"],"mappings":";;;;;;;;AAmDO,SAAS,kBAAkB,KAAA,EAA+B;AAC/D,EAAA,MAAM,WAAA,GAAc,kBAAkB,cAAc,CAAA;AACpD,EAAA,MAAM,gBAAgB,gBAAA,EAAiB;AACvC,EAAA,MAAM,YAAA,GACJ,CAAC,CAAC,aAAA,CAAc,MAAA,IAChB,mBAAmB,aAAA,CAAc,MAAM,CAAA,KACrC,kBAAA,CAAmB,WAAW,CAAA;AAClC,EAAA,MAAM,MAAA,GAAS,YAAA,GAAe,aAAA,CAAc,MAAA,GAAS,MAAA;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MAC3B,kBAAkB,KAAA,CAAM;AAAA;AAAA,GAC1B;AAGJ,EAAA,uBACE,GAAA,CAAC,mBAAA,EAAA,EAAqB,GAAG,mBAAA,EAAsB,QAAA,EAAA,MAAA,EAAO,CAAA;AAE1D;;;;"}
1
+ {"version":3,"file":"CatalogEntityPage.esm.js","sources":["../../../src/alpha/components/CatalogEntityPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType, ReactElement } from 'react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n type EntityContentGroupDefinitions,\n type EntityHeaderLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { useEntityFromUrl } from '../../components/CatalogEntityPage/useEntityFromUrl';\nimport { EntityLayout } from './EntityLayout';\nimport { EntityLayoutBui } from './EntityLayout/EntityLayoutBui';\nimport type { EntityLayoutRoute } from './EntityLayout/entityLayoutRoutes';\nimport type { EntityContextMenuItemDataWithNode } from './EntityContextMenu';\n\nexport interface CatalogEntityPageProps {\n menuItems: Array<\n EntityContextMenuItemDataWithNode & { filter: (entity: Entity) => boolean }\n >;\n headerLayouts: Array<{\n Component: ComponentType<EntityHeaderLayoutProps>;\n filter: (entity: Entity) => boolean;\n }>;\n headers: Array<{\n element?: ReactElement;\n filter: (entity: Entity) => boolean;\n }>;\n routes: EntityLayoutRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n showNavItemIcons: boolean;\n}\n\nexport function CatalogEntityPage(props: CatalogEntityPageProps) {\n const routeParams = useRouteRefParams(entityRouteRef);\n const entityFromUrl = useEntityFromUrl();\n const matchesRoute =\n !!entityFromUrl.entity &&\n stringifyEntityRef(entityFromUrl.entity) ===\n stringifyEntityRef(routeParams);\n const entity = matchesRoute ? entityFromUrl.entity : undefined;\n const entityProviderProps = {\n ...entityFromUrl,\n entity,\n loading: entityFromUrl.loading || (!!entityFromUrl.entity && !matchesRoute),\n };\n const filteredMenuItems = entity\n ? props.menuItems\n .filter(item => item.filter(entity))\n .map(({ data, node }) => ({ data, node }))\n : [];\n\n const HeaderComponent = entity\n ? props.headerLayouts.find(layout => layout.filter(entity))?.Component\n : undefined;\n const legacyHeader = entity\n ? props.headers.find(header => header.filter(entity))?.element\n : undefined;\n\n const layout =\n HeaderComponent || !legacyHeader ? (\n <EntityLayoutBui\n routes={props.routes}\n HeaderComponent={HeaderComponent}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n />\n ) : (\n <EntityLayout\n routes={props.routes}\n header={legacyHeader}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n showNavItemIcons={props.showNavItemIcons}\n />\n );\n\n return (\n <AsyncEntityProvider {...entityProviderProps}>{layout}</AsyncEntityProvider>\n );\n}\n"],"names":["layout"],"mappings":";;;;;;;;AAmDO,SAAS,kBAAkB,KAAA,EAA+B;AAC/D,EAAA,MAAM,WAAA,GAAc,kBAAkB,cAAc,CAAA;AACpD,EAAA,MAAM,gBAAgB,gBAAA,EAAiB;AACvC,EAAA,MAAM,YAAA,GACJ,CAAC,CAAC,aAAA,CAAc,MAAA,IAChB,mBAAmB,aAAA,CAAc,MAAM,CAAA,KACrC,kBAAA,CAAmB,WAAW,CAAA;AAClC,EAAA,MAAM,MAAA,GAAS,YAAA,GAAe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AAqB,KAAA,CAAM,mBAAA;AAAA,MAC3B,kBAAkB,KAAA,CAAM;AAAA;AAAA,GAC1B;AAGJ,EAAA,uBACE,GAAA,CAAC,mBAAA,EAAA,EAAqB,GAAG,mBAAA,EAAsB,QAAA,EAAA,MAAA,EAAO,CAAA;AAE1D;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogOverviewPage.esm.js","sources":["../../../src/alpha/components/CatalogOverviewPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType, lazy as reactLazy, ReactElement } from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n type AppNode,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n type EntityCardType,\n type EntityContentLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst LazyDefaultLayoutComponent = reactLazy(() =>\n import('../DefaultEntityContentLayout').then(m => ({\n default: m.DefaultEntityContentLayout,\n })),\n);\n\nexport interface CatalogOverviewPageProps {\n node: AppNode;\n layouts: Array<{\n filter: (entity: Entity) => boolean;\n Component: ComponentType<EntityContentLayoutProps>;\n }>;\n cards: Array<{\n element: ReactElement;\n type?: EntityCardType;\n filter: (entity: Entity) => boolean;\n }>;\n}\n\nexport function CatalogOverviewPage(props: CatalogOverviewPageProps) {\n const { entity } = useEntity();\n const layout = props.layouts.find(item => item.filter(entity));\n const cards = props.cards.filter(card => card.filter(entity));\n\n if (layout) {\n return <layout.Component cards={cards} />;\n }\n\n return (\n <ExtensionBoundary node={props.node}>\n <LazyDefaultLayoutComponent cards={cards} />\n </ExtensionBoundary>\n );\n}\n"],"names":["reactLazy"],"mappings":";;;;;AA4BA,MAAM,0BAAA,GAA6BA,IAAA;AAAA,EAAU,MAC3C,OAAO,sCAA+B,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACjD,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AAeO,SAAS,oBAAoB,KAAA,EAAiC;AACnE,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,CAAK,UAAQ,IAAA,CAAK,MAAA,CAAO,MAAM,CAAC,CAAA;AAC7D,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,MAAA,CAAO,UAAQ,IAAA,CAAK,MAAA,CAAO,MAAM,CAAC,CAAA;AAE5D,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,uBAAO,GAAA,CAAC,MAAA,CAAO,SAAA,EAAP,EAAiB,KAAA,EAAc,CAAA;AAAA,EACzC;AAEA,EAAA,uBACE,GAAA,CAAC,qBAAkB,IAAA,EAAM,KAAA,CAAM,MAC7B,QAAA,kBAAA,GAAA,CAAC,0BAAA,EAAA,EAA2B,OAAc,CAAA,EAC5C,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"CatalogOverviewPage.esm.js","sources":["../../../src/alpha/components/CatalogOverviewPage.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType, lazy as reactLazy, ReactElement } from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n type AppNode,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n type EntityCardType,\n type EntityContentLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst LazyDefaultLayoutComponent = reactLazy(() =>\n import('../DefaultEntityContentLayout').then(m => ({\n default: m.DefaultEntityContentLayout,\n })),\n);\n\nexport interface CatalogOverviewPageProps {\n node: AppNode;\n layouts: Array<{\n filter: (entity: Entity) => boolean;\n Component: ComponentType<EntityContentLayoutProps>;\n }>;\n cards: Array<{\n element: ReactElement;\n type?: EntityCardType;\n filter: (entity: Entity) => boolean;\n }>;\n}\n\nexport function CatalogOverviewPage(props: CatalogOverviewPageProps) {\n const { entity } = useEntity();\n const layout = props.layouts.find(item => item.filter(entity));\n const cards = props.cards.filter(card => card.filter(entity));\n\n if (layout) {\n return <layout.Component cards={cards} />;\n }\n\n return (\n <ExtensionBoundary node={props.node}>\n <LazyDefaultLayoutComponent cards={cards} />\n </ExtensionBoundary>\n );\n}\n"],"names":["reactLazy"],"mappings":";;;;;AA4BA,MAAM,0BAAA,GAA6BA,IAAA;AAAA,EAAU,MAC3C,OAAO,sCAA+B,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACjD,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AAeO,SAAS,oBAAoB,KAAA,EAAiC;AACnE,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,CAAK,UAAQ,IAAA,CAAK,MAAA,CAAO,MAAM,CAAC,CAAA;AAC7D,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,MAAA,CAAO,UAAQ,IAAA,CAAK,MAAA,CAAO,MAAM,CAAC,CAAA;AAE5D,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,uBAAO,GAAA,CAAC,MAAA,CAAO,SAAA,EAAP,EAAiB,KAAA,EAAc,CAAA;AAAA,EACzC;AAEA,EAAA,uBACE,GAAA,CAAC,qBAAkB,IAAA,EAAM,KAAA,CAAM,MAC7B,QAAA,kBAAA,GAAA,CAAC,0BAAA,EAAA,EAA2B,OAAc,CAAA,EAC5C,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityContextMenu.esm.js","sources":["../../../../src/alpha/components/EntityContextMenu/EntityContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 type AppNode,\n ExtensionBoundary,\n IconComponent,\n useTranslationRef,\n} from '@backstage/frontend-plugin-api';\nimport type { EntityContextMenuItemData } from '@backstage/plugin-catalog-react/alpha';\nimport {\n ButtonIcon,\n Menu,\n MenuItem,\n MenuSeparator,\n MenuTrigger,\n} from '@backstage/ui';\nimport { RiMore2Line } from '@remixicon/react';\nimport { catalogTranslationRef } from '../../translation';\n\nexport type EntityContextMenuItemDataWithNode = {\n data: EntityContextMenuItemData;\n node: AppNode;\n};\n\nfunction EntityContextMenuItemContent(props: {\n data: EntityContextMenuItemData;\n}) {\n const { icon, useProps } = props.data;\n const { title, disabled, onClick, ...menuItemProps } = useProps();\n const onAction = onClick\n ? () => {\n const result = onClick();\n if (result) {\n // Prevent rejected async actions from becoming unhandled rejections.\n void result.catch(() => {});\n }\n }\n : undefined;\n\n if ('href' in menuItemProps) {\n return (\n <MenuItem\n iconStart={icon}\n href={menuItemProps.href}\n onAction={onAction}\n isDisabled={disabled}\n >\n {title}\n </MenuItem>\n );\n }\n\n return (\n <MenuItem iconStart={icon} onAction={onAction} isDisabled={disabled}>\n {title}\n </MenuItem>\n );\n}\n\nfunction EntityContextMenuItem(props: {\n item: EntityContextMenuItemDataWithNode;\n}) {\n return (\n <ExtensionBoundary node={props.item.node} errorPresentation=\"error-api\">\n <EntityContextMenuItemContent data={props.item.data} />\n </ExtensionBoundary>\n );\n}\n\n/** @alpha */\nexport function EntityContextMenu(props: {\n UNSTABLE_extraContextMenuItems?: {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n }[];\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { UNSTABLE_extraContextMenuItems, contextMenuItems } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <MenuTrigger>\n <ButtonIcon\n variant=\"secondary\"\n icon={<RiMore2Line />}\n aria-label={t('entityContextMenu.moreButtonAriaLabel')}\n />\n <Menu placement=\"bottom end\">\n {UNSTABLE_extraContextMenuItems?.map((item, index) => (\n <MenuItem\n key={`${item.title}-${index}`}\n iconStart={<item.Icon />}\n onAction={() => item.onClick()}\n >\n {item.title}\n </MenuItem>\n ))}\n {UNSTABLE_extraContextMenuItems?.length && contextMenuItems?.length ? (\n <MenuSeparator />\n ) : null}\n {contextMenuItems?.map(item => (\n <EntityContextMenuItem key={item.node.spec.id} item={item} />\n ))}\n </Menu>\n </MenuTrigger>\n );\n}\n"],"names":[],"mappings":";;;;;;AAsCA,SAAS,6BAA6B,KAAA,EAEnC;AACD,EAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAS,GAAI,KAAA,CAAM,IAAA;AACjC,EAAA,MAAM,EAAE,KAAA,EAAO,QAAA,EAAU,SAAS,GAAG,aAAA,KAAkB,QAAA,EAAS;AAChE,EAAA,MAAM,QAAA,GAAW,UACb,MAAM;AACJ,IAAA,MAAM,SAAS,OAAA,EAAQ;AACvB,IAAA,IAAI,MAAA,EAAQ;AAEV,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AA,8BAAA,EAAgC,GAAA,CAAI,CAAC,IAAA,EAAM,KAAA,qBAC1C,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UAEC,SAAA,kBAAW,GAAA,CAAC,IAAA,CAAK,IAAA,EAAL,EAAU,CAAA;AAAA,UACtB,QAAA,EAAU,MAAM,IAAA,CAAK,OAAA,EAAQ;AAAA,UAE5B,QAAA,EAAA,IAAA,CAAK;AAAA,SAAA;AAAA,QAJD,CAAA,EAAG,IAAA,CAAK,KAAK,CAAA,CAAA,EAAI,KAAK,CAAA;AAAA,OAM9B,CAAA;AAAA,MACA,gCAAgC,MAAA,IAAU,gBAAA,EAAkB,MAAA,mBAC3D,GAAA,CAAC,iBAAc,CAAA,GACb,IAAA;AAAA,MACH,gBAAA,EAAkB,GAAA,CAAI,CAAA,IAAA,qBACrB,GAAA,CAAC,qBAAA,EAAA,EAA8C,QAAnB,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,EAAgB,CAC5D;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityContextMenu.esm.js","sources":["../../../../src/alpha/components/EntityContextMenu/EntityContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 type AppNode,\n ExtensionBoundary,\n IconComponent,\n useTranslationRef,\n} from '@backstage/frontend-plugin-api';\nimport type { EntityContextMenuItemData } from '@backstage/plugin-catalog-react/alpha';\nimport {\n ButtonIcon,\n Menu,\n MenuItem,\n MenuSeparator,\n MenuTrigger,\n} from '@backstage/ui';\nimport { RiMore2Line } from '@remixicon/react';\nimport { catalogTranslationRef } from '../../translation';\n\nexport type EntityContextMenuItemDataWithNode = {\n data: EntityContextMenuItemData;\n node: AppNode;\n};\n\nfunction EntityContextMenuItemContent(props: {\n data: EntityContextMenuItemData;\n}) {\n const { icon, useProps } = props.data;\n const { title, disabled, onClick, ...menuItemProps } = useProps();\n const onAction = onClick\n ? () => {\n const result = onClick();\n if (result) {\n // Prevent rejected async actions from becoming unhandled rejections.\n void result.catch(() => {});\n }\n }\n : undefined;\n\n if ('href' in menuItemProps) {\n return (\n <MenuItem\n iconStart={icon}\n href={menuItemProps.href}\n onAction={onAction}\n isDisabled={disabled}\n >\n {title}\n </MenuItem>\n );\n }\n\n return (\n <MenuItem iconStart={icon} onAction={onAction} isDisabled={disabled}>\n {title}\n </MenuItem>\n );\n}\n\nfunction EntityContextMenuItem(props: {\n item: EntityContextMenuItemDataWithNode;\n}) {\n return (\n <ExtensionBoundary node={props.item.node} errorPresentation=\"error-api\">\n <EntityContextMenuItemContent data={props.item.data} />\n </ExtensionBoundary>\n );\n}\n\n/** @alpha */\nexport function EntityContextMenu(props: {\n UNSTABLE_extraContextMenuItems?: {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n }[];\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { UNSTABLE_extraContextMenuItems, contextMenuItems } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <MenuTrigger>\n <ButtonIcon\n variant=\"secondary\"\n icon={<RiMore2Line />}\n aria-label={t('entityContextMenu.moreButtonAriaLabel')}\n />\n <Menu placement=\"bottom end\">\n {UNSTABLE_extraContextMenuItems?.map((item, index) => (\n <MenuItem\n key={`${item.title}-${index}`}\n iconStart={<item.Icon />}\n onAction={() => item.onClick()}\n >\n {item.title}\n </MenuItem>\n ))}\n {UNSTABLE_extraContextMenuItems?.length && contextMenuItems?.length ? (\n <MenuSeparator />\n ) : null}\n {contextMenuItems?.map(item => (\n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AI,KAAA;AAC7D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AAErD,EAAA,4BACG,WAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,WAAA;AAAA,QACR,IAAA,sBAAO,WAAA,EAAA,EAAY,CAAA;AAAA,QACnB,YAAA,EAAY,EAAE,uCAAuC;AAAA;AAAA,KACvD;AAAA,oBACA,IAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,YAAA,EACb,QAAA,EAAA;AAAA,MAAA,8BAAA,EAAgC,GAAA,CAAI,CAAC,IAAA,EAAM,KAAA,qBAC1C,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UAEC,SAAA,kBAAW,GAAA,CAAC,IAAA,CAAK,IAAA,EAAL,EAAU,CAAA;AAAA,UACtB,QAAA,EAAU,MAAM,IAAA,CAAK,OAAA,EAAQ;AAAA,UAE5B,QAAA,EAAA,IAAA,CAAK;AAAA,SAAA;AAAA,QAJD,CAAA,EAAG,IAAA,CAAK,KAAK,CAAA,CAAA,EAAI,KAAK,CAAA;AAAA,OAM9B,CAAA;AAAA,MACA,gCAAgC,MAAA,IAAU,gBAAA,EAAkB,MAAA,mBAC3D,GAAA,CAAC,iBAAc,CAAA,GACb,IAAA;AAAA,MACH,gBAAA,EAAkB,GAAA,CAAI,CAAA,IAAA,qBACrB,GAAA,CAAC,qBAAA,EAAA,EAA8C,QAAnB,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,EAAgB,CAC5D;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;"}
@@ -18,10 +18,10 @@ function headerProps(paramKind, paramNamespace, paramName, entity) {
18
18
  return {
19
19
  headerTitle: `${name}${namespace && namespace !== DEFAULT_NAMESPACE ? ` in ${namespace}` : ""}`,
20
20
  headerType: (() => {
21
- let t = kind.toLocaleLowerCase("en-US");
21
+ let t = kind.toLowerCase();
22
22
  if (entity && entity.spec && "type" in entity.spec) {
23
23
  t += " \u2014 ";
24
- t += entity.spec.type.toLocaleLowerCase("en-US");
24
+ t += entity.spec.type.toLowerCase();
25
25
  }
26
26
  return t;
27
27
  })()
@@ -1 +1 @@
1
- {"version":3,"file":"EntityHeader.esm.js","sources":["../../../../src/alpha/components/EntityHeader/EntityHeader.tsx"],"sourcesContent":["/*\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 { useCallback, ComponentProps, ReactNode } from 'react';\nimport { 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 { useApi, useRouteRefParams } 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 EntityDisplayName,\n FavoriteEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { EntityLabels } from '../EntityLabels';\nimport {\n EntityContextMenu,\n type EntityContextMenuItemDataWithNode,\n} from '../EntityContextMenu';\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 contextMenuItems?: EntityContextMenuItemDataWithNode[];\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 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 [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 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 contextMenuItems={contextMenuItems}\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 </>\n )}\n </Header>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiDA,SAAS,WAAA,CACP,SAAA,EACA,cAAA,EACA,SAAA,EACA,MAAA,EAC6C;AAC7C,EAAA,MAAM,IAAA,GAAO,SAAA,IAAa,MAAA,EAAQ,IAAA,IAAQ,EAAA;AAC1C,EAAA,MAAM,SAAA,GAAY,cAAA,IAAkB,MAAA,EAAQ,QAAA,CAAS,SAAA,IAAa,EAAA;AAClE,EAAA,MAAM,OACJ,MAAA,EAAQ,QAAA,CAAS,SAAS,SAAA,IAAa,MAAA,EAAQ,SAAS,IAAA,IAAQ,EAAA;AAElE,EAAA,OAAO;AAAA,IACL,WAAA,EAAa,CAAA,EAAG,IAAI,CAAA,EAClB,SAAA,IAAa,cAAc,iBAAA,GAAoB,CAAA,IAAA,EAAO,SAAS,CAAA,CAAA,GAAK,EACtE,CAAA,CAAA;AAAA,IACA,aAAa,MAAM;AACjB,MAAA,IAAI,CAAA,GAAI,IAAA,CAAK,iBAAA,CAAkB,OAAO,CAAA;AACtC,MAAA,IAAI,MAAA,IAAU,MAAA,CAAO,IAAA,IAAQ,MAAA,IAAU,OAAO,IAAA,EAAM;AAClD,QAAA,CAAA,IAAK,UAAA;AACL,QAAA,CAAA,IAAM,MAAA,CAAO,IAAA,CAA0B,IAAA,CAA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GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,kBAAA;AAAA,MACnB,IAAA;AAAA,MACA,KAAA,EAAO,KAAA,oBAAS,GAAA,CAAC,iBAAA,EAAA,EAAkB,CAAA;AAAA,MACnC,QAAA,EACE,QAAA,oBACE,GAAA,CAAC,oBAAA,EAAA,EAAqB,qBAAA,EAA8C,CAAA;AAAA,MAIvE,oCACC,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,gBAAa,MAAA,EAAgB,CAAA;AAAA,wBAC9B,GAAA;AAAA,UAAC,iBAAA;AAAA,UAAA;AAAA,YACC,8BAAA;AAAA,YACA;AAAA;AAAA,SACF;AAAA,wBACA,GAAA;AAAA,UAAC,mBAAA;AAAA,UAAA;AAAA,YACC,MAAA;AAAA,YACA,YACG,8BAAA,IAEmB,MAAA;AAAA,YAEtB,IAAA,EAAM,iBAAA;AAAA,YACN,OAAA,EAAS,wBAAA;AAAA,YACT,QAAA,EAAU;AAAA;AAAA;AACZ,OAAA,EACF;AAAA;AAAA,GAEJ;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityHeader.esm.js","sources":["../../../../src/alpha/components/EntityHeader/EntityHeader.tsx"],"sourcesContent":["/*\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 { useCallback, ComponentProps, ReactNode } from 'react';\nimport { 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 { useApi, useRouteRefParams } 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 EntityDisplayName,\n FavoriteEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { EntityLabels } from '../EntityLabels';\nimport {\n EntityContextMenu,\n type EntityContextMenuItemDataWithNode,\n} from '../EntityContextMenu';\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.toLowerCase();\n if (entity && entity.spec && 'type' in entity.spec) {\n t += ' — ';\n t += (entity.spec as { type: string }).type.toLowerCase();\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 contextMenuItems?: EntityContextMenuItemDataWithNode[];\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 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 [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 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 contextMenuItems={contextMenuItems}\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 </>\n )}\n </Header>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiDA,SAAS,WAAA,CACP,SAAA,EACA,cAAA,EACA,SAAA,EACA,MAAA,EAC6C;AAC7C,EAAA,MAAM,IAAA,GAAO,SAAA,IAAa,MAAA,EAAQ,IAAA,IAAQ,EAAA;AAC1C,EAAA,MAAM,SAAA,GAAY,cAAA,IAAkB,MAAA,EAAQ,QAAA,CAAS,SAAA,IAAa,EAAA;AAClE,EAAA,MAAM,OACJ,MAAA,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Ref(ref))) });
53
53
  }
54
54
  function hierarchyLabel(ref) {
55
- switch (ref.kind.toLocaleLowerCase("en-US")) {
55
+ switch (ref.kind.toLowerCase()) {
56
56
  case "system":
57
57
  return "systemLabel";
58
58
  case "domain":
@@ -1 +1 @@
1
- {"version":3,"file":"EntityHeaderBui.esm.js","sources":["../../../../src/alpha/components/EntityHeader/EntityHeaderBui.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { useMemo } from 'react';\nimport {\n Box,\n ButtonIcon,\n Header,\n HeaderMetadataUsers,\n Link,\n type HeaderMetadataItem,\n type HeaderMetadataUser,\n type HeaderNavTabItem,\n} from '@backstage/ui';\nimport {\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n stringifyEntityRef,\n type CompoundEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi, useRouteRefParams } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n catalogApiRef,\n catalogReactTranslationRef,\n entityRouteRef,\n getEntityRelations,\n useAsyncEntity,\n useEntityPresentation,\n useEntityRefLink,\n useStarredEntity,\n} from '@backstage/plugin-catalog-react';\nimport { RiStarFill, RiStarLine } from '@remixicon/react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogTranslationRef } from '../../translation';\nimport {\n EntityContextMenu,\n type EntityContextMenuItemDataWithNode,\n} from '../EntityContextMenu';\n\nfunction useOwnerUsers(entity: Entity | undefined): HeaderMetadataUser[] {\n const catalogApi = useApi(catalogApiRef);\n const entityLink = useEntityRefLink();\n const ownerRefs = useMemo(\n () => getEntityRelations(entity, RELATION_OWNED_BY),\n [entity],\n );\n const ownerRefStrings = useMemo(\n () => ownerRefs.map(ref => stringifyEntityRef(ref)),\n [ownerRefs],\n );\n const { value: ownerEntities } = useAsync(async () => {\n if (ownerRefStrings.length === 0) return [];\n return (\n await catalogApi.getEntitiesByRefs({\n entityRefs: ownerRefStrings,\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'metadata.title',\n 'spec.profile',\n ],\n })\n ).items;\n }, [catalogApi, ownerRefStrings]);\n\n return ownerRefs.map((ref, index) => {\n const owner = ownerEntities?.[index];\n const profile = (owner?.spec as { profile?: { picture?: string } })\n ?.profile;\n return {\n name: owner?.metadata.title ?? owner?.metadata.name ?? ref.name,\n src: profile?.picture,\n href: entityLink(ref),\n };\n });\n}\n\nfunction HierarchyLinks(props: { refs: CompoundEntityRef[] }) {\n const entityLink = useEntityRefLink();\n return (\n <Box as=\"ul\" display=\"inline\" m=\"0\" p=\"0\" style={{ listStyle: 'none' }}>\n {props.refs.map((ref, index) => (\n <Box as=\"li\" display=\"inline\" key={stringifyEntityRef(ref)}>\n {index > 0 ? ', ' : null}\n <Link href={entityLink(ref)} standalone>\n {ref.name}\n </Link>\n </Box>\n ))}\n </Box>\n );\n}\n\nfunction hierarchyLabel(\n ref: CompoundEntityRef,\n): 'systemLabel' | 'domainLabel' | 'partOfLabel' {\n switch (ref.kind.toLocaleLowerCase('en-US')) {\n case 'system':\n return 'systemLabel';\n case 'domain':\n return 'domainLabel';\n default:\n return 'partOfLabel';\n }\n}\n\nfunction useMetadata(entity: Entity | undefined): HeaderMetadataItem[] {\n const owners = useOwnerUsers(entity);\n const { t } = useTranslationRef(catalogTranslationRef);\n return useMemo(() => {\n if (!entity) return [];\n const metadata: HeaderMetadataItem[] = [];\n const lifecycle = entity.spec?.lifecycle?.toString();\n if (lifecycle) {\n metadata.push({\n label: t('entityLabels.lifecycleLabel'),\n value: lifecycle,\n });\n }\n if (owners.length > 0) {\n metadata.push({\n label: t('entityLabels.ownerLabel'),\n value: <HeaderMetadataUsers users={owners} />,\n });\n }\n\n const hierarchy = getEntityRelations(entity, RELATION_PART_OF).reduce(\n (groups, ref) => {\n const label = hierarchyLabel(ref);\n groups[label] = [...(groups[label] ?? []), ref];\n return groups;\n },\n {} as Record<string, CompoundEntityRef[]>,\n );\n for (const [label, refs] of Object.entries(hierarchy)) {\n metadata.push({\n label: t(\n `entityLabels.${label}` as\n | 'entityLabels.systemLabel'\n | 'entityLabels.domainLabel'\n | 'entityLabels.partOfLabel',\n ),\n value: <HierarchyLinks refs={refs} />,\n });\n }\n return metadata;\n }, [entity, owners, t]);\n}\n\nfunction FavoriteEntityButton(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const { isStarredEntity, toggleStarredEntity } = useStarredEntity(\n props.entity,\n );\n return (\n <ButtonIcon\n variant=\"secondary\"\n aria-label={\n isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites')\n }\n icon={isStarredEntity ? <RiStarFill /> : <RiStarLine />}\n onPress={() => toggleStarredEntity()}\n />\n );\n}\n\nexport function EntityHeaderBui(props: {\n tabs: HeaderNavTabItem[];\n activeTabId?: string;\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { entity } = useAsyncEntity();\n const routeParams = useRouteRefParams(entityRouteRef);\n const presentation = useEntityPresentation(entity ?? routeParams);\n const metadata = useMetadata(entity);\n const type = entity?.spec?.type?.toString();\n\n return (\n <Header\n title={presentation.primaryTitle}\n tags={[\n { label: entity?.kind ?? routeParams.kind },\n ...(type ? [{ label: type }] : []),\n ]}\n metadata={metadata}\n tabs={entity ? props.tabs : undefined}\n activeTabId={props.activeTabId}\n customActions={\n entity ? (\n <>\n <FavoriteEntityButton entity={entity} />\n <EntityContextMenu contextMenuItems={props.contextMenuItems} />\n </>\n ) : undefined\n }\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;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CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,wBAAqB,MAAA,EAAgB,CAAA;AAAA,wBACtC,GAAA,CAAC,iBAAA,EAAA,EAAkB,gBAAA,EAAkB,KAAA,CAAM,gBAAA,EAAkB;AAAA,OAAA,EAC/D,CAAA,GACE;AAAA;AAAA,GAER;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityHeaderBui.esm.js","sources":["../../../../src/alpha/components/EntityHeader/EntityHeaderBui.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { useMemo } from 'react';\nimport {\n Box,\n ButtonIcon,\n Header,\n HeaderMetadataUsers,\n Link,\n type HeaderMetadataItem,\n type HeaderMetadataUser,\n type HeaderNavTabItem,\n} from '@backstage/ui';\nimport {\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n stringifyEntityRef,\n type CompoundEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi, useRouteRefParams } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n catalogApiRef,\n catalogReactTranslationRef,\n entityRouteRef,\n getEntityRelations,\n useAsyncEntity,\n useEntityPresentation,\n useEntityRefLink,\n useStarredEntity,\n} from '@backstage/plugin-catalog-react';\nimport { RiStarFill, RiStarLine } from '@remixicon/react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogTranslationRef } from '../../translation';\nimport {\n EntityContextMenu,\n type EntityContextMenuItemDataWithNode,\n} from '../EntityContextMenu';\n\nfunction useOwnerUsers(entity: Entity | undefined): HeaderMetadataUser[] {\n const catalogApi = useApi(catalogApiRef);\n const entityLink = useEntityRefLink();\n const ownerRefs = useMemo(\n () => getEntityRelations(entity, RELATION_OWNED_BY),\n [entity],\n );\n const ownerRefStrings = useMemo(\n () => ownerRefs.map(ref => stringifyEntityRef(ref)),\n [ownerRefs],\n );\n const { value: ownerEntities } = useAsync(async () => {\n if (ownerRefStrings.length === 0) return [];\n return (\n await catalogApi.getEntitiesByRefs({\n entityRefs: ownerRefStrings,\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'metadata.title',\n 'spec.profile',\n ],\n })\n ).items;\n }, [catalogApi, ownerRefStrings]);\n\n return ownerRefs.map((ref, index) => {\n const owner = ownerEntities?.[index];\n const profile = (owner?.spec as { profile?: { picture?: string } })\n ?.profile;\n return {\n name: owner?.metadata.title ?? owner?.metadata.name ?? ref.name,\n src: profile?.picture,\n href: entityLink(ref),\n };\n });\n}\n\nfunction HierarchyLinks(props: { refs: CompoundEntityRef[] }) {\n const entityLink = useEntityRefLink();\n return (\n <Box as=\"ul\" display=\"inline\" m=\"0\" p=\"0\" style={{ listStyle: 'none' }}>\n {props.refs.map((ref, index) => (\n <Box as=\"li\" display=\"inline\" key={stringifyEntityRef(ref)}>\n {index > 0 ? ', ' : null}\n <Link href={entityLink(ref)} standalone>\n {ref.name}\n </Link>\n </Box>\n ))}\n </Box>\n );\n}\n\nfunction hierarchyLabel(\n ref: CompoundEntityRef,\n): 'systemLabel' | 'domainLabel' | 'partOfLabel' {\n switch (ref.kind.toLowerCase()) {\n case 'system':\n return 'systemLabel';\n case 'domain':\n return 'domainLabel';\n default:\n return 'partOfLabel';\n }\n}\n\nfunction useMetadata(entity: Entity | undefined): HeaderMetadataItem[] {\n const owners = useOwnerUsers(entity);\n const { t } = useTranslationRef(catalogTranslationRef);\n return useMemo(() => {\n if (!entity) return [];\n const metadata: HeaderMetadataItem[] = [];\n const lifecycle = entity.spec?.lifecycle?.toString();\n if (lifecycle) {\n metadata.push({\n label: t('entityLabels.lifecycleLabel'),\n value: lifecycle,\n });\n }\n if (owners.length > 0) {\n metadata.push({\n label: t('entityLabels.ownerLabel'),\n value: <HeaderMetadataUsers users={owners} />,\n });\n }\n\n const hierarchy = getEntityRelations(entity, RELATION_PART_OF).reduce(\n (groups, ref) => {\n const label = hierarchyLabel(ref);\n groups[label] = [...(groups[label] ?? []), ref];\n return groups;\n },\n {} as Record<string, CompoundEntityRef[]>,\n );\n for (const [label, refs] of Object.entries(hierarchy)) {\n metadata.push({\n label: t(\n `entityLabels.${label}` as\n | 'entityLabels.systemLabel'\n | 'entityLabels.domainLabel'\n | 'entityLabels.partOfLabel',\n ),\n value: <HierarchyLinks refs={refs} />,\n });\n }\n return metadata;\n }, [entity, owners, t]);\n}\n\nfunction FavoriteEntityButton(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const { isStarredEntity, toggleStarredEntity } = useStarredEntity(\n props.entity,\n );\n return (\n <ButtonIcon\n variant=\"secondary\"\n aria-label={\n isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites')\n }\n icon={isStarredEntity ? <RiStarFill /> : <RiStarLine />}\n onPress={() => toggleStarredEntity()}\n />\n );\n}\n\nexport function EntityHeaderBui(props: {\n tabs: HeaderNavTabItem[];\n activeTabId?: string;\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { entity } = useAsyncEntity();\n const routeParams = useRouteRefParams(entityRouteRef);\n const presentation = useEntityPresentation(entity ?? routeParams);\n const metadata = useMetadata(entity);\n const type = entity?.spec?.type?.toString();\n\n return (\n <Header\n title={presentation.primaryTitle}\n tags={[\n { label: entity?.kind ?? routeParams.kind },\n ...(type ? [{ label: type }] : []),\n ]}\n metadata={metadata}\n tabs={entity ? props.tabs : undefined}\n activeTabId={props.activeTabId}\n customActions={\n entity ? (\n <>\n <FavoriteEntityButton entity={entity} />\n <EntityContextMenu contextMenuItems={props.contextMenuIt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A,CAAM,WAAA;AAAA,MACnB,aAAA,EACE,yBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,wBAAqB,MAAA,EAAgB,CAAA;AAAA,wBACtC,GAAA,CAAC,iBAAA,EAAA,EAAkB,gBAAA,EAAkB,KAAA,CAAM,gBAAA,EAAkB;AAAA,OAAA,EAC/D,CAAA,GACE;AAAA;AAAA,GAER;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityLabels.esm.js","sources":["../../../../src/alpha/components/EntityLabels/EntityLabels.tsx"],"sourcesContent":["/*\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"],"names":[],"mappings":";;;;;;;AA6BO,SAAS,aAAa,KAAA,EAA0B;AACrD,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AACnB,EAAA,MAAM,gBAAA,GAAmB,kBAAA,CAAmB,MAAA,EAAQ,iBAAiB,CAAA;AACrE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,gBAAA,CAAiB,SAAS,CAAA,oBACzB,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,yBAAyB,CAAA;AAAA,QAClC,6BAAA,EAA8B,GAAA;AAAA,QAC9B,KAAA,kBACE,GAAA;AAAA,UAAC,cAAA;AAAA,UAAA;AAAA,YACC,UAAA,EAAY,gBAAA;AAAA,YACZ,WAAA,EAAY,OAAA;AAAA,YACZ,KAAA,EAAM;AAAA;AAAA;AACR;AAAA,KAEJ;AAAA,IAED,MAAA,CAAO,MAAM,SAAA,oBACZ,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,QACtC,KAAA,EAAO,MAAA,CAAO,IAAA,CAAK,SAAA,EAAW,QAAA;AAAS;AAAA;AACzC,GAAA,EAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityLabels.esm.js","sources":["../../../../src/alpha/components/EntityLabels/EntityLabels.tsx"],"sourcesContent":["/*\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"],"names":[],"mappings":";;;;;;;AA6BO,SAAS,aAAa,KAAA,EAA0B;AACrD,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AACnB,EAAA,MAAM,gBAAA,GAAmB,kBAAA,CAAmB,MAAA,EAAQ,iBAAiB,CAAA;AACrE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,gBAAA,CAAiB,SAAS,CAAA,oBACzB,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,yBAAyB,CAAA;AAAA,QAClC,6BAAA,EAA8B,GAAA;AAAA,QAC9B,KAAA,kBACE,GAAA;AAAA,UAAC,cAAA;AAAA,UAAA;AAAA,YACC,UAAA,EAAY,gBAAA;AAAA,YACZ,WAAA,EAAY,OAAA;AAAA,YACZ,KAAA,EAAM;AAAA;AAAA;AACR;AAAA,KAEJ;AAAA,IAED,MAAA,CAAO,MAAM,SAAA,oBACZ,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,QACtC,KAAA,EAAO,MAAA,CAAO,IAAA,CAAK,SAAA,EAAW,QAAA;AAAS;AAAA;AACzC,GAAA,EAEJ,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityLayout.esm.js","sources":["../../../../src/alpha/components/EntityLayout/EntityLayout.tsx"],"sourcesContent":["/*\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 } from 'react';\n\nimport Alert from '@material-ui/lab/Alert';\n\nimport { useRouteRefParams } 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 {\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';\nimport {\n EntityLayoutRoute,\n filterEntityLayoutRoutes,\n} from './entityLayoutRoutes';\n\ninterface EntityLayoutProps {\n UNSTABLE_extraContextMenuItems?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_extraContextMenuItems'];\n contextMenuItems?: ComponentProps<typeof EntityHeader>['contextMenuItems'];\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 routes: EntityLayoutRoute[];\n}\n\nexport function EntityLayout(props: EntityLayoutProps) {\n const {\n UNSTABLE_extraContextMenuItems,\n contextMenuItems,\n header,\n NotFoundComponent,\n parentEntityRelations,\n groupDefinitions,\n defaultContentOrder,\n showNavItemIcons,\n routes,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const visibleRoutes = filterEntityLayoutRoutes(routes, entity);\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_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n )}\n\n {loading && <Progress />}\n\n {entity && (\n <EntityTabs\n routes={visibleRoutes}\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-catal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A,EAAS,EAAE,CAAA,EAC5C,CAAA;AAAA,IAGD,CAAC,OAAA,IAAW,CAAC,KAAA,IAAS,CAAC,0BACtB,GAAA,CAAC,OAAA,EAAA,EACE,QAAA,EAAA,iBAAA,GACC,iBAAA,uBAEC,YAAA,EAAA,EAAa,KAAA,EAAO,EAAE,gCAAgC,CAAA,EACpD,YAAE,4BAAA,EAA8B;AAAA,MAC/B,IAAA;AAAA,MACA,sBACE,GAAA,CAAC,IAAA,EAAA,EAAK,IAAG,gEAAA,EACN,QAAA,EAAA,CAAA,CAAE,6BAA6B,CAAA,EAClC;AAAA,KAEH,GACH,CAAA,EAEJ;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityLayout.esm.js","sources":["../../../../src/alpha/components/EntityLayout/EntityLayout.tsx"],"sourcesContent":["/*\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 } from 'react';\n\nimport Alert from '@material-ui/lab/Alert';\n\nimport { useRouteRefParams } 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 {\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';\nimport {\n EntityLayoutRoute,\n filterEntityLayoutRoutes,\n} from './entityLayoutRoutes';\n\ninterface EntityLayoutProps {\n UNSTABLE_extraContextMenuItems?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_extraContextMenuItems'];\n contextMenuItems?: ComponentProps<typeof EntityHeader>['contextMenuItems'];\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 routes: EntityLayoutRoute[];\n}\n\nexport function EntityLayout(props: EntityLayoutProps) {\n const {\n UNSTABLE_extraContextMenuItems,\n contextMenuItems,\n header,\n NotFoundComponent,\n parentEntityRelations,\n groupDefinitions,\n defaultContentOrder,\n showNavItemIcons,\n routes,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const visibleRoutes = filterEntityLayoutRoutes(routes, entity);\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_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n )}\n\n {loading && <Progress />}\n\n {entity && (\n <EntityTabs\n routes={visibleRoutes}\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"],"names":[],"mappings":";;;;;;;;;;;AAmEO,SAAS,aAAa,KAAA,EAA0B;AACrD,EAAA,MAAM;AAAA,IACJ,8BAAA;AAAA,IACA,gBAAA;AAAA,IACA,MAAA;AAAA,IACA,iBAAA;AAAA,IACA,qBAAA;AAAA,IACA,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,iBAAA,CAAkB,cAAc,CAAA;AACjD,EAAA,MAAM,EAAE,MAAA,EAAQ,OAAA,EAAS,KAAA,KAAU,cAAA,EAAe;AAElD,EAAA,MAAM,aAAA,GAAgB,wBAAA,CAAyB,MAAA,EAAQ,MAAM,CAAA;AAE7D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AAErD,EAAA,uBACE,IAAA,CAAC,QAAK,OAAA,EAAS,MAAA,EAAQ,MAAM,IAAA,EAAM,QAAA,MAAc,MAAA,EAC9C,QAAA,EAAA;AAAA,IAAA,MAAA,oBACC,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,qBAAA;AAAA,QACA,8BAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IAGD,OAAA,wBAAY,QAAA,EAAA,EAAS,CAAA;AAAA,IAErB,MAAA,oBACC,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,MAAA,EAAQ,aAAA;AAAA,QACR,gBAAA;AAAA,QACA,mBAAA;AAAA,QACA,SAAA,EAAW;AAAA;AAAA,KACb;AAAA,IAGD,KAAA,oBACC,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAM,UAAS,OAAA,EAAS,QAAA,EAAA,KAAA,CAAM,QAAA,EAAS,EAAE,CAAA,EAC5C,CAAA;AAAA,IAGD,CAAC,OAAA,IAAW,CAAC,KAAA,IAAS,CAAC,0BACtB,GAAA,CAAC,OAAA,EAAA,EACE,QAAA,EAAA,iBAAA,GACC,iBAAA,uBAEC,YAAA,EAAA,EAAa,KAAA,EAAO,EAAE,gCAAgC,CAAA,EACpD,YAAE,4BAAA,EAA8B;AAAA,MAC/B,IAAA;AAAA,MACA,sBACE,GAAA,CAAC,IAAA,EAAA,EAAK,IAAG,gEAAA,EACN,QAAA,EAAA,CAAA,CAAE,6BAA6B,CAAA,EAClC;AAAA,KAEH,GACH,CAAA,EAEJ;AAAA,GAAA,EAEJ,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityLayoutBui.esm.js","sources":["../../../../src/alpha/components/EntityLayout/EntityLayoutBui.tsx"],"sourcesContent":["/*\n * Copyright 2026 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, ComponentType, ReactNode, useCallback } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { useSearchParams } from 'react-router-dom';\nimport { Alert, Container } from '@backstage/ui';\nimport {\n configApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { Link, Progress } from '@backstage/core-components';\nimport { NotFoundErrorPage } from '@backstage/frontend-plugin-api';\nimport {\n entityRouteRef,\n InspectEntityDialog,\n useAsyncEntity,\n useEntityPresentation,\n} from '@backstage/plugin-catalog-react';\nimport {\n type EntityContentGroupDefinitions,\n type EntityHeaderLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { catalogTranslationRef } from '../../translation';\nimport { EntityHeaderBui } from '../EntityHeader/EntityHeaderBui';\nimport { useEntityTabs } from '../EntityTabs/useEntityTabs';\nimport {\n EntityLayoutRoute,\n filterEntityLayoutRoutes,\n} from './entityLayoutRoutes';\n\nfunction EntityDocumentTitle(props: { activeContentTitle?: string }) {\n const configApi = useApi(configApiRef);\n const routeParams = useRouteRefParams(entityRouteRef);\n const { entity } = useAsyncEntity();\n const presentation = useEntityPresentation(entity ?? routeParams);\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n return (\n <>\n <Helmet\n titleTemplate={`${presentation.primaryTitle} | %s | ${appTitle}`}\n defaultTitle={`${presentation.primaryTitle} | ${appTitle}`}\n />\n {props.activeContentTitle && <Helmet title={props.activeContentTitle} />}\n </>\n );\n}\n\nfunction InspectEntityDialogHost() {\n const { entity } = useAsyncEntity();\n const [searchParams, setSearchParams] = useSearchParams();\n const selectedTab = searchParams.get('inspect');\n const setSelectedTab = useCallback(\n (tab: string) =>\n setSearchParams(params => {\n const next = new URLSearchParams(params);\n next.set('inspect', tab);\n return next;\n }),\n [setSearchParams],\n );\n const close = useCallback(\n () =>\n setSearchParams(params => {\n const next = new URLSearchParams(params);\n next.delete('inspect');\n return next;\n }),\n [setSearchParams],\n );\n if (!entity) return null;\n return (\n <InspectEntityDialog\n entity={entity}\n initialTab={\n (selectedTab as ComponentProps<\n typeof InspectEntityDialog\n >['initialTab']) || undefined\n }\n open={typeof selectedTab === 'string'}\n onClose={close}\n onSelect={setSelectedTab}\n />\n );\n}\n\nfunction EntityLayoutContent(props: {\n content?: React.JSX.Element;\n NotFoundComponent?: ReactNode;\n}) {\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n let content: ReactNode;\n if (error) {\n content = (\n <Container>\n <Alert status=\"danger\" title={error.toString()} />\n </Container>\n );\n } else if (entity) {\n content = <Container>{props.content ?? <NotFoundErrorPage />}</Container>;\n } else if (!loading) {\n content = (\n <Container>\n {props.NotFoundComponent ?? (\n <Alert\n status=\"warning\"\n title={t('entityLabels.warningPanelTitle')}\n description={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 />\n )}\n </Container>\n );\n }\n\n return (\n <>\n {loading && <Progress />}\n {content}\n </>\n );\n}\n\nexport function EntityLayoutBui(props: {\n routes: EntityLayoutRoute[];\n NotFoundComponent?: ReactNode;\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n contextMenuItems?: ComponentProps<typeof EntityHeaderBui>['contextMenuItems'];\n HeaderComponent?: ComponentType<EntityHeaderLayoutProps>;\n}) {\n const {\n routes,\n NotFoundComponent,\n groupDefinitions,\n defaultContentOrder,\n contextMenuItems,\n HeaderComponent,\n } = props;\n const { entity } = useAsyncEntity();\n const visibleRoutes = filterEntityLayoutRoutes(routes, entity);\n const tabs = useEntityTabs({\n routes: visibleRoutes,\n groupDefinitions,\n defaultContentOrder,\n });\n\n return (\n <main>\n <EntityDocumentTitle activeContentTitle={tabs.title} />\n {HeaderComponent ? (\n <HeaderComponent tabs={tabs.tabs} activeTabId={tabs.activeTabId} />\n ) : (\n <EntityHeaderBui\n tabs={tabs.tabs}\n activeTabId={tabs.activeTabId}\n contextMenuItems={contextMenuItems}\n />\n )}\n <EntityLayoutContent\n content={tabs.content}\n NotFoundComponent={NotFoundComponent}\n />\n <InspectEntityDialogHost />\n </main>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA8CA,SAAS,oBAAoB,KAAA,EAAwC;AACnE,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC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AAK,IAAA;AAAA,QACX,aAAa,IAAA,CAAK,WAAA;AAAA,QAClB;AAAA;AAAA,KACF;AAAA,oBAEF,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,SAAS,IAAA,CAAK,OAAA;AAAA,QACd;AAAA;AAAA,KACF;AAAA,wBACC,uBAAA,EAAA,EAAwB;AAAA,GAAA,EAC3B,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityLayoutBui.esm.js","sources":["../../../../src/alpha/components/EntityLayout/EntityLayoutBui.tsx"],"sourcesContent":["/*\n * Copyright 2026 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, ComponentType, ReactNode, useCallback } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { useSearchParams } from 'react-router-dom';\nimport { Alert, Container } from '@backstage/ui';\nimport {\n configApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { Link, Progress } from '@backstage/core-components';\nimport { NotFoundErrorPage } from '@backstage/frontend-plugin-api';\nimport {\n entityRouteRef,\n InspectEntityDialog,\n useAsyncEntity,\n useEntityPresentation,\n} from '@backstage/plugin-catalog-react';\nimport {\n type EntityContentGroupDefinitions,\n type EntityHeaderLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { catalogTranslationRef } from '../../translation';\nimport { EntityHeaderBui } from '../EntityHeader/EntityHeaderBui';\nimport { useEntityTabs } from '../EntityTabs/useEntityTabs';\nimport {\n EntityLayoutRoute,\n filterEntityLayoutRoutes,\n} from './entityLayoutRoutes';\n\nfunction EntityDocumentTitle(props: { activeContentTitle?: string }) {\n const configApi = useApi(configApiRef);\n const routeParams = useRouteRefParams(entityRouteRef);\n const { entity } = useAsyncEntity();\n const presentation = useEntityPresentation(entity ?? routeParams);\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n return (\n <>\n <Helmet\n titleTemplate={`${presentation.primaryTitle} | %s | ${appTitle}`}\n defaultTitle={`${presentation.primaryTitle} | ${appTitle}`}\n />\n {props.activeContentTitle && <Helmet title={props.activeContentTitle} />}\n </>\n );\n}\n\nfunction InspectEntityDialogHost() {\n const { entity } = useAsyncEntity();\n const [searchParams, setSearchParams] = useSearchParams();\n const selectedTab = searchParams.get('inspect');\n const setSelectedTab = useCallback(\n (tab: string) =>\n setSearchParams(params => {\n const next = new URLSearchParams(params);\n next.set('inspect', tab);\n return next;\n }),\n [setSearchParams],\n );\n const close = useCallback(\n () =>\n setSearchParams(params => {\n const next = new URLSearchParams(params);\n next.delete('inspect');\n return next;\n }),\n [setSearchParams],\n );\n if (!entity) return null;\n return (\n <InspectEntityDialog\n entity={entity}\n initialTab={\n (selectedTab as ComponentProps<\n typeof InspectEntityDialog\n >['initialTab']) || undefined\n }\n open={typeof selectedTab === 'string'}\n onClose={close}\n onSelect={setSelectedTab}\n />\n );\n}\n\nfunction EntityLayoutContent(props: {\n content?: React.JSX.Element;\n NotFoundComponent?: ReactNode;\n}) {\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n let content: ReactNode;\n if (error) {\n content = (\n <Container>\n <Alert status=\"danger\" title={error.toString()} />\n </Container>\n );\n } else if (entity) {\n content = <Container>{props.content ?? <NotFoundErrorPage />}</Container>;\n } else if (!loading) {\n content = (\n <Container>\n {props.NotFoundComponent ?? (\n <Alert\n status=\"warning\"\n title={t('entityLabels.warningPanelTitle')}\n description={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 />\n )}\n </Container>\n );\n }\n\n return (\n <>\n {loading && <Progress />}\n {content}\n </>\n );\n}\n\nexport function EntityLayoutBui(props: {\n routes: EntityLayoutRoute[];\n NotFoundComponent?: ReactNode;\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n contextMenuItems?: ComponentProps<typeof EntityHeaderBui>['contextMenuItems'];\n HeaderComponent?: ComponentType<EntityHeaderLayoutProps>;\n}) {\n const {\n routes,\n NotFoundComponent,\n groupDefinitions,\n defaultContentOrder,\n contextMenuItems,\n HeaderComponent,\n } = props;\n const { entity } = useAsyncEntity();\n const visibleRoutes = filterEntityLayoutRoutes(routes, entity);\n const tabs = useEntityTabs({\n routes: visibleRoutes,\n groupDefinitions,\n defaultContentOrder,\n });\n\n return (\n <main>\n <EntityDocumentTitle activeContentTitle={tabs.title} />\n {HeaderComponent ? (\n <HeaderComponent tabs={tabs.tabs} activeTabId={tabs.activeTabId} />\n ) : (\n <EntityHeaderBui\n tabs={tabs.tabs}\n activeTabId={tabs.activeTabId}\n contextMenuItems={contextMenuItems}\n />\n )}\n <EntityLayoutContent\n content={tabs.content}\n NotFoundComponent={NotFoundComponent}\n />\n <InspectEntityDialogHost />\n </main>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA8CA,SAAS,oBAAoB,KAAA,EAAwC;AACnE,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAA,MAAM,WAAA,GAAc,kBAAkB,cAAc,CAAA;AACpD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,cAAA,EAAe;AAClC,EAAA,MAAM,YAAA,GAAe,qBAAA,CAAsB,MAAA,IAAU,WAAW,CAAA;AAChE,EAAA,MAAM,QAAA,GAAW,SAAA,CAAU,iBAAA,CAAkB,WAAW,CAAA,IAAK,WAAA;AAC7D,EAAA,uBACE,IAAA,CA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"version":3,"file":"entityLayoutRoutes.esm.js","sources":["../../../../src/alpha/components/EntityLayout/entityLayoutRoutes.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ReactElement } from 'react';\n\nexport type EntityLayoutRoute = {\n path: string;\n title: string;\n group?: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n};\n\nexport function filterEntityLayoutRoutes(\n routes: EntityLayoutRoute[],\n entity: Entity | undefined,\n) {\n if (!entity) {\n return [];\n }\n return routes.filter(route => !route.if || route.if(entity));\n}\n"],"names":[],"mappings":"AA4BO,SAAS,wBAAA,CACd,QACA,MAAA,EACA;AACA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,EAAC;AAAA,EACV;AACA,EAAA,OAAO,MAAA,CAAO,OAAO,CAAA,KAAA,KAAS,CAAC,MAAM,EAAA,IAAM,KAAA,CAAM,EAAA,CAAG,MAAM,CAAC,CAAA;AAC7D;;;;"}
1
+ {"version":3,"file":"entityLayoutRoutes.esm.js","sources":["../../../../src/alpha/components/EntityLayout/entityLayoutRoutes.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ReactElement } from 'react';\n\nexport type EntityLayoutRoute = {\n path: string;\n title: string;\n group?: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n};\n\nexport function filterEntityLayoutRoutes(\n routes: EntityLayoutRoute[],\n entity: Entity | undefined,\n) {\n if (!entity) {\n return [];\n }\n return routes.filter(route => !route.if || route.if(entity));\n}\n"],"names":[],"mappings":"AA4BO,SAAS,wBAAA,CACd,QACA,MAAA,EACA;AACA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,EAAC;AAAA,EACV;AACA,EAAA,OAAO,MAAA,CAAO,OAAO,CAAA,KAAA,KAAS,CAAC,MAAM,EAAA,IAAM,KAAA,CAAM,EAAA,CAAG,MAAM,CAAC,CAAA;AAC7D;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityTabs.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabs.tsx"],"sourcesContent":["/*\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 { NotFoundErrorPage } from '@backstage/frontend-plugin-api';\nimport { EntityTabsPanel } from './EntityTabsPanel';\nimport { EntityTabsList } from './EntityTabsList';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nexport type SubRoute = {\n group?: string;\n path: string;\n title: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n};\n\n// Normalize a route path so it can be matched correctly:\n// - strip leading slashes\n// - if the path already ends with a `*`, keep it as-is so explicit wildcards\n// like `/*` or `/foo/*` aren't double-suffixed into `*/*` / `foo/*/*`\n// - otherwise strip trailing slashes and append `/*` for nested matching;\n// a bare `/` collapses to the empty string so it acts as an index route\n// rather than a wildcard that would swallow every sub-path\nfunction normalizeRoutePath(path: string): string {\n const withoutLeading = path.replace(/^\\/+/, '');\n if (withoutLeading.endsWith('*')) {\n return withoutLeading;\n }\n const trimmed = withoutLeading.replace(/\\/+$/, '');\n return trimmed ? `${trimmed}/*` : '';\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 = useMemo(\n () =>\n subRoutes.map(({ path, children }) => ({\n caseSensitive: false,\n path: normalizeRoutePath(path),\n element: children,\n })),\n [subRoutes],\n );\n\n const element = useRoutes(routes) ?? undefined;\n\n let currentRoute = params['*'] ?? '';\n if (!currentRoute.startsWith('/')) {\n currentRoute = `/${currentRoute}`;\n }\n\n const [matchedRoute] = matchRoutes(routes, currentRoute) ?? [];\n const foundIndex = matchedRoute\n ? routes.findIndex(r => r.path === matchedRoute.route.path)\n : -1;\n\n return {\n index: foundIndex,\n element,\n route: subRoutes[foundIndex],\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(r => {\n const { path, title, group, icon } = r;\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 ?? <NotFoundErrorPage />}\n </EntityTabsPanel>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAsCA,SAAS,mBAAmB,IAAA,EAAsB;AAChD,EAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA;AAC9C,EAAA,IAAI,cAAA,CAAe,QAAA,CAAS,GAAG,CAAA,EAAG;AAChC,IAAA,OAAO,cAAA;AAAA,EACT;AACA,EAAA,MAAM,OAAA,GAAU,cAAA,CAAe,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA;AACjD,EAAA,OAAO,OAAA,GAAU,CAAA,EAAG,OAAO,CAAA,EAAA,CAAA,GAAO,EAAA;AACpC;AAEO,SAAS,oBAAoB,SAAA,EAIlC;AACA,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,MAAM,MAAA,GAAS,OAAA;AAAA,IACb,MACE,SAAA,CAAU,GAAA,CAAI,CAAC,EAAE,IAAA,EAAM,UAAS,MAAO;AAAA,MACrC,aAAA,EAAe,KAAA;AAAA,MACf,IAAA,EAAM,mBAAmB,IAAI,CAAA;AAAA,MAC7B,OAAA,EAAS;AAAA,KACX,CAAE,CAAA;AAAA,IACJ,CAAC,SAAS;AAAA,GACZ;AAEA,EAAA,MAAM,OAAA,GAAU,SAAA,CAAU,MAAM,CAAA,IAAK,MAAA;AAErC,EAAA,IAAI,YAAA,GAAe,MAAA,CAAO,GAAG,CAAA,IAAK,EAAA;AAClC,EAAA,IAAI,CAAC,YAAA,CAAa,UAAA,CAAW,GAAG,CAAA,EAAG;AACjC,IAAA,YAAA,GAAe,IAAI,YAAY,CAAA,CAAA;AAAA,EACjC;AAEA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QACA,aAAA,EAAe,KAAA;AAAA,QACf,SAAA;AAAA,QACA,gBAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,yBACC,eAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,CAAA;AAAA,MAC5B,OAAA,wBAAY,iBAAA,EAAA,EAAkB;AAAA,KAAA,EACjC;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityTabs.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabs.tsx"],"sourcesContent":["/*\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 { NotFoundErrorPage } from '@backstage/frontend-plugin-api';\nimport { EntityTabsPanel } from './EntityTabsPanel';\nimport { EntityTabsList } from './EntityTabsList';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nexport type SubRoute = {\n group?: string;\n path: string;\n title: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n};\n\n// Normalize a route path so it can be matched correctly:\n// - strip leading slashes\n// - if the path already ends with a `*`, keep it as-is so explicit wildcards\n// like `/*` or `/foo/*` aren't double-suffixed into `*/*` / `foo/*/*`\n// - otherwise strip trailing slashes and append `/*` for nested matching;\n// a bare `/` collapses to the empty string so it acts as an index route\n// rather than a wildcard that would swallow every sub-path\nfunction normalizeRoutePath(path: string): string {\n const withoutLeading = path.replace(/^\\/+/, '');\n if (withoutLeading.endsWith('*')) {\n return withoutLeading;\n }\n const trimmed = withoutLeading.replace(/\\/+$/, '');\n return trimmed ? `${trimmed}/*` : '';\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 = useMemo(\n () =>\n subRoutes.map(({ path, children }) => ({\n caseSensitive: false,\n path: normalizeRoutePath(path),\n element: children,\n })),\n [subRoutes],\n );\n\n const element = useRoutes(routes) ?? undefined;\n\n let currentRoute = params['*'] ?? '';\n if (!currentRoute.startsWith('/')) {\n currentRoute = `/${currentRoute}`;\n }\n\n const [matchedRoute] = matchRoutes(routes, currentRoute) ?? [];\n const foundIndex = matchedRoute\n ? routes.findIndex(r => r.path === matchedRoute.route.path)\n : -1;\n\n return {\n index: foundIndex,\n element,\n route: subRoutes[foundIndex],\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(r => {\n const { path, title, group, icon } = r;\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 ?? <NotFoundErrorPage />}\n </EntityTabsPanel>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAsCA,SAAS,mBAAmB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