@backstage/plugin-catalog 2.0.10-next.0 → 2.0.10-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/alpha/components/EntityHeader/EntityHeaderBui.esm.js +2 -2
- package/dist/alpha/components/EntityHeader/EntityHeaderBui.esm.js.map +1 -1
- package/dist/alpha/components/EntityTabs/EntityTabsGroup.esm.js +1 -1
- package/dist/alpha/components/EntityTabs/EntityTabsGroup.esm.js.map +1 -1
- package/dist/plugins/catalog/package.json.esm.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 2.0.10-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 13adaa1: Updated internal React component names to improve debugging and tooling compatibility.
|
|
8
|
+
- a7a1274: Use EntityDisplayName for hierarchy links in BUI entity header in order to display titles
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/plugin-techdocs-react@1.3.16-next.1
|
|
11
|
+
- @backstage/core-components@0.18.15-next.1
|
|
12
|
+
|
|
3
13
|
## 2.0.10-next.0
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ import { Header, HeaderMetadataUsers, ButtonIcon, Box, Link } from '@backstage/u
|
|
|
4
4
|
import { RELATION_PART_OF, RELATION_OWNED_BY, stringifyEntityRef } from '@backstage/catalog-model';
|
|
5
5
|
import { useRouteRefParams, useApi } from '@backstage/core-plugin-api';
|
|
6
6
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
7
|
-
import { useAsyncEntity, entityRouteRef, useEntityPresentation, getEntityRelations, catalogReactTranslationRef, useStarredEntity, catalogApiRef, useEntityRefLink } from '@backstage/plugin-catalog-react';
|
|
7
|
+
import { useAsyncEntity, entityRouteRef, useEntityPresentation, getEntityRelations, catalogReactTranslationRef, useStarredEntity, catalogApiRef, useEntityRefLink, EntityDisplayName } from '@backstage/plugin-catalog-react';
|
|
8
8
|
import { RiStarFill, RiStarLine } from '@remixicon/react';
|
|
9
9
|
import useAsync from 'react-use/esm/useAsync';
|
|
10
10
|
import { catalogTranslationRef } from '../../translation.esm.js';
|
|
@@ -48,7 +48,7 @@ function HierarchyLinks(props) {
|
|
|
48
48
|
const entityLink = useEntityRefLink();
|
|
49
49
|
return /* @__PURE__ */ jsx(Box, { as: "ul", display: "inline", m: "0", p: "0", style: { listStyle: "none" }, children: props.refs.map((ref, index) => /* @__PURE__ */ jsxs(Box, { as: "li", display: "inline", children: [
|
|
50
50
|
index > 0 ? ", " : null,
|
|
51
|
-
/* @__PURE__ */ jsx(Link, { href: entityLink(ref), standalone: true, children: ref
|
|
51
|
+
/* @__PURE__ */ jsx(Link, { href: entityLink(ref), standalone: true, children: /* @__PURE__ */ jsx(EntityDisplayName, { entityRef: ref }) })
|
|
52
52
|
] }, stringifyEntityRef(ref))) });
|
|
53
53
|
}
|
|
54
54
|
function hierarchyLabel(ref) {
|
|
@@ -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.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.contextMenuItems} />\n </>\n ) : undefined\n }\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAsDA,SAAS,cAAc,MAAA,EAAkD;AACvE,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,aAAa,gBAAA,EAAiB;AACpC,EAAA,MAAM,SAAA,GAAY,OAAA;AAAA,IAChB,MAAM,kBAAA,CAAmB,MAAA,EAAQ,iBAAiB,CAAA;AAAA,IAClD,CAAC,MAAM;AAAA,GACT;AACA,EAAA,MAAM,eAAA,GAAkB,OAAA;AAAA,IACtB,MAAM,SAAA,CAAU,GAAA,CAAI,CAAA,GAAA,KAAO,kBAAA,CAAmB,GAAG,CAAC,CAAA;AAAA,IAClD,CAAC,SAAS;AAAA,GACZ;AACA,EAAA,MAAM,EAAE,KAAA,EAAO,aAAA,EAAc,GAAI,SAAS,YAAY;AACpD,IAAA,IAAI,eAAA,CAAgB,MAAA,KAAW,CAAA,EAAG,OAAO,EAAC;AAC1C,IAAA,OAAA,CACE,MAAM,WAAW,iBAAA,CAAkB;AAAA,MACjC,UAAA,EAAY,eAAA;AAAA,MACZ,MAAA,EAAQ;AAAA,QACN,MAAA;AAA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AAChE,EAAA,MAAM,QAAA,GAAW,YAAY,MAAM,CAAA;AACnC,EAAA,MAAM,IAAA,GAAO,MAAA,EAAQ,IAAA,EAAM,IAAA,EAAM,QAAA,EAAS;AAE1C,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAO,YAAA,CAAa,YAAA;AAAA,MACpB,IAAA,EAAM;AAAA,QACJ,EAAE,KAAA,EAAO,MAAA,EAAQ,IAAA,IAAQ,YAAY,IAAA,EAAK;AAAA,QAC1C,GAAI,OAAO,CAAC,EAAE,OAAO,IAAA,EAAM,IAAI;AAAC,OAClC;AAAA,MACA,QAAA;AAAA,MACA,IAAA,EAAM,MAAA,GAAS,KAAA,CAAM,IAAA,GAAO,MAAA;AAAA,MAC5B,aAAa,KAAA,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
|
+
{"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 EntityDisplayName,\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 <EntityDisplayName entityRef={ref} />\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.contextMenuItems} />\n </>\n ) : undefined\n }\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAuDA,SAAS,cAAc,MAAA,EAAkD;AACvE,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,aAAa,gBAAA,EAAiB;AACpC,EAAA,MAAM,SAAA,GAAY,OAAA;AAAA,IAChB,MAAM,kBAAA,CAAmB,MAAA,EAAQ,iBAAiB,CAAA;AAAA,IAClD,CAAC,MAAM;AAAA,GACT;AACA,EAAA,MAAM,eAAA,GAAkB,OAAA;AAAA,IACtB,MAAM,SAAA,CAAU,GAAA,CAAI,CAAA,GAAA,KAAO,kBAAA,CAAmB,GAAG,CAAC,CAAA;AAAA,IAClD,CAAC,SAAS;AAAA,GACZ;AACA,EAAA,MAAM,EAAE,KAAA,EAAO,aAAA,EAAc,GAAI,SAAS,YAAY;AACpD,IAAA,IAAI,eAAA,CAAgB,MAAA,KAAW,CAAA,EAAG,OAAO,EAAC;AAC1C,IAAA,OAAA,CACE,MAAM,WAAW,iBAAA,C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AO,GAAI,cAAA,EAAe;AAClC,EAAA,MAAM,WAAA,GAAc,kBAAkB,cAAc,CAAA;AACpD,EAAA,MAAM,YAAA,GAAe,qBAAA,CAAsB,MAAA,IAAU,WAAW,CAAA;AAChE,EAAA,MAAM,QAAA,GAAW,YAAY,MAAM,CAAA;AACnC,EAAA,MAAM,IAAA,GAAO,MAAA,EAAQ,IAAA,EAAM,IAAA,EAAM,QAAA,EAAS;AAE1C,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAO,YAAA,CAAa,YAAA;AAAA,MACpB,IAAA,EAAM;AAAA,QACJ,EAAE,KAAA,EAAO,MAAA,EAAQ,IAAA,IAAQ,YAAY,IAAA,EAAK;AAAA,QAC1C,GAAI,OAAO,CAAC,EAAE,OAAO,IAAA,EAAM,IAAI;AAAC,OAClC;AAAA,MACA,QAAA;AAAA,MACA,IAAA,EAAM,MAAA,GAAS,KAAA,CAAM,IAAA,GAAO,MAAA;AAAA,MAC5B,aAAa,KAAA,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;;"}
|
|
@@ -128,7 +128,7 @@ function resolveIcon(icon, iconsApi, showIcons) {
|
|
|
128
128
|
}
|
|
129
129
|
return icon;
|
|
130
130
|
}
|
|
131
|
-
const Tab = forwardRef(function
|
|
131
|
+
const Tab = forwardRef(function EntityTabsGroupTab(props, ref) {
|
|
132
132
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
133
133
|
const iconsApi = useApi(iconsApiRef);
|
|
134
134
|
const open = Boolean(anchorEl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTabsGroup.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabsGroup.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 */\nimport {\n ReactNode,\n forwardRef,\n useState,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n} from 'react';\nimport { Link } from 'react-router-dom';\nimport classnames from 'classnames';\n\nimport Typography from '@material-ui/core/Typography';\nimport Popover from '@material-ui/core/Popover';\nimport { TabProps, TabClassKey } from '@material-ui/core/Tab';\nimport { capitalize } from '@material-ui/core/utils';\nimport { createStyles, Theme, withStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Button from '@material-ui/core/Button';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport List from '@material-ui/core/List';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { IconsApi, iconsApiRef } from '@backstage/frontend-plugin-api';\n\nconst styles = (theme: Theme) =>\n createStyles({\n /* Styles applied to the root element. */\n root: {\n ...theme.typography.button,\n maxWidth: 264,\n minWidth: 72,\n position: 'relative',\n boxSizing: 'border-box',\n minHeight: 48,\n flexShrink: 0,\n padding: '6px 12px',\n [theme.breakpoints.up('sm')]: {\n padding: '6px 24px',\n },\n overflow: 'hidden',\n whiteSpace: 'normal',\n textAlign: 'center',\n [theme.breakpoints.up('sm')]: {\n minWidth: 160,\n },\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n /* Styles applied to the root element if both `icon` and `label` are provided. */\n labelIcon: {\n minHeight: 72,\n paddingTop: 9,\n '& $wrapper > *:first-child': {\n marginBottom: 6,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"inherit\"`. */\n textColorInherit: {\n color: 'inherit',\n opacity: 0.7,\n '&$selected': {\n opacity: 1,\n },\n '&$disabled': {\n opacity: 0.5,\n },\n },\n selectedButton: {\n color: `${theme.palette.text.primary}`,\n opacity: `${1}`,\n },\n unselectedButton: {\n color: `${theme.palette.text.secondary}`,\n opacity: `${0.7}`,\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"primary\"`. */\n textColorPrimary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.primary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"secondary\"`. */\n textColorSecondary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.secondary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Pseudo-class applied to the root element if `selected={true}` (controlled by the Tabs component). */\n selected: {},\n /* Pseudo-class applied to the root element if `disabled={true}` (controlled by the Tabs component). */\n disabled: {},\n /* Styles applied to the root element if `fullWidth={true}` (controlled by the Tabs component). */\n fullWidth: {\n flexShrink: 1,\n flexGrow: 1,\n flexBasis: 0,\n maxWidth: 'none',\n },\n /* Styles applied to the root element if `wrapped={true}`. */\n wrapped: {\n fontSize: theme.typography.pxToRem(12),\n lineHeight: 1.5,\n },\n /* Styles applied to the `icon` and `label`'s wrapper element. */\n wrapper: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n flexDirection: 'row',\n },\n });\n\ntype EntityTabsGroupItem = {\n id: string;\n label: string;\n path: string;\n icon?: string | ReactElement;\n};\n\ntype EntityTabsGroupProps = TabProps & {\n classes?: Partial<ReturnType<typeof styles>>;\n indicator?: ReactNode;\n highlightedButton?: string;\n items: EntityTabsGroupItem[];\n onSelectTab?: MouseEventHandler<HTMLAnchorElement>;\n showIcons?: boolean;\n};\n\nfunction resolveIcon(\n icon: string | ReactElement | undefined,\n iconsApi: IconsApi,\n showIcons: boolean,\n) {\n if (!showIcons) {\n return undefined;\n }\n if (typeof icon === 'string') {\n const Icon = iconsApi.getIcon(icon);\n if (Icon) {\n return <Icon />;\n }\n return undefined;\n }\n return icon;\n}\n\nconst Tab = forwardRef(function Tab(props: EntityTabsGroupProps, ref: any) {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const iconsApi = useApi(iconsApiRef);\n\n const open = Boolean(anchorEl);\n const submenuId = open ? 'tabbed-submenu' : undefined;\n\n const {\n classes,\n className,\n disabled = false,\n disableFocusRipple = false,\n items,\n fullWidth,\n indicator,\n label,\n onSelectTab,\n selected,\n textColor = 'inherit',\n wrapped = false,\n highlightedButton,\n showIcons = false,\n } = props;\n\n const groupIcon = resolveIcon(props.icon, iconsApi, showIcons);\n const testId = 'data-testid' in props && props['data-testid'];\n\n const handleMenuClose = () => {\n setAnchorEl(null);\n };\n\n const handleMenuClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const classArray = [\n classes?.root,\n classes?.[`textColor${capitalize(textColor)}` as TabClassKey],\n classes && {\n [classes.disabled!]: disabled,\n [classes.selected!]: selected,\n [classes.labelIcon!]: label && groupIcon,\n [classes.fullWidth!]: fullWidth,\n [classes.wrapped!]: wrapped,\n },\n className,\n ];\n\n if (items.length === 1) {\n return (\n <Button\n focusRipple={!disableFocusRipple}\n data-testid={testId}\n className={classnames(\n classArray,\n classes && {\n [classes.labelIcon!]: label && (items[0].icon ?? groupIcon),\n },\n )}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n component={Link}\n onClick={onSelectTab}\n to={items[0]?.path}\n startIcon={resolveIcon(items[0].icon, iconsApi, showIcons)}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {items[0].label}\n </Typography>\n {indicator}\n </Button>\n );\n }\n const hasIcons = showIcons && items.some(i => i.icon);\n return (\n <>\n <Button\n data-testid={testId}\n focusRipple={!disableFocusRipple}\n className={classnames(classArray)}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n onClick={handleMenuClick}\n startIcon={groupIcon}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {label}\n </Typography>\n <ExpandMoreIcon />\n </Button>\n <Popover\n id={submenuId}\n open={open}\n anchorEl={anchorEl}\n onClose={handleMenuClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}\n >\n <List component=\"nav\">\n {items.map(i => {\n const itemIcon = resolveIcon(i.icon, iconsApi, showIcons);\n return (\n <ListItem\n key={`popover_item_${i.id}`}\n button\n focusRipple={!disableFocusRipple}\n classes={{\n selected: classnames(classes?.selectedButton),\n default: classnames(classes?.unselectedButton),\n disabled: classnames(classes?.disabled),\n }}\n ref={ref}\n aria-selected={selected}\n disabled={disabled}\n selected={highlightedButton === i.id}\n component={Link}\n onClick={e => {\n handleMenuClose();\n onSelectTab?.(e);\n }}\n to={i.path}\n >\n {itemIcon && <ListItemIcon>{itemIcon}</ListItemIcon>}\n <ListItemText\n inset={!itemIcon && hasIcons}\n primary={\n <>\n <Typography variant=\"button\">{i.label}</Typography>\n {indicator}\n </>\n }\n />\n </ListItem>\n );\n })}\n </List>\n </Popover>\n </>\n );\n});\n\n// @ts-ignore\nexport const EntityTabsGroup = withStyles(styles, { name: 'MuiTab' })(Tab);\n"],"names":["Tab"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,MAAM,MAAA,GAAS,CAAC,KAAA,KACd,YAAA,CAAa;AAAA;AAAA,EAEX,IAAA,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,yBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,sCAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,QAAA,EAAU,QAAA,EAAA,CAAA,CAAE,KAAA,EAAM,CAAA;AAAA,sBACrC;AAAA,qBAAA,EACH;AAAA;AAAA;AAEJ;AAAA,aAAA;AAAA,YA5BK,CAAA,aAAA,EAAgB,EAAE,EAAE,CAAA;AAAA,WA6B3B;AAAA,QAEJ,CAAC,CAAA,EACH;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ,CAAC,CAAA;AAGM,MAAM,eAAA,GAAkB,WAAW,MAAA,EAAQ,EAAE,MAAM,QAAA,EAAU,EAAE,GAAG;;"}
|
|
1
|
+
{"version":3,"file":"EntityTabsGroup.esm.js","sources":["../../../../src/alpha/components/EntityTabs/EntityTabsGroup.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 */\nimport {\n ReactNode,\n forwardRef,\n useState,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n} from 'react';\nimport { Link } from 'react-router-dom';\nimport classnames from 'classnames';\n\nimport Typography from '@material-ui/core/Typography';\nimport Popover from '@material-ui/core/Popover';\nimport { TabProps, TabClassKey } from '@material-ui/core/Tab';\nimport { capitalize } from '@material-ui/core/utils';\nimport { createStyles, Theme, withStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Button from '@material-ui/core/Button';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport List from '@material-ui/core/List';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { IconsApi, iconsApiRef } from '@backstage/frontend-plugin-api';\n\nconst styles = (theme: Theme) =>\n createStyles({\n /* Styles applied to the root element. */\n root: {\n ...theme.typography.button,\n maxWidth: 264,\n minWidth: 72,\n position: 'relative',\n boxSizing: 'border-box',\n minHeight: 48,\n flexShrink: 0,\n padding: '6px 12px',\n [theme.breakpoints.up('sm')]: {\n padding: '6px 24px',\n },\n overflow: 'hidden',\n whiteSpace: 'normal',\n textAlign: 'center',\n [theme.breakpoints.up('sm')]: {\n minWidth: 160,\n },\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n /* Styles applied to the root element if both `icon` and `label` are provided. */\n labelIcon: {\n minHeight: 72,\n paddingTop: 9,\n '& $wrapper > *:first-child': {\n marginBottom: 6,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"inherit\"`. */\n textColorInherit: {\n color: 'inherit',\n opacity: 0.7,\n '&$selected': {\n opacity: 1,\n },\n '&$disabled': {\n opacity: 0.5,\n },\n },\n selectedButton: {\n color: `${theme.palette.text.primary}`,\n opacity: `${1}`,\n },\n unselectedButton: {\n color: `${theme.palette.text.secondary}`,\n opacity: `${0.7}`,\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"primary\"`. */\n textColorPrimary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.primary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"secondary\"`. */\n textColorSecondary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.secondary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Pseudo-class applied to the root element if `selected={true}` (controlled by the Tabs component). */\n selected: {},\n /* Pseudo-class applied to the root element if `disabled={true}` (controlled by the Tabs component). */\n disabled: {},\n /* Styles applied to the root element if `fullWidth={true}` (controlled by the Tabs component). */\n fullWidth: {\n flexShrink: 1,\n flexGrow: 1,\n flexBasis: 0,\n maxWidth: 'none',\n },\n /* Styles applied to the root element if `wrapped={true}`. */\n wrapped: {\n fontSize: theme.typography.pxToRem(12),\n lineHeight: 1.5,\n },\n /* Styles applied to the `icon` and `label`'s wrapper element. */\n wrapper: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n flexDirection: 'row',\n },\n });\n\ntype EntityTabsGroupItem = {\n id: string;\n label: string;\n path: string;\n icon?: string | ReactElement;\n};\n\ntype EntityTabsGroupProps = TabProps & {\n classes?: Partial<ReturnType<typeof styles>>;\n indicator?: ReactNode;\n highlightedButton?: string;\n items: EntityTabsGroupItem[];\n onSelectTab?: MouseEventHandler<HTMLAnchorElement>;\n showIcons?: boolean;\n};\n\nfunction resolveIcon(\n icon: string | ReactElement | undefined,\n iconsApi: IconsApi,\n showIcons: boolean,\n) {\n if (!showIcons) {\n return undefined;\n }\n if (typeof icon === 'string') {\n const Icon = iconsApi.getIcon(icon);\n if (Icon) {\n return <Icon />;\n }\n return undefined;\n }\n return icon;\n}\n\nconst Tab = forwardRef(function EntityTabsGroupTab(\n props: EntityTabsGroupProps,\n ref: any,\n) {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const iconsApi = useApi(iconsApiRef);\n\n const open = Boolean(anchorEl);\n const submenuId = open ? 'tabbed-submenu' : undefined;\n\n const {\n classes,\n className,\n disabled = false,\n disableFocusRipple = false,\n items,\n fullWidth,\n indicator,\n label,\n onSelectTab,\n selected,\n textColor = 'inherit',\n wrapped = false,\n highlightedButton,\n showIcons = false,\n } = props;\n\n const groupIcon = resolveIcon(props.icon, iconsApi, showIcons);\n const testId = 'data-testid' in props && props['data-testid'];\n\n const handleMenuClose = () => {\n setAnchorEl(null);\n };\n\n const handleMenuClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const classArray = [\n classes?.root,\n classes?.[`textColor${capitalize(textColor)}` as TabClassKey],\n classes && {\n [classes.disabled!]: disabled,\n [classes.selected!]: selected,\n [classes.labelIcon!]: label && groupIcon,\n [classes.fullWidth!]: fullWidth,\n [classes.wrapped!]: wrapped,\n },\n className,\n ];\n\n if (items.length === 1) {\n return (\n <Button\n focusRipple={!disableFocusRipple}\n data-testid={testId}\n className={classnames(\n classArray,\n classes && {\n [classes.labelIcon!]: label && (items[0].icon ?? groupIcon),\n },\n )}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n component={Link}\n onClick={onSelectTab}\n to={items[0]?.path}\n startIcon={resolveIcon(items[0].icon, iconsApi, showIcons)}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {items[0].label}\n </Typography>\n {indicator}\n </Button>\n );\n }\n const hasIcons = showIcons && items.some(i => i.icon);\n return (\n <>\n <Button\n data-testid={testId}\n focusRipple={!disableFocusRipple}\n className={classnames(classArray)}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n onClick={handleMenuClick}\n startIcon={groupIcon}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {label}\n </Typography>\n <ExpandMoreIcon />\n </Button>\n <Popover\n id={submenuId}\n open={open}\n anchorEl={anchorEl}\n onClose={handleMenuClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}\n >\n <List component=\"nav\">\n {items.map(i => {\n const itemIcon = resolveIcon(i.icon, iconsApi, showIcons);\n return (\n <ListItem\n key={`popover_item_${i.id}`}\n button\n focusRipple={!disableFocusRipple}\n classes={{\n selected: classnames(classes?.selectedButton),\n default: classnames(classes?.unselectedButton),\n disabled: classnames(classes?.disabled),\n }}\n ref={ref}\n aria-selected={selected}\n disabled={disabled}\n selected={highlightedButton === i.id}\n component={Link}\n onClick={e => {\n handleMenuClose();\n onSelectTab?.(e);\n }}\n to={i.path}\n >\n {itemIcon && <ListItemIcon>{itemIcon}</ListItemIcon>}\n <ListItemText\n inset={!itemIcon && hasIcons}\n primary={\n <>\n <Typography variant=\"button\">{i.label}</Typography>\n {indicator}\n </>\n }\n />\n </ListItem>\n );\n })}\n </List>\n </Popover>\n </>\n );\n});\n\n// @ts-ignore\nexport const EntityTabsGroup = withStyles(styles, { name: 'MuiTab' })(Tab);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAwCA,MAAM,MAAA,GAAS,CAAC,KAAA,KACd,YAAA,CAAa;AAAA;AAAA,EAEX,IAAA,EAAM;AAAA,IACJ,GAAG,MAAM,UAAA,CAAW,MAAA;AAAA,IACpB,QAAA,EAAU,GAAA;AAAA,IACV,QAAA,EAAU,EAAA;AAAA,IACV,QAAA,EAAU,UAAA;AAAA,IACV,SAAA,EAAW,YAAA;AAAA,IACX,SAAA,EAAW,EAAA;AAAA,IACX,UAAA,EAAY,CAAA;AAAA,IACZ,OAAA,EAAS,UAAA;AAAA,IACT,CAAC,KAAA,CAAM,WAAA,CAAY,EAAA,CAAG,IAAI,CAAC,GAAG;AAAA,MAC5B,OAAA,EAAS;AAAA,KACX;AAAA,IACA,QAAA,EAAU,QAAA;AAAA,IACV,UAAA,EAAY,QAAA;AAAA,IACZ,SAAA,EAAW,QAAA;AAAA,IACX,CAAC,KAAA,CAAM,WAAA,CAAY,EAAA,CAAG,IAAI,CAAC,GAAG;AAAA,MAC5B,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,GAAG,MAAM,UAAA,CAAW,OAAA;AAAA,IACpB,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,CAAA,EAAG,CAAC,CAAA;AAAA,IAC3B,aAAA,EAAe,WAAA;AAAA,IACf,UAAA,EAAY,MAAM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EAAe,QAAA;AAAA,cACf,QAAA;AAAA,cACA,QAAA,EAAU,sBAAsB,CAAA,CAAE,EAAA;AAAA,cAClC,SAAA,EAAW,IAAA;AAAA,cACX,SAAS,CAAA,CAAA,KAAK;AACZ,gBAAA,eAAA,EAAgB;AAChB,gBAAA,WAAA,GAAc,CAAC,CAAA;AAAA,cACjB,CAAA;AAAA,cACA,IAAI,CAAA,CAAE,IAAA;AAAA,cAEL,QAAA,EAAA;AAAA,gBAAA,QAAA,oBAAY,GAAA,CAAC,gBAAc,QAAA,EAAA,QAAA,EAAS,CAAA;AAAA,gCACrC,GAAA;AAAA,kBAAC,YAAA;AAAA,kBAAA;AAAA,oBACC,KAAA,EAAO,CAAC,QAAA,IAAY,QAAA;AAAA,oBACpB,yBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,sCAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,QAAA,EAAU,QAAA,EAAA,CAAA,CAAE,KAAA,EAAM,CAAA;AAAA,sBACrC;AAAA,qBAAA,EACH;AAAA;AAAA;AAEJ;AAAA,aAAA;AAAA,YA5BK,CAAA,aAAA,EAAgB,EAAE,EAAE,CAAA;AAAA,WA6B3B;AAAA,QAEJ,CAAC,CAAA,EACH;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ,CAAC,CAAA;AAGM,MAAM,eAAA,GAAkB,WAAW,MAAA,EAAQ,EAAE,MAAM,QAAA,EAAU,EAAE,GAAG;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog",
|
|
3
|
-
"version": "2.0.10-next.
|
|
3
|
+
"version": "2.0.10-next.1",
|
|
4
4
|
"description": "The Backstage plugin for browsing the Backstage catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@backstage/catalog-client": "1.16.3-next.0",
|
|
74
74
|
"@backstage/catalog-model": "1.10.2-next.0",
|
|
75
75
|
"@backstage/core-compat-api": "0.5.16-next.0",
|
|
76
|
-
"@backstage/core-components": "0.18.15-next.
|
|
76
|
+
"@backstage/core-components": "0.18.15-next.1",
|
|
77
77
|
"@backstage/core-plugin-api": "1.12.11-next.0",
|
|
78
78
|
"@backstage/errors": "1.3.2-next.0",
|
|
79
79
|
"@backstage/frontend-plugin-api": "0.18.2-next.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@backstage/plugin-search-common": "1.2.26-next.0",
|
|
86
86
|
"@backstage/plugin-search-react": "1.11.9-next.0",
|
|
87
87
|
"@backstage/plugin-techdocs-common": "0.1.1",
|
|
88
|
-
"@backstage/plugin-techdocs-react": "1.3.16-next.
|
|
88
|
+
"@backstage/plugin-techdocs-react": "1.3.16-next.1",
|
|
89
89
|
"@backstage/types": "1.2.2",
|
|
90
90
|
"@backstage/ui": "0.18.0",
|
|
91
91
|
"@backstage/version-bridge": "1.0.12",
|