@backstage/plugin-catalog-react 1.20.0-next.1 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/alpha/blueprints/CatalogFilterBlueprint.esm.js.map +1 -1
  3. package/dist/alpha/blueprints/EntityCardBlueprint.esm.js +1 -1
  4. package/dist/alpha/blueprints/EntityCardBlueprint.esm.js.map +1 -1
  5. package/dist/alpha/blueprints/EntityContentBlueprint.esm.js +11 -16
  6. package/dist/alpha/blueprints/EntityContentBlueprint.esm.js.map +1 -1
  7. package/dist/alpha/blueprints/EntityContentLayoutBlueprint.esm.js +1 -1
  8. package/dist/alpha/blueprints/EntityContentLayoutBlueprint.esm.js.map +1 -1
  9. package/dist/alpha/blueprints/EntityContextMenuItemBlueprint.esm.js.map +1 -1
  10. package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js.map +1 -1
  11. package/dist/alpha/blueprints/EntityIconLinkBlueprint.esm.js +1 -1
  12. package/dist/alpha/blueprints/EntityIconLinkBlueprint.esm.js.map +1 -1
  13. package/dist/alpha/blueprints/extensionData.esm.js.map +1 -1
  14. package/dist/alpha/blueprints/resolveEntityFilterData.esm.js.map +1 -1
  15. package/dist/alpha/converters/convertLegacyEntityCardExtension.esm.js.map +1 -1
  16. package/dist/alpha/converters/convertLegacyEntityContentExtension.esm.js +3 -3
  17. package/dist/alpha/converters/convertLegacyEntityContentExtension.esm.js.map +1 -1
  18. package/dist/alpha/predicates/createEntityPredicateSchema.esm.js.map +1 -1
  19. package/dist/alpha/predicates/entityPredicateToFilterFunction.esm.js.map +1 -1
  20. package/dist/alpha/predicates/valueAtPath.esm.js.map +1 -1
  21. package/dist/alpha.d.ts +43 -30
  22. package/dist/api.esm.js.map +1 -1
  23. package/dist/apis/EntityPresentationApi/EntityPresentationApi.esm.js.map +1 -1
  24. package/dist/apis/EntityPresentationApi/defaultEntityPresentation.esm.js.map +1 -1
  25. package/dist/apis/EntityPresentationApi/useEntityPresentation.esm.js.map +1 -1
  26. package/dist/apis/EntityPresentationApi/useUpdatingObservable.esm.js.map +1 -1
  27. package/dist/apis/StarredEntitiesApi/MockStarredEntitiesApi.esm.js.map +1 -1
  28. package/dist/apis/StarredEntitiesApi/StarredEntitiesApi.esm.js.map +1 -1
  29. package/dist/components/CatalogAutocomplete/CatalogAutocomplete.esm.js.map +1 -1
  30. package/dist/components/CatalogFilterLayout/CatalogFilterLayout.esm.js.map +1 -1
  31. package/dist/components/DefaultFilters/DefaultFilters.esm.js.map +1 -1
  32. package/dist/components/EntityAutocompletePicker/EntityAutocompletePicker.esm.js.map +1 -1
  33. package/dist/components/EntityAutocompletePicker/EntityAutocompletePickerOption.esm.js.map +1 -1
  34. package/dist/components/EntityDisplayName/EntityDisplayName.esm.js.map +1 -1
  35. package/dist/components/EntityKindPicker/EntityKindPicker.esm.js.map +1 -1
  36. package/dist/components/EntityKindPicker/kindFilterUtils.esm.js.map +1 -1
  37. package/dist/components/EntityLifecyclePicker/EntityLifecyclePicker.esm.js.map +1 -1
  38. package/dist/components/EntityNamespacePicker/EntityNamespacePicker.esm.js.map +1 -1
  39. package/dist/components/EntityOwnerPicker/EntityOwnerPicker.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/EntitySearchBar/EntitySearchBar.esm.js.map +1 -1
  53. package/dist/components/EntityTable/EntityTable.esm.js.map +1 -1
  54. package/dist/components/EntityTable/columns.esm.js +1 -1
  55. package/dist/components/EntityTable/columns.esm.js.map +1 -1
  56. package/dist/components/EntityTable/presets.esm.js.map +1 -1
  57. package/dist/components/EntityTagPicker/EntityTagPicker.esm.js.map +1 -1
  58. package/dist/components/EntityTypePicker/EntityTypePicker.esm.js.map +1 -1
  59. package/dist/components/FavoriteEntity/FavoriteEntity.esm.js.map +1 -1
  60. package/dist/components/InspectEntityDialog/InspectEntityDialog.esm.js.map +1 -1
  61. package/dist/components/InspectEntityDialog/components/AncestryPage.esm.js.map +1 -1
  62. package/dist/components/InspectEntityDialog/components/ColocatedPage.esm.js.map +1 -1
  63. package/dist/components/InspectEntityDialog/components/EntityKindIcon.esm.js.map +1 -1
  64. package/dist/components/InspectEntityDialog/components/JsonPage.esm.js.map +1 -1
  65. package/dist/components/InspectEntityDialog/components/OverviewPage.esm.js +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 +1 -1
  80. package/dist/hooks/useEntity.esm.js.map +1 -1
  81. package/dist/hooks/useEntityContextMenu.esm.js.map +1 -1
  82. package/dist/hooks/useEntityListProvider.esm.js +1 -1
  83. package/dist/hooks/useEntityListProvider.esm.js.map +1 -1
  84. package/dist/hooks/useEntityOwnership.esm.js.map +1 -1
  85. package/dist/hooks/useEntityPermission.esm.js.map +1 -1
  86. package/dist/hooks/useEntityTypeFilter.esm.js.map +1 -1
  87. package/dist/hooks/useRelatedEntities.esm.js.map +1 -1
  88. package/dist/hooks/useStarredEntities.esm.js.map +1 -1
  89. package/dist/hooks/useStarredEntity.esm.js.map +1 -1
  90. package/dist/routes.esm.js.map +1 -1
  91. package/dist/testUtils/MockEntityListContextProvider.esm.js.map +1 -1
  92. package/dist/testUtils/catalogApiMock.esm.js.map +1 -1
  93. package/dist/translation.esm.js.map +1 -1
  94. package/dist/utils/filters.esm.js.map +1 -1
  95. package/dist/utils/getEntityRelations.esm.js.map +1 -1
  96. package/dist/utils/getEntitySourceLocation.esm.js.map +1 -1
  97. package/dist/utils/isOwnerOf.esm.js +1 -1
  98. package/dist/utils/isOwnerOf.esm.js.map +1 -1
  99. package/package.json +20 -20
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
+ ## 1.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3f4da39: Added the `analyzeLocation` method to `catalogApiMock`
8
+ - e4ddf22: **BREAKING ALPHA**: The `defaultPath`, `defaultTitle`, and `defaultGroup` params of `PageBlueprint` has been renamed to `path`, `title`, and `group`. The `convertLegacyEntityContentExtension` utility has also received the same change. This change does not affect the compatibility of extensions created with older versions of this blueprint.
9
+
10
+ ### Patch Changes
11
+
12
+ - 77eebdc: Support `filter` parameter on the `EntityHeaderBlueprint`
13
+ - a3a878d: Adding `type` as an override to the `convertLegacyEntityCardExtension`
14
+ - defc243: hide pagination `queryparams` if pagination mode is set to none
15
+ - Updated dependencies
16
+ - @backstage/core-components@0.17.5
17
+ - @backstage/frontend-plugin-api@0.11.0
18
+ - @backstage/frontend-test-utils@0.3.5
19
+ - @backstage/core-compat-api@0.5.0
20
+ - @backstage/catalog-client@1.11.0
21
+
22
+ ## 1.20.0-next.2
23
+
24
+ ### Minor Changes
25
+
26
+ - e4ddf22: **BREAKING ALPHA**: The `defaultPath`, `defaultTitle`, and `defaultGroup` params of `PageBlueprint` has been renamed to `path`, `title`, and `group`. The `convertLegacyEntityContentExtension` utility has also received the same change. This change does not affect the compatibility of extensions created with older versions of this blueprint.
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies
31
+ - @backstage/frontend-plugin-api@0.11.0-next.1
32
+ - @backstage/frontend-test-utils@0.3.5-next.2
33
+ - @backstage/core-compat-api@0.5.0-next.2
34
+ - @backstage/core-components@0.17.5-next.1
35
+ - @backstage/catalog-client@1.11.0-next.0
36
+ - @backstage/catalog-model@1.7.5
37
+ - @backstage/core-plugin-api@1.10.9
38
+ - @backstage/errors@1.2.7
39
+ - @backstage/integration-react@1.2.9
40
+ - @backstage/types@1.2.1
41
+ - @backstage/version-bridge@1.0.11
42
+ - @backstage/plugin-catalog-common@1.1.5
43
+ - @backstage/plugin-permission-common@0.9.1
44
+ - @backstage/plugin-permission-react@0.4.36
45
+
3
46
  ## 1.20.0-next.1
