@backstage/plugin-catalog-react 0.0.0-nightly-20260918023200 → 0.0.0-nightly-20260920023043

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 (96) hide show
  1. package/CHANGELOG.md +13 -13
  2. package/dist/alpha/blueprints/CatalogFilterBlueprint.esm.js.map +1 -1
  3. package/dist/alpha/blueprints/EntityCardBlueprint.esm.js.map +1 -1
  4. package/dist/alpha/blueprints/EntityContentBlueprint.esm.js.map +1 -1
  5. package/dist/alpha/blueprints/EntityContentLayoutBlueprint.esm.js.map +1 -1
  6. package/dist/alpha/blueprints/EntityContextMenuItemBlueprint.esm.js.map +1 -1
  7. package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js.map +1 -1
  8. package/dist/alpha/blueprints/EntityHeaderLayoutBlueprint.esm.js.map +1 -1
  9. package/dist/alpha/blueprints/EntityIconLinkBlueprint.esm.js.map +1 -1
  10. package/dist/alpha/blueprints/extensionData.esm.js.map +1 -1
  11. package/dist/alpha/blueprints/resolveEntityFilterData.esm.js.map +1 -1
  12. package/dist/alpha/converters/convertLegacyEntityCardExtension.esm.js.map +1 -1
  13. package/dist/alpha/converters/convertLegacyEntityContentExtension.esm.js.map +1 -1
  14. package/dist/alpha.d.ts +11 -11
  15. package/dist/alpha.esm.js.map +1 -1
  16. package/dist/api.esm.js.map +1 -1
  17. package/dist/apis/EntityPresentationApi/EntityPresentationApi.esm.js.map +1 -1
  18. package/dist/apis/EntityPresentationApi/defaultEntityPresentation.esm.js.map +1 -1
  19. package/dist/apis/EntityPresentationApi/entityPresentationSnapshot.esm.js.map +1 -1
  20. package/dist/apis/EntityPresentationApi/useEntityPresentation.esm.js.map +1 -1
  21. package/dist/apis/EntityPresentationApi/useUpdatingObservable.esm.js.map +1 -1
  22. package/dist/apis/StarredEntitiesApi/MockStarredEntitiesApi.esm.js.map +1 -1
  23. package/dist/apis/StarredEntitiesApi/StarredEntitiesApi.esm.js.map +1 -1
  24. package/dist/components/CatalogAutocomplete/CatalogAutocomplete.esm.js.map +1 -1
  25. package/dist/components/CatalogFilterLayout/CatalogFilterLayout.esm.js.map +1 -1
  26. package/dist/components/DefaultFilters/DefaultFilters.esm.js.map +1 -1
  27. package/dist/components/EntityAutocompletePicker/EntityAutocompletePicker.esm.js.map +1 -1
  28. package/dist/components/EntityAutocompletePicker/EntityAutocompletePickerOption.esm.js.map +1 -1
  29. package/dist/components/EntityDataTable/EntityDataTable.esm.js.map +1 -1
  30. package/dist/components/EntityDataTable/columnFactories.esm.js.map +1 -1
  31. package/dist/components/EntityDataTable/presets.esm.js.map +1 -1
  32. package/dist/components/EntityDisplayName/EntityDisplayName.esm.js.map +1 -1
  33. package/dist/components/EntityInfoCard/EntityInfoCard.esm.js.map +1 -1
  34. package/dist/components/EntityKindPicker/EntityKindPicker.esm.js.map +1 -1
  35. package/dist/components/EntityKindPicker/kindFilterUtils.esm.js.map +1 -1
  36. package/dist/components/EntityLifecyclePicker/EntityLifecyclePicker.esm.js.map +1 -1
  37. package/dist/components/EntityNamespacePicker/EntityNamespacePicker.esm.js.map +1 -1
  38. package/dist/components/EntityOwnerPicker/EntityOwnerPicker.esm.js.map +1 -1
  39. package/dist/components/EntityOwnerPicker/VirtualizedListbox.esm.js.map +1 -1
  40. package/dist/components/EntityOwnerPicker/useFacetsEntities.esm.js.map +1 -1
  41. package/dist/components/EntityOwnerPicker/useFetchEntities.esm.js.map +1 -1
  42. package/dist/components/EntityOwnerPicker/useQueryEntities.esm.js.map +1 -1
  43. package/dist/components/EntityPeekAheadPopover/CardActionComponents/EmailCardAction.esm.js.map +1 -1
  44. package/dist/components/EntityPeekAheadPopover/CardActionComponents/EntityCardActions.esm.js.map +1 -1
  45. package/dist/components/EntityPeekAheadPopover/CardActionComponents/GroupCardActions.esm.js.map +1 -1
  46. package/dist/components/EntityPeekAheadPopover/CardActionComponents/UserCardActions.esm.js.map +1 -1
  47. package/dist/components/EntityPeekAheadPopover/EntityPeekAheadPopover.esm.js.map +1 -1
  48. package/dist/components/EntityProcessingStatusPicker/EntityProcessingStatusPicker.esm.js.map +1 -1
  49. package/dist/components/EntityRefLink/EntityRefLink.esm.js.map +1 -1
  50. package/dist/components/EntityRefLink/EntityRefLinks.esm.js.map +1 -1
  51. package/dist/components/EntityRefLink/humanize.esm.js.map +1 -1
  52. package/dist/components/EntityRelationCard/EntityRelationCard.esm.js.map +1 -1
  53. package/dist/components/EntitySearchBar/EntitySearchBar.esm.js.map +1 -1
  54. package/dist/components/EntityTable/EntityTable.esm.js.map +1 -1
  55. package/dist/components/EntityTable/TitleColumn.esm.js.map +1 -1
  56. package/dist/components/EntityTable/columns.esm.js.map +1 -1
  57. package/dist/components/EntityTable/presets.esm.js.map +1 -1
  58. package/dist/components/EntityTagPicker/EntityTagPicker.esm.js.map +1 -1
  59. package/dist/components/EntityTypePicker/EntityTypePicker.esm.js.map +1 -1
  60. package/dist/components/FavoriteEntity/FavoriteEntity.esm.js.map +1 -1
  61. package/dist/components/InspectEntityDialog/InspectEntityDialog.esm.js.map +1 -1
  62. package/dist/components/InspectEntityDialog/components/AncestryPage.esm.js.map +1 -1
  63. package/dist/components/InspectEntityDialog/components/ColocatedPage.esm.js.map +1 -1
  64. package/dist/components/InspectEntityDialog/components/EntityKindIcon.esm.js.map +1 -1
  65. package/dist/components/InspectEntityDialog/components/JsonPage.esm.js.map +1 -1
  66. package/dist/components/InspectEntityDialog/components/OverviewPage.esm.js.map +1 -1
  67. package/dist/components/InspectEntityDialog/components/YamlPage.esm.js.map +1 -1
  68. package/dist/components/InspectEntityDialog/components/common.esm.js.map +1 -1
  69. package/dist/components/InspectEntityDialog/components/util.esm.js.map +1 -1
  70. package/dist/components/MissingAnnotationEmptyState/MissingAnnotationEmptyState.esm.js.map +1 -1
  71. package/dist/components/UnregisterEntityDialog/UnregisterEntityDialog.esm.js.map +1 -1
  72. package/dist/components/UnregisterEntityDialog/useUnregisterEntityDialogState.esm.js.map +1 -1
  73. package/dist/components/UserListPicker/UserListPicker.esm.js.map +1 -1
  74. package/dist/components/UserListPicker/useAllEntitiesCount.esm.js.map +1 -1
  75. package/dist/components/UserListPicker/useOwnedEntitiesCount.esm.js.map +1 -1
  76. package/dist/components/UserListPicker/useStarredEntitiesCount.esm.js.map +1 -1
  77. package/dist/deprecated.esm.js.map +1 -1
  78. package/dist/filters.esm.js.map +1 -1
  79. package/dist/hooks/useEntity.esm.js.map +1 -1
  80. package/dist/hooks/useEntityListProvider.esm.js.map +1 -1
  81. package/dist/hooks/useEntityOwnership.esm.js.map +1 -1
  82. package/dist/hooks/useEntityPermission.esm.js.map +1 -1
  83. package/dist/hooks/useEntityTypeFilter.esm.js.map +1 -1
  84. package/dist/hooks/useRelatedEntities.esm.js.map +1 -1
  85. package/dist/hooks/useStarredEntities.esm.js.map +1 -1
  86. package/dist/hooks/useStarredEntity.esm.js.map +1 -1
  87. package/dist/routes.esm.js.map +1 -1
  88. package/dist/testUtils/MockEntityListContextProvider.esm.js.map +1 -1
  89. package/dist/testUtils/catalogApiMock.esm.js.map +1 -1
  90. package/dist/testUtils/createTestEntityPage.esm.js.map +1 -1
  91. package/dist/translation.esm.js.map +1 -1
  92. package/dist/utils/filters.esm.js.map +1 -1
  93. package/dist/utils/getEntityRelations.esm.js.map +1 -1
  94. package/dist/utils/getEntitySourceLocation.esm.js.map +1 -1
  95. package/dist/utils/isOwnerOf.esm.js.map +1 -1
  96. package/package.json +19 -19
package/CHANGELOG.md CHANGED
@@ -1,25 +1,25 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 0.0.0-nightly-20260918023200
3
+ ## 0.0.0-nightly-20260920023043
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @backstage/integration-react@0.0.0-nightly-20260918023200
9
- - @backstage/catalog-client@1.16.2
10
- - @backstage/catalog-model@1.10.1
11
- - @backstage/core-compat-api@0.0.0-nightly-20260918023200
12
- - @backstage/core-components@0.18.14
13
- - @backstage/core-plugin-api@1.12.10
14
- - @backstage/errors@1.3.1
15
- - @backstage/filter-predicates@0.1.5
16
- - @backstage/frontend-plugin-api@0.18.1
17
- - @backstage/frontend-test-utils@0.0.0-nightly-20260918023200
8
+ - @backstage/errors@0.0.0-nightly-20260920023043
9
+ - @backstage/integration-react@0.0.0-nightly-20260920023043
10
+ - @backstage/core-components@0.0.0-nightly-20260920023043
11
+ - @backstage/core-plugin-api@0.0.0-nightly-20260920023043
12
+ - @backstage/filter-predicates@0.0.0-nightly-20260920023043
13
+ - @backstage/frontend-plugin-api@0.0.0-nightly-20260920023043
14
+ - @backstage/frontend-test-utils@0.0.0-nightly-20260920023043
15
+ - @backstage/plugin-permission-common@0.0.0-nightly-20260920023043
16
+ - @backstage/plugin-permission-react@0.0.0-nightly-20260920023043
17
+ - @backstage/catalog-client@0.0.0-nightly-20260920023043
18
+ - @backstage/catalog-model@0.0.0-nightly-20260920023043
19
+ - @backstage/core-compat-api@0.0.0-nightly-20260920023043
18
20
  - @backstage/types@1.2.2
19
21
  - @backstage/ui@0.18.0
20
22
  - @backstage/version-bridge@1.0.12
21
- - @backstage/plugin-permission-common@0.9.11
22
- - @backstage/plugin-permission-react@0.5.5
23
23
 
24
24
  ## 3.2.3
