@backstage/plugin-catalog-react 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/alpha/blueprints/EntityContentLayoutBlueprint.esm.js +5 -6
- package/dist/alpha/blueprints/EntityContentLayoutBlueprint.esm.js.map +1 -1
- package/dist/alpha/blueprints/EntityContextMenuItemBlueprint.esm.js +3 -5
- package/dist/alpha/blueprints/EntityContextMenuItemBlueprint.esm.js.map +1 -1
- package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js +3 -5
- package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js.map +1 -1
- package/dist/alpha/blueprints/EntityIconLinkBlueprint.esm.js +6 -7
- package/dist/alpha/blueprints/EntityIconLinkBlueprint.esm.js.map +1 -1
- package/dist/alpha.d.ts +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 2.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6b60bd7: Replaced old config schema values from existing extensions and blueprints.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/ui@0.14.1
|
|
10
|
+
- @backstage/frontend-plugin-api@0.16.1
|
|
11
|
+
|
|
3
12
|
## 2.1.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createExtensionDataRef, createExtensionBlueprint, ExtensionBoundary } from '@backstage/frontend-plugin-api';
|
|
2
2
|
import { entityFilterExpressionDataRef, entityFilterFunctionDataRef } from './extensionData.esm.js';
|
|
3
|
-
import {
|
|
3
|
+
import { createZodV4FilterPredicateSchema } from '@backstage/filter-predicates';
|
|
4
|
+
import { z } from 'zod/v4';
|
|
4
5
|
import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
|
|
5
6
|
|
|
6
7
|
const entityCardLayoutComponentDataRef = createExtensionDataRef().with({
|
|
@@ -19,11 +20,9 @@ const EntityContentLayoutBlueprint = createExtensionBlueprint({
|
|
|
19
20
|
filterExpression: entityFilterExpressionDataRef,
|
|
20
21
|
component: entityCardLayoutComponentDataRef
|
|
21
22
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
filter: (z) => z.union([z.string(), createZodV3FilterPredicateSchema(z)]).optional()
|
|
26
|
-
}
|
|
23
|
+
configSchema: {
|
|
24
|
+
type: z.string().optional(),
|
|
25
|
+
filter: z.union([z.string(), createZodV4FilterPredicateSchema()]).optional()
|
|
27
26
|
},
|
|
28
27
|
*factory({
|
|
29
28
|
loader,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityContentLayoutBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentLayoutBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExtensionDataRef,\n createExtensionBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n EntityCardType,\n} from './extensionData';\nimport { JSX } from 'react';\nimport {\n FilterPredicate,\n
|
|
1
|
+
{"version":3,"file":"EntityContentLayoutBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentLayoutBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExtensionDataRef,\n createExtensionBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n EntityCardType,\n} from './extensionData';\nimport { JSX } from 'react';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { z } from 'zod/v4';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport interface EntityContentLayoutProps {\n cards: Array<{\n type?: EntityCardType;\n element: JSX.Element;\n }>;\n}\n\nconst entityCardLayoutComponentDataRef = createExtensionDataRef<\n (props: EntityContentLayoutProps) => React.JSX.Element\n>().with({\n id: 'catalog.entity-content-layout.component',\n});\n\n/** @alpha */\nexport const EntityContentLayoutBlueprint = createExtensionBlueprint({\n kind: 'entity-content-layout',\n attachTo: { id: 'entity-content:catalog/overview', input: 'layouts' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityCardLayoutComponentDataRef,\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n component: entityCardLayoutComponentDataRef,\n },\n configSchema: {\n type: z.string().optional(),\n filter: z\n .union([z.string(), createZodV4FilterPredicateSchema()])\n .optional(),\n },\n *factory(\n {\n loader,\n filter,\n }: {\n filter?: string | FilterPredicate | ((entity: Entity) => boolean);\n loader: () => Promise<(props: EntityContentLayoutProps) => JSX.Element>;\n },\n { node, config },\n ) {\n yield* resolveEntityFilterData(filter, config, node);\n\n yield entityCardLayoutComponentDataRef(\n ExtensionBoundary.lazyComponent(node, loader),\n );\n },\n});\n"],"names":[],"mappings":";;;;;;AA2CA,MAAM,gCAAA,GAAmC,sBAAA,EAEvC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,+BAA+B,wBAAA,CAAyB;AAAA,EACnE,IAAA,EAAM,uBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,iCAAA,EAAmC,OAAO,SAAA,EAAU;AAAA,EACpE,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,SAAA,EAAW;AAAA,GACb;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC1B,MAAA,EAAQ,CAAA,CACL,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,gCAAA,EAAkC,CAAC,CAAA,CACtD,QAAA;AAAS,GACd;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE,MAAA;AAAA,IACA;AAAA,GACF,EAIA,EAAE,IAAA,EAAM,MAAA,EAAO,EACf;AACA,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,MAAM,gCAAA;AAAA,MACJ,iBAAA,CAAkB,aAAA,CAAc,IAAA,EAAM,MAAM;AAAA,KAC9C;AAAA,EACF;AACF,CAAC;;;;"}
|
|
@@ -4,7 +4,7 @@ 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 { filterPredicateToFilterFunction,
|
|
7
|
+
import { filterPredicateToFilterFunction, createZodV4FilterPredicateSchema } from '@backstage/filter-predicates';
|
|
8
8
|
import { entityFilterFunctionDataRef } from './extensionData.esm.js';
|
|
9
9
|
|
|
10
10
|
const EntityContextMenuItemBlueprint = createExtensionBlueprint({
|
|
@@ -17,10 +17,8 @@ const EntityContextMenuItemBlueprint = createExtensionBlueprint({
|
|
|
17
17
|
dataRefs: {
|
|
18
18
|
filterFunction: entityFilterFunctionDataRef
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
filter: (z) => createZodV3FilterPredicateSchema(z).optional()
|
|
23
|
-
}
|
|
20
|
+
configSchema: {
|
|
21
|
+
filter: createZodV4FilterPredicateSchema().optional()
|
|
24
22
|
},
|
|
25
23
|
*factory(params, { node, config }) {
|
|
26
24
|
const loader = async () => {
|
|
@@ -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 {\n FilterPredicate,\n filterPredicateToFilterFunction,\n
|
|
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 createZodV4FilterPredicateSchema,\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 configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\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,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;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,5 +1,5 @@
|
|
|
1
1
|
import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
|
|
2
|
-
import {
|
|
2
|
+
import { createZodV4FilterPredicateSchema } from '@backstage/filter-predicates';
|
|
3
3
|
import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
|
|
4
4
|
import { entityFilterFunctionDataRef, entityFilterExpressionDataRef } from './extensionData.esm.js';
|
|
5
5
|
|
|
@@ -10,10 +10,8 @@ const EntityHeaderBlueprint = createExtensionBlueprint({
|
|
|
10
10
|
filterFunction: entityFilterFunctionDataRef,
|
|
11
11
|
element: coreExtensionData.reactElement
|
|
12
12
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
filter: (z) => createZodV3FilterPredicateSchema(z).optional()
|
|
16
|
-
}
|
|
13
|
+
configSchema: {
|
|
14
|
+
filter: createZodV4FilterPredicateSchema().optional()
|
|
17
15
|
},
|
|
18
16
|
output: [
|
|
19
17
|
entityFilterFunctionDataRef.optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityHeaderBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExtensionBlueprint,\n coreExtensionData,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n FilterPredicate,\n
|
|
1
|
+
{"version":3,"file":"EntityHeaderBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExtensionBlueprint,\n coreExtensionData,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\n\n/** @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 configSchema: {\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n coreExtensionData.reactElement.optional(),\n ],\n *factory(\n params: {\n loader: () => Promise<JSX.Element>;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n const { loader, filter } = params;\n\n yield* resolveEntityFilterData(filter, config, node);\n\n if (loader) {\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, loader),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;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,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC,iBAAA,CAAkB,aAAa,QAAA;AAAS,GAC1C;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAIA,EAAE,IAAA,EAAM,QAAO,EACf;AACA,IAAA,MAAM,EAAE,MAAA,EAAQ,MAAA,EAAO,GAAI,MAAA;AAE3B,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,MAAM,iBAAA,CAAkB,YAAA;AAAA,QACtB,iBAAA,CAAkB,IAAA,CAAK,IAAA,EAAM,MAAM;AAAA,OACrC;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
|
|
2
|
-
import {
|
|
2
|
+
import { createZodV4FilterPredicateSchema } from '@backstage/filter-predicates';
|
|
3
|
+
import { z } from 'zod/v4';
|
|
3
4
|
import { entityFilterExpressionDataRef, entityFilterFunctionDataRef } from './extensionData.esm.js';
|
|
4
5
|
import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
|
|
5
6
|
|
|
@@ -19,12 +20,10 @@ const EntityIconLinkBlueprint = createExtensionBlueprint({
|
|
|
19
20
|
filterFunction: entityFilterFunctionDataRef,
|
|
20
21
|
filterExpression: entityFilterExpressionDataRef
|
|
21
22
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
filter: (z) => createZodV3FilterPredicateSchema(z).optional()
|
|
27
|
-
}
|
|
23
|
+
configSchema: {
|
|
24
|
+
label: z.string().optional(),
|
|
25
|
+
title: z.string().optional(),
|
|
26
|
+
filter: createZodV4FilterPredicateSchema().optional()
|
|
28
27
|
},
|
|
29
28
|
*factory(params, { config, node }) {
|
|
30
29
|
const { filter, useProps } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityIconLinkBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityIconLinkBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconLinkVerticalProps } from '@backstage/core-components';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n FilterPredicate,\n
|
|
1
|
+
{"version":3,"file":"EntityIconLinkBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityIconLinkBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconLinkVerticalProps } from '@backstage/core-components';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n FilterPredicate,\n createZodV4FilterPredicateSchema,\n} from '@backstage/filter-predicates';\n\nimport { z } from 'zod/v4';\n\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\n\nconst entityIconLinkPropsDataRef = createExtensionDataRef<\n () => IconLinkVerticalProps\n>().with({\n id: 'entity-icon-link-props',\n});\n\n/** @alpha */\nexport const EntityIconLinkBlueprint = createExtensionBlueprint({\n kind: 'entity-icon-link',\n attachTo: { id: 'entity-card:catalog/about', input: 'iconLinks' },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n entityIconLinkPropsDataRef,\n ],\n dataRefs: {\n useProps: entityIconLinkPropsDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n },\n configSchema: {\n label: z.string().optional(),\n title: z.string().optional(),\n filter: createZodV4FilterPredicateSchema().optional(),\n },\n *factory(\n params: {\n useProps: () => Omit<IconLinkVerticalProps, 'color'>;\n filter?: FilterPredicate | ((entity: Entity) => boolean);\n },\n { config, node },\n ) {\n const { filter, useProps } = params;\n yield* resolveEntityFilterData(filter, config, node);\n // Only include properties that are defined in the config\n // to avoid overriding defaults with undefined values\n const configProps = Object.entries(config).reduce(\n (rest, [key, value]) =>\n value !== undefined\n ? {\n ...rest,\n [key]: value,\n }\n : rest,\n {},\n );\n yield entityIconLinkPropsDataRef(() => ({ ...useProps(), ...configProps }));\n },\n});\n"],"names":[],"mappings":";;;;;;AAoCA,MAAM,0BAAA,GAA6B,sBAAA,EAEjC,CAAE,IAAA,CAAK;AAAA,EACP,EAAA,EAAI;AACN,CAAC,CAAA;AAGM,MAAM,0BAA0B,wBAAA,CAAyB;AAAA,EAC9D,IAAA,EAAM,kBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,2BAAA,EAA6B,OAAO,WAAA,EAAY;AAAA,EAChE,MAAA,EAAQ;AAAA,IACN,4BAA4B,QAAA,EAAS;AAAA,IACrC,8BAA8B,QAAA,EAAS;AAAA,IACvC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,QAAA,EAAU,0BAAA;AAAA,IACV,cAAA,EAAgB,2BAAA;AAAA,IAChB,gBAAA,EAAkB;AAAA,GACpB;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC3B,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC3B,MAAA,EAAQ,gCAAA,EAAiC,CAAE,QAAA;AAAS,GACtD;AAAA,EACA,CAAC,OAAA,CACC,MAAA,EAIA,EAAE,MAAA,EAAQ,MAAK,EACf;AACA,IAAA,MAAM,EAAE,MAAA,EAAQ,QAAA,EAAS,GAAI,MAAA;AAC7B,IAAA,OAAO,uBAAA,CAAwB,MAAA,EAAQ,MAAA,EAAQ,IAAI,CAAA;AAGnD,IAAA,MAAM,WAAA,GAAc,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,CAAE,MAAA;AAAA,MACzC,CAAC,IAAA,EAAM,CAAC,KAAK,KAAK,CAAA,KAChB,UAAU,MAAA,GACN;AAAA,QACE,GAAG,IAAA;AAAA,QACH,CAAC,GAAG,GAAG;AAAA,OACT,GACA,IAAA;AAAA,MACN;AAAC,KACH;AACA,IAAA,MAAM,0BAAA,CAA2B,OAAO,EAAE,GAAG,UAAS,EAAG,GAAG,aAAY,CAAE,CAAA;AAAA,EAC5E;AACF,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -200,8 +200,8 @@ declare const EntityContentLayoutBlueprint: _backstage_frontend_plugin_api.Exten
|
|
|
200
200
|
filter: FilterPredicate | undefined;
|
|
201
201
|
};
|
|
202
202
|
configInput: {
|
|
203
|
-
filter?: FilterPredicate | undefined;
|
|
204
203
|
type?: string | undefined;
|
|
204
|
+
filter?: FilterPredicate | undefined;
|
|
205
205
|
};
|
|
206
206
|
dataRefs: {
|
|
207
207
|
filterFunction: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {}>;
|
|
@@ -291,9 +291,9 @@ declare const EntityIconLinkBlueprint: _backstage_frontend_plugin_api.ExtensionB
|
|
|
291
291
|
filter: FilterPredicate | undefined;
|
|
292
292
|
};
|
|
293
293
|
configInput: {
|
|
294
|
-
filter?: FilterPredicate | undefined;
|
|
295
294
|
label?: string | undefined;
|
|
296
295
|
title?: string | undefined;
|
|
296
|
+
filter?: FilterPredicate | undefined;
|
|
297
297
|
};
|
|
298
298
|
dataRefs: {
|
|
299
299
|
useProps: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<() => IconLinkVerticalProps, "entity-icon-link-props", {}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
"@backstage/core-plugin-api": "^1.12.5",
|
|
81
81
|
"@backstage/errors": "^1.3.0",
|
|
82
82
|
"@backstage/filter-predicates": "^0.1.2",
|
|
83
|
-
"@backstage/frontend-plugin-api": "^0.16.
|
|
83
|
+
"@backstage/frontend-plugin-api": "^0.16.1",
|
|
84
84
|
"@backstage/integration-react": "^1.2.17",
|
|
85
85
|
"@backstage/plugin-catalog-common": "^1.1.9",
|
|
86
86
|
"@backstage/plugin-permission-common": "^0.9.8",
|
|
87
87
|
"@backstage/plugin-permission-react": "^0.5.0",
|
|
88
88
|
"@backstage/types": "^1.2.2",
|
|
89
|
-
"@backstage/ui": "^0.14.
|
|
89
|
+
"@backstage/ui": "^0.14.1",
|
|
90
90
|
"@backstage/version-bridge": "^1.0.12",
|
|
91
91
|
"@material-ui/core": "^4.12.2",
|
|
92
92
|
"@material-ui/icons": "^4.9.1",
|