@backstage/plugin-catalog-react 1.21.6 → 2.0.0-next.2

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 (43) hide show
  1. package/CHANGELOG.md +80 -8
  2. package/dist/alpha/blueprints/EntityCardBlueprint.esm.js +2 -2
  3. package/dist/alpha/blueprints/EntityCardBlueprint.esm.js.map +1 -1
  4. package/dist/alpha/blueprints/EntityContentBlueprint.esm.js +13 -6
  5. package/dist/alpha/blueprints/EntityContentBlueprint.esm.js.map +1 -1
  6. package/dist/alpha/blueprints/EntityContentLayoutBlueprint.esm.js +2 -2
  7. package/dist/alpha/blueprints/EntityContentLayoutBlueprint.esm.js.map +1 -1
  8. package/dist/alpha/blueprints/EntityContextMenuItemBlueprint.esm.js +4 -5
  9. package/dist/alpha/blueprints/EntityContextMenuItemBlueprint.esm.js.map +1 -1
  10. package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js +2 -2
  11. package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js.map +1 -1
  12. package/dist/alpha/blueprints/EntityIconLinkBlueprint.esm.js +2 -2
  13. package/dist/alpha/blueprints/EntityIconLinkBlueprint.esm.js.map +1 -1
  14. package/dist/alpha/blueprints/extensionData.esm.js +28 -9
  15. package/dist/alpha/blueprints/extensionData.esm.js.map +1 -1
  16. package/dist/alpha/blueprints/resolveEntityFilterData.esm.js +3 -3
  17. package/dist/alpha/blueprints/resolveEntityFilterData.esm.js.map +1 -1
  18. package/dist/alpha/converters/convertLegacyEntityCardExtension.esm.js.map +1 -1
  19. package/dist/alpha/converters/convertLegacyEntityContentExtension.esm.js +1 -0
  20. package/dist/alpha/converters/convertLegacyEntityContentExtension.esm.js.map +1 -1
  21. package/dist/alpha.d.ts +65 -66
  22. package/dist/alpha.esm.js +1 -2
  23. package/dist/alpha.esm.js.map +1 -1
  24. package/dist/components/UnregisterEntityDialog/UnregisterEntityDialog.esm.js +235 -168
  25. package/dist/components/UnregisterEntityDialog/UnregisterEntityDialog.esm.js.map +1 -1
  26. package/dist/components/UserListPicker/UserListPicker.esm.js +2 -1
  27. package/dist/components/UserListPicker/UserListPicker.esm.js.map +1 -1
  28. package/dist/hooks/useEntityListProvider.esm.js +4 -2
  29. package/dist/hooks/useEntityListProvider.esm.js.map +1 -1
  30. package/dist/testUtils/catalogApiMock.esm.js +4 -23
  31. package/dist/testUtils/catalogApiMock.esm.js.map +1 -1
  32. package/dist/testUtils/createTestEntityPage.esm.js +106 -0
  33. package/dist/testUtils/createTestEntityPage.esm.js.map +1 -0
  34. package/dist/testUtils.d.ts +61 -5
  35. package/dist/testUtils.esm.js +1 -0
  36. package/dist/testUtils.esm.js.map +1 -1
  37. package/package.json +28 -22
  38. package/dist/alpha/predicates/createEntityPredicateSchema.esm.js +0 -33
  39. package/dist/alpha/predicates/createEntityPredicateSchema.esm.js.map +0 -1
  40. package/dist/alpha/predicates/entityPredicateToFilterFunction.esm.js +0 -73
  41. package/dist/alpha/predicates/entityPredicateToFilterFunction.esm.js.map +0 -1
  42. package/dist/alpha/predicates/valueAtPath.esm.js +0 -31
  43. package/dist/alpha/predicates/valueAtPath.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,17 +1,89 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 1.21.6
3
+ ## 2.0.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - 491a06c: Add the ability to show icons for the tabs on the entity page (new frontend)
8
+ - 7feb83b: **BREAKING ALPHA**: All of the predicate types and functions have been moved to the `@backstage/filter-predicates` package.
9
+
10
+ When moving into the more general package, they were renamed as follows:
11
+
12
+ - `EntityPredicate` -> `FilterPredicate`
13
+ - `EntityPredicateExpression` -> `FilterPredicateExpression`
14
+ - `EntityPredicatePrimitive` -> `FilterPredicatePrimitive`
15
+ - `entityPredicateToFilterFunction` -> `filterPredicateToFilterFunction`
16
+ - `EntityPredicateValue` -> `FilterPredicateValue`
17
+
18
+ - ac9bead: Added `createTestEntityPage` test utility for testing entity cards and content extensions in the new frontend system. This utility creates a test page extension that provides `EntityProvider` context and accepts entity extensions through input redirects:
19
+
20
+ ```typescript
21
+ import { renderTestApp } from '@backstage/frontend-test-utils';
22
+ import { createTestEntityPage } from '@backstage/plugin-catalog-react/testUtils';
23
+
24
+ renderTestApp({
25
+ extensions: [createTestEntityPage({ entity: myEntity }), myEntityCard],
26
+ });
27
+ ```
4
28
 
5
29
  ### Patch Changes
6
30
 
7
- - 5683c85: Bump to latest zod to ensure it has the latest features
31
+ - 09a6aad: The `catalogApiMock` test utility now returns a `MockWithApiFactory`, allowing it to be passed directly to test utilities like `renderTestApp` and `TestApiProvider` without needing the `[catalogApiRef, catalogApiMock()]` tuple.
32
+ - 88dbd5e: fixed bug in `UserListPicker` by getting the `kindParamater` from the `filters` rather than from the `queryParameters`
33
+ - a7e0d50: Prepare for React Router v7 migration by updating to v6.30.2 across all NFS packages and enabling v7 future flags. Convert routes from splat paths to parent/child structure with Outlet components.
8
34
  - Updated dependencies