25
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogFilterBlueprint.esm.js","sources":["../../../src/alpha/blueprints/CatalogFilterBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\n\n/**\n * Creates Catalog Filter Extensions\n * @alpha\n */\nexport const CatalogFilterBlueprint = createExtensionBlueprint({\n kind: 'catalog-filter',\n attachTo: { id: 'page:catalog', input: 'filters' },\n output: [coreExtensionData.reactElement],\n factory(params: { loader: () => Promise<JSX.Element> }, { node }) {\n return [\n coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n ),\n ];\n },\n});\n"],"names":[],"mappings":";;AA0BO,MAAM,yBAAyB,wBAAA,CAAyB;AAAA,EAC7D,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,cAAA,EAAgB,OAAO,SAAA,EAAU;AAAA,EACjD,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,OAAA,CAAQ,MAAA,EAAgD,EAAE,IAAA,EAAK,EAAG;AAChE,IAAA,OAAO;AAAA,MACL,iBAAA,CAAkB,YAAA;AAAA,QAChB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAA,CAAO,MAAM;AAAA;AAC5C,KACF;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"CatalogFilterBlueprint.esm.js","sources":["../../../src/alpha/blueprints/CatalogFilterBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\n\n/**\n * Creates Catalog Filter Extensions\n * @alpha\n */\nexport const CatalogFilterBlueprint = createExtensionBlueprint({\n kind: 'catalog-filter',\n attachTo: { id: 'page:catalog', input: 'filters' },\n output: [coreExtensionData.reactElement],\n factory(params: { loader: () => Promise<JSX.Element> }, { node }) {\n return [\n coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n ),\n ];\n },\n});\n"],"names":[],"mappings":";;AA0BO,MAAM,yBAAyB,wBAAA,CAAyB;AAAA,EAC7D,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,cAAA,EAAgB,OAAO,SAAA,EAAU;AAAA,EACjD,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,OAAA,CAAQ,MAAA,EAAgD,EAAE,IAAA,EAAK,EAAG;AAChE,IAAA,OAAO;AAAA,MACL,iBAAA,CAAkB,YAAA;AAAA,QAChB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAA,CAAO,MAAM;AAAA;AAC5C,KACF;AAAA,EACF;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityCardBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityCardBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n entityCardTypeDataRef,\n entityCardTypes,\n EntityCardType,\n} from './extensionData';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\nimport { z } from 'zod/v4';\n\n/**\n * @alpha\n * A blueprint for creating cards for the entity pages in the catalog.\n */\nexport const EntityCardBlueprint = createExtensionBlueprint({\n kind: 'entity-card',\n attachTo: { id: 'entity-content:catalog/overview', input: 'cards' },\n output: [\n coreExtensionData.reactElement,\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityCardTypeDataRef.optional(),\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n type: entityCardTypeDataRef,\n },\n configSchema: {\n filter: z\n .union([z.string(), createZodV4FilterPredicateSchema()])\n .optional(),\n type: z.enum(entityCardTypes).optional(),\n },\n *factory(\n {\n loader,\n filter,\n type,\n }: {\n loader: () => Promise<JSX.Element>;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n type?: EntityCardType;\n },\n { node, config },\n ) {\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n yield* resolveEntityFilterData(filter, config, node);\n\n const finalType = config.type ?? type;\n if (finalType) {\n yield entityCardTypeDataRef(finalType);\n }\n },\n});\n"],"names":[],"mappings":";;;;;;AAwCO,MAAM,sBAAsB,wBAAA,CAAyB;AAAA,EAC1D,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,iCAAA,EAAmC,OAAO,OAAA,EAAQ;AAAA,EAClE,MAAA,EAAQ;AAAA,IACN,iBAAA,CAAkB,YAAA;AAAA,IAClB,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC,sBAAsB,QAAA;AAAS,GACjC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,IAAA,EAAM;AAAA,GACR;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,CAAA,CACL,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,gCAAA,EAAkC,CAAC,CAAA,CACtD,QAAA,EAAS;AAAA,IACZ,IAAA,EAAM,CAAA,CAAE,IAAA,CAAK,eAAe,EAAE,QAAA;AAAS,GACzC;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE,MAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF,EAKA,EAAE,IAAA,EAAM,MAAA,EAAO,EACf;AACA,IAAA,MAAM,kBAAkB,YAAA,CAAa,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAM,CAAC,CAAA;AAEzE,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,MAAM,SAAA,GAAY,OAAO,IAAA,IAAQ,IAAA;AACjC,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,MAAM,sBAAsB,SAAS,CAAA;AAAA,IACvC;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityCardBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityCardBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n entityCardTypeDataRef,\n entityCardTypes,\n EntityCardType,\n} from './extensionData';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\nimport { z } from 'zod/v4';\n\n/**\n * @alpha\n * A blueprint for creating cards for the entity pages in the catalog.\n */\nexport const EntityCardBlueprint = createExtensionBlueprint({\n kind: 'entity-card',\n attachTo: { id: 'entity-content:catalog/overview', input: 'cards' },\n output: [\n coreExtensionData.reactElement,\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityCardTypeDataRef.optional(),\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n type: entityCardTypeDataRef,\n },\n configSchema: {\n filter: z\n .union([z.string(), createZodV4FilterPredicateSchema()])\n .optional(),\n type: z.enum(entityCardTypes).optional(),\n },\n *factory(\n {\n loader,\n filter,\n type,\n }: {\n loader: () => Promise<JSX.Element>;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n type?: EntityCardType;\n },\n { node, config },\n ) {\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n yield* resolveEntityFilterData(filter, config, node);\n\n const finalType = config.type ?? type;\n if (finalType) {\n yield entityCardTypeDataRef(finalType);\n }\n },\n});\n"],"names":[],"mappings":";;;;;;AAwCO,MAAM,sBAAsB,wBAAA,CAAyB;AAAA,EAC1D,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,iCAAA,EAAmC,OAAO,OAAA,EAAQ;AAAA,EAClE,MAAA,EAAQ;AAAA,IACN,iBAAA,CAAkB,YAAA;AAAA,IAClB,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC,sBAAsB,QAAA;AAAS,GACjC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,IAAA,EAAM;AAAA,GACR;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,CAAA,CACL,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,gCAAA,EAAkC,CAAC,CAAA,CACtD,QAAA,EAAS;AAAA,IACZ,IAAA,EAAM,CAAA,CAAE,IAAA,CAAK,eAAe,EAAE,QAAA;AAAS,GACzC;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE,MAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF,EAKA,EAAE,IAAA,EAAM,MAAA,EAAO,EACf;AACA,IAAA,MAAM,kBAAkB,YAAA,CAAa,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAM,CAAC,CAAA;AAEzE,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,MAAM,SAAA,GAAY,OAAO,IAAA,IAAQ,IAAA;AACjC,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,MAAM,sBAAsB,SAAS,CAAA;AAAA,IACvC;AAAA,EACF;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityContentBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n coreExtensionData,\n createExtensionBlueprint,\n ExtensionBoundary,\n RouteRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityContentTitleDataRef,\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n entityContentGroupDataRef,\n defaultEntityContentGroups,\n entityContentIconDataRef,\n} from './extensionData';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\nimport { ReactElement } from 'react';\nimport { z } from 'zod/v4';\n\n/**\n * @alpha\n * Creates an EntityContent extension.\n */\nexport const EntityContentBlueprint = createExtensionBlueprint({\n kind: 'entity-content',\n attachTo: { id: 'page:catalog/entity', input: 'contents' },\n output: [\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n entityContentTitleDataRef,\n coreExtensionData.routeRef.optional(),\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityContentGroupDataRef.optional(),\n entityContentIconDataRef.optional(),\n ],\n dataRefs: {\n title: entityContentTitleDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n group: entityContentGroupDataRef,\n icon: entityContentIconDataRef,\n },\n configSchema: {\n path: z.string().optional(),\n title: z.string().optional(),\n filter: z\n .union([z.string(), createZodV4FilterPredicateSchema()])\n .optional(),\n group: z.literal(false).or(z.string()).optional(),\n icon: z.string().optional(),\n },\n *factory(\n params: {\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultPath?: [Error: `Use the 'path' param instead`];\n path: string;\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultTitle?: [Error: `Use the 'title' param instead`];\n title: string;\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultGroup?: [Error: `Use the 'group' param instead`];\n group?: keyof typeof defaultEntityContentGroups | (string & {});\n icon?: string | ReactElement;\n loader: () => Promise<JSX.Element>;\n routeRef?: RouteRef;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n const path = config.path ?? params.path ?? params.defaultPath;\n const title = config.title ?? params.title ?? params.defaultTitle;\n const icon = config.icon ?? params.icon;\n const group = config.group ?? params.group ?? params.defaultGroup;\n\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n );\n\n yield coreExtensionData.routePath(path);\n\n yield entityContentTitleDataRef(title);\n\n if (params.routeRef) {\n yield coreExtensionData.routeRef(params.routeRef);\n }\n\n yield* resolveEntityFilterData(params.filter, config, node);\n\n if (group && typeof group === 'string') {\n yield entityContentGroupDataRef(group);\n }\n if (icon) {\n yield entityContentIconDataRef(icon);\n }\n },\n});\n"],"names":[],"mappings":";;;;;;AA2CO,MAAM,yBAAyB,wBAAA,CAAyB;AAAA,EAC7D,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,UAAA,EAAW;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,iBAAA,CAAkB,YAAA;AAAA,IAClB,iBAAA,CAAkB,SAAA;AAAA,IAClB,yBAAA;AAAA,IACA,iBAAA,CAAkB,SAAS,QAAA,EAAS;AAAA,IACpC,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC,0BAA0B,QAAA,EAAS;AAAA,IACnC,yBAAyB,QAAA;AAAS,GACpC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,yBAAA;AAAA,IACP,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,KAAA,EAAO,yBAAA;AAAA,IACP,IAAA,EAAM;AAAA,GACR;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC1B,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC3B,MAAA,EAAQ,CAAA,CACL,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,E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,MAAM,yBAAyB,IAAI,CAAA;AAAA,IACrC;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityContentBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n coreExtensionData,\n createExtensionBlueprint,\n ExtensionBoundary,\n RouteRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityContentTitleDataRef,\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n entityContentGroupDataRef,\n defaultEntityContentGroups,\n entityContentIconDataRef,\n} from './extensionData';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\nimport { ReactElement } from 'react';\nimport { z } from 'zod/v4';\n\n/**\n * @alpha\n * Creates an EntityContent extension.\n */\nexport const EntityContentBlueprint = createExtensionBlueprint({\n kind: 'entity-content',\n attachTo: { id: 'page:catalog/entity', input: 'contents' },\n output: [\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n entityContentTitleDataRef,\n coreExtensionData.routeRef.optional(),\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityContentGroupDataRef.optional(),\n entityContentIconDataRef.optional(),\n ],\n dataRefs: {\n title: entityContentTitleDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n group: entityContentGroupDataRef,\n icon: entityContentIconDataRef,\n },\n configSchema: {\n path: z.string().optional(),\n title: z.string().optional(),\n filter: z\n .union([z.string(), createZodV4FilterPredicateSchema()])\n .optional(),\n group: z.literal(false).or(z.string()).optional(),\n icon: z.string().optional(),\n },\n *factory(\n params: {\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultPath?: [Error: `Use the 'path' param instead`];\n path: string;\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultTitle?: [Error: `Use the 'title' param instead`];\n title: string;\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultGroup?: [Error: `Use the 'group' param instead`];\n group?: keyof typeof defaultEntityContentGroups | (string & {});\n icon?: string | ReactElement;\n loader: () => Promise<JSX.Element>;\n routeRef?: RouteRef;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n const path = config.path ?? params.path ?? params.defaultPath;\n const title = config.title ?? params.title ?? params.defaultTitle;\n const icon = config.icon ?? params.icon;\n const group = config.group ?? params.group ?? params.defaultGroup;\n\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n );\n\n yield coreExtensionData.routePath(path);\n\n yield entityContentTitleDataRef(title);\n\n if (params.routeRef) {\n yield coreExtensionData.routeRef(params.routeRef);\n }\n\n yield* resolveEntityFilterData(params.filter, config, node);\n\n if (group && typeof group === 'string') {\n yield entityContentGroupDataRef(group);\n }\n if (icon) {\n yield entityContentIconDataRef(icon);\n }\n },\n});\n"],"names":[],"mappings":";;;;;;AA2CO,MAAM,yBAAyB,wBAAA,CAAyB;AAAA,EAC7D,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,UAAA,EAAW;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,iBAAA,CAAkB,YAAA;AAAA,IAClB,iBAAA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AQ,MAAA,CAAO,KAAA,IAAS,MAAA,CAAO,SAAS,MAAA,CAAO,YAAA;AAErD,IAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,MACtB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAA,CAAO,MAAM;AAAA,KAC5C;AAEA,IAAA,MAAM,iBAAA,CAAkB,UAAU,IAAI,CAAA;AAEtC,IAAA,MAAM,0BAA0B,KAAK,CAAA;AAErC,IAAA,IAAI,OAAO,QAAA,EAAU;AACnB,MAAA,MAAM,iBAAA,CAAkB,QAAA,CAAS,MAAA,CAAO,QAAQ,CAAA;AAAA,IAClD;AAEA,IAAA,OAAO,uBAAA,CAAwB,MAAA,CAAO,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAE1D,IAAA,IAAI,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,EAAU;AACtC,MAAA,MAAM,0BAA0B,KAAK,CAAA;AAAA,IACvC;AACA,IAAA,IAAI,IAAA,EAAM;AACR,MAAA,MAAM,yBAAyB,IAAI,CAAA;AAAA,IACrC;AAAA,EACF;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityContentLayoutBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentLayoutBlueprint.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 {\n createExtensionDataRef,\n createExtensionBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n EntityCardType,\n} from './extensionData';\nimport { JSX } from 'react';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { z } from 'zod/v4';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport interface EntityContentLayoutProps {\n cards: Array<{\n type?: EntityCardType;\n element: JSX.Element;\n }>;\n}\n\nconst entityCardLayoutComponentDataRef = createExtensionDataRef<\n (props: EntityContentLayoutProps) => React.JSX.Element\n>().with({\n id: 'catalog.entity-content-layout.component',\n});\n\n/** @alpha */\nexport const EntityContentLayoutBlueprint = createExtensionBlueprint({\n kind: 'entity-content-layout',\n attachTo: { id: 'entity-content:catalog/overview', input: 'layouts' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityCardLayoutComponentDataRef,\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n component: entityCardLayoutComponentDataRef,\n },\n configSchema: {\n type: z.string().optional(),\n filter: z\n .union([z.string(), createZodV4FilterPredicateSchema()])\n .optional(),\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n loader: () => Promise<(props: EntityContentLayoutProps) => JSX.Element>;\n },\n { node, config },\n ) {\n yield* resolveEntityFilterData(filter, config, node);\n\n yield entityCardLayoutComponentDataRef(\n ExtensionBoundary.lazyComponent(node, loader),\n );\n },\n});\n"],"names":[],"mappings":";;;;;;AA2CA,MAAM,gCAAA,GAAmC,sBAAA,EAEvC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,+BAA+B,wBAAA,CAAyB;AAAA,EACnE,IAAA,EAAM,uBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,iCAAA,EAAmC,OAAO,SAAA,EAAU;AAAA,EACpE,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,SAAA,EAAW;AAAA,GACb;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC1B,MAAA,EAAQ,CAAA,CACL,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,gCAAA,EAAkC,CAAC,CAAA,CACtD,QAAA;AAAS,GACd;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE,MAAA;AAAA,IACA;AAAA,GACF,EAIA,EAAE,IAAA,EAAM,MAAA,EAAO,EACf;AACA,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,MAAM,gCAAA;AAAA,MACJ,iBAAA,CAAkB,aAAA,CAAc,IAAA,EAAM,MAAM;AAAA,KAC9C;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityContentLayoutBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentLayoutBlueprint.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 {\n createExtensionDataRef,\n createExtensionBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n EntityCardType,\n} from './extensionData';\nimport { JSX } from 'react';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { z } from 'zod/v4';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport interface EntityContentLayoutProps {\n cards: Array<{\n type?: EntityCardType;\n element: JSX.Element;\n }>;\n}\n\nconst entityCardLayoutComponentDataRef = createExtensionDataRef<\n (props: EntityContentLayoutProps) => React.JSX.Element\n>().with({\n id: 'catalog.entity-content-layout.component',\n});\n\n/** @alpha */\nexport const EntityContentLayoutBlueprint = createExtensionBlueprint({\n kind: 'entity-content-layout',\n attachTo: { id: 'entity-content:catalog/overview', input: 'layouts' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityCardLayoutComponentDataRef,\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n component: entityCardLayoutComponentDataRef,\n },\n configSchema: {\n type: z.string().optional(),\n filter: z\n .union([z.string(), createZodV4FilterPredicateSchema()])\n .optional(),\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n loader: () => Promise<(props: EntityContentLayoutProps) => JSX.Element>;\n },\n { node, config },\n ) {\n yield* resolveEntityFilterData(filter, config, node);\n\n yield entityCardLayoutComponentDataRef(\n ExtensionBoundary.lazyComponent(node, loader),\n );\n },\n});\n"],"names":[],"mappings":";;;;;;AA2CA,MAAM,gCAAA,GAAmC,sBAAA,EAEvC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,+BAA+B,wBAAA,CAAyB;AAAA,EACnE,IAAA,EAAM,uBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,iCAAA,EAAmC,OAAO,SAAA,EAAU;AAAA,EACpE,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,SAAA,EAAW;AAAA,GACb;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC1B,MAAA,EAAQ,CAAA,CACL,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,gCAAA,EAAkC,CAAC,CAAA,CACtD,QAAA;AAAS,GACd;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE,MAAA;AAAA,IACA;AAAA,GACF,EAIA,EAAE,IAAA,EAAM,MAAA,EAAO,EACf;AACA,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,MAAM,gCAAA;AAAA,MACJ,iBAAA,CAAkB,aAAA,CAAc,IAAA,EAAM,MAAM;AAAA,KAC9C;AAAA,EACF;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityContextMenuItemBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContextMenuItemBlueprint.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 {\n createExtensionBlueprint,\n type IconElement,\n} from '@backstage/frontend-plugin-api';\nimport {\n FilterPredicate,\n filterPredicateToFilterFunction,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport type { Entity } from '@backstage/catalog-model';\nimport {\n entityContextMenuItemDataRef,\n entityFilterFunctionDataRef,\n type UseProps,\n} from './extensionData';\n\nexport type { EntityContextMenuItemData, UseProps } from './extensionData';\n\n/** @alpha */\nexport type EntityContextMenuItemParams = {\n useProps: UseProps;\n icon: IconElement;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n};\n\n/** @alpha */\nexport const EntityContextMenuItemBlueprint = createExtensionBlueprint({\n kind: 'entity-context-menu-item',\n attachTo: { id: 'page:catalog/entity', input: 'contextMenuItems' },\n output: [\n entityContextMenuItemDataRef,\n entityFilterFunctionDataRef.optional(),\n ],\n dataRefs: {\n data: entityContextMenuItemDataRef,\n filterFunction: entityFilterFunctionDataRef,\n },\n configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n *factory(params: EntityContextMenuItemParams, { config }) {\n yield entityContextMenuItemDataRef({\n icon: params.icon,\n useProps: params.useProps,\n });\n\n if (config.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof params.filter === 'function') {\n yield entityFilterFunctionDataRef(params.filter);\n } else if (params.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(params.filter),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;AA0CO,MAAM,iCAAiC,wBAAA,CAAyB;AAAA,EACrE,IAAA,EAAM,0BAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,kBAAA,EAAmB;AAAA,EACjE,MAAA,EAAQ;AAAA,IACN,4BAAA;AAAA,IACA,4BAA4B,QAAA;AAAS,GACvC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,4BAAA;AAAA,IACN,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,CAAC,OAAA,CAAQ,MAAA,EAAqC,EAAE,QAAO,EAAG;AACxD,IAAA,MAAM,4BAAA,CAA6B;AAAA,MACjC,MAAM,MAAA,CAAO,IAAA;AAAA,MACb,UAAU,MAAA,CAAO;AAAA,KAClB,CAAA;AAED,IAAA,IAAI,OAAO,MAAA,EAAQ;AACjB,MAAA,MAAM,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA,IACF,CAAA,MAAA,IAAW,OAAO,MAAA,CAAO,MAAA,KAAW,UAAA,EAAY;AAC9C,MAAA,MAAM,2BAAA,CAA4B,OAAO,MAAM,CAAA;AAAA,IACjD,CAAA,MAAA,IAAW,OAAO,MAAA,EAAQ;AACxB,MAAA,MAAM,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityContextMenuItemBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContextMenuItemBlueprint.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 {\n createExtensionBlueprint,\n type IconElement,\n} from '@backstage/frontend-plugin-api';\nimport {\n FilterPredicate,\n filterPredicateToFilterFunction,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport type { Entity } from '@backstage/catalog-model';\nimport {\n entityContextMenuItemDataRef,\n entityFilterFunctionDataRef,\n type UseProps,\n} from './extensionData';\n\nexport type { EntityContextMenuItemData, UseProps } from './extensionData';\n\n/** @alpha */\nexport type EntityContextMenuItemParams = {\n useProps: UseProps;\n icon: IconElement;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n};\n\n/** @alpha */\nexport const EntityContextMenuItemBlueprint = createExtensionBlueprint({\n kind: 'entity-context-menu-item',\n attachTo: { id: 'page:catalog/entity', input: 'contextMenuItems' },\n output: [\n entityContextMenuItemDataRef,\n entityFilterFunctionDataRef.optional(),\n ],\n dataRefs: {\n data: entityContextMenuItemDataRef,\n filterFunction: entityFilterFunctionDataRef,\n },\n configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n *factory(params: EntityContextMenuItemParams, { config }) {\n yield entityContextMenuItemDataRef({\n icon: params.icon,\n useProps: params.useProps,\n });\n\n if (config.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof params.filter === 'function') {\n yield entityFilterFunctionDataRef(params.filter);\n } else if (params.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(params.filter),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;AA0CO,MAAM,iCAAiC,wBAAA,CAAyB;AAAA,EACrE,IAAA,EAAM,0BAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,kBAAA,EAAmB;AAAA,EACjE,MAAA,EAAQ;AAAA,IACN,4BAAA;AAAA,IACA,4BAA4B,QAAA;AAAS,GACvC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,4BAAA;AAAA,IACN,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,CAAC,OAAA,CAAQ,MAAA,EAAqC,EAAE,QAAO,EAAG;AACxD,IAAA,MAAM,4BAAA,CAA6B;AAAA,MACjC,MAAM,MAAA,CAAO,IAAA;AAAA,MACb,UAAU,MAAA,CAAO;AAAA,KAClB,CAAA;AAED,IAAA,IAAI,OAAO,MAAA,EAAQ;AACjB,MAAA,MAAM,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA,IACF,CAAA,MAAA,IAAW,OAAO,MAAA,CAAO,MAAA,KAAW,UAAA,EAAY;AAC9C,MAAA,MAAM,2BAAA,CAA4B,OAAO,MAAM,CAAA;AAAA,IACjD,CAAA,MAAA,IAAW,OAAO,MAAA,EAAQ;AACxB,MAAA,MAAM,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA,IACF;AAAA,EACF;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityHeaderBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderBlueprint.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 {\n createExtensionBlueprint,\n coreExtensionData,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\n\n/**\n * @alpha\n * @deprecated Use {@link EntityHeaderLayoutBlueprint} instead. This legacy\n * blueprint renders an opaque header element through the temporary Catalog\n * entity-page fallback.\n */\nexport const EntityHeaderBlueprint = createExtensionBlueprint({\n kind: 'entity-header',\n attachTo: { id: 'page:catalog/entity', input: 'headers' },\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n element: coreExtensionData.reactElement,\n },\n configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n coreExtensionData.reactElement.optional(),\n ],\n *factory(\n params: {\n loader: () => Promise<JSX.Element>;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n const { loader, filter } = params;\n\n yield* resolveEntityFilterData(filter, config, node);\n\n if (loader) {\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, loader),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAsCO,MAAM,wBAAwB,wBAAA,CAAyB;AAAA,EAC5D,IAAA,EAAM,eAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,SAAA,EAAU;AAAA,EACxD,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,SAAS,iBAAA,CAAkB;AAAA,GAC7B;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC,iBAAA,CAAkB,aAAa,QAAA;AAAS,GAC1C;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAIA,EAAE,IAAA,EAAM,QAAO,EACf;AACA,IAAA,MAAM,EAAE,MAAA,EAAQ,MAAA,EAAO,GAAI,MAAA;AAE3B,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,QACtB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAM;AAAA,OACrC;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityHeaderBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderBlueprint.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 {\n createExtensionBlueprint,\n coreExtensionData,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\n\n/**\n * @alpha\n * @deprecated Use {@link EntityHeaderLayoutBlueprint} instead. This legacy\n * blueprint renders an opaque header element through the temporary Catalog\n * entity-page fallback.\n */\nexport const EntityHeaderBlueprint = createExtensionBlueprint({\n kind: 'entity-header',\n attachTo: { id: 'page:catalog/entity', input: 'headers' },\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n element: coreExtensionData.reactElement,\n },\n configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n coreExtensionData.reactElement.optional(),\n ],\n *factory(\n params: {\n loader: () => Promise<JSX.Element>;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n const { loader, filter } = params;\n\n yield* resolveEntityFilterData(filter, config, node);\n\n if (loader) {\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, loader),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAsCO,MAAM,wBAAwB,wBAAA,CAAyB;AAAA,EAC5D,IAAA,EAAM,eAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,SAAA,EAAU;AAAA,EACxD,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,SAAS,iBAAA,CAAkB;AAAA,GAC7B;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC,iBAAA,CAAkB,aAAa,QAAA;AAAS,GAC1C;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAIA,EAAE,IAAA,EAAM,QAAO,EACf;AACA,IAAA,MAAM,EAAE,MAAA,EAAQ,MAAA,EAAO,GAAI,MAAA;AAE3B,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,QACtB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAM;AAAA,OACrC;AAAA,IACF;AAAA,EACF;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityHeaderLayoutBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderLayoutBlueprint.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 {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n filterPredicateToFilterFunction,\n} from '@backstage/filter-predicates';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { JSX } from 'react';\nimport { entityFilterFunctionDataRef } from './extensionData';\n\n/** @alpha */\nexport interface EntityHeaderLayoutProps {\n tabs: Array<\n | {\n id: string;\n label: string;\n href: string;\n }\n | {\n id: string;\n label: string;\n items: Array<{\n id: string;\n label: string;\n href: string;\n }>;\n }\n >;\n activeTabId?: string;\n}\n\nconst entityHeaderLayoutComponentDataRef = createExtensionDataRef<\n (props: EntityHeaderLayoutProps) => JSX.Element\n>().with({\n id: 'catalog.entity-header-layout.component',\n});\n\n/** @alpha */\nexport const EntityHeaderLayoutBlueprint = createExtensionBlueprint({\n kind: 'entity-header-layout',\n attachTo: { id: 'page:catalog/entity', input: 'headerLayouts' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityHeaderLayoutComponentDataRef,\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n component: entityHeaderLayoutComponentDataRef,\n },\n configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n loader: () => Promise<(props: EntityHeaderLayoutProps) => JSX.Element>;\n },\n { node, config },\n ) {\n if (config.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof filter === 'function') {\n yield entityFilterFunctionDataRef(filter);\n } else if (filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(filter),\n );\n }\n yield entityHeaderLayoutComponentDataRef(\n ExtensionBoundary.lazyComponent(node, loader),\n );\n },\n});\n"],"names":[],"mappings":";;;;AAmDA,MAAM,kCAAA,GAAqC,sBAAA,EAEzC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,8BAA8B,wBAAA,CAAyB;AAAA,EAClE,IAAA,EAAM,sBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,eAAA,EAAgB;AAAA,EAC9D,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,SAAA,EAAW;AAAA,GACb;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE,MAAA;AAAA,IACA;AAAA,GACF,EAIA,EAAE,IAAA,EAAM,MAAA,EAAO,EACf;AACA,IAAA,IAAI,OAAO,MAAA,EAAQ;AACjB,MAAA,MAAM,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA,IACF,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,UAAA,EAAY;AACvC,MAAA,MAAM,4BAA4B,MAAM,CAAA;AAAA,IAC1C,WAAW,MAAA,EAAQ;AACjB,MAAA,MAAM,2BAAA;AAAA,QACJ,gCAAgC,MAAM;AAAA,OACxC;AAAA,IACF;AACA,IAAA,MAAM,kCAAA;AAAA,MACJ,iBAAA,CAAkB,aAAA,CAAc,IAAA,EAAM,MAAM;AAAA,KAC9C;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityHeaderLayoutBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderLayoutBlueprint.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 {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n filterPredicateToFilterFunction,\n} from '@backstage/filter-predicates';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { JSX } from 'react';\nimport { entityFilterFunctionDataRef } from './extensionData';\n\n/** @alpha */\nexport interface EntityHeaderLayoutProps {\n tabs: Array<\n | {\n id: string;\n label: string;\n href: string;\n }\n | {\n id: string;\n label: string;\n items: Array<{\n id: string;\n label: string;\n href: string;\n }>;\n }\n >;\n activeTabId?: string;\n}\n\nconst entityHeaderLayoutComponentDataRef = createExtensionDataRef<\n (props: EntityHeaderLayoutProps) => JSX.Element\n>().with({\n id: 'catalog.entity-header-layout.component',\n});\n\n/** @alpha */\nexport const EntityHeaderLayoutBlueprint = createExtensionBlueprint({\n kind: 'entity-header-layout',\n attachTo: { id: 'page:catalog/entity', input: 'headerLayouts' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityHeaderLayoutComponentDataRef,\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n component: entityHeaderLayoutComponentDataRef,\n },\n configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n loader: () => Promise<(props: EntityHeaderLayoutProps) => JSX.Element>;\n },\n { node, config },\n ) {\n if (config.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof filter === 'function') {\n yield entityFilterFunctionDataRef(filter);\n } else if (filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(filter),\n );\n }\n yield entityHeaderLayoutComponentDataRef(\n ExtensionBoundary.lazyComponent(node, loader),\n );\n },\n});\n"],"names":[],"mappings":";;;;AAmDA,MAAM,kCAAA,GAAqC,sBAAA,EAEzC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,8BAA8B,wBAAA,CAAyB;AAAA,EAClE,IAAA,EAAM,sBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,eAAA,EAAgB;AAAA,EAC9D,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,SAAA,EAAW;AAAA,GACb;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE,MAAA;AAAA,IACA;AAAA,GACF,EAIA,EAAE,IAAA,EAAM,MAAA,EAAO,EACf;AACA,IAAA,IAAI,OAAO,MAAA,EAAQ;AACjB,MAAA,MAAM,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA,IACF,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,UAAA,EAAY;AACvC,MAAA,MAAM,4BAA4B,MAAM,CAAA;AAAA,IAC1C,WAAW,MAAA,EAAQ;AACjB,MAAA,MAAM,2BAAA;AAAA,QACJ,gCAAgC,MAAM;AAAA,OACxC;AAAA,IACF;AACA,IAAA,MAAM,kCAAA;AAAA,MACJ,iBAAA,CAAkB,aAAA,CAAc,IAAA,EAAM,MAAM;AAAA,KAC9C;AAAA,EACF;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityIconLinkBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityIconLinkBlueprint.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 { IconLinkVerticalProps } from '@backstage/core-components';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\n\nimport { z } from 'zod/v4';\n\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\n\nconst entityIconLinkPropsDataRef = createExtensionDataRef<\n () => IconLinkVerticalProps\n>().with({\n id: 'entity-icon-link-props',\n});\n\n/** @alpha */\nexport const EntityIconLinkBlueprint = createExtensionBlueprint({\n kind: 'entity-icon-link',\n attachTo: { id: 'entity-card:catalog/about', input: 'iconLinks' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityIconLinkPropsDataRef,\n ],\n dataRefs: {\n useProps: entityIconLinkPropsDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n },\n configSchema: {\n label: z.string().optional(),\n title: z.string().optional(),\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n *factory(\n params: {\n useProps: () => Omit<IconLinkVerticalProps, 'color'>;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { config, node },\n ) {\n const { filter, useProps } = params;\n yield* resolveEntityFilterData(filter, config, node);\n // Only include properties that are defined in the config\n // to avoid overriding defaults with undefined values\n const configProps = Object.entries(config).reduce(\n (rest, [key, value]) =>\n value !== undefined\n ? {\n ...rest,\n [key]: value,\n }\n : rest,\n {},\n );\n yield entityIconLinkPropsDataRef(() => ({ ...useProps(), ...configProps }));\n },\n});\n"],"names":[],"mappings":";;;;;;AAoCA,MAAM,0BAAA,GAA6B,sBAAA,EAEjC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,0BAA0B,wBAAA,CAAyB;AAAA,EAC9D,IAAA,EAAM,kBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,2BAAA,EAA6B,OAAO,WAAA,EAAY;AAAA,EAChE,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,QAAA,EAAU,0BAAA;AAAA,IACV,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB;AAAA,GACpB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC3B,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC3B,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAIA,EAAE,MAAA,EAAQ,MAAK,EACf;AACA,IAAA,MAAM,EAAE,MAAA,EAAQ,QAAA,EAAS,GAAI,MAAA;AAC7B,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAGnD,IAAA,MAAM,WAAA,GAAc,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,CAAE,MAAA;AAAA,MACzC,CAAC,IAAA,EAAM,CAAC,KAAK,KAAK,CAAA,KAChB,UAAU,MAAA,GACN;AAAA,QACE,GAAG,IAAA;AAAA,QACH,CAAC,GAAG,GAAG;AAAA,OACT,GACA,IAAA;AAAA,MACN;AAAC,KACH;AACA,IAAA,MAAM,0BAAA,CAA2B,OAAO,EAAE,GAAG,UAAS,EAAG,GAAG,aAAY,CAAE,CAAA;AAAA,EAC5E;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityIconLinkBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityIconLinkBlueprint.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 { IconLinkVerticalProps } from '@backstage/core-components';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\n\nimport { z } from 'zod/v4';\n\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\n\nconst entityIconLinkPropsDataRef = createExtensionDataRef<\n () => IconLinkVerticalProps\n>().with({\n id: 'entity-icon-link-props',\n});\n\n/** @alpha */\nexport const EntityIconLinkBlueprint = createExtensionBlueprint({\n kind: 'entity-icon-link',\n attachTo: { id: 'entity-card:catalog/about', input: 'iconLinks' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityIconLinkPropsDataRef,\n ],\n dataRefs: {\n useProps: entityIconLinkPropsDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n },\n configSchema: {\n label: z.string().optional(),\n title: z.string().optional(),\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n *factory(\n params: {\n useProps: () => Omit<IconLinkVerticalProps, 'color'>;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { config, node },\n ) {\n const { filter, useProps } = params;\n yield* resolveEntityFilterData(filter, config, node);\n // Only include properties that are defined in the config\n // to avoid overriding defaults with undefined values\n const configProps = Object.entries(config).reduce(\n (rest, [key, value]) =>\n value !== undefined\n ? {\n ...rest,\n [key]: value,\n }\n : rest,\n {},\n );\n yield entityIconLinkPropsDataRef(() => ({ ...useProps(), ...configProps }));\n },\n});\n"],"names":[],"mappings":";;;;;;AAoCA,MAAM,0BAAA,GAA6B,sBAAA,EAEjC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,0BAA0B,wBAAA,CAAyB;AAAA,EAC9D,IAAA,EAAM,kBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,2BAAA,EAA6B,OAAO,WAAA,EAAY;AAAA,EAChE,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,QAAA,EAAU,0BAAA;AAAA,IACV,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB;AAAA,GACpB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC3B,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC3B,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAIA,EAAE,MAAA,EAAQ,MAAK,EACf;AACA,IAAA,MAAM,EAAE,MAAA,EAAQ,QAAA,EAAS,GAAI,MAAA;AAC7B,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAGnD,IAAA,MAAM,WAAA,GAAc,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,CAAE,MAAA;AAAA,MACzC,CAAC,IAAA,EAAM,CAAC,KAAK,KAAK,CAAA,KAChB,UAAU,MAAA,GACN;AAAA,QACE,GAAG,IAAA;AAAA,QACH,CAAC,GAAG,GAAG;AAAA,OACT,GACA,IAAA;AAAA,MACN;AAAC,KACH;AACA,IAAA,MAAM,0BAAA,CAA2B,OAAO,EAAE,GAAG,UAAS,EAAG,GAAG,aAAY,CAAE,CAAA;AAAA,EAC5E;AACF,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"extensionData.esm.js","sources":["../../../src/alpha/blueprints/extensionData.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 { Entity } from '@backstage/catalog-model';\nimport {\n createExtensionDataRef,\n type IconElement,\n} from '@backstage/frontend-plugin-api';\nimport { ReactElement, type ReactNode } from 'react';\n\n/** @alpha */\nexport type UseProps = () =>\n | {\n title: ReactNode;\n href: string;\n onClick?: () => void | Promise<void>;\n disabled?: boolean;\n }\n | {\n title: ReactNode;\n onClick: () => void | Promise<void>;\n disabled?: boolean;\n };\n\n/** @alpha */\nexport type EntityContextMenuItemData = {\n icon: IconElement;\n useProps: UseProps;\n};\n\n/** @internal */\nexport const entityContextMenuItemDataRef =\n createExtensionDataRef<EntityContextMenuItemData>().with({\n id: 'catalog.entity-context-menu-item-data',\n });\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n});\n\n/** @internal */\nexport const entityContentIconDataRef = createExtensionDataRef<\n string | ReactElement\n>().with({\n id: 'catalog.entity-content-icon',\n});\n\n/** @internal */\nexport const entityFilterFunctionDataRef = createExtensionDataRef<\n (entity: Entity) => boolean\n>().with({ id: 'catalog.entity-filter-function' });\n\n/** @internal */\nexport const entityFilterExpressionDataRef =\n createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n });\n\n/** @alpha */\nexport type EntityContentGroupDefinitions = Record<\n string,\n {\n title: string;\n icon?: string | ReactElement;\n /** Other group IDs that should be treated as aliases for this group. */\n aliases?: string[];\n /** How to sort the content items within this group. Overrides the page-level default. */\n contentOrder?: 'title' | 'natural';\n }\n>;\n\n/**\n * @alpha\n * Default entity content groups.\n */\nexport const defaultEntityContentGroupDefinitions = {\n overview: {\n title: 'Overview',\n },\n documentation: {\n title: 'Documentation',\n },\n development: {\n title: 'Development',\n },\n deployment: {\n title: 'Deployment',\n },\n operation: {\n title: 'Operation',\n },\n observability: {\n title: 'Observability',\n },\n} satisfies EntityContentGroupDefinitions;\n\n/**\n * @alpha\n * Default entity content groups.\n * @deprecated use defaultEntityContentGroupDefinitions\n */\nexport const defaultEntityContentGroups = Object.fromEntries(\n Object.entries(defaultEntityContentGroupDefinitions).map(\n ([key, { title }]) => [key, title],\n ),\n) as Record<keyof typeof defaultEntityContentGroupDefinitions, string>;\n\n/** @internal */\nexport const entityContentGroupDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-group',\n});\n\n/**\n * @internal\n * Available entity card types\n */\nexport const entityCardTypes = [\n 'info',\n 'content',\n] as const satisfies readonly EntityCardType[];\n\n/** @alpha */\nexport type EntityCardType = 'info' | 'content';\n\n/** @internal */\nexport const entityCardTypeDataRef =\n createExtensionDataRef<EntityCardType>().with({\n id: 'catalog.entity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AAuC,CAAE,IAAA,CAAK;AAAA,EAC5C,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"extensionData.esm.js","sources":["../../../src/alpha/blueprints/extensionData.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 { Entity } from '@backstage/catalog-model';\nimport {\n createExtensionDataRef,\n type IconElement,\n} from '@backstage/frontend-plugin-api';\nimport { ReactElement, type ReactNode } from 'react';\n\n/** @alpha */\nexport type UseProps = () =>\n | {\n title: ReactNode;\n href: string;\n onClick?: () => void | Promise<void>;\n disabled?: boolean;\n }\n | {\n title: ReactNode;\n onClick: () => void | Promise<void>;\n disabled?: boolean;\n };\n\n/** @alpha */\nexport type EntityContextMenuItemData = {\n icon: IconElement;\n useProps: UseProps;\n};\n\n/** @internal */\nexport const entityContextMenuItemDataRef =\n createExtensionDataRef<EntityContextMenuItemData>().with({\n id: 'catalog.entity-context-menu-item-data',\n });\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n});\n\n/** @internal */\nexport const entityContentIconDataRef = createExtensionDataRef<\n string | ReactElement\n>().with({\n id: 'catalog.entity-content-icon',\n});\n\n/** @internal */\nexport const entityFilterFunctionDataRef = createExtensionDataRef<\n (entity: Entity) => boolean\n>().with({ id: 'catalog.entity-filter-function' });\n\n/** @internal */\nexport const entityFilterExpressionDataRef =\n createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n });\n\n/** @alpha */\nexport type EntityContentGroupDefinitions = Record<\n string,\n {\n title: string;\n icon?: string | ReactElement;\n /** Other group IDs that should be treated as aliases for this group. */\n aliases?: string[];\n /** How to sort the content items within this group. Overrides the page-level default. */\n contentOrder?: 'title' | 'natural';\n }\n>;\n\n/**\n * @alpha\n * Default entity content groups.\n */\nexport const defaultEntityContentGroupDefinitions = {\n overview: {\n title: 'Overview',\n },\n documentation: {\n title: 'Documentation',\n },\n development: {\n title: 'Development',\n },\n deployment: {\n title: 'Deployment',\n },\n operation: {\n title: 'Operation',\n },\n observability: {\n title: 'Observability',\n },\n} satisfies EntityContentGroupDefinitions;\n\n/**\n * @alpha\n * Default entity content groups.\n * @deprecated use defaultEntityContentGroupDefinitions\n */\nexport const defaultEntityContentGroups = Object.fromEntries(\n Object.entries(defaultEntityContentGroupDefinitions).map(\n ([key, { title }]) => [key, title],\n ),\n) as Record<keyof typeof defaultEntityContentGroupDefinitions, string>;\n\n/** @internal */\nexport const entityContentGroupDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-group',\n});\n\n/**\n * @internal\n * Available entity card types\n */\nexport const entityCardTypes = [\n 'info',\n 'content',\n] as const satisfies readonly EntityCardType[];\n\n/** @alpha */\nexport type EntityCardType = 'info' | 'content';\n\n/** @internal */\nexport const entityCardTypeDataRef =\n createExtensionDataRef<EntityCardType>().with({\n id: 'catalog.entity-card-type',\n });\n"],"names":[],"mappings":";;AA4CO,MAAM,4BAAA,GACX,sBAAA,EAAkD,CAAE,IAAA,CAAK;AAAA,EACvD,EAAA,EAAI;AACN,CAAC;AAGI,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,wBAAA,GAA2B,sBAAA,EAEtC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,8BAA8B,sBAAA,EAEzC,CAAE,KAAK,EAAE,EAAA,EAAI,kCAAkC;AAG1C,MAAM,6BAAA,GACX,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EACpC,EAAA,EAAI;AACN,CAAC;AAmBI,MAAM,oCAAA,GAAuC;AAAA,EAClD,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA,GACT;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO;AAAA,GACT;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO;AAAA,GACT;AAAA,EACA,SAAA,EAAW;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA;AAEX;AAOO,MAAM,6BAA6B,MAAA,CAAO,WAAA;AAAA,EAC/C,MAAA,CAAO,OAAA,CAAQ,oCAAoC,CAAA,CAAE,GAAA;AAAA,IACnD,CAAC,CAAC,GAAA,EAAK,EAAE,OAAO,CAAA,KAAM,CAAC,GAAA,EAAK,KAAK;AAAA;AAErC;AAGO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAMM,MAAM,eAAA,GAAkB;AAAA,EAC7B,MAAA;AAAA,EACA;AACF;AAMO,MAAM,qBAAA,GACX,sBAAA,EAAuC,CAAE,IAAA,CAAK;AAAA,EAC5C,EAAA,EAAI;AACN,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveEntityFilterData.esm.js","sources":["../../../src/alpha/blueprints/resolveEntityFilterData.ts"],"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 {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\nimport {\n FilterPredicate,\n filterPredicateToFilterFunction,\n} from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { AppNode } from '@backstage/frontend-plugin-api';\n\nexport function* resolveEntityFilterData(\n filter: ((entity: Entity) => boolean) | FilterPredicate | string | undefined,\n config: { filter?: FilterPredicate | string },\n node: AppNode,\n) {\n if (typeof config.filter === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Using a string-based filter in the configuration for '${node.spec.id}' is deprecated. Use an entity predicate object instead.`,\n );\n yield entityFilterExpressionDataRef(config.filter);\n } else if (config.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof filter === 'function') {\n yield entityFilterFunctionDataRef(filter);\n } else if (typeof filter === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Using a string as the default filter for '${node.spec.id}' is deprecated. Use an entity predicate object instead.`,\n );\n yield entityFilterExpressionDataRef(filter);\n } else if (filter) {\n yield entityFilterFunctionDataRef(filterPredicateToFilterFunction(filter));\n }\n}\n"],"names":[],"mappings":";;;AA2BO,UAAU,uBAAA,CACf,MAAA,EACA,MAAA,EACA,IAAA,EACA;AACA,EAAA,IAAI,OAAO,MAAA,CAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,2EAAA,EAA8E,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAC5F;AACA,IAAA,MAAM,6BAAA,CAA8B,OAAO,MAAM,CAAA;AAAA,EACnD,CAAA,MAAA,IAAW,OAAO,MAAA,EAAQ;AACxB,IAAA,MAAM,2BAAA;AAAA,MACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,KAC/C;AAAA,EACF,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,UAAA,EAAY;AACvC,IAAA,MAAM,4BAA4B,MAAM,CAAA;AAAA,EAC1C,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,+DAAA,EAAkE,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAChF;AACA,IAAA,MAAM,8BAA8B,MAAM,CAAA;AAAA,EAC5C,WAAW,MAAA,EAAQ;AACjB,IAAA,MAAM,2BAAA,CAA4B,+BAAA,CAAgC,MAAM,CAAC,CAAA;AAAA,EAC3E;AACF;;;;"}
1
+ {"version":3,"file":"resolveEntityFilterData.esm.js","sources":["../../../src/alpha/blueprints/resolveEntityFilterData.ts"],"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 {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\nimport {\n FilterPredicate,\n filterPredicateToFilterFunction,\n} from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { AppNode } from '@backstage/frontend-plugin-api';\n\nexport function* resolveEntityFilterData(\n filter: ((entity: Entity) => boolean) | FilterPredicate | string | undefined,\n config: { filter?: FilterPredicate | string },\n node: AppNode,\n) {\n if (typeof config.filter === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Using a string-based filter in the configuration for '${node.spec.id}' is deprecated. Use an entity predicate object instead.`,\n );\n yield entityFilterExpressionDataRef(config.filter);\n } else if (config.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof filter === 'function') {\n yield entityFilterFunctionDataRef(filter);\n } else if (typeof filter === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Using a string as the default filter for '${node.spec.id}' is deprecated. Use an entity predicate object instead.`,\n );\n yield entityFilterExpressionDataRef(filter);\n } else if (filter) {\n yield entityFilterFunctionDataRef(filterPredicateToFilterFunction(filter));\n }\n}\n"],"names":[],"mappings":";;;AA2BO,UAAU,uBAAA,CACf,MAAA,EACA,MAAA,EACA,IAAA,EACA;AACA,EAAA,IAAI,OAAO,MAAA,CAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,2EAAA,EAA8E,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAC5F;AACA,IAAA,MAAM,6BAAA,CAA8B,OAAO,MAAM,CAAA;AAAA,EACnD,CAAA,MAAA,IAAW,OAAO,MAAA,EAAQ;AACxB,IAAA,MAAM,2BAAA;AAAA,MACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,KAC/C;AAAA,EACF,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,UAAA,EAAY;AACvC,IAAA,MAAM,4BAA4B,MAAM,CAAA;AAAA,EAC1C,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,+DAAA,EAAkE,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAChF;AACA,IAAA,MAAM,8BAA8B,MAAM,CAAA;AAAA,EAC5C,WAAW,MAAA,EAAQ;AACjB,IAAA,MAAM,2BAAA,CAA4B,+BAAA,CAAgC,MAAM,CAAC,CAAA;AAAA,EAC3E;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"convertLegacyEntityCardExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityCardExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { compatWrapper } from '@backstage/core-compat-api';\nimport { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport { ComponentType } from 'react';\nimport { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint';\nimport kebabCase from 'lodash/kebabCase';\nimport { FilterPredicate } from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityCardType } from '../blueprints/extensionData';\n\n/** @alpha */\nexport function convertLegacyEntityCardExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n type?: EntityCardType;\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Card$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (pluginId && name.toLowerCase().startsWith(pluginId.toLowerCase())) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n\n return EntityCardBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n loader: async () => compatWrapper(element),\n type: overrides?.type,\n },\n });\n}\n"],"names":[],"mappings":";;;;;;AA2BO,SAAS,gCAAA,CAC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024 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 { compatWrapper } from '@backstage/core-compat-api';\nimport { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport { ComponentType } from 'react';\nimport { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint';\nimport kebabCase from 'lodash/kebabCase';\nimport { FilterPredicate } from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityCardType } from '../blueprints/extensionData';\n\n/** @alpha */\nexport function convertLegacyEntityCardExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n type?: EntityCardType;\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Card$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (pluginId && name.toLowerCase().startsWith(pluginId.toLowerCase())) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n\n return EntityCardBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n loader: async () => compatWrapper(element),\n type: overrides?.type,\n },\n });\n}\n"],"names":[],"mappings":";;;;;;AA2BO,SAAS,gCAAA,CACd,iBACA,SAAA,EAKqB;AACrB,EAAA,MAAM,OAAA,uBAAW,eAAA,EAAA,EAAgB,CAAA;AAEjC,EAAA,MAAM,OAAA,GAAU,gBAAA,CAAyB,OAAA,EAAS,oBAAoB,CAAA;AACtE,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,MAAM,uBAAuB,CAAA;AAAA,EACzC;AAEA,EAAA,MAAM,MAAA,GAAS,gBAAA,CAAkC,OAAA,EAAS,aAAa,CAAA;AACvE,EAAA,MAAM,QAAA,GAAW,QAAQ,KAAA,EAAM;AAE/B,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,KAAA,CAAM,kBAAkB,CAAA;AAC9C,EAAA,MAAM,KAAA,GAAQ,KAAA,GAAQ,CAAC,CAAA,IAAK,OAAA;AAE5B,EAAA,IAAI,IAAA,GAA2B,KAAA;AAC/B,EAAA,IAAI,QAAA,IAAY,KAAK,WAAA,EAAY,CAAE,WAAW,QAAA,CAAS,WAAA,EAAa,CAAA,EAAG;AACrE,IAAA,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,QAAA,CAAS,MAAM,CAAA;AACjC,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,IAAA,GAAO,MAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,IAAA,GAAO,IAAA,IAAQ,UAAU,IAAI,CAAA;AAE7B,EAAA,OAAO,oBAAoB,IAAA,CAAK;AAAA,IAC9B,IAAA,EAAM,WAAW,IAAA,IAAQ,IAAA;AAAA,IACzB,MAAA,EAAQ;AAAA,MACN,QAAQ,SAAA,EAAW,MAAA;AAAA,MACnB,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO,CAAA;AAAA,MACzC,MAAM,SAAA,EAAW;AAAA;AACnB,GACD,CAAA;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"convertLegacyEntityContentExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityContentExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n BackstagePlugin,\n getComponentData,\n RouteRef as LegacyRouteRef,\n} from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport kebabCase from 'lodash/kebabCase';\nimport startCase from 'lodash/startCase';\nimport { ComponentType, ReactElement } from 'react';\nimport { EntityContentBlueprint } from '../blueprints/EntityContentBlueprint';\nimport { FilterPredicate } from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport function convertLegacyEntityContentExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n path?: string;\n title?: string;\n icon?: string | ReactElement;\n\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultPath?: [Error: `Use the 'path' override instead`];\n\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultTitle?: [Error: `Use the 'title' override instead`];\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const mountPoint = getComponentData<LegacyRouteRef>(\n element,\n 'core.mountPoint',\n );\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Content$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (pluginId && name.toLowerCase().startsWith(pluginId.toLowerCase())) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n return EntityContentBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n path: (overrides?.path ??\n overrides?.defaultPath ??\n `/${kebabCase(infix)}`) as string,\n title: (overrides?.title ??\n overrides?.defaultTitle ??\n startCase(infix)) as string,\n icon: overrides?.icon,\n routeRef: mountPoint && convertLegacyRouteRef(mountPoint),\n loader: async () => compatWrapper(element),\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;AAkCO,SAAS,mCAAA,CACd,iBACA,SAAA,EAiBqB;AACrB,EAAA,MAAM,OAAA,uBAAW,eAAA,EAAA,EAAgB,CAAA;AAEjC,EAAA,MAAM,OAAA,GAAU,gBAAA,CAAyB,OAAA,EAAS,oBAAoB,CAAA;AACtE,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,MAAM,uBAAuB,CAAA;AAAA,EACzC;AAEA,EAAA,MAAM,UAAA,GAAa,gBAAA;AAAA,IACjB,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,MAAA,GAAS,gBAAA,CAAkC,OAAA,EAAS,aAAa,CAAA;AACvE,EAAA,MAAM,QAAA,GAAW,QAAQ,KAAA,EAAM;AAE/B,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,KAAA,CAAM,qBAAqB,CAAA;AACjD,EAAA,MAAM,KAAA,GAAQ,KAAA,GAAQ,CAAC,CAAA,IAAK,OAAA;AAE5B,EAAA,IAAI,IAAA,GAA2B,KAAA;AAC/B,EAAA,IAAI,QAAA,IAAY,KAAK,WAAA,EAAY,CAAE,WAAW,QAAA,CAAS,WAAA,EAAa,CAAA,EAAG;AACrE,IAAA,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,QAAA,CAAS,MAAM,CAAA;AACjC,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,IAAA,GAAO,MAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,IAAA,GAAO,IAAA,IAAQ,UAAU,IAAI,CAAA;AAI7B,EAAA,OAAO,uBAAuB,IAAA,CAAK;AAAA,IACjC,IAAA,EAAM,WAAW,IAAA,IAAQ,IAAA;AAAA,IACzB,MAAA,EAAQ;AAAA,MACN,QAAQ,SAAA,EAAW,MAAA;AAAA,MACnB,IAAA,EAAO,WAAW,IAAA,IAChB,SAAA,EAAW,eACX,CAAA,CAAA,EAAI,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,MACtB,OAAQ,SAAA,EAAW,KAAA,IACjB,SAAA,EAAW,YAAA,IACX,UAAU,KAAK,CAAA;AAAA,MACjB,MAAM,SAAA,EAAW,IAAA;AAAA,MACjB,QAAA,EAAU,UAAA,IAAc,qBAAA,CAAsB,UAAU,CAAA;AAAA,MACxD,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO;AAAA;AAC3C,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"convertLegacyEntityContentExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityContentExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n BackstagePlugin,\n getComponentData,\n RouteRef as LegacyRouteRef,\n} from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport kebabCase from 'lodash/kebabCase';\nimport startCase from 'lodash/startCase';\nimport { ComponentType, ReactElement } from 'react';\nimport { EntityContentBlueprint } from '../blueprints/EntityContentBlueprint';\nimport { FilterPredicate } from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport function convertLegacyEntityContentExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n path?: string;\n title?: string;\n icon?: string | ReactElement;\n\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultPath?: [Error: `Use the 'path' override instead`];\n\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultTitle?: [Error: `Use the 'title' override instead`];\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const mountPoint = getComponentData<LegacyRouteRef>(\n element,\n 'core.mountPoint',\n );\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Content$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (pluginId && name.toLowerCase().startsWith(pluginId.toLowerCase())) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n return EntityContentBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n path: (overrides?.path ??\n overrides?.defaultPath ??\n `/${kebabCase(infix)}`) as string,\n title: (overrides?.title ??\n overrides?.defaultTitle ??\n startCase(infix)) as string,\n icon: overrides?.icon,\n routeRef: mountPoint && convertLegacyRouteRef(mountPoint),\n loader: async () => compatWrapper(element),\n },\n });\n}\n"],"names":[],"mappings":";;;;;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AQ,SAAA,EAAW,KAAA,IACjB,SAAA,EAAW,YAAA,IACX,UAAU,KAAK,CAAA;AAAA,MACjB,MAAM,SAAA,EAAW,IAAA;AAAA,MACjB,QAAA,EAAU,UAAA,IAAc,qBAAA,CAAsB,UAAU,CAAA;AAAA,MACxD,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO;AAAA;AAC3C,GACD,CAAA;AACH;;"}
package/dist/alpha.d.ts CHANGED
@@ -10,17 +10,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
10
10
  import { ColumnConfig, TableItem } from '@backstage/ui';
