@backstage/plugin-catalog-react 0.0.0-nightly-20240904022810 → 0.0.0-nightly-20240906022905

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 CHANGED
@@ -1,21 +1,22 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 0.0.0-nightly-20240904022810
3
+ ## 0.0.0-nightly-20240906022905
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - c891b69: Add `FavoriteToggle` in `core-components` to standardise favorite marking
7
8
  - fec8b57: Updated exports to use the new type parameters for extensions and extension blueprints.
8
9
  - 5446061: The `/alpha` export no longer export extension creators for the new frontend system, existing usage should be switched to use the equivalent extension blueprint instead. For more information see the [new frontend system 1.30 migration documentation](https://backstage.io/docs/frontend-system/architecture/migrations#130).
9
10
  - ae9b6cb: Small internal fix to better work with recent `lodash` versions
10
11
  - Updated dependencies
11
- - @backstage/frontend-plugin-api@0.0.0-nightly-20240904022810
12
- - @backstage/core-compat-api@0.0.0-nightly-20240904022810
13
- - @backstage/catalog-client@0.0.0-nightly-20240904022810
14
- - @backstage/core-components@0.0.0-nightly-20240904022810
12
+ - @backstage/core-components@0.0.0-nightly-20240906022905
13
+ - @backstage/frontend-plugin-api@0.0.0-nightly-20240906022905
14
+ - @backstage/core-compat-api@0.0.0-nightly-20240906022905
15
+ - @backstage/catalog-client@0.0.0-nightly-20240906022905
16
+ - @backstage/integration-react@0.0.0-nightly-20240906022905
15
17
  - @backstage/catalog-model@1.6.0
16
18
  - @backstage/core-plugin-api@1.9.3
17
19
  - @backstage/errors@1.2.4
18
- - @backstage/integration-react@1.1.30
19
20
  - @backstage/types@1.1.1
20
21
  - @backstage/version-bridge@1.0.8
21
22
  - @backstage/plugin-catalog-common@1.0.26
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react__alpha",
3
- "version": "0.0.0-nightly-20240904022810",
3
+ "version": "0.0.0-nightly-20240906022905",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
@@ -1,19 +1,10 @@
1
1
  import { stringifyEntityRef } from '@backstage/catalog-model';
2
- import IconButton from '@material-ui/core/IconButton';
3
- import Tooltip from '@material-ui/core/Tooltip';
4
- import { withStyles } from '@material-ui/core/styles';
5
- import StarIcon from '@material-ui/icons/Star';
6
- import StarBorder from '@material-ui/icons/StarBorder';
7
2
  import React from 'react';
8
3
  import { useStarredEntity } from '../../hooks/useStarredEntity.esm.js';
9
4
  import { catalogReactTranslationRef } from '../../translation.esm.js';
10
5
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
6
+ import { FavoriteToggle } from '@backstage/core-components';
11
7
 
12
- const YellowStar = withStyles({
13
- root: {
14
- color: "#f3ba37"
15
- }
16
- })(StarIcon);
17
8
  const FavoriteEntity = (props) => {
18
9
  const { toggleStarredEntity, isStarredEntity } = useStarredEntity(
19
10
  props.entity
@@ -25,15 +16,14 @@ const FavoriteEntity = (props) => {
25
16
  "-"
26
17
  )}`;
27
18
  return /* @__PURE__ */ React.createElement(
28
- IconButton,
19
+ FavoriteToggle,
29
20
  {
30
- "aria-label": title,
21
+ title,
31
22
  id,
32
- color: "inherit",
33
- ...props,
34
- onClick: () => toggleStarredEntity()
35
- },
36
- /* @__PURE__ */ React.createElement(Tooltip, { id, title }, isStarredEntity ? /* @__PURE__ */ React.createElement(YellowStar, null) : /* @__PURE__ */ React.createElement(StarBorder, null))
23
+ isFavorite: isStarredEntity,
24
+ onToggle: toggleStarredEntity,
25
+ ...props
26
+ }
37
27
  );
38
28
  };
39
29
 
@@ -1 +1 @@
1
- {"version":3,"file":"FavoriteEntity.esm.js","sources":["../../../src/components/FavoriteEntity/FavoriteEntity.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { withStyles } from '@material-ui/core/styles';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport React, { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const title = isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites');\n\n const id = `favorite-${stringifyEntityRef(props.entity).replace(\n /[^a-zA-Z0-9-_]/g,\n '-',\n )}`;\n\n return (\n <IconButton\n aria-label={title}\n id={id}\n color=\"inherit\"\n {...props}\n onClick={() => toggleStarredEntity()}\n >\n <Tooltip id={id} title={title}>\n {isStarredEntity ? <YellowStar /> : <StarBorder />}\n </Tooltip>\n </IconButton>\n );\n};\n"],"names":["Star"],"mappings":";;;;;;;;;;;AAgCA,MAAM,aAAa,UAAW,CAAA;AAAA,EAC5B,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,SAAA;AAAA,GACT;AACF,CAAC,EAAEA,QAAI,CAAA,CAAA;AAOM,MAAA,cAAA,GAAiB,CAAC,KAA+B,KAAA;AAC5D,EAAM,MAAA,EAAE,mBAAqB,EAAA,eAAA,EAAoB,GAAA,gBAAA;AAAA,IAC/C,KAAM,CAAA,MAAA;AAAA,GACR,CAAA;AACA,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA,CAAA;AAC1D,EAAA,MAAM,QAAQ,eACV,GAAA,CAAA,CAAE,oCAAoC,CAAA,GACtC,EAAE,+BAA+B,CAAA,CAAA;AAErC,EAAA,MAAM,EAAK,GAAA,CAAA,SAAA,EAAY,kBAAmB,CAAA,KAAA,CAAM,MAAM,CAAE,CAAA,OAAA;AAAA,IACtD,iBAAA;AAAA,IACA,GAAA;AAAA,GACD,CAAA,CAAA,CAAA;AAED,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAY,EAAA,KAAA;AAAA,MACZ,EAAA;AAAA,MACA,KAAM,EAAA,SAAA;AAAA,MACL,GAAG,KAAA;AAAA,MACJ,OAAA,EAAS,MAAM,mBAAoB,EAAA;AAAA,KAAA;AAAA,oBAEnC,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,EAAA,EAAQ,KACd,EAAA,EAAA,eAAA,uCAAmB,UAAW,EAAA,IAAA,CAAA,mBAAM,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,IAAW,CAClD,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"FavoriteEntity.esm.js","sources":["../../../src/components/FavoriteEntity/FavoriteEntity.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport IconButton from '@material-ui/core/IconButton';\nimport React, { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { FavoriteToggle } from '@backstage/core-components';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const title = isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites');\n\n const id = `favorite-${stringifyEntityRef(props.entity).replace(\n /[^a-zA-Z0-9-_]/g,\n '-',\n )}`;\n\n return (\n <FavoriteToggle\n title={title}\n id={id}\n isFavorite={isStarredEntity}\n onToggle={toggleStarredEntity}\n {...props}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAkCa,MAAA,cAAA,GAAiB,CAAC,KAA+B,KAAA;AAC5D,EAAM,MAAA,EAAE,mBAAqB,EAAA,eAAA,EAAoB,GAAA,gBAAA;AAAA,IAC/C,KAAM,CAAA,MAAA;AAAA,GACR,CAAA;AACA,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA,CAAA;AAC1D,EAAA,MAAM,QAAQ,eACV,GAAA,CAAA,CAAE,oCAAoC,CAAA,GACtC,EAAE,+BAA+B,CAAA,CAAA;AAErC,EAAA,MAAM,EAAK,GAAA,CAAA,SAAA,EAAY,kBAAmB,CAAA,KAAA,CAAM,MAAM,CAAE,CAAA,OAAA;AAAA,IACtD,iBAAA;AAAA,IACA,GAAA;AAAA,GACD,CAAA,CAAA,CAAA;AAED,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,EAAA;AAAA,MACA,UAAY,EAAA,eAAA;AAAA,MACZ,QAAU,EAAA,mBAAA;AAAA,MACT,GAAG,KAAA;AAAA,KAAA;AAAA,GACN,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "0.0.0-nightly-20240904022810",
3
+ "version": "0.0.0-nightly-20240906022905",
4
4
  "description": "A frontend library that helps other Backstage plugins interact with the catalog",
5
5
  "backstage": {
6
6
  "role": "web-library",
@@ -56,14 +56,14 @@
56
56
  "test": "backstage-cli package test"
57
57
  },
58
58
  "dependencies": {
59
- "@backstage/catalog-client": "^0.0.0-nightly-20240904022810",
59
+ "@backstage/catalog-client": "^0.0.0-nightly-20240906022905",
60
60
  "@backstage/catalog-model": "^1.6.0",
61
- "@backstage/core-compat-api": "^0.0.0-nightly-20240904022810",
62
- "@backstage/core-components": "^0.0.0-nightly-20240904022810",
61
+ "@backstage/core-compat-api": "^0.0.0-nightly-20240906022905",
62
+ "@backstage/core-components": "^0.0.0-nightly-20240906022905",
63
63
  "@backstage/core-plugin-api": "^1.9.3",
64
64
  "@backstage/errors": "^1.2.4",
65
- "@backstage/frontend-plugin-api": "^0.0.0-nightly-20240904022810",
66
- "@backstage/integration-react": "^1.1.30",
65
+ "@backstage/frontend-plugin-api": "^0.0.0-nightly-20240906022905",
66
+ "@backstage/integration-react": "^0.0.0-nightly-20240906022905",
67
67
  "@backstage/plugin-catalog-common": "^1.0.26",
68
68
  "@backstage/plugin-permission-common": "^0.8.1",
69
69
  "@backstage/plugin-permission-react": "^0.4.25",
@@ -83,12 +83,12 @@
83
83
  "zen-observable": "^0.10.0"
84
84
  },
85
85
  "devDependencies": {
86
- "@backstage/cli": "^0.0.0-nightly-20240904022810",
87
- "@backstage/core-app-api": "^0.0.0-nightly-20240904022810",
88
- "@backstage/frontend-test-utils": "^0.0.0-nightly-20240904022810",
86
+ "@backstage/cli": "^0.0.0-nightly-20240906022905",
87
+ "@backstage/core-app-api": "^0.0.0-nightly-20240906022905",
88
+ "@backstage/frontend-test-utils": "^0.0.0-nightly-20240906022905",
89
89
  "@backstage/plugin-catalog-common": "^1.0.26",
90
90
  "@backstage/plugin-scaffolder-common": "^1.5.5",
91
- "@backstage/test-utils": "^0.0.0-nightly-20240904022810",
91
+ "@backstage/test-utils": "^0.0.0-nightly-20240906022905",
92
92
  "@testing-library/dom": "^10.0.0",
93
93
  "@testing-library/jest-dom": "^6.0.0",
94
94
  "@testing-library/react": "^15.0.0",