9
- - @backstage/frontend-test-utils@0.4.5
10
- - @backstage/frontend-plugin-api@0.13.4
11
- - @backstage/plugin-permission-common@0.9.5
12
- - @backstage/core-compat-api@0.5.7
13
- - @backstage/core-components@0.18.6
14
- - @backstage/core-plugin-api@1.12.2
35
+ - @backstage/ui@0.12.0-next.2
36
+ - @backstage/frontend-test-utils@0.5.0-next.2
37
+ - @backstage/catalog-client@1.12.2-next.0
38
+ - @backstage/frontend-plugin-api@0.14.0-next.2
39
+ - @backstage/integration-react@1.2.15-next.2
40
+ - @backstage/core-compat-api@0.5.8-next.2
41
+ - @backstage/core-components@0.18.7-next.2
42
+ - @backstage/core-plugin-api@1.12.3-next.1
43
+ - @backstage/plugin-permission-react@0.4.40-next.1
44
+ - @backstage/version-bridge@1.0.12-next.0
45
+ - @backstage/filter-predicates@0.1.0-next.0
46
+
47
+ ## 1.22.0-next.1
48
+
49
+ ### Minor Changes
50
+
51
+ - 0e9578d: Migrated `UnregisterEntityDialog` from Material UI to Backstage UI components.
52
+ - e8258d0: **BREAKING**: Removed the 'summary' entity card type from `EntityCardType`. Users should migrate to using 'content' or 'info' card types instead.
53
+
54
+ TypeScript will now show errors if you try to use `type: 'summary'` when creating entity cards.
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies
59
+ - @backstage/frontend-test-utils@0.4.6-next.1
60
+ - @backstage/ui@0.12.0-next.1
61
+ - @backstage/frontend-plugin-api@0.14.0-next.1
62
+ - @backstage/core-compat-api@0.5.8-next.1
63
+ - @backstage/core-components@0.18.7-next.1
64
+ - @backstage/integration-react@1.2.15-next.1
65
+
66
+ ## 1.21.6-next.0
67
+
68
+ ### Patch Changes
69
+
70
+ - f523983: Fixes a bug where the `EntityListProvider` would not correctly hydrate query parameters if more than 20 were provided for the same key.
71
+ - 69d880e: Bump to latest zod to ensure it has the latest features
72
+ - Updated dependencies
73
+ - @backstage/core-components@0.18.6-next.0
74
+ - @backstage/core-compat-api@0.5.7-next.0
75
+ - @backstage/frontend-plugin-api@0.14.0-next.0
76
+ - @backstage/frontend-test-utils@0.4.5-next.0
77
+ - @backstage/core-plugin-api@1.12.2-next.0
78
+ - @backstage/plugin-permission-common@0.9.5-next.0
79
+ - @backstage/catalog-client@1.12.1
80
+ - @backstage/catalog-model@1.7.6
81
+ - @backstage/errors@1.2.7
82
+ - @backstage/integration-react@1.2.15-next.0
83
+ - @backstage/types@1.2.2
84
+ - @backstage/version-bridge@1.0.11
85
+ - @backstage/plugin-catalog-common@1.1.8-next.0
86
+ - @backstage/plugin-permission-react@0.4.40-next.0
15
87
 
16
88
  ## 1.21.5
17
89
 
@@ -1,6 +1,6 @@
1
1
  import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
2
  import { entityCardTypeDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef, entityCardTypes } from './extensionData.esm.js';
3
- import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
3
+ import { createZodV3FilterPredicateSchema } from '@backstage/filter-predicates';
4
4
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
5
5
 