11
11
  import { EntityPresentationApi } from '@backstage/plugin-catalog-react';
12
12
 
13
- /**
14
- * Returns true if the `owner` argument is a direct owner on the `entity` argument.
15
- *
16
- * @alpha
17
- * @remarks
18
- *
19
- * Note that this ownership is not the same as using the claims in the auth-resolver, it only will take into account ownership as expressed by direct entity relations.
20
- * It doesn't know anything about the additional groups that a user might belong to which the claims contain.
21
- */
22
- declare function isOwnerOf(owner: Entity, entity: Entity): boolean;
23
-
24
13
  /**
25
14
  * Creates Catalog Filter Extensions
26
15
  * @alpha
@@ -378,6 +367,17 @@ declare function convertLegacyEntityContentExtension(LegacyExtension: ComponentT
378
367
  defaultTitle?: [Error: `Use the 'title' override instead`];
379
368
  }): ExtensionDefinition;
380
369
 
370
+ /**
371
+ * Returns true if the `owner` argument is a direct owner on the `entity` argument.
372
+ *
373
+ * @alpha
374
+ * @remarks
375
+ *
376
+ * Note that this ownership is not the same as using the claims in the auth-resolver, it only will take into account ownership as expressed by direct entity relations.
377
+ * It doesn't know anything about the additional groups that a user might belong to which the claims contain.
378
+ */
379
+ declare function isOwnerOf(owner: Entity, entity: Entity): boolean;
380
+
381
381
  /**
382
382
  * A thin wrapper around the
383
383
  * {@link @backstage/plugin-permission-react#usePermission} hook which uses the
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './blueprints';\nexport * from './converters';\nimport { catalogReactTranslationRef as _catalogReactTranslationRef } from '../translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-catalog-react` instead.\n */\nexport const catalogReactTranslationRef = _catalogReactTranslationRef;\nexport { isOwnerOf } from '../utils/isOwnerOf';\nexport { useEntityPermission } from '../hooks/useEntityPermission';\nexport * from '../components/EntityTable/TitleColumn';\nexport * from '../components/EntityDataTable';\nexport * from '../components/EntityRelationCard';\n"],"names":["_catalogReactTranslationRef"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,0BAAA,GAA6BA;;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './blueprints';\nexport * from './converters';\nimport { catalogReactTranslationRef as _catalogReactTranslationRef } from '../translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-catalog-react` instead.\n */\nexport const catalogReactTranslationRef = _catalogReactTranslationRef;\nexport { isOwnerOf } from '../utils/isOwnerOf';\nexport { useEntityPermission } from '../hooks/useEntityPermission';\nexport * from '../components/EntityTable/TitleColumn';\nexport * from '../components/EntityDataTable';\nexport * from '../components/EntityRelationCard';\n"],"names":["_catalogReactTranslationRef"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,0BAAA,GAA6BA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"api.esm.js","sources":["../src/api.ts"],"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 { CatalogApi } from '@backstage/catalog-client';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * The API reference for the {@link @backstage/catalog-client#CatalogApi}.\n * @public\n */\nexport const catalogApiRef = createApiRef<CatalogApi>({\n id: 'plugin.catalog.service',\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,gBAAgB,YAAA,CAAyB;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"api.esm.js","sources":["../src/api.ts"],"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 { CatalogApi } from '@backstage/catalog-client';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * The API reference for the {@link @backstage/catalog-client#CatalogApi}.\n * @public\n */\nexport const catalogApiRef = createApiRef<CatalogApi>({\n id: 'plugin.catalog.service',\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,gBAAgB,YAAA,CAAyB;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityPresentationApi.esm.js","sources":["../../../src/apis/EntityPresentationApi/EntityPresentationApi.ts"],"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 { Entity } from '@backstage/catalog-model';\nimport {\n ApiRef,\n IconComponent,\n createApiRef,\n} from '@backstage/core-plugin-api';\nimport { Observable } from '@backstage/types';\n\n/**\n * An API that handles how to represent entities in the interface.\n *\n * @remarks\n *\n * There are several ways to consume this API depending on context:\n *\n * - In React components, use the {@link useEntityPresentation} hook to get a\n * reactive presentation snapshot that updates over time.\n *\n * - For simple inline rendering, use the {@link EntityDisplayName} component\n * which wraps the hook and renders a styled entity name with optional icon\n * and tooltip.\n *\n * - In non-React contexts such as sort comparators or data mappers, use the\n * {@link entityPresentationSnapshot} helper for synchronous access, or\n * the API directly via `forEntity().promise` in async loaders.\n *\n * @public\n */\nexport const entityPresentationApiRef: ApiRef<EntityPresentationApi> =\n createApiRef({\n id: 'plugin.catalog.entity-presentation',\n });\n\n/**\n * The visual presentation of an entity reference at some point in time.\n *\n * @public\n */\nexport interface EntityRefPresentationSnapshot {\n /**\n * The ref to the entity that this snapshot represents.\n *\n * @remarks\n *\n * Note that when the input data was broken or had missing vital pieces of\n * information, this string may contain placeholders such as \"unknown\". You\n * can therefore not necessarily assume that the ref is completely valid and\n * usable for example for forming a clickable link to the entity.\n */\n entityRef: string;\n /**\n * A string that can be used as a plain representation of the entity, for\n * example in a header or a link.\n *\n * @remarks\n *\n * The title may be short and not contain all of the information that the\n * entity holds. When rendering the primary title, you may also want to\n * make sure to add more contextual information nearby such as the icon or\n * secondary title, since the primary could for example just be the\n * `metadata.name` of the entity which might be ambiguous to the reader.\n */\n primaryTitle: string;\n /**\n * Optionally, some additional textual information about the entity, to be\n * used as a clarification on top of the primary title.\n *\n * @remarks\n *\n * This text can for example be rendered in a tooltip or be used as a\n * subtitle. It may not be sufficient to display on its own; it should\n * typically be used in conjunction with the primary title. It can contain\n * such information as the entity ref and/or a `spec.type` etc.\n */\n secondaryTitle?: string;\n /**\n * Optionally, an icon that represents the kind/type of entity.\n *\n * @remarks\n *\n * This icon should ideally be easily recognizable as the kind of entity, and\n * be used consistently throughout the Backstage interface. It can be rendered\n * both in larger formats such as in a header, or in smaller formats such as\n * inline with regular text, so bear in mind that the legibility should be\n * high in both cases.\n *\n * A value of `false` here indicates the desire to not have an icon present\n * for the given implementation. A value of `undefined` leaves it at the\n * discretion of the display layer to choose what to do (such as for example\n * showing a fallback icon).\n */\n Icon?: IconComponent | undefined | false;\n}\n\n/**\n * The visual presentation of an entity reference.\n *\n * @public\n */\nexport interface EntityRefPresentation {\n /**\n * The representation that's suitable to use for this entity right now.\n */\n snapshot: EntityRefPresentationSnapshot;\n /**\n * Some presentation implementations support emitting updated snapshots over\n * time, for example after retrieving additional data from the catalog or\n * elsewhere.\n */\n update$?: Observable<EntityRefPresentationSnapshot>;\n /**\n * A promise that resolves to a usable entity presentation.\n */\n promise: Promise<EntityRefPresentationSnapshot>;\n}\n\n/**\n * An API that decides how to visually represent entities in the interface.\n *\n * @remarks\n *\n * Most consumers will not need to interact with this interface directly.\n * Instead, use one of the following:\n *\n * - {@link useEntityPresentation} — React hook for reactive presentation data.\n *\n * - {@link EntityDisplayName} — React component that renders an entity name\n * with optional icon and tooltip.\n *\n * For non-React contexts, use the {@link entityPresentationSnapshot} helper\n * for synchronous access, or the API directly via `forEntity().promise`\n * for async contexts.\n *\n * Implement this interface to customize how entities are displayed throughout\n * the Backstage interface.\n *\n * @public\n */\nexport interface EntityPresentationApi {\n /**\n * Fetches the presentation for an entity.\n *\n * @param entityOrRef - Either an entity, or a string ref to it. If you pass\n * in an entity, it is assumed that it is not a partial one - i.e. only pass\n * in an entity if you know that it was fetched in such a way that it\n * contains all of the fields that the representation renderer needs.\n * @param context - Contextual information that may affect the presentation.\n */\n forEntity(\n entityOrRef: Entity | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n ): EntityRefPresentation;\n}\n"],"names":[],"mappings":";;AA4CO,MAAM,2BACX,YAAA,CAAa;AAAA,EACX,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"EntityPresentationApi.esm.js","sources":["../../../src/apis/EntityPresentationApi/EntityPresentationApi.ts"],"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 { Entity } from '@backstage/catalog-model';\nimport {\n ApiRef,\n IconComponent,\n createApiRef,\n} from '@backstage/core-plugin-api';\nimport { Observable } from '@backstage/types';\n\n/**\n * An API that handles how to represent entities in the interface.\n *\n * @remarks\n *\n * There are several ways to consume this API depending on context:\n *\n * - In React components, use the {@link useEntityPresentation} hook to get a\n * reactive presentation snapshot that updates over time.\n *\n * - For simple inline rendering, use the {@link EntityDisplayName} component\n * which wraps the hook and renders a styled entity name with optional icon\n * and tooltip.\n *\n * - In non-React contexts such as sort comparators or data mappers, use the\n * {@link entityPresentationSnapshot} helper for synchronous access, or\n * the API directly via `forEntity().promise` in async loaders.\n *\n * @public\n */\nexport const entityPresentationApiRef: ApiRef<EntityPresentationApi> =\n createApiRef({\n id: 'plugin.catalog.entity-presentation',\n });\n\n/**\n * The visual presentation of an entity reference at some point in time.\n *\n * @public\n */\nexport interface EntityRefPresentationSnapshot {\n /**\n * The ref to the entity that this snapshot represents.\n *\n * @remarks\n *\n * Note that when the input data was broken or had missing vital pieces of\n * information, this string may contain placeholders such as \"unknown\". You\n * can therefore not necessarily assume that the ref is completely valid and\n * usable for example for forming a clickable link to the entity.\n */\n entityRef: string;\n /**\n * A string that can be used as a plain representation of the entity, for\n * example in a header or a link.\n *\n * @remarks\n *\n * The title may be short and not contain all of the information that the\n * entity holds. When rendering the primary title, you may also want to\n * make sure to add more contextual information nearby such as the icon or\n * secondary title, since the primary could for example just be the\n * `metadata.name` of the entity which might be ambiguous to the reader.\n */\n primaryTitle: string;\n /**\n * Optionally, some additional textual information about the entity, to be\n * used as a clarification on top of the primary title.\n *\n * @remarks\n *\n * This text can for example be rendered in a tooltip or be used as a\n * subtitle. It may not be sufficient to display on its own; it should\n * typically be used in conjunction with the primary title. It can contain\n * such information as the entity ref and/or a `spec.type` etc.\n */\n secondaryTitle?: string;\n /**\n * Optionally, an icon that represents the kind/type of entity.\n *\n * @remarks\n *\n * This icon should ideally be easily recognizable as the kind of entity, and\n * be used consistently throughout the Backstage interface. It can be rendered\n * both in larger formats such as in a header, or in smaller formats such as\n * inline with regular text, so bear in mind that the legibility should be\n * high in both cases.\n *\n * A value of `false` here indicates the desire to not have an icon present\n * for the given implementation. A value of `undefined` leaves it at the\n * discretion of the display layer to choose what to do (such as for example\n * showing a fallback icon).\n */\n Icon?: IconComponent | undefined | false;\n}\n\n/**\n * The visual presentation of an entity reference.\n *\n * @public\n */\nexport interface EntityRefPresentation {\n /**\n * The representation that's suitable to use for this entity right now.\n */\n snapshot: EntityRefPresentationSnapshot;\n /**\n * Some presentation implementations support emitting updated snapshots over\n * time, for example after retrieving additional data from the catalog or\n * elsewhere.\n */\n update$?: Observable<EntityRefPresentationSnapshot>;\n /**\n * A promise that resolves to a usable entity presentation.\n */\n promise: Promise<EntityRefPresentationSnapshot>;\n}\n\n/**\n * An API that decides how to visually represent entities in the interface.\n *\n * @remarks\n *\n * Most consumers will not need to interact with this interface directly.\n * Instead, use one of the following:\n *\n * - {@link useEntityPresentation} — React hook for reactive presentation data.\n *\n * - {@link EntityDisplayName} — React component that renders an entity name\n * with optional icon and tooltip.\n *\n * For non-React contexts, use the {@link entityPresentationSnapshot} helper\n * for synchronous access, or the API directly via `forEntity().promise`\n * for async contexts.\n *\n * Implement this interface to customize how entities are displayed throughout\n * the Backstage interface.\n *\n * @public\n */\nexport interface EntityPresentationApi {\n /**\n * Fetches the presentation for an entity.\n *\n * @param entityOrRef - Either an entity, or a string ref to it. If you pass\n * in an entity, it is assumed that it is not a partial one - i.e. only pass\n * in an entity if you know that it was fetched in such a way that it\n * contains all of the fields that the representation renderer needs.\n * @param context - Contextual information that may affect the presentation.\n */\n forEntity(\n entityOrRef: Entity | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n ): EntityRefPresentation;\n}\n"],"names":[],"mappings":";;AA4CO,MAAM,2BACX,YAAA,CAAa;AAAA,EACX,EAAA,EAAI;AACN,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultEntityPresentation.esm.js","sources":["../../../src/apis/EntityPresentationApi/defaultEntityPresentation.ts"],"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 CompoundEntityRef,\n DEFAULT_NAMESPACE,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport get from 'lodash/get';\nimport { EntityRefPresentationSnapshot } from './EntityPresentationApi';\n\n/**\n * Returns the default representation of an entity.\n *\n * @remarks\n *\n * This is a synchronous helper that extracts a display name from an\n * already-loaded entity or entity ref. It resolves `primaryTitle` as the\n * first available value among `spec.profile.displayName`, `metadata.title`,\n * and a shortened entity ref string.\n *\n * This function is primarily used as the internal fallback within the\n * {@link EntityPresentationApi} when no custom implementation is registered.\n * In React components, use the {@link useEntityPresentation} hook or the\n * {@link EntityDisplayName} component. In non-React contexts, use\n * {@link entityPresentationSnapshot} which respects custom presentation\n * overrides and falls back to this function when no API is registered.\n *\n * @public\n * @param entityOrRef - Either an entity, or a ref to it.\n * @param context - Contextual information that may affect the presentation.\n */\nexport function defaultEntityPresentation(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n): EntityRefPresentationSnapshot {\n // NOTE(freben): This code may look convoluted, but it tries its very best to\n // be defensive and handling any type of malformed input and still producing\n // some form of result without crashing.\n const { kind, namespace, name, title, description, displayName, type } =\n getParts(entityOrRef);\n\n const entityRef: string = stringifyEntityRef({\n kind: kind || 'unknown',\n namespace: namespace || DEFAULT_NAMESPACE,\n name: name || 'unknown',\n });\n\n const shortRef = getShortRef({ kind, namespace, name, context });\n\n const primary = [displayName, title, shortRef].find(\n candidate => candidate && typeof candidate === 'string',\n )!;\n\n const secondary = [\n primary !== entityRef ? entityRef : undefined,\n type,\n description,\n ]\n .filter(candidate => candidate && typeof candidate === 'string')\n .join(' | ');\n\n return {\n entityRef,\n primaryTitle: primary,\n secondaryTitle: secondary || undefined,\n Icon: undefined, // leave it up to the presentation API to handle\n };\n}\n\nconst isString = (value: unknown): value is string =>\n Boolean(value) && typeof value === 'string';\n\n// Try to extract display-worthy parts of an entity or ref as best we can, without throwing\nfunction getParts(entityOrRef: Entity | CompoundEntityRef | string): {\n kind?: string;\n namespace?: string;\n name?: string;\n title?: string;\n description?: string;\n displayName?: string;\n type?: string;\n} {\n if (typeof entityOrRef === 'string') {\n let colonI = entityOrRef.indexOf(':');\n const slashI = entityOrRef.indexOf('/');\n\n // If the / is ahead of the :, treat the rest as the name\n if (slashI !== -1 && slashI < colonI) {\n colonI = -1;\n }\n\n const kind = colonI === -1 ? undefined : entityOrRef.slice(0, colonI);\n const namespace =\n slashI === -1 ? undefined : entityOrRef.slice(colonI + 1, slashI);\n const name = entityOrRef.slice(Math.max(colonI + 1, slashI + 1));\n\n return { kind, namespace, name };\n }\n\n if (typeof entityOrRef === 'object' && entityOrRef !== null) {\n const kind = [get(entityOrRef, 'kind')].find(isString);\n\n const namespace = [\n get(entityOrRef, 'metadata.namespace'),\n get(entityOrRef, 'namespace'),\n ].find(isString);\n\n const name = [\n get(entityOrRef, 'metadata.name'),\n get(entityOrRef, 'name'),\n ].find(isString);\n\n const title = [get(entityOrRef, 'metadata.title')].find(isString);\n\n const description = [get(entityOrRef, 'metadata.description')].find(\n isString,\n );\n\n const displayName = [get(entityOrRef, 'spec.profile.displayName')].find(\n isString,\n );\n\n const type = [get(entityOrRef, 'spec.type')].find(isString);\n\n return { kind, namespace, name, title, description, displayName, type };\n }\n\n return {};\n}\n\nfunction getShortRef(options: {\n kind?: string;\n namespace?: string;\n name?: string;\n context?: { defaultKind?: string; defaultNamespace?: string };\n}): string {\n const kind = options.kind?.toLowerCase() || 'unknown';\n const namespace = options.namespace || DEFAULT_NAMESPACE;\n const name = options.name || 'unknown';\n const defaultKindLower = options.context?.defaultKind?.toLowerCase();\n const defaultNamespaceLower =\n options.context?.defaultNamespace?.toLowerCase();\n\n let result = name;\n\n if (\n (defaultNamespaceLower &&\n namespace.toLowerCase() !== defaultNamespaceLower) ||\n namespace !== DEFAULT_NAMESPACE\n ) {\n result = `${namespace}/${result}`;\n }\n\n if (defaultKindLower && kind.toLowerCase() !== defaultKindLower) {\n result = `${kind}:${result}`;\n }\n\n return result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ultEntityPresentation.ts"],"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 CompoundEntityRef,\n DEFAULT_NAMESPACE,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport get from 'lodash/get';\nimport { EntityRefPresentationSnapshot } from './EntityPresentationApi';\n\n/**\n * Returns the default representation of an entity.\n *\n * @remarks\n *\n * This is a synchronous helper that extracts a display name from an\n * already-loaded entity or entity ref. It resolves `primaryTitle` as the\n * first available value among `spec.profile.displayName`, `metadata.title`,\n * and a shortened entity ref string.\n *\n * This function is primarily used as the internal fallback within the\n * {@link EntityPresentationApi} when no custom implementation is registered.\n * In React components, use the {@link useEntityPresentation} hook or the\n * {@link EntityDisplayName} component. In non-React contexts, use\n * {@link entityPresentationSnapshot} which respects custom presentation\n * overrides and falls back to this function when no API is registered.\n *\n * @public\n * @param entityOrRef - Either an entity, or a ref to it.\n * @param context - Contextual information that may affect the presentation.\n */\nexport function defaultEntityPresentation(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n): EntityRefPresentationSnapshot {\n // NOTE(freben): This code may look convoluted, but it tries its very best to\n // be defensive and handling any type of malformed input and still producing\n // some form of result without crashing.\n const { kind, namespace, name, title, description, displayName, type } =\n getParts(entityOrRef);\n\n const entityRef: string = stringifyEntityRef({\n kind: kind || 'unknown',\n namespace: namespace || DEFAULT_NAMESPACE,\n name: name || 'unknown',\n });\n\n const shortRef = getShortRef({ kind, namespace, name, context });\n\n const primary = [displayName, title, shortRef].find(\n candidate => candidate && typeof candidate === 'string',\n )!;\n\n const secondary = [\n primary !== entityRef ? entityRef : undefined,\n type,\n description,\n ]\n .filter(candidate => candidate && typeof candidate === 'string')\n .join(' | ');\n\n return {\n entityRef,\n primaryTitle: primary,\n secondaryTitle: secondary || undefined,\n Icon: undefined, // leave it up to the presentation API to handle\n };\n}\n\nconst isString = (value: unknown): value is string =>\n Boolean(value) && typeof value === 'string';\n\n// Try to extract display-worthy parts of an entity or ref as best we can, without throwing\nfunction getParts(entityOrRef: Entity | CompoundEntityRef | string): {\n kind?: string;\n namespace?: string;\n name?: string;\n title?: string;\n description?: string;\n displayName?: string;\n type?: string;\n} {\n if (typeof entityOrRef === 'string') {\n let colonI = entityOrRef.indexOf(':');\n const slashI = entityOrRef.indexOf('/');\n\n // If the / is ahead of the :, treat the rest as the name\n if (slashI !== -1 && slashI < colonI) {\n colonI = -1;\n }\n\n const kind = colonI === -1 ? undefined : entityOrRef.slice(0, colonI);\n const namespace =\n slashI === -1 ? undefined : entityOrRef.slice(colonI + 1, slashI);\n const name = entityOrRef.slice(Math.max(colonI + 1, slashI + 1));\n\n return { kind, namespace, name };\n }\n\n if (typeof entityOrRef === 'object' && entityOrRef !== null) {\n const kind = [get(entityOrRef, 'kind')].find(isString);\n\n const namespace = [\n get(entityOrRef, 'metadata.namespace'),\n get(entityOrRef, 'namespace'),\n ].find(isString);\n\n const name = [\n get(entityOrRef, 'metadata.name'),\n get(entityOrRef, 'name'),\n ].find(isString);\n\n const title = [get(entityOrRef, 'metadata.title')].find(isString);\n\n const description = [get(entityOrRef, 'metadata.description')].find(\n isString,\n );\n\n const displayName = [get(entityOrRef, 'spec.profile.displayName')].find(\n isString,\n );\n\n const type = [get(entityOrRef, 'spec.type')].find(isString);\n\n return { kind, namespace, name, title, description, displayName, type };\n }\n\n return {};\n}\n\nfunction getShortRef(options: {\n kind?: string;\n namespace?: string;\n name?: string;\n context?: { defaultKind?: string; defaultNamespace?: string };\n}): string {\n const kind = options.kind?.toLowerCase() || 'unknown';\n const namespace = options.namespace || DEFAULT_NAMESPACE;\n const name = options.name || 'unknown';\n const defaultKindLower = options.context?.defaultKind?.toLowerCase();\n const defaultNamespaceLower =\n options.context?.defaultNamespace?.toLowerCase();\n\n let result = name;\n\n if (\n (defaultNamespaceLower &&\n namespace.toLowerCase() !== defaultNamespaceLower) ||\n namespace !== DEFAULT_NAMESPACE\n ) {\n result = `${namespace}/${result}`;\n }\n\n if (defaultKindLower && kind.toLowerCase() !== defaultKindLower) {\n result = `${kind}:${result}`;\n }\n\n return result;\n}\n"],"names":[],"mappings":";;;AA8CO,SAAS,yBAAA,CACd,aACA,OAAA,EAI+B;AAI/B,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,aAAa,WAAA,EAAa,IAAA,EAAK,GACnE,QAAA,CAAS,WAAW,CAAA;AAEtB,EAAA,MAAM,YAAoB,kBAAA,CAAmB;AAAA,IAC3C,MAAM,IAAA,IAAQ,SAAA;AAAA,IACd,WAAW,SAAA,IAAa,iBAAA;AAAA,IACxB,MAAM,IAAA,IAAQ;AAAA,GACf,CAAA;AAED,EAAA,MAAM,WAAW,WAAA,CAAY,EAAE,MAAM,SAAA,EAAW,IAAA,EAAM,SAAS,CAAA;AAE/D,EAAA,MAAM,OAAA,GAAU,CAAC,WAAA,EAAa,KAAA,EAAO,QAAQ,CAAA,CAAE,IAAA;AAAA,IAC7C,CAAA,SAAA,KAAa,SAAA,IAAa,OAAO,SAAA,KAAc;AAAA,GACjD;AAEA,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,OAAA,KAAY,YAAY,SAAA,GAAY,MAAA;AAAA,IACpC,IAAA;AAAA,IACA;AAAA,GACF,CACG,OAAO,CAAA,SAAA,KAAa,SAAA,IAAa,OAAO,SAAA,KAAc,QAAQ,CAAA,CAC9D,IAAA,CAAK,KAAK,CAAA;AAEb,EAAA,OAAO;AAAA,IACL,SAAA;AAAA,IACA,YAAA,EAAc,OAAA;A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CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA;AAAA,EACjC;AAEA,EAAA,IAAI,gBAAA,IAAoB,IAAA,CAAK,WAAA,EAAY,KAAM,gBAAA,EAAkB;AAC/D,IAAA,MAAA,GAAS,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA;AAAA,EAC5B;AAEA,EAAA,OAAO,MAAA;AACT;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"entityPresentationSnapshot.esm.js","sources":["../../../src/apis/EntityPresentationApi/entityPresentationSnapshot.ts"],"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 CompoundEntityRef,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n EntityPresentationApi,\n EntityRefPresentationSnapshot,\n} from './EntityPresentationApi';\nimport { defaultEntityPresentation } from './defaultEntityPresentation';\n\n/**\n * Returns a synchronous presentation snapshot for an entity in non-React\n * contexts.\n *\n * @remarks\n *\n * This is the synchronous, non-React counterpart to\n * {@link useEntityPresentation}. It handles `Entity`, `CompoundEntityRef`,\n * and string ref inputs uniformly, using the provided\n * {@link EntityPresentationApi} when available and falling back to\n * {@link defaultEntityPresentation} otherwise.\n *\n * Because this function is synchronous, it uses cached data from the\n * presentation API (via `.snapshot`). If the entity has been seen before,\n * the snapshot will contain the full resolved title; otherwise it falls\n * back to what can be extracted from the ref alone. This is the correct\n * trade-off for sort comparators, column factories, filter callbacks, and\n * data mappers where a synchronous return value is required.\n *\n * In async contexts such as data loaders where you can `await`, prefer\n * using the {@link EntityPresentationApi} directly via\n * `forEntity().promise` for the richest possible presentation.\n *\n * @public\n * @param entityOrRef - An entity, a compound entity ref, or a string entity ref.\n * @param context - Optional context that may affect the presentation.\n * @param entityPresentationApi - Optional presentation API instance. When not\n * provided, falls back to {@link defaultEntityPresentation}.\n */\nexport function entityPresentationSnapshot(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: { defaultKind?: string; defaultNamespace?: string },\n entityPresentationApi?: EntityPresentationApi,\n): EntityRefPresentationSnapshot {\n if (entityPresentationApi) {\n const ref =\n typeof entityOrRef === 'string' || 'metadata' in entityOrRef\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n return entityPresentationApi.forEntity(ref, context).snapshot;\n }\n return defaultEntityPresentation(entityOrRef, context);\n}\n"],"names":[],"mappings":";;;AAwDO,SAAS,0BAAA,CACd,WAAA,EACA,OAAA,EACA,qBAAA,EAC+B;AAC/B,EAAA,IAAI,qBAAA,EAAuB;AACzB,IAAA,MAAM,GAAA,GACJ,OAAO,WAAA,KAAgB,QAAA,IAAY,cAAc,WAAA,GAC7C,WAAA,GACA,mBAAmB,WAAW,CAAA;AACpC,IAAA,OAAO,qBAAA,CAAsB,SAAA,CAAU,GAAA,EAAK,OAAO,CAAA,CAAE,QAAA;AAAA,EACvD;AACA,EAAA,OAAO,yBAAA,CAA0B,aAAa,OAAO,CAAA;AACvD;;;;"}
1
+ {"version":3,"file":"entityPresentationSnapshot.esm.js","sources":["../../../src/apis/EntityPresentationApi/entityPresentationSnapshot.ts"],"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 CompoundEntityRef,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n EntityPresentationApi,\n EntityRefPresentationSnapshot,\n} from './EntityPresentationApi';\nimport { defaultEntityPresentation } from './defaultEntityPresentation';\n\n/**\n * Returns a synchronous presentation snapshot for an entity in non-React\n * contexts.\n *\n * @remarks\n *\n * This is the synchronous, non-React counterpart to\n * {@link useEntityPresentation}. It handles `Entity`, `CompoundEntityRef`,\n * and string ref inputs uniformly, using the provided\n * {@link EntityPresentationApi} when available and falling back to\n * {@link defaultEntityPresentation} otherwise.\n *\n * Because this function is synchronous, it uses cached data from the\n * presentation API (via `.snapshot`). If the entity has been seen before,\n * the snapshot will contain the full resolved title; otherwise it falls\n * back to what can be extracted from the ref alone. This is the correct\n * trade-off for sort comparators, column factories, filter callbacks, and\n * data mappers where a synchronous return value is required.\n *\n * In async contexts such as data loaders where you can `await`, prefer\n * using the {@link EntityPresentationApi} directly via\n * `forEntity().promise` for the richest possible presentation.\n *\n * @public\n * @param entityOrRef - An entity, a compound entity ref, or a string entity ref.\n * @param context - Optional context that may affect the presentation.\n * @param entityPresentationApi - Optional presentation API instance. When not\n * provided, falls back to {@link defaultEntityPresentation}.\n */\nexport function entityPresentationSnapshot(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: { defaultKind?: string; defaultNamespace?: string },\n entityPresentationApi?: EntityPresentationApi,\n): EntityRefPresentationSnapshot {\n if (entityPresentationApi) {\n const ref =\n typeof entityOrRef === 'string' || 'metadata' in entityOrRef\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n return entityPresentationApi.forEntity(ref, context).snapshot;\n }\n return defaultEntityPresentation(entityOrRef, context);\n}\n"],"names":[],"mappings":";;;AAwDO,SAAS,0BAAA,CACd,WAAA,EACA,OAAA,EACA,qBAAA,EAC+B;AAC/B,EAAA,IAAI,qBAAA,EAAuB;AACzB,IAAA,MAAM,GAAA,GACJ,OAAO,WAAA,KAAgB,QAAA,IAAY,cAAc,WAAA,GAC7C,WAAA,GACA,mBAAmB,WAAW,CAAA;AACpC,IAAA,OAAO,qBAAA,CAAsB,SAAA,CAAU,GAAA,EAAK,OAAO,CAAA,CAAE,QAAA;AAAA,EACvD;AACA,EAAA,OAAO,yBAAA,CAA0B,aAAa,OAAO,CAAA;AACvD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityPresentation.esm.js","sources":["../../../src/apis/EntityPresentationApi/useEntityPresentation.ts"],"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 CompoundEntityRef,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApiHolder } from '@backstage/core-plugin-api';\nimport { useMemo } from 'react';\nimport {\n EntityRefPresentation,\n EntityRefPresentationSnapshot,\n entityPresentationApiRef,\n} from './EntityPresentationApi';\nimport { defaultEntityPresentation } from './defaultEntityPresentation';\nimport { useUpdatingObservable } from './useUpdatingObservable';\n\n/**\n * Returns information about how to represent an entity in the interface.\n *\n * @remarks\n *\n * This hook subscribes to the {@link EntityPresentationApi} and returns a\n * snapshot that may update over time as richer data is fetched (for example,\n * resolving `metadata.title` from a string entity ref). If no presentation\n * API is registered, it falls back to {@link defaultEntityPresentation}.\n *\n * For simple inline rendering, consider using the {@link EntityDisplayName}\n * component instead, which wraps this hook with icon and tooltip support.\n *\n * For non-React contexts such as sort comparators or data mappers, use\n * {@link entityPresentationSnapshot}.\n *\n * @public\n * @param entityOrRef - The entity to represent, or an entity ref to it. If you\n * pass in an entity, it is assumed that it is NOT a partial one - i.e. only\n * pass in an entity if you know that it was fetched in such a way that it\n * contains all of the fields that the representation renderer needs.\n * @param context - Optional context that control details of the presentation.\n * @returns A snapshot of the entity presentation, which may change over time\n */\nexport function useEntityPresentation(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n): EntityRefPresentationSnapshot {\n // Defensively allow for a missing presentation API, which makes this hook\n // safe to use in tests.\n const apis = useApiHolder();\n const entityPresentationApi = apis.get(entityPresentationApiRef);\n\n const deps = [\n entityPresentationApi,\n JSON.stringify(entityOrRef),\n JSON.stringify(context || null),\n ];\n\n const presentation = useMemo<EntityRefPresentation>(\n () => {\n if (!entityPresentationApi) {\n const fallback = defaultEntityPresentation(entityOrRef, context);\n return { snapshot: fallback, promise: Promise.resolve(fallback) };\n }\n\n return entityPresentationApi.forEntity(\n typeof entityOrRef === 'string' || 'metadata' in entityOrRef\n ? entityOrRef\n : stringifyEntityRef(entityOrRef),\n context,\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps,\n );\n\n // NOTE(freben): We intentionally do not use the plain useObservable from the\n // react-use library here. That hook does not support a dependencies array,\n // and also it only subscribes once to the initially passed in observable and\n // won't properly react when either initial value or the actual observable\n // changes.\n return useUpdatingObservable(presentation.snapshot, presentation.update$, [\n presentation,\n ]);\n}\n"],"names":[],"mappings":";;;;;;;AAuDO,SAAS,qBAAA,CACd,aACA,OAAA,EAI+B;AAG/B,EAAA,MAAM,OAAO,YAAA,EAAa;AAC1B,EAAA,MAAM,qBAAA,GAAwB,IAAA,CAAK,GAAA,CAAI,wBAAwB,CAAA;AAE/D,EAAA,MAAM,IAAA,GAAO;AAAA,IACX,qBAAA;AAAA,IACA,IAAA,CAAK,UAAU,WAAW,CAAA;AAAA,IAC1B,IAAA,CAAK,SAAA,CAAU,OAAA,IAAW,IAAI;AAAA,GAChC;AAEA,EAAA,MAAM,YAAA,GAAe,OAAA;AAAA,IACnB,MAAM;AACJ,MAAA,IAAI,CAAC,qBAAA,EAAuB;AAC1B,QAAA,MAAM,QAAA,GAAW,yBAAA,CAA0B,WAAA,EAAa,OAAO,CAAA;AAC/D,QAAA,OAAO,EAAE,QAAA,EAAU,QAAA,EAAU,SAAS,OAAA,CAAQ,OAAA,CAAQ,QAAQ,CAAA,EAAE;AAAA,MAClE;AAEA,MAAA,OAAO,qBAAA,CAAsB,SAAA;AAAA,QAC3B,OAAO,WAAA,KAAgB,QAAA,IAAY,cAAc,WAAA,GAC7C,WAAA,GACA,mBAAmB,WAAW,CAAA;AAAA,QAClC;AAAA,OACF;AAAA,IACF,CAAA;AAAA;AAAA,IAEA;AAAA,GACF;AAOA,EAAA,OAAO,qBAAA,CAAsB,YAAA,CAAa,QAAA,EAAU,YAAA,CAAa,OAAA,EAAS;AAAA,IACxE;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"useEntityPresentation.esm.js","sources":["../../../src/apis/EntityPresentationApi/useEntityPresentation.ts"],"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 CompoundEntityRef,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApiHolder } from '@backstage/core-plugin-api';\nimport { useMemo } from 'react';\nimport {\n EntityRefPresentation,\n EntityRefPresentationSnapshot,\n entityPresentationApiRef,\n} from './EntityPresentationApi';\nimport { defaultEntityPresentation } from './defaultEntityPresentation';\nimport { useUpdatingObservable } from './useUpdatingObservable';\n\n/**\n * Returns information about how to represent an entity in the interface.\n *\n * @remarks\n *\n * This hook subscribes to the {@link EntityPresentationApi} and returns a\n * snapshot that may update over time as richer data is fetched (for example,\n * resolving `metadata.title` from a string entity ref). If no presentation\n * API is registered, it falls back to {@link defaultEntityPresentation}.\n *\n * For simple inline rendering, consider using the {@link EntityDisplayName}\n * component instead, which wraps this hook with icon and tooltip support.\n *\n * For non-React contexts such as sort comparators or data mappers, use\n * {@link entityPresentationSnapshot}.\n *\n * @public\n * @param entityOrRef - The entity to represent, or an entity ref to it. If you\n * pass in an entity, it is assumed that it is NOT a partial one - i.e. only\n * pass in an entity if you know that it was fetched in such a way that it\n * contains all of the fields that the representation renderer needs.\n * @param context - Optional context that control details of the presentation.\n * @returns A snapshot of the entity presentation, which may change over time\n */\nexport function useEntityPresentation(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: {\n defaultKind?: string;\n defaultNamespace?: string;\n },\n): EntityRefPresentationSnapshot {\n // Defensively allow for a missing presentation API, which makes this hook\n // safe to use in tests.\n const apis = useApiHolder();\n const entityPresentationApi = apis.get(entityPresentationApiRef);\n\n const deps = [\n entityPresentationApi,\n JSON.stringify(entityOrRef),\n JSON.stringify(context || null),\n ];\n\n const presentation = useMemo<EntityRefPresentation>(\n () => {\n if (!entityPresentationApi) {\n const fallback = defaultEntityPresentation(entityOrRef, context);\n return { snapshot: fallback, promise: Promise.resolve(fallback) };\n }\n\n return entityPresentationApi.forEntity(\n typeof entityOrRef === 'string' || 'metadata' in entityOrRef\n ? entityOrRef\n : stringifyEntityRef(entityOrRef),\n context,\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps,\n );\n\n // NOTE(freben): We intentionally do not use the plain useObservable from the\n // react-use library here. That hook does not support a dependencies array,\n // and also it only subscribes once to the initially passed in observable and\n // won't properly react when either initial value or the actual observable\n // changes.\n return useUpdatingObservable(presentation.snapshot, presentation.update$, [\n presentation,\n ]);\n}\n"],"names":[],"mappings":";;;;;;;AAuDO,SAAS,qBAAA,CACd,aACA,OAAA,EAI+B;AAG/B,EAAA,MAAM,OAAO,YAAA,EAAa;AAC1B,EAAA,MAAM,qBAAA,GAAwB,IAAA,CAAK,GAAA,CAAI,wBAAwB,CAAA;AAE/D,EAAA,MAAM,IAAA,GAAO;AAAA,IACX,qBAAA;AAAA,IACA,IAAA,CAAK,UAAU,WAAW,CAAA;AAAA,IAC1B,IAAA,CAAK,SAAA,CAAU,OAAA,IAAW,IAAI;AAAA,GAChC;AAEA,EAAA,MAAM,YAAA,GAAe,OAAA;AAAA,IACnB,MAAM;AACJ,MAAA,IAAI,CAAC,qBAAA,EAAuB;AAC1B,QAAA,MAAM,QAAA,GAAW,yBAAA,CAA0B,WAAA,EAAa,OAAO,CAAA;AAC/D,QAAA,OAAO,EAAE,QAAA,EAAU,QAAA,EAAU,SAAS,OAAA,CAAQ,OAAA,CAAQ,QAAQ,CAAA,EAAE;AAAA,MAClE;AAEA,MAAA,OAAO,qBAAA,CAAsB,SAAA;AAAA,QAC3B,OAAO,WAAA,KAAgB,QAAA,IAAY,cAAc,WAAA,GAC7C,WAAA,GACA,mBAAmB,WAAW,CAAA;AAAA,QAClC;AAAA,OACF;AAAA,IACF,CAAA;AAAA;AAAA,IAEA;AAAA,GACF;AAOA,EAAA,OAAO,qBAAA,CAAsB,YAAA,CAAa,QAAA,EAAU,YAAA,CAAa,OAAA,EAAS;AAAA,IACxE;AAAA,GACD,CAAA;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUpdatingObservable.esm.js","sources":["../../../src/apis/EntityPresentationApi/useUpdatingObservable.ts"],"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 { Observable } from '@backstage/types';\nimport { DependencyList, useEffect, useState } from 'react';\n\n/**\n * Subscribe to an observable and return the latest value from it.\n *\n * @remarks\n *\n * This implementation differs in a few important ways from the plain\n * useObservable from the react-use library. That hook does not support a\n * dependencies array, and also it only subscribes once to the initially passed\n * in observable and won't properly react when either initial value or the\n * actual observable changes.\n *\n * This hook will ensure to resubscribe and reconsider the initial value,\n * whenever the dependencies change.\n */\nexport function useUpdatingObservable<T>(\n value: T,\n observable: Observable<T> | undefined,\n deps: DependencyList,\n): T {\n const [snapshot, setSnapshot] = useState(value);\n\n useEffect(() => {\n setSnapshot(value);\n\n const subscription = observable?.subscribe({\n next: updatedValue => {\n setSnapshot(updatedValue);\n },\n complete: () => {\n subscription?.unsubscribe();\n },\n });\n\n return () => {\n subscription?.unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n\n return snapshot;\n}\n"],"names":[],"mappings":";;AAiCO,SAAS,qBAAA,CACd,KAAA,EACA,UAAA,EACA,IAAA,EACG;AACH,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAE9C,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,WAAA,CAAY,KAAK,CAAA;AAEjB,IAAA,MAAM,YAAA,GAAe,YAAY,SAAA,CAAU;AAAA,MACzC,MAAM,CAAA,YAAA,KAAgB;AACpB,QAAA,WAAA,CAAY,YAAY,CAAA;AAAA,MAC1B,CAAA;AAAA,MACA,UAAU,MAAM;AACd,QAAA,YAAA,EAAc,WAAA,EAAY;AAAA,MAC5B;AAAA,KACD,CAAA;AAED,IAAA,OAAO,MAAM;AACX,MAAA,YAAA,EAAc,WAAA,EAAY;AAAA,IAC5B,CAAA;AAAA,EAEF,GAAG,IAAI,CAAA;AAEP,EAAA,OAAO,QAAA;AACT;;;;"}
1
+ {"version":3,"file":"useUpdatingObservable.esm.js","sources":["../../../src/apis/EntityPresentationApi/useUpdatingObservable.ts"],"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 { Observable } from '@backstage/types';\nimport { DependencyList, useEffect, useState } from 'react';\n\n/**\n * Subscribe to an observable and return the latest value from it.\n *\n * @remarks\n *\n * This implementation differs in a few important ways from the plain\n * useObservable from the react-use library. That hook does not support a\n * dependencies array, and also it only subscribes once to the initially passed\n * in observable and won't properly react when either initial value or the\n * actual observable changes.\n *\n * This hook will ensure to resubscribe and reconsider the initial value,\n * whenever the dependencies change.\n */\nexport function useUpdatingObservable<T>(\n value: T,\n observable: Observable<T> | undefined,\n deps: DependencyList,\n): T {\n const [snapshot, setSnapshot] = useState(value);\n\n useEffect(() => {\n setSnapshot(value);\n\n const subscription = observable?.subscribe({\n next: updatedValue => {\n setSnapshot(updatedValue);\n },\n complete: () => {\n subscription?.unsubscribe();\n },\n });\n\n return () => {\n subscription?.unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n\n return snapshot;\n}\n"],"names":[],"mappings":";;AAiCO,SAAS,qBAAA,CACd,KAAA,EACA,UAAA,EACA,IAAA,EACG;AACH,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAE9C,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,WAAA,CAAY,KAAK,CAAA;AAEjB,IAAA,MAAM,YAAA,GAAe,YAAY,SAAA,CAAU;AAAA,MACzC,MAAM,CAAA,YAAA,KAAgB;AACpB,QAAA,WAAA,CAAY,YAAY,CAAA;AAAA,MAC1B,CAAA;AAAA,MACA,UAAU,MAAM;AACd,QAAA,YAAA,EAAc,WAAA,EAAY;AAAA,MAC5B;AAAA,KACD,CAAA;AAED,IAAA,OAAO,MAAM;AACX,MAAA,YAAA,EAAc,WAAA,EAAY;AAAA,IAC5B,CAAA;AAAA,EAEF,GAAG,IAAI,CAAA;AAEP,EAAA,OAAO,QAAA;AACT;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MockStarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/MockStarredEntitiesApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { StarredEntitiesApi } from './StarredEntitiesApi';\n\n/**\n * An in-memory mock implementation of the StarredEntitiesApi.\n *\n * @public\n */\nexport class MockStarredEntitiesApi implements StarredEntitiesApi {\n private readonly starredEntities = new Set<string>();\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (!this.starredEntities.delete(entityRef)) {\n this.starredEntities.add(entityRef);\n }\n\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n}\n"],"names":[],"mappings":";;AAyBO,MAAM,sBAAA,CAAqD;AAAA,EAC/C,eAAA,uBAAsB,GAAA,EAAY;AAAA,EAClC,WAAA,uBAAkB,GAAA,EAEjC;AAAA,EAEe,UAAA,GAAa,IAAI,cAAA,CAA4B,CAAA,UAAA,KAAc;AAC1E,IAAA,UAAA,CAAW,IAAA,CAAK,IAAI,GAAA,CAAI,IAAA,CAAK,eAAe,CAAC,CAAA;AAE7C,IAAA,IAAA,CAAK,WAAA,CAAY,IAAI,UAAU,CAAA;AAC/B,IAAA,OAAO,MAAM;AACX,MAAA,IAAA,CAAK,WAAA,CAAY,OAAO,UAAU,CAAA;AAAA,IACpC,CAAA;AAAA,EACF,CAAC,CAAA;AAAA,EAED,MAAM,cAAc,SAAA,EAAkC;AACpD,IAAA,IAAI,CAAC,IAAA,CAAK,eAAA,CAAgB,MAAA,CAAO,SAAS,CAAA,EAAG;AAC3C,MAAA,IAAA,CAAK,eAAA,CAAgB,IAAI,SAAS,CAAA;AAAA,IACpC;AAEA,IAAA,KAAA,MAAW,YAAA,IAAgB,KAAK,WAAA,EAAa;AAC3C,MAAA,YAAA,CAAa,IAAA,CAAK,IAAI,GAAA,CAAI,IAAA,CAAK,eAAe,CAAC,CAAA;AAAA,IACjD;AAAA,EACF;AAAA,EAEA,eAAA,GAA2C;AACzC,IAAA,OAAO,IAAA,CAAK,UAAA;AAAA,EACd;AACF;;;;"}
1
+ {"version":3,"file":"MockStarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/MockStarredEntitiesApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { StarredEntitiesApi } from './StarredEntitiesApi';\n\n/**\n * An in-memory mock implementation of the StarredEntitiesApi.\n *\n * @public\n */\nexport class MockStarredEntitiesApi implements StarredEntitiesApi {\n private readonly starredEntities = new Set<string>();\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (!this.starredEntities.delete(entityRef)) {\n this.starredEntities.add(entityRef);\n }\n\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n}\n"],"names":[],"mappings":";;AAyBO,MAAM,sBAAA,CAAqD;AAAA,EAC/C,eAAA,uBAAsB,GAAA,EAAY;AAAA,EAClC,WAAA,uBAAkB,GAAA,EAEjC;AAAA,EAEe,UAAA,GAAa,IAAI,cAAA,CAA4B,CAAA,UAAA,KAAc;AAC1E,IAAA,UAAA,CAAW,IAAA,CAAK,IAAI,GAAA,CAAI,IAAA,CAAK,eAAe,CAAC,CAAA;AAE7C,IAAA,IAAA,CAAK,WAAA,CAAY,IAAI,UAAU,CAAA;AAC/B,IAAA,OAAO,MAAM;AACX,MAAA,IAAA,CAAK,WAAA,CAAY,OAAO,UAAU,CAAA;AAAA,IACpC,CAAA;AAAA,EACF,CAAC,CAAA;AAAA,EAED,MAAM,cAAc,SAAA,EAAkC;AACpD,IAAA,IAAI,CAAC,IAAA,CAAK,eAAA,CAAgB,MAAA,CAAO,SAAS,CAAA,EAAG;AAC3C,MAAA,IAAA,CAAK,eAAA,CAAgB,IAAI,SAAS,CAAA;AAAA,IACpC;AAEA,IAAA,KAAA,MAAW,YAAA,IAAgB,KAAK,WAAA,EAAa;AAC3C,MAAA,YAAA,CAAa,IAAA,CAAK,IAAI,GAAA,CAAI,IAAA,CAAK,eAAe,CAAC,CAAA;AAAA,IACjD;AAAA,EACF;AAAA,EAEA,eAAA,GAA2C;AACzC,IAAA,OAAO,IAAA,CAAK,UAAA;AAAA,EACd;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/StarredEntitiesApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiRef, createApiRef } from '@backstage/core-plugin-api';\nimport { Observable } from '@backstage/types';\n\n/**\n * An API to store starred entities\n *\n * @public\n */\nexport const starredEntitiesApiRef: ApiRef<StarredEntitiesApi> = createApiRef({\n id: 'catalog-react.starred-entities',\n});\n\n/**\n * An API to store and retrieve starred entities\n *\n * @public\n */\nexport interface StarredEntitiesApi {\n /**\n * Toggle the star state of the entity\n *\n * @param entityRef - an entity reference to toggle\n */\n toggleStarred(entityRef: string): Promise<void>;\n\n /**\n * Observe the set of starred entity references.\n */\n starredEntitie$(): Observable<Set<string>>;\n}\n"],"names":[],"mappings":";;AAwBO,MAAM,wBAAoD,YAAA,CAAa;AAAA,EAC5E,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"StarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/StarredEntitiesApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiRef, createApiRef } from '@backstage/core-plugin-api';\nimport { Observable } from '@backstage/types';\n\n/**\n * An API to store starred entities\n *\n * @public\n */\nexport const starredEntitiesApiRef: ApiRef<StarredEntitiesApi> = createApiRef({\n id: 'catalog-react.starred-entities',\n});\n\n/**\n * An API to store and retrieve starred entities\n *\n * @public\n */\nexport interface StarredEntitiesApi {\n /**\n * Toggle the star state of the entity\n *\n * @param entityRef - an entity reference to toggle\n */\n toggleStarred(entityRef: string): Promise<void>;\n\n /**\n * Observe the set of starred entity references.\n */\n starredEntitie$(): Observable<Set<string>>;\n}\n"],"names":[],"mappings":";;AAwBO,MAAM,wBAAoD,YAAA,CAAa;AAAA,EAC5E,EAAA,EAAI;AACN,CAAC;;"}