4
47
 
5
48
  ### Minor Changes
@@ -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,wBAAyB,CAAA;AAAA,EAC7D,IAAM,EAAA,gBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,cAAA,EAAgB,OAAO,SAAU,EAAA;AAAA,EACjD,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,OAAQ,CAAA,MAAA,EAAgD,EAAE,IAAA,EAAQ,EAAA;AAChE,IAAO,OAAA;AAAA,MACL,iBAAkB,CAAA,YAAA;AAAA,QAChB,iBAAkB,CAAA,IAAA,CAAK,IAAM,EAAA,MAAA,CAAO,MAAM;AAAA;AAC5C,KACF;AAAA;AAEJ,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,5 +1,5 @@
1
1
  import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
- import { entityFilterFunctionDataRef, entityFilterExpressionDataRef, entityCardTypeDataRef, entityCardTypes } from './extensionData.esm.js';
2
+ import { entityCardTypeDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef, entityCardTypes } from './extensionData.esm.js';
3
3
  import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
4
4
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
5
5
 
@@ -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 { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\nimport { EntityPredicate } from '../predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\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 config: {\n schema: {\n filter: z =>\n z.union([z.string(), createEntityPredicateSchema(z)]).optional(),\n type: z => z.enum(entityCardTypes).optional(),\n },\n },\n *factory(\n {\n loader,\n filter,\n type,\n }: {\n loader: () => Promise<JSX.Element>;\n filter?: string | EntityPredicate | ((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 } else {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Not providing type for entity cards is deprecated. Missing from '${node.spec.id}'`,\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAqCO,MAAM,sBAAsB,wBAAyB,CAAA;AAAA,EAC1D,IAAM,EAAA,aAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,iCAAA,EAAmC,OAAO,OAAQ,EAAA;AAAA,EAClE,MAAQ,EAAA;AAAA,IACN,iBAAkB,CAAA,YAAA;AAAA,IAClB,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,IACvC,sBAAsB,QAAS;AAAA,GACjC;AAAA,EACA,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA,2BAAA;AAAA,IAChB,gBAAkB,EAAA,6BAAA;AAAA,IAClB,IAAM,EAAA;AAAA,GACR;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,MAAQ,EAAA,CAAA,CAAA,KACN,CAAE,CAAA,KAAA,CAAM,CAAC,CAAA,CAAE,MAAO,EAAA,EAAG,2BAA4B,CAAA,CAAC,CAAC,CAAC,EAAE,QAAS,EAAA;AAAA,MACjE,MAAM,CAAK,CAAA,KAAA,CAAA,CAAE,IAAK,CAAA,eAAe,EAAE,QAAS;AAAA;AAC9C,GACF;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,MAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GAMF,EAAA,EAAE,IAAM,EAAA,MAAA,EACR,EAAA;AACA,IAAA,MAAM,kBAAkB,YAAa,CAAA,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM,CAAC,CAAA;AAEzE,IAAO,OAAA,uBAAA,CAAwB,MAAQ,EAAA,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAM,MAAA,SAAA,GAAY,OAAO,IAAQ,IAAA,IAAA;AACjC,IAAA,IAAI,SAAW,EAAA;AACb,MAAA,MAAM,sBAAsB,SAAS,CAAA;AAAA,KAChC,MAAA;AAEL,MAAQ,OAAA,CAAA,IAAA;AAAA,QACN,CAAA,sFAAA,EAAyF,IAAK,CAAA,IAAA,CAAK,EAAE,CAAA,CAAA;AAAA,OACvG;AAAA;AACF;AAEJ,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 { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\nimport { EntityPredicate } from '../predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\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 config: {\n schema: {\n filter: z =>\n z.union([z.string(), createEntityPredicateSchema(z)]).optional(),\n type: z => z.enum(entityCardTypes).optional(),\n },\n },\n *factory(\n {\n loader,\n filter,\n type,\n }: {\n loader: () => Promise<JSX.Element>;\n filter?: string | EntityPredicate | ((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 } else {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Not providing type for entity cards is deprecated. Missing from '${node.spec.id}'`,\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAqCO,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,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,MAAA,EAAQ,CAAA,CAAA,KACN,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,2BAAA,CAA4B,CAAC,CAAC,CAAC,EAAE,QAAA,EAAS;AAAA,MACjE,MAAM,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,eAAe,EAAE,QAAA;AAAS;AAC9C,GACF;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,CAAA,MAAO;AAEL,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN,CAAA,sFAAA,EAAyF,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,CAAA;AAAA,OACvG;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
- import { entityContentTitleDataRef, entityFilterFunctionDataRef, entityFilterExpressionDataRef, entityContentGroupDataRef } from './extensionData.esm.js';
2
+ import { entityContentGroupDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef, entityContentTitleDataRef } from './extensionData.esm.js';
3
3
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
4
4
  import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
5
5
 
@@ -29,24 +29,19 @@ const EntityContentBlueprint = createExtensionBlueprint({
29
29
  group: (z) => z.literal(false).or(z.string()).optional()
30
30
  }
31
31
  },
32
- *factory({
33
- loader,
34
- defaultPath,
35
- defaultTitle,
36
- defaultGroup,
37
- filter,
38
- routeRef
39
- }, { node, config }) {
40
- const path = config.path ?? defaultPath;
41
- const title = config.title ?? defaultTitle;
42
- const group = config.group ?? defaultGroup;
43
- yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
32
+ *factory(params, { node, config }) {
33
+ const path = config.path ?? params.path;
34
+ const title = config.title ?? params.title;
35
+ const group = config.group ?? params.group;
36
+ yield coreExtensionData.reactElement(
37
+ ExtensionBoundary.lazy(node, params.loader)
38
+ );
44
39
  yield coreExtensionData.routePath(path);
45
40
  yield entityContentTitleDataRef(title);
46
- if (routeRef) {
47
- yield coreExtensionData.routeRef(routeRef);
41
+ if (params.routeRef) {
42
+ yield coreExtensionData.routeRef(params.routeRef);
48
43
  }
49
- yield* resolveEntityFilterData(filter, config, node);
44
+ yield* resolveEntityFilterData(params.filter, config, node);
50
45
  if (group) {
51
46
  yield entityContentGroupDataRef(group);
52
47
  }
@@ -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} from './extensionData';\nimport { EntityPredicate } from '../predicates/types';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\nimport { Entity } from '@backstage/catalog-model';\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 ],\n dataRefs: {\n title: entityContentTitleDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n group: entityContentGroupDataRef,\n },\n config: {\n schema: {\n path: z => z.string().optional(),\n title: z => z.string().optional(),\n filter: z =>\n z.union([z.string(), createEntityPredicateSchema(z)]).optional(),\n group: z => z.literal(false).or(z.string()).optional(),\n },\n },\n *factory(\n {\n loader,\n defaultPath,\n defaultTitle,\n defaultGroup,\n filter,\n routeRef,\n }: {\n loader: () => Promise<JSX.Element>;\n defaultPath: string;\n defaultTitle: string;\n defaultGroup?: keyof typeof defaultEntityContentGroups | (string & {});\n routeRef?: RouteRef;\n filter?: string | EntityPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n const path = config.path ?? defaultPath;\n const title = config.title ?? defaultTitle;\n const group = config.group ?? defaultGroup;\n\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n yield coreExtensionData.routePath(path);\n\n yield entityContentTitleDataRef(title);\n\n if (routeRef) {\n yield coreExtensionData.routeRef(routeRef);\n }\n\n yield* resolveEntityFilterData(filter, config, node);\n\n if (group) {\n yield entityContentGroupDataRef(group);\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAsCO,MAAM,yBAAyB,wBAAyB,CAAA;AAAA,EAC7D,IAAM,EAAA,gBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,qBAAA,EAAuB,OAAO,UAAW,EAAA;AAAA,EACzD,MAAQ,EAAA;AAAA,IACN,iBAAkB,CAAA,YAAA;AAAA,IAClB,iBAAkB,CAAA,SAAA;AAAA,IAClB,yBAAA;AAAA,IACA,iBAAA,CAAkB,SAAS,QAAS,EAAA;AAAA,IACpC,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,IACvC,0BAA0B,QAAS;AAAA,GACrC;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,yBAAA;AAAA,IACP,cAAgB,EAAA,2BAAA;AAAA,IAChB,gBAAkB,EAAA,6BAAA;AAAA,IAClB,KAAO,EAAA;AAAA,GACT;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MAC/B,KAAO,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MAChC,MAAQ,EAAA,CAAA,CAAA,KACN,CAAE,CAAA,KAAA,CAAM,CAAC,CAAA,CAAE,MAAO,EAAA,EAAG,2BAA4B,CAAA,CAAC,CAAC,CAAC,EAAE,QAAS,EAAA;AAAA,MACjE,KAAA,EAAO,CAAK,CAAA,KAAA,CAAA,CAAE,OAAQ,CAAA,KAAK,CAAE,CAAA,EAAA,CAAG,CAAE,CAAA,MAAA,EAAQ,CAAA,CAAE,QAAS;AAAA;AACvD,GACF;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,MAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GASF,EAAA,EAAE,IAAM,EAAA,MAAA,EACR,EAAA;AACA,IAAM,MAAA,IAAA,GAAO,OAAO,IAAQ,IAAA,WAAA;AAC5B,IAAM,MAAA,KAAA,GAAQ,OAAO,KAAS,IAAA,YAAA;AAC9B,IAAM,MAAA,KAAA,GAAQ,OAAO,KAAS,IAAA,YAAA;AAE9B,IAAA,MAAM,kBAAkB,YAAa,CAAA,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM,CAAC,CAAA;AAEzE,IAAM,MAAA,iBAAA,CAAkB,UAAU,IAAI,CAAA;AAEtC,IAAA,MAAM,0BAA0B,KAAK,CAAA;AAErC,IAAA,IAAI,QAAU,EAAA;AACZ,MAAM,MAAA,iBAAA,CAAkB,SAAS,QAAQ,CAAA;AAAA;AAG3C,IAAO,OAAA,uBAAA,CAAwB,MAAQ,EAAA,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,MAAM,0BAA0B,KAAK,CAAA;AAAA;AACvC;AAEJ,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} from './extensionData';\nimport { EntityPredicate } from '../predicates/types';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\nimport { Entity } from '@backstage/catalog-model';\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 ],\n dataRefs: {\n title: entityContentTitleDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n group: entityContentGroupDataRef,\n },\n config: {\n schema: {\n path: z => z.string().optional(),\n title: z => z.string().optional(),\n filter: z =>\n z.union([z.string(), createEntityPredicateSchema(z)]).optional(),\n group: z => z.literal(false).or(z.string()).optional(),\n },\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 loader: () => Promise<JSX.Element>;\n routeRef?: RouteRef;\n filter?: string | EntityPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n const path = config.path ?? params.path;\n const title = config.title ?? params.title;\n const group = config.group ?? params.group;\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) {\n yield entityContentGroupDataRef(group);\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAsCO,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;AAAS,GACrC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,yBAAA;AAAA,IACP,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,KAAA,EAAO;AAAA,GACT;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS;AAAA,MAC/B,KAAA,EAAO,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS;AAAA,MAChC,MAAA,EAAQ,CAAA,CAAA,KACN,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,2BAAA,CAA4B,CAAC,CAAC,CAAC,EAAE,QAAA,EAAS;AAAA,MACjE,KAAA,EAAO,CAAA,CAAA,KAAK,CAAA,CAAE,OAAA,CAAQ,KAAK,CAAA,CAAE,EAAA,CAAG,CAAA,CAAE,MAAA,EAAQ,CAAA,CAAE,QAAA;AAAS;AACvD,GACF;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAoBA,EAAE,IAAA,EAAM,QAAO,EACf;AACA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,IAAA;AACnC,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,KAAA,IAAS,MAAA,CAAO,KAAA;AACrC,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,KAAA,IAAS,MAAA,CAAO,KAAA;AAErC,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,EAAO;AACT,MAAA,MAAM,0BAA0B,KAAK,CAAA;AAAA,IACvC;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { createExtensionDataRef, createExtensionBlueprint, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
- import { entityFilterFunctionDataRef, entityFilterExpressionDataRef } from './extensionData.esm.js';
2
+ import { entityFilterExpressionDataRef, entityFilterFunctionDataRef } from './extensionData.esm.js';
3
3
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
4
4
  import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
5
5
 
@@ -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 { EntityPredicate } from '../predicates/types';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\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 config: {\n schema: {\n type: z => z.string().optional(),\n filter: z =>\n z.union([z.string(), createEntityPredicateSchema(z)]).optional(),\n },\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: string | EntityPredicate | ((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":";;;;;AAwCA,MAAM,gCAAA,GAAmC,sBAEvC,EAAA,CAAE,IAAK,CAAA;AAAA,EACP,EAAI,EAAA;AACN,CAAC,CAAA;AAGM,MAAM,+BAA+B,wBAAyB,CAAA;AAAA,EACnE,IAAM,EAAA,uBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,iCAAA,EAAmC,OAAO,SAAU,EAAA;AAAA,EACpE,MAAQ,EAAA;AAAA,IACN,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA,2BAAA;AAAA,IAChB,gBAAkB,EAAA,6BAAA;AAAA,IAClB,SAAW,EAAA;AAAA,GACb;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MAC/B,MAAQ,EAAA,CAAA,CAAA,KACN,CAAE,CAAA,KAAA,CAAM,CAAC,CAAA,CAAE,MAAO,EAAA,EAAG,2BAA4B,CAAA,CAAC,CAAC,CAAC,EAAE,QAAS;AAAA;AACnE,GACF;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,MAAA;AAAA,IACA;AAAA,GAKF,EAAA,EAAE,IAAM,EAAA,MAAA,EACR,EAAA;AACA,IAAO,OAAA,uBAAA,CAAwB,MAAQ,EAAA,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAM,MAAA,gCAAA;AAAA,MACJ,iBAAA,CAAkB,aAAc,CAAA,IAAA,EAAM,MAAM;AAAA,KAC9C;AAAA;AAEJ,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 { EntityPredicate } from '../predicates/types';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\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 config: {\n schema: {\n type: z => z.string().optional(),\n filter: z =>\n z.union([z.string(), createEntityPredicateSchema(z)]).optional(),\n },\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: string | EntityPredicate | ((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":";;;;;AAwCA,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,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS;AAAA,MAC/B,MAAA,EAAQ,CAAA,CAAA,KACN,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,2BAAA,CAA4B,CAAC,CAAC,CAAC,EAAE,QAAA;AAAS;AACnE,GACF;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 { ReactNode, JSX } from 'react';\nimport {\n coreExtensionData,\n createExtensionBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { useEntityContextMenu } from '../../hooks/useEntityContextMenu';\nimport { EntityPredicate } from '../predicates/types';\nimport { entityPredicateToFilterFunction } from '../predicates/entityPredicateToFilterFunction';\nimport type { Entity } from '@backstage/catalog-model';\nimport { entityFilterFunctionDataRef } from './extensionData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\n/** @alpha */\nexport type UseProps = () =>\n | {\n title: ReactNode;\n href: string;\n disabled?: boolean;\n }\n | {\n title: ReactNode;\n onClick: () => void | Promise<void>;\n disabled?: boolean;\n };\n\n/** @alpha */\nexport type EntityContextMenuItemParams = {\n useProps: UseProps;\n icon: JSX.Element;\n filter?: EntityPredicate | ((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 coreExtensionData.reactElement,\n entityFilterFunctionDataRef.optional(),\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n },\n config: {\n schema: {\n filter: z => createEntityPredicateSchema(z).optional(),\n },\n },\n *factory(params: EntityContextMenuItemParams, { node, config }) {\n const loader = async () => {\n const Component = () => {\n const { onMenuClose } = useEntityContextMenu();\n const { title, ...menuItemProps } = params.useProps();\n let handleClick = undefined;\n\n if ('onClick' in menuItemProps) {\n handleClick = () => {\n const result = menuItemProps.onClick();\n if (result && 'then' in result) {\n result.then(onMenuClose, onMenuClose);\n } else {\n onMenuClose();\n }\n };\n }\n\n return (\n <MenuItem {...menuItemProps} onClick={handleClick}>\n <ListItemIcon>{params.icon}</ListItemIcon>\n <ListItemText primary={title} />\n </MenuItem>\n );\n };\n\n return <Component />;\n };\n\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n if (config.filter) {\n yield entityFilterFunctionDataRef(\n entityPredicateToFilterFunction(config.filter),\n );\n } else if (typeof params.filter === 'function') {\n yield entityFilterFunctionDataRef(params.filter);\n } else if (params.filter) {\n yield entityFilterFunctionDataRef(\n entityPredicateToFilterFunction(params.filter),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAoDO,MAAM,iCAAiC,wBAAyB,CAAA;AAAA,EACrE,IAAM,EAAA,0BAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,qBAAA,EAAuB,OAAO,kBAAmB,EAAA;AAAA,EACjE,MAAQ,EAAA;AAAA,IACN,iBAAkB,CAAA,YAAA;AAAA,IAClB,4BAA4B,QAAS;AAAA,GACvC;AAAA,EACA,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,MAAQ,EAAA,CAAA,CAAA,KAAK,2BAA4B,CAAA,CAAC,EAAE,QAAS;AAAA;AACvD,GACF;AAAA,EACA,CAAC,OAAQ,CAAA,MAAA,EAAqC,EAAE,IAAA,EAAM,QAAU,EAAA;AAC9D,IAAA,MAAM,SAAS,YAAY;AACzB,MAAA,MAAM,YAAY,MAAM;AACtB,QAAM,MAAA,EAAE,WAAY,EAAA,GAAI,oBAAqB,EAAA;AAC7C,QAAA,MAAM,EAAE,KAAO,EAAA,GAAG,aAAc,EAAA,GAAI,OAAO,QAAS,EAAA;AACpD,QAAA,IAAI,WAAc,GAAA,KAAA,CAAA;AAElB,QAAA,IAAI,aAAa,aAAe,EAAA;AAC9B,UAAA,WAAA,GAAc,MAAM;AAClB,YAAM,MAAA,MAAA,GAAS,cAAc,OAAQ,EAAA;AACrC,YAAI,IAAA,MAAA,IAAU,UAAU,MAAQ,EAAA;AAC9B,cAAO,MAAA,CAAA,IAAA,CAAK,aAAa,WAAW,CAAA;AAAA,aAC/B,MAAA;AACL,cAAY,WAAA,EAAA;AAAA;AACd,WACF;AAAA;AAGF,QAAA,uBACG,IAAA,CAAA,QAAA,EAAA,EAAU,GAAG,aAAA,EAAe,SAAS,WACpC,EAAA,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,YAAA,EAAA,EAAc,iBAAO,IAAK,EAAA,CAAA;AAAA,0BAC3B,GAAA,CAAC,YAAa,EAAA,EAAA,OAAA,EAAS,KAAO,EAAA;AAAA,SAChC,EAAA,CAAA;AAAA,OAEJ;AAEA,MAAA,2BAAQ,SAAU,EAAA,EAAA,CAAA;AAAA,KACpB;AAEA,IAAA,MAAM,kBAAkB,YAAa,CAAA,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM,CAAC,CAAA;AAEzE,IAAA,IAAI,OAAO,MAAQ,EAAA;AACjB,MAAM,MAAA,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA,KACS,MAAA,IAAA,OAAO,MAAO,CAAA,MAAA,KAAW,UAAY,EAAA;AAC9C,MAAM,MAAA,2BAAA,CAA4B,OAAO,MAAM,CAAA;AAAA,KACjD,MAAA,IAAW,OAAO,MAAQ,EAAA;AACxB,MAAM,MAAA,2BAAA;AAAA,QACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,OAC/C;AAAA;AACF;AAEJ,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 { ReactNode, JSX } from 'react';\nimport {\n coreExtensionData,\n createExtensionBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { useEntityContextMenu } from '../../hooks/useEntityContextMenu';\nimport { EntityPredicate } from '../predicates/types';\nimport { entityPredicateToFilterFunction } from '../predicates/entityPredicateToFilterFunction';\nimport type { Entity } from '@backstage/catalog-model';\nimport { entityFilterFunctionDataRef } from './extensionData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\n/** @alpha */\nexport type UseProps = () =>\n | {\n title: ReactNode;\n href: string;\n disabled?: boolean;\n }\n | {\n title: ReactNode;\n onClick: () => void | Promise<void>;\n disabled?: boolean;\n };\n\n/** @alpha */\nexport type EntityContextMenuItemParams = {\n useProps: UseProps;\n icon: JSX.Element;\n filter?: EntityPredicate | ((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 coreExtensionData.reactElement,\n entityFilterFunctionDataRef.optional(),\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n },\n config: {\n schema: {\n filter: z => createEntityPredicateSchema(z).optional(),\n },\n },\n *factory(params: EntityContextMenuItemParams, { node, config }) {\n const loader = async () => {\n const Component = () => {\n const { onMenuClose } = useEntityContextMenu();\n const { title, ...menuItemProps } = params.useProps();\n let handleClick = undefined;\n\n if ('onClick' in menuItemProps) {\n handleClick = () => {\n const result = menuItemProps.onClick();\n if (result && 'then' in result) {\n result.then(onMenuClose, onMenuClose);\n } else {\n onMenuClose();\n }\n };\n }\n\n return (\n <MenuItem {...menuItemProps} onClick={handleClick}>\n <ListItemIcon>{params.icon}</ListItemIcon>\n <ListItemText primary={title} />\n </MenuItem>\n );\n };\n\n return <Component />;\n };\n\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n if (config.filter) {\n yield entityFilterFunctionDataRef(\n entityPredicateToFilterFunction(config.filter),\n );\n } else if (typeof params.filter === 'function') {\n yield entityFilterFunctionDataRef(params.filter);\n } else if (params.filter) {\n yield entityFilterFunctionDataRef(\n entityPredicateToFilterFunction(params.filter),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAoDO,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,iBAAA,CAAkB,YAAA;AAAA,IAClB,4BAA4B,QAAA;AAAS,GACvC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,MAAA,EAAQ,CAAA,CAAA,KAAK,2BAAA,CAA4B,CAAC,EAAE,QAAA;AAAS;AACvD,GACF;AAAA,EACA,CAAC,OAAA,CAAQ,MAAA,EAAqC,EAAE,IAAA,EAAM,QAAO,EAAG;AAC9D,IAAA,MAAM,SAAS,YAAY;AACzB,MAAA,MAAM,YAAY,MAAM;AACtB,QAAA,MAAM,EAAE,WAAA,EAAY,GAAI,oBAAA,EAAqB;AAC7C,QAAA,MAAM,EAAE,KAAA,EAAO,GAAG,aAAA,EAAc,GAAI,OAAO,QAAA,EAAS;AACpD,QAAA,IAAI,WAAA,GAAc,MAAA;AAElB,QAAA,IAAI,aAAa,aAAA,EAAe;AAC9B,UAAA,WAAA,GAAc,MAAM;AAClB,YAAA,MAAM,MAAA,GAAS,cAAc,OAAA,EAAQ;AACrC,YAAA,IAAI,MAAA,IAAU,UAAU,MAAA,EAAQ;AAC9B,cAAA,MAAA,CAAO,IAAA,CAAK,aAAa,WAAW,CAAA;AAAA,YACtC,CAAA,MAAO;AACL,cAAA,WAAA,EAAY;AAAA,YACd;AAAA,UACF,CAAA;AAAA,QACF;AAEA,QAAA,uBACE,IAAA,CAAC,QAAA,EAAA,EAAU,GAAG,aAAA,EAAe,SAAS,WAAA,EACpC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,YAAA,EAAA,EAAc,iBAAO,IAAA,EAAK,CAAA;AAAA,0BAC3B,GAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAS,KAAA,EAAO;AAAA,SAAA,EAChC,CAAA;AAAA,MAEJ,CAAA;AAEA,MAAA,2BAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,IACpB,CAAA;AAEA,IAAA,MAAM,kBAAkB,YAAA,CAAa,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAM,CAAC,CAAA;AAEzE,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 { EntityPredicate } from '../predicates/types';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\n\n/** @alpha */\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 config: {\n schema: {\n filter: z => createEntityPredicateSchema(z).optional(),\n },\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?: EntityPredicate | ((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":";;;;;AA+BO,MAAM,wBAAwB,wBAAyB,CAAA;AAAA,EAC5D,IAAM,EAAA,eAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,qBAAA,EAAuB,OAAO,SAAU,EAAA;AAAA,EACxD,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA,2BAAA;AAAA,IAChB,SAAS,iBAAkB,CAAA;AAAA,GAC7B;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,MAAQ,EAAA,CAAA,CAAA,KAAK,2BAA4B,CAAA,CAAC,EAAE,QAAS;AAAA;AACvD,GACF;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,IACvC,iBAAA,CAAkB,aAAa,QAAS;AAAA,GAC1C;AAAA,EACA,CAAC,OACC,CAAA,MAAA,EAIA,EAAE,IAAA,EAAM,QACR,EAAA;AACA,IAAM,MAAA,EAAE,MAAQ,EAAA,MAAA,EAAW,GAAA,MAAA;AAE3B,IAAO,OAAA,uBAAA,CAAwB,MAAQ,EAAA,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,IAAI,MAAQ,EAAA;AACV,MAAA,MAAM,iBAAkB,CAAA,YAAA;AAAA,QACtB,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM;AAAA,OACrC;AAAA;AACF;AAEJ,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 { EntityPredicate } from '../predicates/types';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\n\n/** @alpha */\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 config: {\n schema: {\n filter: z => createEntityPredicateSchema(z).optional(),\n },\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?: EntityPredicate | ((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":";;;;;AA+BO,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,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,MAAA,EAAQ,CAAA,CAAA,KAAK,2BAAA,CAA4B,CAAC,EAAE,QAAA;AAAS;AACvD,GACF;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,6 +1,6 @@
1
1
  import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
2
  import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
3
- import { entityFilterFunctionDataRef, entityFilterExpressionDataRef } from './extensionData.esm.js';
3
+ import { entityFilterExpressionDataRef, entityFilterFunctionDataRef } from './extensionData.esm.js';
4
4
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
5
5
 
6
6
  const entityIconLinkPropsDataRef = createExtensionDataRef().with({
@@ -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 { EntityPredicate } from '../predicates/types';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\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 config: {\n schema: {\n label: z => z.string().optional(),\n title: z => z.string().optional(),\n filter: z => createEntityPredicateSchema(z).optional(),\n },\n },\n *factory(\n params: {\n useProps: () => Omit<IconLinkVerticalProps, 'color'>;\n filter?: EntityPredicate | ((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":";;;;;AAgCA,MAAM,0BAAA,GAA6B,sBAEjC,EAAA,CAAE,IAAK,CAAA;AAAA,EACP,EAAI,EAAA;AACN,CAAC,CAAA;AAGM,MAAM,0BAA0B,wBAAyB,CAAA;AAAA,EAC9D,IAAM,EAAA,kBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,2BAAA,EAA6B,OAAO,WAAY,EAAA;AAAA,EAChE,MAAQ,EAAA;AAAA,IACN,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,0BAAA;AAAA,IACV,cAAgB,EAAA,2BAAA;AAAA,IAChB,gBAAkB,EAAA;AAAA,GACpB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MAChC,KAAO,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MAChC,MAAQ,EAAA,CAAA,CAAA,KAAK,2BAA4B,CAAA,CAAC,EAAE,QAAS;AAAA;AACvD,GACF;AAAA,EACA,CAAC,OACC,CAAA,MAAA,EAIA,EAAE,MAAA,EAAQ,MACV,EAAA;AACA,IAAM,MAAA,EAAE,MAAQ,EAAA,QAAA,EAAa,GAAA,MAAA;AAC7B,IAAO,OAAA,uBAAA,CAAwB,MAAQ,EAAA,MAAA,EAAQ,IAAI,CAAA;AAGnD,IAAA,MAAM,WAAc,GAAA,MAAA,CAAO,OAAQ,CAAA,MAAM,CAAE,CAAA,MAAA;AAAA,MACzC,CAAC,IAAM,EAAA,CAAC,KAAK,KAAK,CAAA,KAChB,UAAU,KACN,CAAA,GAAA;AAAA,QACE,GAAG,IAAA;AAAA,QACH,CAAC,GAAG,GAAG;AAAA,OAET,GAAA,IAAA;AAAA,MACN;AAAC,KACH;AACA,IAAM,MAAA,0BAAA,CAA2B,OAAO,EAAE,GAAG,UAAY,EAAA,GAAG,aAAc,CAAA,CAAA;AAAA;AAE9E,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 { EntityPredicate } from '../predicates/types';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\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 config: {\n schema: {\n label: z => z.string().optional(),\n title: z => z.string().optional(),\n filter: z => createEntityPredicateSchema(z).optional(),\n },\n },\n *factory(\n params: {\n useProps: () => Omit<IconLinkVerticalProps, 'color'>;\n filter?: EntityPredicate | ((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":";;;;;AAgCA,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,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS;AAAA,MAChC,KAAA,EAAO,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,GAAS,QAAA,EAAS;AAAA,MAChC,MAAA,EAAQ,CAAA,CAAA,KAAK,2BAAA,CAA4B,CAAC,EAAE,QAAA;AAAS;AACvD,GACF;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 { createExtensionDataRef } from '@backstage/frontend-plugin-api';\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\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/**\n * @alpha\n * Default entity content groups.\n */\nexport const defaultEntityContentGroups = {\n overview: 'Overview',\n documentation: 'Documentation',\n development: 'Development',\n deployment: 'Deployment',\n operation: 'Operation',\n observability: 'Observability',\n};\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 'summary',\n 'info',\n 'content',\n] as const satisfies readonly EntityCardType[];\n\n/** @alpha */\nexport type EntityCardType = 'summary' | 'info' | 'content';\n\n/** @internal */\nexport const entityCardTypeDataRef =\n createExtensionDataRef<EntityCardType>().with({\n id: 'catalog.entity-card-type',\n });\n"],"names":[],"mappings":";;AAoBa,MAAA,yBAAA,GAA4B,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,EAC7E,EAAI,EAAA;AACN,CAAC;AAGM,MAAM,8BAA8B,sBAEzC,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,kCAAkC;AAGpC,MAAA,6BAAA,GACX,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,EACpC,EAAI,EAAA;AACN,CAAC;AAMI,MAAM,0BAA6B,GAAA;AAAA,EACxC,QAAU,EAAA,UAAA;AAAA,EACV,aAAe,EAAA,eAAA;AAAA,EACf,WAAa,EAAA,aAAA;AAAA,EACb,UAAY,EAAA,YAAA;AAAA,EACZ,SAAW,EAAA,WAAA;AAAA,EACX,aAAe,EAAA;AACjB;AAGa,MAAA,yBAAA,GAA4B,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,EAC7E,EAAI,EAAA;AACN,CAAC;AAMM,MAAM,eAAkB,GAAA;AAAA,EAC7B,SAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF;AAMa,MAAA,qBAAA,GACX,sBAAuC,EAAA,CAAE,IAAK,CAAA;AAAA,EAC5C,EAAI,EAAA;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 { createExtensionDataRef } from '@backstage/frontend-plugin-api';\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\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/**\n * @alpha\n * Default entity content groups.\n */\nexport const defaultEntityContentGroups = {\n overview: 'Overview',\n documentation: 'Documentation',\n development: 'Development',\n deployment: 'Deployment',\n operation: 'Operation',\n observability: 'Observability',\n};\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 'summary',\n 'info',\n 'content',\n] as const satisfies readonly EntityCardType[];\n\n/** @alpha */\nexport type EntityCardType = 'summary' | 'info' | 'content';\n\n/** @internal */\nexport const entityCardTypeDataRef =\n createExtensionDataRef<EntityCardType>().with({\n id: 'catalog.entity-card-type',\n });\n"],"names":[],"mappings":";;AAoBO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,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;AAMI,MAAM,0BAAA,GAA6B;AAAA,EACxC,QAAA,EAAU,UAAA;AAAA,EACV,aAAA,EAAe,eAAA;AAAA,EACf,WAAA,EAAa,aAAA;AAAA,EACb,UAAA,EAAY,YAAA;AAAA,EACZ,SAAA,EAAW,WAAA;AAAA,EACX,aAAA,EAAe;AACjB;AAGO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAMM,MAAM,eAAA,GAAkB;AAAA,EAC7B,SAAA;AAAA,EACA,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 EntityPredicate,\n entityPredicateToFilterFunction,\n} from '../predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { AppNode } from '@backstage/frontend-plugin-api';\n\nexport function* resolveEntityFilterData(\n filter: ((entity: Entity) => boolean) | EntityPredicate | string | undefined,\n config: { filter?: EntityPredicate | 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 entityPredicateToFilterFunction(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(entityPredicateToFilterFunction(filter));\n }\n}\n"],"names":[],"mappings":";;;AA2BiB,UAAA,uBAAA,CACf,MACA,EAAA,MAAA,EACA,IACA,EAAA;AACA,EAAI,IAAA,OAAO,MAAO,CAAA,MAAA,KAAW,QAAU,EAAA;AAErC,IAAQ,OAAA,CAAA,IAAA;AAAA,MACN,CAAA,2EAAA,EAA8E,IAAK,CAAA,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAC5F;AACA,IAAM,MAAA,6BAAA,CAA8B,OAAO,MAAM,CAAA;AAAA,GACnD,MAAA,IAAW,OAAO,MAAQ,EAAA;AACxB,IAAM,MAAA,2BAAA;AAAA,MACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,KAC/C;AAAA,GACF,MAAA,IAAW,OAAO,MAAA,KAAW,UAAY,EAAA;AACvC,IAAA,MAAM,4BAA4B,MAAM,CAAA;AAAA,GAC1C,MAAA,IAAW,OAAO,MAAA,KAAW,QAAU,EAAA;AAErC,IAAQ,OAAA,CAAA,IAAA;AAAA,MACN,CAAA,+DAAA,EAAkE,IAAK,CAAA,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAChF;AACA,IAAA,MAAM,8BAA8B,MAAM,CAAA;AAAA,aACjC,MAAQ,EAAA;AACjB,IAAM,MAAA,2BAAA,CAA4B,+BAAgC,CAAA,MAAM,CAAC,CAAA;AAAA;AAE7E;;;;"}
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 EntityPredicate,\n entityPredicateToFilterFunction,\n} from '../predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { AppNode } from '@backstage/frontend-plugin-api';\n\nexport function* resolveEntityFilterData(\n filter: ((entity: Entity) => boolean) | EntityPredicate | string | undefined,\n config: { filter?: EntityPredicate | 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 entityPredicateToFilterFunction(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(entityPredicateToFilterFunction(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 { EntityPredicate } from '../predicates/types';\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 | EntityPredicate | ((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 (\n pluginId &&\n name\n .toLocaleLowerCase('en-US')\n .startsWith(pluginId.toLocaleLowerCase('en-US'))\n ) {\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":";;;;;;AA2BgB,SAAA,gCAAA,CACd,iBACA,SAKqB,EAAA;AACrB,EAAM,MAAA,OAAA,uBAAW,eAAgB,EAAA,EAAA,CAAA;AAEjC,EAAM,MAAA,OAAA,GAAU,gBAAyB,CAAA,OAAA,EAAS,oBAAoB,CAAA;AACtE,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,uBAAuB,CAAA;AAAA;AAGzC,EAAM,MAAA,MAAA,GAAS,gBAAkC,CAAA,OAAA,EAAS,aAAa,CAAA;AACvE,EAAM,MAAA,QAAA,GAAW,QAAQ,KAAM,EAAA;AAE/B,EAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,KAAA,CAAM,kBAAkB,CAAA;AAC9C,EAAM,MAAA,KAAA,GAAQ,KAAQ,GAAA,CAAC,CAAK,IAAA,OAAA;AAE5B,EAAA,IAAI,IAA2B,GAAA,KAAA;AAC/B,EACE,IAAA,QAAA,IACA,IACG,CAAA,iBAAA,CAAkB,OAAO,CAAA,CACzB,WAAW,QAAS,CAAA,iBAAA,CAAkB,OAAO,CAAC,CACjD,EAAA;AACA,IAAO,IAAA,GAAA,IAAA,CAAK,KAAM,CAAA,QAAA,CAAS,MAAM,CAAA;AACjC,IAAA,IAAI,CAAC,IAAM,EAAA;AACT,MAAO,IAAA,GAAA,KAAA,CAAA;AAAA;AACT;AAEF,EAAO,IAAA,GAAA,IAAA,IAAQ,UAAU,IAAI,CAAA;AAE7B,EAAA,OAAO,oBAAoB,IAAK,CAAA;AAAA,IAC9B,IAAA,EAAM,WAAW,IAAQ,IAAA,IAAA;AAAA,IACzB,MAAQ,EAAA;AAAA,MACN,QAAQ,SAAW,EAAA,MAAA;AAAA,MACnB,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO,CAAA;AAAA,MACzC,MAAM,SAAW,EAAA;AAAA;AACnB,GACD,CAAA;AACH;;;;"}
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 { EntityPredicate } from '../predicates/types';\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 | EntityPredicate | ((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 (\n pluginId &&\n name\n .toLocaleLowerCase('en-US')\n .startsWith(pluginId.toLocaleLowerCase('en-US'))\n ) {\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,IACE,QAAA,IACA,IAAA,CACG,iBAAA,CAAkB,OAAO,CAAA,CACzB,WAAW,QAAA,CAAS,iBAAA,CAAkB,OAAO,CAAC,CAAA,EACjD;AACA,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,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
2
+ import { compatWrapper, convertLegacyRouteRef } from '@backstage/core-compat-api';
3
3
  import { getComponentData } from '@backstage/core-plugin-api';
4
4
  import kebabCase from 'lodash/kebabCase';
5
5
  import startCase from 'lodash/startCase';
@@ -31,8 +31,8 @@ function convertLegacyEntityContentExtension(LegacyExtension, overrides) {
31
31
  name: overrides?.name ?? name,
32
32
  params: {
33
33
  filter: overrides?.filter,
34
- defaultPath: overrides?.defaultPath ?? `/${kebabCase(infix)}`,
35
- defaultTitle: overrides?.defaultTitle ?? startCase(infix),
34
+ path: overrides?.path ?? `/${kebabCase(infix)}`,
35
+ title: overrides?.title ?? startCase(infix),
36
36
  routeRef: mountPoint && convertLegacyRouteRef(mountPoint),
37
37
  loader: async () => compatWrapper(element)
38
38
  }
@@ -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 } from 'react';\nimport { EntityContentBlueprint } from '../blueprints/EntityContentBlueprint';\nimport { EntityPredicate } from '../predicates/types';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport function convertLegacyEntityContentExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | EntityPredicate | ((entity: Entity) => boolean);\n defaultPath?: string;\n defaultTitle?: string;\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 (\n pluginId &&\n name\n .toLocaleLowerCase('en-US')\n .startsWith(pluginId.toLocaleLowerCase('en-US'))\n ) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n\n return EntityContentBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n defaultPath: overrides?.defaultPath ?? `/${kebabCase(infix)}`,\n defaultTitle: overrides?.defaultTitle ?? startCase(infix),\n routeRef: mountPoint && convertLegacyRouteRef(mountPoint),\n loader: async () => compatWrapper(element),\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;AAkCgB,SAAA,mCAAA,CACd,iBACA,SAMqB,EAAA;AACrB,EAAM,MAAA,OAAA,uBAAW,eAAgB,EAAA,EAAA,CAAA;AAEjC,EAAM,MAAA,OAAA,GAAU,gBAAyB,CAAA,OAAA,EAAS,oBAAoB,CAAA;AACtE,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,uBAAuB,CAAA;AAAA;AAGzC,EAAA,MAAM,UAAa,GAAA,gBAAA;AAAA,IACjB,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAM,MAAA,MAAA,GAAS,gBAAkC,CAAA,OAAA,EAAS,aAAa,CAAA;AACvE,EAAM,MAAA,QAAA,GAAW,QAAQ,KAAM,EAAA;AAE/B,EAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,KAAA,CAAM,qBAAqB,CAAA;AACjD,EAAM,MAAA,KAAA,GAAQ,KAAQ,GAAA,CAAC,CAAK,IAAA,OAAA;AAE5B,EAAA,IAAI,IAA2B,GAAA,KAAA;AAC/B,EACE,IAAA,QAAA,IACA,IACG,CAAA,iBAAA,CAAkB,OAAO,CAAA,CACzB,WAAW,QAAS,CAAA,iBAAA,CAAkB,OAAO,CAAC,CACjD,EAAA;AACA,IAAO,IAAA,GAAA,IAAA,CAAK,KAAM,CAAA,QAAA,CAAS,MAAM,CAAA;AACjC,IAAA,IAAI,CAAC,IAAM,EAAA;AACT,MAAO,IAAA,GAAA,KAAA,CAAA;AAAA;AACT;AAEF,EAAO,IAAA,GAAA,IAAA,IAAQ,UAAU,IAAI,CAAA;AAE7B,EAAA,OAAO,uBAAuB,IAAK,CAAA;AAAA,IACjC,IAAA,EAAM,WAAW,IAAQ,IAAA,IAAA;AAAA,IACzB,MAAQ,EAAA;AAAA,MACN,QAAQ,SAAW,EAAA,MAAA;AAAA,MACnB,aAAa,SAAW,EAAA,WAAA,IAAe,CAAI,CAAA,EAAA,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,MAC3D,YAAc,EAAA,SAAA,EAAW,YAAgB,IAAA,SAAA,CAAU,KAAK,CAAA;AAAA,MACxD,QAAA,EAAU,UAAc,IAAA,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 } from 'react';\nimport { EntityContentBlueprint } from '../blueprints/EntityContentBlueprint';\nimport { EntityPredicate } from '../predicates/types';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport function convertLegacyEntityContentExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | EntityPredicate | ((entity: Entity) => boolean);\n path?: string;\n title?: string;\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 (\n pluginId &&\n name\n .toLocaleLowerCase('en-US')\n .startsWith(pluginId.toLocaleLowerCase('en-US'))\n ) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n\n return EntityContentBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n path: overrides?.path ?? `/${kebabCase(infix)}`,\n title: overrides?.title ?? startCase(infix),\n routeRef: mountPoint && convertLegacyRouteRef(mountPoint),\n loader: async () => compatWrapper(element),\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;AAkCO,SAAS,mCAAA,CACd,iBACA,SAAA,EAgBqB;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,IACE,QAAA,IACA,IAAA,CACG,iBAAA,CAAkB,OAAO,CAAA,CACzB,WAAW,QAAA,CAAS,iBAAA,CAAkB,OAAO,CAAC,CAAA,EACjD;AACA,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,uBAAuB,IAAA,CAAK;AAAA,IACjC,IAAA,EAAM,WAAW,IAAA,IAAQ,IAAA;AAAA,IACzB,MAAA,EAAQ;AAAA,MACN,QAAQ,SAAA,EAAW,MAAA;AAAA,MACnB,MAAM,SAAA,EAAW,IAAA,IAAQ,CAAA,CAAA,EAAI,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,MAC7C,KAAA,EAAO,SAAA,EAAW,KAAA,IAAS,SAAA,CAAU,KAAK,CAAA;AAAA,MAC1C,QAAA,EAAU,UAAA,IAAc,qBAAA,CAAsB,UAAU,CAAA;AAAA,MACxD,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO;AAAA;AAC3C,GACD,CAAA;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createEntityPredicateSchema.esm.js","sources":["../../../src/alpha/predicates/createEntityPredicateSchema.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 { EntityPredicate, EntityPredicateValue } from './types';\nimport type { z as zImpl, ZodType } from 'zod';\n\n/** @internal */\nexport function createEntityPredicateSchema(z: typeof zImpl) {\n const primitiveSchema = z.union([z.string(), z.number(), z.boolean()]);\n\n const comparableValueSchema = z.union([\n primitiveSchema,\n z.array(primitiveSchema),\n ]);\n\n // eslint-disable-next-line prefer-const\n let valuePredicateSchema: ZodType<EntityPredicateValue>;\n\n const predicateSchema = z.lazy(() =>\n z.union([\n comparableValueSchema,\n z.object({ $all: z.array(predicateSchema) }),\n z.object({ $any: z.array(predicateSchema) }),\n z.object({ $not: predicateSchema }),\n z.record(z.string().regex(/^(?!\\$).*$/), valuePredicateSchema),\n ]),\n ) as ZodType<EntityPredicate>;\n\n valuePredicateSchema = z.union([\n comparableValueSchema,\n z.object({ $exists: z.boolean() }),\n z.object({ $in: z.array(primitiveSchema) }),\n z.object({ $contains: predicateSchema }),\n ]) as ZodType<EntityPredicateValue>;\n\n return predicateSchema;\n}\n"],"names":[],"mappings":"AAoBO,SAAS,4BAA4B,CAAiB,EAAA;AAC3D,EAAA,MAAM,eAAkB,GAAA,CAAA,CAAE,KAAM,CAAA,CAAC,CAAE,CAAA,MAAA,EAAU,EAAA,CAAA,CAAE,MAAO,EAAA,EAAG,CAAE,CAAA,OAAA,EAAS,CAAC,CAAA;AAErE,EAAM,MAAA,qBAAA,GAAwB,EAAE,KAAM,CAAA;AAAA,IACpC,eAAA;AAAA,IACA,CAAA,CAAE,MAAM,eAAe;AAAA,GACxB,CAAA;AAGD,EAAI,IAAA,oBAAA;AAEJ,EAAA,MAAM,kBAAkB,CAAE,CAAA,IAAA;AAAA,IAAK,MAC7B,EAAE,KAAM,CAAA;AAAA,MACN,qBAAA;AAAA,MACA,CAAA,CAAE,OAAO,EAAE,IAAA,EAAM,EAAE,KAAM,CAAA,eAAe,GAAG,CAAA;AAAA,MAC3C,CAAA,CAAE,OAAO,EAAE,IAAA,EAAM,EAAE,KAAM,CAAA,eAAe,GAAG,CAAA;AAAA,MAC3C,CAAE,CAAA,MAAA,CAAO,EAAE,IAAA,EAAM,iBAAiB,CAAA;AAAA,MAClC,CAAA,CAAE,OAAO,CAAE,CAAA,MAAA,GAAS,KAAM,CAAA,YAAY,GAAG,oBAAoB;AAAA,KAC9D;AAAA,GACH;AAEA,EAAA,oBAAA,GAAuB,EAAE,KAAM,CAAA;AAAA,IAC7B,qBAAA;AAAA,IACA,EAAE,MAAO,CAAA,EAAE,SAAS,CAAE,CAAA,OAAA,IAAW,CAAA;AAAA,IACjC,CAAA,CAAE,OAAO,EAAE,GAAA,EAAK,EAAE,KAAM,CAAA,eAAe,GAAG,CAAA;AAAA,IAC1C,CAAE,CAAA,MAAA,CAAO,EAAE,SAAA,EAAW,iBAAiB;AAAA,GACxC,CAAA;AAED,EAAO,OAAA,eAAA;AACT;;;;"}
1
+ {"version":3,"file":"createEntityPredicateSchema.esm.js","sources":["../../../src/alpha/predicates/createEntityPredicateSchema.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 { EntityPredicate, EntityPredicateValue } from './types';\nimport type { z as zImpl, ZodType } from 'zod';\n\n/** @internal */\nexport function createEntityPredicateSchema(z: typeof zImpl) {\n const primitiveSchema = z.union([z.string(), z.number(), z.boolean()]);\n\n const comparableValueSchema = z.union([\n primitiveSchema,\n z.array(primitiveSchema),\n ]);\n\n // eslint-disable-next-line prefer-const\n let valuePredicateSchema: ZodType<EntityPredicateValue>;\n\n const predicateSchema = z.lazy(() =>\n z.union([\n comparableValueSchema,\n z.object({ $all: z.array(predicateSchema) }),\n z.object({ $any: z.array(predicateSchema) }),\n z.object({ $not: predicateSchema }),\n z.record(z.string().regex(/^(?!\\$).*$/), valuePredicateSchema),\n ]),\n ) as ZodType<EntityPredicate>;\n\n valuePredicateSchema = z.union([\n comparableValueSchema,\n z.object({ $exists: z.boolean() }),\n z.object({ $in: z.array(primitiveSchema) }),\n z.object({ $contains: predicateSchema }),\n ]) as ZodType<EntityPredicateValue>;\n\n return predicateSchema;\n}\n"],"names":[],"mappings":"AAoBO,SAAS,4BAA4B,CAAA,EAAiB;AAC3D,EAAA,MAAM,eAAA,GAAkB,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,CAAA,CAAE,MAAA,EAAO,EAAG,CAAA,CAAE,OAAA,EAAS,CAAC,CAAA;AAErE,EAAA,MAAM,qBAAA,GAAwB,EAAE,KAAA,CAAM;AAAA,IACpC,eAAA;AAAA,IACA,CAAA,CAAE,MAAM,eAAe;AAAA,GACxB,CAAA;AAGD,EAAA,IAAI,oBAAA;AAEJ,EAAA,MAAM,kBAAkB,CAAA,CAAE,IAAA;AAAA,IAAK,MAC7B,EAAE,KAAA,CAAM;AAAA,MACN,qBAAA;AAAA,MACA,CAAA,CAAE,OAAO,EAAE,IAAA,EAAM,EAAE,KAAA,CAAM,eAAe,GAAG,CAAA;AAAA,MAC3C,CAAA,CAAE,OAAO,EAAE,IAAA,EAAM,EAAE,KAAA,CAAM,eAAe,GAAG,CAAA;AAAA,MAC3C,CAAA,CAAE,MAAA,CAAO,EAAE,IAAA,EAAM,iBAAiB,CAAA;AAAA,MAClC,CAAA,CAAE,OAAO,CAAA,CAAE,MAAA,GAAS,KAAA,CAAM,YAAY,GAAG,oBAAoB;AAAA,KAC9D;AAAA,GACH;AAEA,EAAA,oBAAA,GAAuB,EAAE,KAAA,CAAM;AAAA,IAC7B,qBAAA;AAAA,IACA,EAAE,MAAA,CAAO,EAAE,SAAS,CAAA,CAAE,OAAA,IAAW,CAAA;AAAA,IACjC,CAAA,CAAE,OAAO,EAAE,GAAA,EAAK,EAAE,KAAA,CAAM,eAAe,GAAG,CAAA;AAAA,IAC1C,CAAA,CAAE,MAAA,CAAO,EAAE,SAAA,EAAW,iBAAiB;AAAA,GACxC,CAAA;AAED,EAAA,OAAO,eAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"entityPredicateToFilterFunction.esm.js","sources":["../../../src/alpha/predicates/entityPredicateToFilterFunction.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 { JsonValue } from '@backstage/types';\nimport { EntityPredicate, EntityPredicateValue } from './types';\nimport { valueAtPath } from './valueAtPath';\n\n/**\n * Convert an entity predicate to a filter function that can be used to filter entities.\n * @alpha\n */\nexport function entityPredicateToFilterFunction<T extends JsonValue>(\n entityPredicate: EntityPredicate,\n): (value: T) => boolean {\n return value => evaluateEntityPredicate(entityPredicate, value);\n}\n\n/**\n * Evaluate a entity predicate against a value, typically an entity.\n *\n * @internal\n */\nfunction evaluateEntityPredicate(\n filter: EntityPredicate,\n value: JsonValue,\n): boolean {\n if (typeof filter !== 'object' || filter === null || Array.isArray(filter)) {\n return valuesAreEqual(value, filter);\n }\n\n if ('$all' in filter) {\n return filter.$all.every(f => evaluateEntityPredicate(f, value));\n }\n if ('$any' in filter) {\n return filter.$any.some(f => evaluateEntityPredicate(f, value));\n }\n if ('$not' in filter) {\n return !evaluateEntityPredicate(filter.$not, value);\n }\n\n for (const filterKey in filter) {\n if (!Object.hasOwn(filter, filterKey)) {\n continue;\n }\n if (filterKey.startsWith('$')) {\n return false;\n }\n if (\n !evaluatePredicateValue(filter[filterKey], valueAtPath(value, filterKey))\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Evaluate a single value against a predicate value.\n *\n * @internal\n */\nfunction evaluatePredicateValue(\n filter: EntityPredicateValue,\n value: JsonValue | undefined,\n): boolean {\n if (typeof filter !== 'object' || filter === null || Array.isArray(filter)) {\n return valuesAreEqual(value, filter);\n }\n\n if ('$contains' in filter) {\n if (!Array.isArray(value)) {\n return false;\n }\n return value.some(v => evaluateEntityPredicate(filter.$contains, v));\n }\n if ('$in' in filter) {\n return filter.$in.some(search => valuesAreEqual(value, search));\n }\n if ('$exists' in filter) {\n if (filter.$exists === true) {\n return value !== undefined;\n }\n return value === undefined;\n }\n\n return false;\n}\n\nfunction valuesAreEqual(\n a: JsonValue | undefined,\n b: JsonValue | undefined,\n): boolean {\n if (a === null || b === null) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (typeof a === 'string' && typeof b === 'string') {\n return a.toLocaleUpperCase('en-US') === b.toLocaleUpperCase('en-US');\n }\n if (typeof a === 'number' || typeof b === 'number') {\n return String(a) === String(b);\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((v, i) => valuesAreEqual(v, b[i]));\n }\n return false;\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"entityPredicateToFilterFunction.esm.js","sources":["../../../src/alpha/predicates/entityPredicateToFilterFunction.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 { JsonValue } from '@backstage/types';\nimport { EntityPredicate, EntityPredicateValue } from './types';\nimport { valueAtPath } from './valueAtPath';\n\n/**\n * Convert an entity predicate to a filter function that can be used to filter entities.\n * @alpha\n */\nexport function entityPredicateToFilterFunction<T extends JsonValue>(\n entityPredicate: EntityPredicate,\n): (value: T) => boolean {\n return value => evaluateEntityPredicate(entityPredicate, value);\n}\n\n/**\n * Evaluate a entity predicate against a value, typically an entity.\n *\n * @internal\n */\nfunction evaluateEntityPredicate(\n filter: EntityPredicate,\n value: JsonValue,\n): boolean {\n if (typeof filter !== 'object' || filter === null || Array.isArray(filter)) {\n return valuesAreEqual(value, filter);\n }\n\n if ('$all' in filter) {\n return filter.$all.every(f => evaluateEntityPredicate(f, value));\n }\n if ('$any' in filter) {\n return filter.$any.some(f => evaluateEntityPredicate(f, value));\n }\n if ('$not' in filter) {\n return !evaluateEntityPredicate(filter.$not, value);\n }\n\n for (const filterKey in filter) {\n if (!Object.hasOwn(filter, filterKey)) {\n continue;\n }\n if (filterKey.startsWith('$')) {\n return false;\n }\n if (\n !evaluatePredicateValue(filter[filterKey], valueAtPath(value, filterKey))\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Evaluate a single value against a predicate value.\n *\n * @internal\n */\nfunction evaluatePredicateValue(\n filter: EntityPredicateValue,\n value: JsonValue | undefined,\n): boolean {\n if (typeof filter !== 'object' || filter === null || Array.isArray(filter)) {\n return valuesAreEqual(value, filter);\n }\n\n if ('$contains' in filter) {\n if (!Array.isArray(value)) {\n return false;\n }\n return value.some(v => evaluateEntityPredicate(filter.$contains, v));\n }\n if ('$in' in filter) {\n return filter.$in.some(search => valuesAreEqual(value, search));\n }\n if ('$exists' in filter) {\n if (filter.$exists === true) {\n return value !== undefined;\n }\n return value === undefined;\n }\n\n return false;\n}\n\nfunction valuesAreEqual(\n a: JsonValue | undefined,\n b: JsonValue | undefined,\n): boolean {\n if (a === null || b === null) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (typeof a === 'string' && typeof b === 'string') {\n return a.toLocaleUpperCase('en-US') === b.toLocaleUpperCase('en-US');\n }\n if (typeof a === 'number' || typeof b === 'number') {\n return String(a) === String(b);\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((v, i) => valuesAreEqual(v, b[i]));\n }\n return false;\n}\n"],"names":[],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"valueAtPath.esm.js","sources":["../../../src/alpha/predicates/valueAtPath.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 { JsonValue } from '@backstage/types';\n\n/**\n * Looks up a value by path in a nested object structure.\n *\n * @remarks\n *\n * The path should be a dot-separated string of keys to traverse. The traversal\n * will tolerate object keys containing dots, and will keep searching until a\n * value has been found or all matching keys have been traversed.\n *\n * This lookup does not traverse into arrays, returning `undefined` instead.\n *\n * @internal\n */\nexport function valueAtPath(\n value: JsonValue | undefined,\n path: string,\n): JsonValue | undefined {\n if (!path) {\n return undefined;\n }\n if (\n value === undefined ||\n value === null ||\n typeof value !== 'object' ||\n Array.isArray(value)\n ) {\n return undefined;\n }\n\n for (const valueKey in value) {\n if (!Object.hasOwn(value, valueKey)) {\n continue;\n }\n if (valueKey === path) {\n if (value[valueKey] !== undefined) {\n return value[valueKey];\n }\n }\n if (path.startsWith(`${valueKey}.`)) {\n const found = valueAtPath(\n value[valueKey],\n path.slice(valueKey.length + 1),\n );\n if (found !== undefined) {\n return found;\n }\n }\n }\n\n return undefined;\n}\n"],"names":[],"mappings":"AA+BgB,SAAA,WAAA,CACd,OACA,IACuB,EAAA;AACvB,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,KAAA,CAAA;AAAA;AAET,EACE,IAAA,KAAA,KAAU,KACV,CAAA,IAAA,KAAA,KAAU,IACV,IAAA,OAAO,UAAU,QACjB,IAAA,KAAA,CAAM,OAAQ,CAAA,KAAK,CACnB,EAAA;AACA,IAAO,OAAA,KAAA,CAAA;AAAA;AAGT,EAAA,KAAA,MAAW,YAAY,KAAO,EAAA;AAC5B,IAAA,IAAI,CAAC,MAAA,CAAO,MAAO,CAAA,KAAA,EAAO,QAAQ,CAAG,EAAA;AACnC,MAAA;AAAA;AAEF,IAAA,IAAI,aAAa,IAAM,EAAA;AACrB,MAAI,IAAA,KAAA,CAAM,QAAQ,CAAA,KAAM,KAAW,CAAA,EAAA;AACjC,QAAA,OAAO,MAAM,QAAQ,CAAA;AAAA;AACvB;AAEF,IAAA,IAAI,IAAK,CAAA,UAAA,CAAW,CAAG,EAAA,QAAQ,GAAG,CAAG,EAAA;AACnC,MAAA,MAAM,KAAQ,GAAA,WAAA;AAAA,QACZ,MAAM,QAAQ,CAAA;AAAA,QACd,IAAK,CAAA,KAAA,CAAM,QAAS,CAAA,MAAA,GAAS,CAAC;AAAA,OAChC;AACA,MAAA,IAAI,UAAU,KAAW,CAAA,EAAA;AACvB,QAAO,OAAA,KAAA;AAAA;AACT;AACF;AAGF,EAAO,OAAA,KAAA,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"valueAtPath.esm.js","sources":["../../../src/alpha/predicates/valueAtPath.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 { JsonValue } from '@backstage/types';\n\n/**\n * Looks up a value by path in a nested object structure.\n *\n * @remarks\n *\n * The path should be a dot-separated string of keys to traverse. The traversal\n * will tolerate object keys containing dots, and will keep searching until a\n * value has been found or all matching keys have been traversed.\n *\n * This lookup does not traverse into arrays, returning `undefined` instead.\n *\n * @internal\n */\nexport function valueAtPath(\n value: JsonValue | undefined,\n path: string,\n): JsonValue | undefined {\n if (!path) {\n return undefined;\n }\n if (\n value === undefined ||\n value === null ||\n typeof value !== 'object' ||\n Array.isArray(value)\n ) {\n return undefined;\n }\n\n for (const valueKey in value) {\n if (!Object.hasOwn(value, valueKey)) {\n continue;\n }\n if (valueKey === path) {\n if (value[valueKey] !== undefined) {\n return value[valueKey];\n }\n }\n if (path.startsWith(`${valueKey}.`)) {\n const found = valueAtPath(\n value[valueKey],\n path.slice(valueKey.length + 1),\n );\n if (found !== undefined) {\n return found;\n }\n }\n }\n\n return undefined;\n}\n"],"names":[],"mappings":"AA+BO,SAAS,WAAA,CACd,OACA,IAAA,EACuB;AACvB,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,IACE,KAAA,KAAU,MAAA,IACV,KAAA,KAAU,IAAA,IACV,OAAO,UAAU,QAAA,IACjB,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EACnB;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,KAAA,MAAW,YAAY,KAAA,EAAO;AAC5B,IAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAO,KAAA,EAAO,QAAQ,CAAA,EAAG;AACnC,MAAA;AAAA,IACF;AACA,IAAA,IAAI,aAAa,IAAA,EAAM;AACrB,MAAA,IAAI,KAAA,CAAM,QAAQ,CAAA,KAAM,MAAA,EAAW;AACjC,QAAA,OAAO,MAAM,QAAQ,CAAA;AAAA,MACvB;AAAA,IACF;AACA,IAAA,IAAI,IAAA,CAAK,UAAA,CAAW,CAAA,EAAG,QAAQ,GAAG,CAAA,EAAG;AACnC,MAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,QACZ,MAAM,QAAQ,CAAA;AAAA,QACd,IAAA,CAAK,KAAA,CAAM,QAAA,CAAS,MAAA,GAAS,CAAC;AAAA,OAChC;AACA,MAAA,IAAI,UAAU,MAAA,EAAW;AACvB,QAAA,OAAO,KAAA;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;;;;"}