6
6
  const EntityCardBlueprint = createExtensionBlueprint({
@@ -19,7 +19,7 @@ const EntityCardBlueprint = createExtensionBlueprint({
19
19
  },
20
20
  config: {
21
21
  schema: {
22
- filter: (z) => z.union([z.string(), createEntityPredicateSchema(z)]).optional(),
22
+ filter: (z) => z.union([z.string(), createZodV3FilterPredicateSchema(z)]).optional(),
23
23
  type: (z) => z.enum(entityCardTypes).optional()
24
24
  }
25
25
  },
@@ -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 }\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;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityCardBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityCardBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n entityCardTypeDataRef,\n entityCardTypes,\n EntityCardType,\n} from './extensionData';\nimport {\n FilterPredicate,\n createZodV3FilterPredicateSchema,\n} from '@backstage/filter-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(), createZodV3FilterPredicateSchema(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 | FilterPredicate | ((entity: Entity) => boolean);\n type?: EntityCardType;\n },\n { node, config },\n ) {\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n yield* resolveEntityFilterData(filter, config, node);\n\n const finalType = config.type ?? type;\n if (finalType) {\n yield entityCardTypeDataRef(finalType);\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAuCO,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,gCAAA,CAAiC,CAAC,CAAC,CAAC,EAAE,QAAA,EAAS;AAAA,MACtE,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;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
- import { entityContentGroupDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef, entityContentTitleDataRef } from './extensionData.esm.js';
2
+ import { entityContentIconDataRef, entityContentGroupDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef, entityContentTitleDataRef } from './extensionData.esm.js';
3
+ import { createZodV3FilterPredicateSchema } from '@backstage/filter-predicates';
3
4
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
4
- import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
5
5
 
6
6
  const EntityContentBlueprint = createExtensionBlueprint({
7
7
  kind: "entity-content",
@@ -13,25 +13,29 @@ const EntityContentBlueprint = createExtensionBlueprint({
13
13
  coreExtensionData.routeRef.optional(),
14
14
  entityFilterFunctionDataRef.optional(),
15
15
  entityFilterExpressionDataRef.optional(),
16
- entityContentGroupDataRef.optional()
16
+ entityContentGroupDataRef.optional(),
17
+ entityContentIconDataRef.optional()
17
18
  ],
18
19
  dataRefs: {
19
20
  title: entityContentTitleDataRef,
20
21
  filterFunction: entityFilterFunctionDataRef,
21
22
  filterExpression: entityFilterExpressionDataRef,
22
- group: entityContentGroupDataRef
23
+ group: entityContentGroupDataRef,
24
+ icon: entityContentIconDataRef
23
25
  },
24
26
  config: {
25
27
  schema: {
26
28
  path: (z) => z.string().optional(),
27
29
  title: (z) => z.string().optional(),
28
- filter: (z) => z.union([z.string(), createEntityPredicateSchema(z)]).optional(),
29
- group: (z) => z.literal(false).or(z.string()).optional()
30
+ filter: (z) => z.union([z.string(), createZodV3FilterPredicateSchema(z)]).optional(),
31
+ group: (z) => z.literal(false).or(z.string()).optional(),
32
+ icon: (z) => z.string().optional()
30
33
  }
31
34
  },
32
35
  *factory(params, { node, config }) {
33
36
  const path = config.path ?? params.path ?? params.defaultPath;
34
37
  const title = config.title ?? params.title ?? params.defaultTitle;
38
+ const icon = config.icon ?? params.icon;
35
39
  const group = config.group ?? params.group ?? params.defaultGroup;
36
40
  yield coreExtensionData.reactElement(
37
41
  ExtensionBoundary.lazy(node, params.loader)
@@ -45,6 +49,9 @@ const EntityContentBlueprint = createExtensionBlueprint({
45
49
  if (group && typeof group === "string") {
46
50
  yield entityContentGroupDataRef(group);
47
51
  }
52
+ if (icon) {
53
+ yield entityContentIconDataRef(icon);
54
+ }
48
55
  }
49
56
  });
50
57
 
@@ -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 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 // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n const path = config.path ?? params.path ?? params.defaultPath;\n const title = config.title ?? params.title ?? params.defaultTitle;\n const group = config.group ?? params.group ?? params.defaultGroup;\n\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n );\n\n yield coreExtensionData.routePath(path);\n\n yield entityContentTitleDataRef(title);\n\n if (params.routeRef) {\n yield coreExtensionData.routeRef(params.routeRef);\n }\n\n yield* resolveEntityFilterData(params.filter, config, node);\n\n if (group && typeof group === 'string') {\n yield entityContentGroupDataRef(group);\n }\n },\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;AAIA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,QAAQ,MAAA,CAAO,WAAA;AAClD,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,KAAA,IAAS,MAAA,CAAO,SAAS,MAAA,CAAO,YAAA;AACrD,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,KAAA,IAAS,MAAA,CAAO,SAAS,MAAA,CAAO,YAAA;AAErD,IAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,MACtB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAA,CAAO,MAAM;AAAA,KAC5C;AAEA,IAAA,MAAM,iBAAA,CAAkB,UAAU,IAAI,CAAA;AAEtC,IAAA,MAAM,0BAA0B,KAAK,CAAA;AAErC,IAAA,IAAI,OAAO,QAAA,EAAU;AACnB,MAAA,MAAM,iBAAA,CAAkB,QAAA,CAAS,MAAA,CAAO,QAAQ,CAAA;AAAA,IAClD;AAEA,IAAA,OAAO,uBAAA,CAAwB,MAAA,CAAO,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAE1D,IAAA,IAAI,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,EAAU;AACtC,MAAA,MAAM,0BAA0B,KAAK,CAAA;AAAA,IACvC;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"EntityContentBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n coreExtensionData,\n createExtensionBlueprint,\n ExtensionBoundary,\n RouteRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityContentTitleDataRef,\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n entityContentGroupDataRef,\n defaultEntityContentGroups,\n entityContentIconDataRef,\n} from './extensionData';\nimport {\n FilterPredicate,\n createZodV3FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\nimport { ReactElement } from 'react';\n\n/**\n * @alpha\n * Creates an EntityContent extension.\n */\nexport const EntityContentBlueprint = createExtensionBlueprint({\n kind: 'entity-content',\n attachTo: { id: 'page:catalog/entity', input: 'contents' },\n output: [\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n entityContentTitleDataRef,\n coreExtensionData.routeRef.optional(),\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityContentGroupDataRef.optional(),\n entityContentIconDataRef.optional(),\n ],\n dataRefs: {\n title: entityContentTitleDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n group: entityContentGroupDataRef,\n icon: entityContentIconDataRef,\n },\n config: {\n schema: {\n path: z => z.string().optional(),\n title: z => z.string().optional(),\n filter: z =>\n z.union([z.string(), createZodV3FilterPredicateSchema(z)]).optional(),\n group: z => z.literal(false).or(z.string()).optional(),\n icon: z => 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 icon?: string | ReactElement;\n loader: () => Promise<JSX.Element>;\n routeRef?: RouteRef;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n const path = config.path ?? params.path ?? params.defaultPath;\n const title = config.title ?? params.title ?? params.defaultTitle;\n const icon = config.icon ?? params.icon;\n const group = config.group ?? params.group ?? params.defaultGroup;\n\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, params.loader),\n );\n\n yield coreExtensionData.routePath(path);\n\n yield entityContentTitleDataRef(title);\n\n if (params.routeRef) {\n yield coreExtensionData.routeRef(params.routeRef);\n }\n\n yield* resolveEntityFilterData(params.filter, config, node);\n\n if (group && typeof group === 'string') {\n yield entityContentGroupDataRef(group);\n }\n if (icon) {\n yield entityContentIconDataRef(icon);\n }\n },\n});\n"],"names":[],"mappings":";;;;;AA0CO,MAAM,yBAAyB,wBAAA,CAAyB;AAAA,EAC7D,IAAA,EAAM,gBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,qBAAA,EAAuB,OAAO,UAAA,EAAW;AAAA,EACzD,MAAA,EAAQ;AAAA,IACN,iBAAA,CAAkB,YAAA;AAAA,IAClB,iBAAA,CAAkB,SAAA;AAAA,IAClB,yBAAA;AAAA,IACA,iBAAA,CAAkB,SAAS,QAAA,EAAS;AAAA,IACpC,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC,0BAA0B,QAAA,EAAS;AAAA,IACnC,yBAAyB,QAAA;AAAS,GACpC;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,yBAAA;AAAA,IACP,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,KAAA,EAAO,yBAAA;AAAA,IACP,IAAA,EAAM;AAAA,GACR;AAAA,EACA,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,gCAAA,CAAiC,CAAC,CAAC,CAAC,EAAE,QAAA,EAAS;AAAA,MACtE,KAAA,EAAO,CAAA,CAAA,KAAK,CAAA,CAAE,OAAA,CAAQ,KAAK,CAAA,CAAE,EAAA,CAAG,CAAA,CAAE,MAAA,EAAQ,CAAA,CAAE,QAAA,EAAS;AAAA,MACrD,IAAA,EAAM,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,GAAS,QAAA;AAAS;AACjC,GACF;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAqBA,EAAE,IAAA,EAAM,QAAO,EACf;AAIA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,QAAQ,MAAA,CAAO,WAAA;AAClD,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,KAAA,IAAS,MAAA,CAAO,SAAS,MAAA,CAAO,YAAA;AACrD,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,IAAQ,MAAA,CAAO,IAAA;AACnC,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,KAAA,IAAS,MAAA,CAAO,SAAS,MAAA,CAAO,YAAA;AAErD,IAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,MACtB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAA,CAAO,MAAM;AAAA,KAC5C;AAEA,IAAA,MAAM,iBAAA,CAAkB,UAAU,IAAI,CAAA;AAEtC,IAAA,MAAM,0BAA0B,KAAK,CAAA;AAErC,IAAA,IAAI,OAAO,QAAA,EAAU;AACnB,MAAA,MAAM,iBAAA,CAAkB,QAAA,CAAS,MAAA,CAAO,QAAQ,CAAA;AAAA,IAClD;AAEA,IAAA,OAAO,uBAAA,CAAwB,MAAA,CAAO,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAE1D,IAAA,IAAI,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,EAAU;AACtC,MAAA,MAAM,0BAA0B,KAAK,CAAA;AAAA,IACvC;AACA,IAAA,IAAI,IAAA,EAAM;AACR,MAAA,MAAM,yBAAyB,IAAI,CAAA;AAAA,IACrC;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { createExtensionDataRef, createExtensionBlueprint, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
2
  import { entityFilterExpressionDataRef, entityFilterFunctionDataRef } from './extensionData.esm.js';
3
+ import { createZodV3FilterPredicateSchema } from '@backstage/filter-predicates';
3
4
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
4
- import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
5
5
 
6
6
  const entityCardLayoutComponentDataRef = createExtensionDataRef().with({
7
7
  id: "catalog.entity-content-layout.component"
@@ -22,7 +22,7 @@ const EntityContentLayoutBlueprint = createExtensionBlueprint({
22
22
  config: {
23
23
  schema: {
24
24
  type: (z) => z.string().optional(),
25
- filter: (z) => z.union([z.string(), createEntityPredicateSchema(z)]).optional()
25
+ filter: (z) => z.union([z.string(), createZodV3FilterPredicateSchema(z)]).optional()
26
26
  }
27
27
  },
28
28
  *factory({
@@ -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,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
+ {"version":3,"file":"EntityContentLayoutBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentLayoutBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExtensionDataRef,\n createExtensionBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n EntityCardType,\n} from './extensionData';\nimport { JSX } from 'react';\nimport {\n FilterPredicate,\n createZodV3FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport interface EntityContentLayoutProps {\n cards: Array<{\n type?: EntityCardType;\n element: JSX.Element;\n }>;\n}\n\nconst entityCardLayoutComponentDataRef = createExtensionDataRef<\n (props: EntityContentLayoutProps) => React.JSX.Element\n>().with({\n id: 'catalog.entity-content-layout.component',\n});\n\n/** @alpha */\nexport const EntityContentLayoutBlueprint = createExtensionBlueprint({\n kind: 'entity-content-layout',\n attachTo: { id: 'entity-content:catalog/overview', input: 'layouts' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityCardLayoutComponentDataRef,\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n component: entityCardLayoutComponentDataRef,\n },\n config: {\n schema: {\n type: z => z.string().optional(),\n filter: z =>\n z.union([z.string(), createZodV3FilterPredicateSchema(z)]).optional(),\n },\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n loader: () => Promise<(props: EntityContentLayoutProps) => JSX.Element>;\n },\n { node, config },\n ) {\n yield* resolveEntityFilterData(filter, config, node);\n\n yield entityCardLayoutComponentDataRef(\n ExtensionBoundary.lazyComponent(node, loader),\n );\n },\n});\n"],"names":[],"mappings":";;;;;AA0CA,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,gCAAA,CAAiC,CAAC,CAAC,CAAC,EAAE,QAAA;AAAS;AACxE,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;;;;"}
@@ -4,9 +4,8 @@ import MenuItem from '@material-ui/core/MenuItem';
4
4
  import ListItemIcon from '@material-ui/core/ListItemIcon';
5
5
  import ListItemText from '@material-ui/core/ListItemText';
6
6
  import { useEntityContextMenu } from '../../hooks/useEntityContextMenu.esm.js';
7
- import { entityPredicateToFilterFunction } from '../predicates/entityPredicateToFilterFunction.esm.js';
7
+ import { createZodV3FilterPredicateSchema, filterPredicateToFilterFunction } from '@backstage/filter-predicates';
8
8
  import { entityFilterFunctionDataRef } from './extensionData.esm.js';
9
- import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
10
9
 
11
10
  const EntityContextMenuItemBlueprint = createExtensionBlueprint({
12
11
  kind: "entity-context-menu-item",
@@ -20,7 +19,7 @@ const EntityContextMenuItemBlueprint = createExtensionBlueprint({
20
19
  },
21
20
  config: {
22
21
  schema: {
23
- filter: (z) => createEntityPredicateSchema(z).optional()
22
+ filter: (z) => createZodV3FilterPredicateSchema(z).optional()
24
23
  }
25
24
  },
26
25
  *factory(params, { node, config }) {
@@ -49,13 +48,13 @@ const EntityContextMenuItemBlueprint = createExtensionBlueprint({
49
48
  yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
50
49
  if (config.filter) {
51
50
  yield entityFilterFunctionDataRef(
52
- entityPredicateToFilterFunction(config.filter)
51
+ filterPredicateToFilterFunction(config.filter)
53
52
  );
54
53
  } else if (typeof params.filter === "function") {
55
54
  yield entityFilterFunctionDataRef(params.filter);
56
55
  } else if (params.filter) {
57
56
  yield entityFilterFunctionDataRef(
58
- entityPredicateToFilterFunction(params.filter)
57
+ filterPredicateToFilterFunction(params.filter)
59
58
  );
60
59
  }
61
60
  }
@@ -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,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
+ {"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 {\n FilterPredicate,\n filterPredicateToFilterFunction,\n createZodV3FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport type { Entity } from '@backstage/catalog-model';\nimport { entityFilterFunctionDataRef } from './extensionData';\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?: FilterPredicate | ((entity: Entity) => boolean);\n};\n\n/** @alpha */\nexport const EntityContextMenuItemBlueprint = createExtensionBlueprint({\n kind: 'entity-context-menu-item',\n attachTo: { id: 'page:catalog/entity', input: 'contextMenuItems' },\n output: [\n coreExtensionData.reactElement,\n entityFilterFunctionDataRef.optional(),\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n },\n config: {\n schema: {\n filter: z => createZodV3FilterPredicateSchema(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 filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof params.filter === 'function') {\n yield entityFilterFunctionDataRef(params.filter);\n } else if (params.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(params.filter),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;;;;;AAsDO,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,gCAAA,CAAiC,CAAC,EAAE,QAAA;AAAS;AAC5D,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,6 +1,6 @@
1
1
  import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
2
+ import { createZodV3FilterPredicateSchema } from '@backstage/filter-predicates';
2
3
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
3
- import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
4
4
  import { entityFilterFunctionDataRef, entityFilterExpressionDataRef } from './extensionData.esm.js';
5
5
 
6
6
  const EntityHeaderBlueprint = createExtensionBlueprint({
@@ -12,7 +12,7 @@ const EntityHeaderBlueprint = createExtensionBlueprint({
12
12
  },
13
13
  config: {
14
14
  schema: {
15
- filter: (z) => createEntityPredicateSchema(z).optional()
15
+ filter: (z) => createZodV3FilterPredicateSchema(z).optional()
16
16
  }
17
17
  },
18
18
  output: [
@@ -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,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
+ {"version":3,"file":"EntityHeaderBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExtensionBlueprint,\n coreExtensionData,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n FilterPredicate,\n createZodV3FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\n\n/** @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 => createZodV3FilterPredicateSchema(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?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n const { loader, filter } = params;\n\n yield* resolveEntityFilterData(filter, config, node);\n\n if (loader) {\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, loader),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;AAiCO,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,gCAAA,CAAiC,CAAC,EAAE,QAAA;AAAS;AAC5D,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,5 +1,5 @@
1
1
  import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
- import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
2
+ import { createZodV3FilterPredicateSchema } from '@backstage/filter-predicates';
3
3
  import { entityFilterExpressionDataRef, entityFilterFunctionDataRef } from './extensionData.esm.js';
4
4
  import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
5
5
 
@@ -23,7 +23,7 @@ const EntityIconLinkBlueprint = createExtensionBlueprint({
23
23
  schema: {
24
24
  label: (z) => z.string().optional(),
25
25
  title: (z) => z.string().optional(),
26
- filter: (z) => createEntityPredicateSchema(z).optional()
26
+ filter: (z) => createZodV3FilterPredicateSchema(z).optional()
27
27
  }
28
28
  },
29
29
  *factory(params, { config, node }) {
@@ -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,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
+ {"version":3,"file":"EntityIconLinkBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityIconLinkBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconLinkVerticalProps } from '@backstage/core-components';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n FilterPredicate,\n createZodV3FilterPredicateSchema,\n} from '@backstage/filter-predicates';\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 => createZodV3FilterPredicateSchema(z).optional(),\n },\n },\n *factory(\n params: {\n useProps: () => Omit<IconLinkVerticalProps, 'color'>;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { config, node },\n ) {\n const { filter, useProps } = params;\n yield* resolveEntityFilterData(filter, config, node);\n // Only include properties that are defined in the config\n // to avoid overriding defaults with undefined values\n const configProps = Object.entries(config).reduce(\n (rest, [key, value]) =>\n value !== undefined\n ? {\n ...rest,\n [key]: value,\n }\n : rest,\n {},\n );\n yield entityIconLinkPropsDataRef(() => ({ ...useProps(), ...configProps }));\n },\n});\n"],"names":[],"mappings":";;;;;AAkCA,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,gCAAA,CAAiC,CAAC,EAAE,QAAA;AAAS;AAC5D,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;;;;"}
@@ -3,23 +3,42 @@ import { createExtensionDataRef } from '@backstage/frontend-plugin-api';
3
3
  const entityContentTitleDataRef = createExtensionDataRef().with({
4
4
  id: "catalog.entity-content-title"
5
5
  });
6
+ const entityContentIconDataRef = createExtensionDataRef().with({
7
+ id: "catalog.entity-content-icon"
8
+ });
6
9
  const entityFilterFunctionDataRef = createExtensionDataRef().with({ id: "catalog.entity-filter-function" });
7
10
  const entityFilterExpressionDataRef = createExtensionDataRef().with({
8
11
  id: "catalog.entity-filter-expression"
9
12
  });
10
- const defaultEntityContentGroups = {
11
- overview: "Overview",
12
- documentation: "Documentation",
13
- development: "Development",
14
- deployment: "Deployment",
15
- operation: "Operation",
16
- observability: "Observability"
13
+ const defaultEntityContentGroupDefinitions = {
14
+ overview: {
15
+ title: "Overview"
16
+ },
17
+ documentation: {
18
+ title: "Documentation"
19
+ },
20
+ development: {
21
+ title: "Development"
22
+ },
23
+ deployment: {
24
+ title: "Deployment"
25
+ },
26
+ operation: {
27
+ title: "Operation"
28
+ },
29
+ observability: {
30
+ title: "Observability"
31
+ }
17
32
  };
33
+ const defaultEntityContentGroups = Object.fromEntries(
34
+ Object.entries(defaultEntityContentGroupDefinitions).map(
35
+ ([key, { title }]) => [key, title]
36
+ )
37
+ );
18
38
  const entityContentGroupDataRef = createExtensionDataRef().with({
19
39
  id: "catalog.entity-content-group"
20
40
  });
21
41
  const entityCardTypes = [
22
- "summary",
23
42
  "info",
24
43
  "content"
25
44
  ];
@@ -27,5 +46,5 @@ const entityCardTypeDataRef = createExtensionDataRef().with({
27
46
  id: "catalog.entity-card-type"
28
47
  });
29
48
 
30
- export { defaultEntityContentGroups, entityCardTypeDataRef, entityCardTypes, entityContentGroupDataRef, entityContentTitleDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef };
49
+ export { defaultEntityContentGroupDefinitions, defaultEntityContentGroups, entityCardTypeDataRef, entityCardTypes, entityContentGroupDataRef, entityContentIconDataRef, entityContentTitleDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef };
31
50
  //# sourceMappingURL=extensionData.esm.js.map
@@ -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":";;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
+ {"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';\nimport { ReactElement } from 'react';\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n});\n\n/** @internal */\nexport const entityContentIconDataRef = createExtensionDataRef<\n string | ReactElement\n>().with({\n id: 'catalog.entity-content-icon',\n});\n\n/** @internal */\nexport const entityFilterFunctionDataRef = createExtensionDataRef<\n (entity: Entity) => boolean\n>().with({ id: 'catalog.entity-filter-function' });\n\n/** @internal */\nexport const entityFilterExpressionDataRef =\n createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n });\n\n/** @alpha */\nexport type EntityContentGroupDefinitions = Record<\n string,\n {\n title: string;\n icon?: string | ReactElement;\n }\n>;\n\n/**\n * @alpha\n * Default entity content groups.\n */\nexport const defaultEntityContentGroupDefinitions = {\n overview: {\n title: 'Overview',\n },\n documentation: {\n title: 'Documentation',\n },\n development: {\n title: 'Development',\n },\n deployment: {\n title: 'Deployment',\n },\n operation: {\n title: 'Operation',\n },\n observability: {\n title: 'Observability',\n },\n} satisfies EntityContentGroupDefinitions;\n\n/**\n * @alpha\n * Default entity content groups.\n * @deprecated use defaultEntityContentGroupDefinitions\n */\nexport const defaultEntityContentGroups = Object.fromEntries(\n Object.entries(defaultEntityContentGroupDefinitions).map(\n ([key, { title }]) => [key, title],\n ),\n) as Record<keyof typeof defaultEntityContentGroupDefinitions, string>;\n\n/** @internal */\nexport const entityContentGroupDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-group',\n});\n\n/**\n * @internal\n * Available entity card types\n */\nexport const entityCardTypes = [\n 'info',\n 'content',\n] as const satisfies readonly EntityCardType[];\n\n/** @alpha */\nexport type EntityCardType = 'info' | 'content';\n\n/** @internal */\nexport const entityCardTypeDataRef =\n createExtensionDataRef<EntityCardType>().with({\n id: 'catalog.entity-card-type',\n });\n"],"names":[],"mappings":";;AAqBO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,wBAAA,GAA2B,sBAAA,EAEtC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,8BAA8B,sBAAA,EAEzC,CAAE,KAAK,EAAE,EAAA,EAAI,kCAAkC;AAG1C,MAAM,6BAAA,GACX,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EACpC,EAAA,EAAI;AACN,CAAC;AAeI,MAAM,oCAAA,GAAuC;AAAA,EAClD,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA,GACT;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO;AAAA,GACT;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO;AAAA,GACT;AAAA,EACA,SAAA,EAAW;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA;AAEX;AAOO,MAAM,6BAA6B,MAAA,CAAO,WAAA;AAAA,EAC/C,MAAA,CAAO,OAAA,CAAQ,oCAAoC,CAAA,CAAE,GAAA;AAAA,IACnD,CAAC,CAAC,GAAA,EAAK,EAAE,OAAO,CAAA,KAAM,CAAC,GAAA,EAAK,KAAK;AAAA;AAErC;AAGO,MAAM,yBAAA,GAA4B,sBAAA,EAA+B,CAAE,IAAA,CAAK;AAAA,EAC7E,EAAA,EAAI;AACN,CAAC;AAMM,MAAM,eAAA,GAAkB;AAAA,EAC7B,MAAA;AAAA,EACA;AACF;AAMO,MAAM,qBAAA,GACX,sBAAA,EAAuC,CAAE,IAAA,CAAK;AAAA,EAC5C,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { entityFilterExpressionDataRef, entityFilterFunctionDataRef } from './extensionData.esm.js';
2
- import { entityPredicateToFilterFunction } from '../predicates/entityPredicateToFilterFunction.esm.js';
2
+ import { filterPredicateToFilterFunction } from '@backstage/filter-predicates';
3
3
 
4
4
  function* resolveEntityFilterData(filter, config, node) {
5
5
  if (typeof config.filter === "string") {
@@ -9,7 +9,7 @@ function* resolveEntityFilterData(filter, config, node) {
9
9
  yield entityFilterExpressionDataRef(config.filter);
10
10
  } else if (config.filter) {
11
11
  yield entityFilterFunctionDataRef(
12
- entityPredicateToFilterFunction(config.filter)
12
+ filterPredicateToFilterFunction(config.filter)
13
13
  );
14
14
  } else if (typeof filter === "function") {
15
15
  yield entityFilterFunctionDataRef(filter);
@@ -19,7 +19,7 @@ function* resolveEntityFilterData(filter, config, node) {
19
19
  );
20
20
  yield entityFilterExpressionDataRef(filter);
21
21
  } else if (filter) {
22
- yield entityFilterFunctionDataRef(entityPredicateToFilterFunction(filter));
22
+ yield entityFilterFunctionDataRef(filterPredicateToFilterFunction(filter));
23
23
  }
24
24
  }
25
25
 
@@ -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":";;;AA2BO,UAAU,uBAAA,CACf,MAAA,EACA,MAAA,EACA,IAAA,EACA;AACA,EAAA,IAAI,OAAO,MAAA,CAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,2EAAA,EAA8E,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAC5F;AACA,IAAA,MAAM,6BAAA,CAA8B,OAAO,MAAM,CAAA;AAAA,EACnD,CAAA,MAAA,IAAW,OAAO,MAAA,EAAQ;AACxB,IAAA,MAAM,2BAAA;AAAA,MACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,KAC/C;AAAA,EACF,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,UAAA,EAAY;AACvC,IAAA,MAAM,4BAA4B,MAAM,CAAA;AAAA,EAC1C,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,+DAAA,EAAkE,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAChF;AACA,IAAA,MAAM,8BAA8B,MAAM,CAAA;AAAA,EAC5C,WAAW,MAAA,EAAQ;AACjB,IAAA,MAAM,2BAAA,CAA4B,+BAAA,CAAgC,MAAM,CAAC,CAAA;AAAA,EAC3E;AACF;;;;"}
1
+ {"version":3,"file":"resolveEntityFilterData.esm.js","sources":["../../../src/alpha/blueprints/resolveEntityFilterData.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\nimport {\n FilterPredicate,\n filterPredicateToFilterFunction,\n} from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { AppNode } from '@backstage/frontend-plugin-api';\n\nexport function* resolveEntityFilterData(\n filter: ((entity: Entity) => boolean) | FilterPredicate | string | undefined,\n config: { filter?: FilterPredicate | string },\n node: AppNode,\n) {\n if (typeof config.filter === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Using a string-based filter in the configuration for '${node.spec.id}' is deprecated. Use an entity predicate object instead.`,\n );\n yield entityFilterExpressionDataRef(config.filter);\n } else if (config.filter) {\n yield entityFilterFunctionDataRef(\n filterPredicateToFilterFunction(config.filter),\n );\n } else if (typeof filter === 'function') {\n yield entityFilterFunctionDataRef(filter);\n } else if (typeof filter === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n `DEPRECATION WARNING: Using a string as the default filter for '${node.spec.id}' is deprecated. Use an entity predicate object instead.`,\n );\n yield entityFilterExpressionDataRef(filter);\n } else if (filter) {\n yield entityFilterFunctionDataRef(filterPredicateToFilterFunction(filter));\n }\n}\n"],"names":[],"mappings":";;;AA2BO,UAAU,uBAAA,CACf,MAAA,EACA,MAAA,EACA,IAAA,EACA;AACA,EAAA,IAAI,OAAO,MAAA,CAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,2EAAA,EAA8E,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAC5F;AACA,IAAA,MAAM,6BAAA,CAA8B,OAAO,MAAM,CAAA;AAAA,EACnD,CAAA,MAAA,IAAW,OAAO,MAAA,EAAQ;AACxB,IAAA,MAAM,2BAAA;AAAA,MACJ,+BAAA,CAAgC,OAAO,MAAM;AAAA,KAC/C;AAAA,EACF,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,UAAA,EAAY;AACvC,IAAA,MAAM,4BAA4B,MAAM,CAAA;AAAA,EAC1C,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,QAAA,EAAU;AAErC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,+DAAA,EAAkE,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA,wDAAA;AAAA,KAChF;AACA,IAAA,MAAM,8BAA8B,MAAM,CAAA;AAAA,EAC5C,WAAW,MAAA,EAAQ;AACjB,IAAA,MAAM,2BAAA,CAA4B,+BAAA,CAAgC,MAAM,CAAC,CAAA;AAAA,EAC3E;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"convertLegacyEntityCardExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityCardExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { compatWrapper } from '@backstage/core-compat-api';\nimport { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport { ComponentType } from 'react';\nimport { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint';\nimport kebabCase from 'lodash/kebabCase';\nimport { 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
+ {"version":3,"file":"convertLegacyEntityCardExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityCardExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { compatWrapper } from '@backstage/core-compat-api';\nimport { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport { ComponentType } from 'react';\nimport { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint';\nimport kebabCase from 'lodash/kebabCase';\nimport { FilterPredicate } from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityCardType } from '../blueprints/extensionData';\n\n/** @alpha */\nexport function convertLegacyEntityCardExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n type?: EntityCardType;\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Card$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (\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;;;;"}
@@ -33,6 +33,7 @@ function convertLegacyEntityContentExtension(LegacyExtension, overrides) {
33
33
  filter: overrides?.filter,
34
34
  path: overrides?.path ?? overrides?.defaultPath ?? `/${kebabCase(infix)}`,
35
35
  title: overrides?.title ?? overrides?.defaultTitle ?? startCase(infix),
36
+ icon: overrides?.icon,
36
37
  routeRef: mountPoint && convertLegacyRouteRef(mountPoint),
37
38
  loader: async () => compatWrapper(element)
38
39
  }
@@ -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 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 // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n return EntityContentBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n path: (overrides?.path ??\n overrides?.defaultPath ??\n `/${kebabCase(infix)}`) as string,\n title: (overrides?.title ??\n overrides?.defaultTitle ??\n startCase(infix)) as string,\n 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;AAI7B,EAAA,OAAO,uBAAuB,IAAA,CAAK;AAAA,IACjC,IAAA,EAAM,WAAW,IAAA,IAAQ,IAAA;AAAA,IACzB,MAAA,EAAQ;AAAA,MACN,QAAQ,SAAA,EAAW,MAAA;AAAA,MACnB,IAAA,EAAO,WAAW,IAAA,IAChB,SAAA,EAAW,eACX,CAAA,CAAA,EAAI,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,MACtB,OAAQ,SAAA,EAAW,KAAA,IACjB,SAAA,EAAW,YAAA,IACX,UAAU,KAAK,CAAA;AAAA,MACjB,QAAA,EAAU,UAAA,IAAc,qBAAA,CAAsB,UAAU,CAAA;AAAA,MACxD,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO;AAAA;AAC3C,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"convertLegacyEntityContentExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityContentExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n BackstagePlugin,\n getComponentData,\n RouteRef as LegacyRouteRef,\n} from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport kebabCase from 'lodash/kebabCase';\nimport startCase from 'lodash/startCase';\nimport { ComponentType, ReactElement } from 'react';\nimport { EntityContentBlueprint } from '../blueprints/EntityContentBlueprint';\nimport { FilterPredicate } from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport function convertLegacyEntityContentExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n path?: string;\n title?: string;\n icon?: string | ReactElement;\n\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultPath?: [Error: `Use the 'path' override instead`];\n\n /**\n * @deprecated Use the `path` param instead.\n */\n defaultTitle?: [Error: `Use the 'title' override instead`];\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const mountPoint = getComponentData<LegacyRouteRef>(\n element,\n 'core.mountPoint',\n );\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Content$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (\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 // TODO(blam): Remove support for all the `default*` props in the future, this breaks backwards compatibility without it\n // As this is marked as BREAKING ALPHA, it doesn't affect the public API so it falls in range and gets picked\n // up by packages that depend on `catalog-react`.\n return EntityContentBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n path: (overrides?.path ??\n overrides?.defaultPath ??\n `/${kebabCase(infix)}`) as string,\n title: (overrides?.title ??\n overrides?.defaultTitle ??\n startCase(infix)) as string,\n icon: overrides?.icon,\n routeRef: mountPoint && convertLegacyRouteRef(mountPoint),\n loader: async () => compatWrapper(element),\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;AAkCO,SAAS,mCAAA,CACd,iBACA,SAAA,EAiBqB;AACrB,EAAA,MAAM,OAAA,uBAAW,eAAA,EAAA,EAAgB,CAAA;AAEjC,EAAA,MAAM,OAAA,GAAU,gBAAA,CAAyB,OAAA,EAAS,oBAAoB,CAAA;AACtE,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,MAAM,uBAAuB,CAAA;AAAA,EACzC;AAEA,EAAA,MAAM,UAAA,GAAa,gBAAA;AAAA,IACjB,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,MAAA,GAAS,gBAAA,CAAkC,OAAA,EAAS,aAAa,CAAA;AACvE,EAAA,MAAM,QAAA,GAAW,QAAQ,KAAA,EAAM;AAE/B,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,KAAA,CAAM,qBAAqB,CAAA;AACjD,EAAA,MAAM,KAAA,GAAQ,KAAA,GAAQ,CAAC,CAAA,IAAK,OAAA;AAE5B,EAAA,IAAI,IAAA,GAA2B,KAAA;AAC/B,EAAA,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;AAI7B,EAAA,OAAO,uBAAuB,IAAA,CAAK;AAAA,IACjC,IAAA,EAAM,WAAW,IAAA,IAAQ,IAAA;AAAA,IACzB,MAAA,EAAQ;AAAA,MACN,QAAQ,SAAA,EAAW,MAAA;AAAA,MACnB,IAAA,EAAO,WAAW,IAAA,IAChB,SAAA,EAAW,eACX,CAAA,CAAA,EAAI,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,MACtB,OAAQ,SAAA,EAAW,KAAA,IACjB,SAAA,EAAW,YAAA,IACX,UAAU,KAAK,CAAA;AAAA,MACjB,MAAM,SAAA,EAAW,IAAA;AAAA,MACjB,QAAA,EAAU,UAAA,IAAc,qBAAA,CAAsB,UAAU,CAAA;AAAA,MACxD,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO;AAAA;AAC3C,GACD,CAAA;AACH;;;;"}