@backstage/plugin-home 0.6.3-next.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha.esm.js +1 -1
  4. package/dist/esm/{Content-cd749ae7.esm.js → Content-f3dcf261.esm.js} +23 -22
  5. package/dist/esm/Content-f3dcf261.esm.js.map +1 -0
  6. package/dist/esm/{RecentlyVisited-c0ca7307.esm.js → RecentlyVisited-399210d7.esm.js} +15 -7
  7. package/dist/esm/{RecentlyVisited-c0ca7307.esm.js.map → RecentlyVisited-399210d7.esm.js.map} +1 -1
  8. package/dist/esm/{TopVisited-d22fb15d.esm.js → TopVisited-93920c20.esm.js} +15 -7
  9. package/dist/esm/{TopVisited-d22fb15d.esm.js.map → TopVisited-93920c20.esm.js.map} +1 -1
  10. package/dist/esm/{VisitListener-7a513ef0.esm.js → VisitListener-601cb70c.esm.js} +8 -2
  11. package/dist/esm/VisitListener-601cb70c.esm.js.map +1 -0
  12. package/dist/esm/{index-c91caa6e.esm.js → index-3ec8912b.esm.js} +3 -2
  13. package/dist/esm/{index-c91caa6e.esm.js.map → index-3ec8912b.esm.js.map} +1 -1
  14. package/dist/esm/{index-abfba912.esm.js → index-5967d606.esm.js} +9 -3
  15. package/dist/esm/{index-abfba912.esm.js.map → index-5967d606.esm.js.map} +1 -1
  16. package/dist/esm/{index-21ffb782.esm.js → index-60f5dc58.esm.js} +3 -2
  17. package/dist/esm/index-60f5dc58.esm.js.map +1 -0
  18. package/dist/esm/{index-3155d776.esm.js → index-6c4cdf60.esm.js} +8 -2
  19. package/dist/esm/index-6c4cdf60.esm.js.map +1 -0
  20. package/dist/esm/{index-476343c1.esm.js → index-81188117.esm.js} +2 -2
  21. package/dist/esm/index-81188117.esm.js.map +1 -0
  22. package/dist/esm/{index-6d94aeff.esm.js → index-978cfdc4.esm.js} +10 -2
  23. package/dist/esm/index-978cfdc4.esm.js.map +1 -0
  24. package/dist/esm/{index-4517c5bc.esm.js → index-a6e42355.esm.js} +7 -2
  25. package/dist/esm/index-a6e42355.esm.js.map +1 -0
  26. package/dist/esm/{index-40d9ffac.esm.js → index-f4fbaf5f.esm.js} +5 -2
  27. package/dist/esm/index-f4fbaf5f.esm.js.map +1 -0
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.esm.js +23 -15
  30. package/dist/index.esm.js.map +1 -1
  31. package/package.json +15 -15
  32. package/dist/esm/Content-cd749ae7.esm.js.map +0 -1
  33. package/dist/esm/VisitListener-7a513ef0.esm.js.map +0 -1
  34. package/dist/esm/index-21ffb782.esm.js.map +0 -1
  35. package/dist/esm/index-3155d776.esm.js.map +0 -1
  36. package/dist/esm/index-40d9ffac.esm.js.map +0 -1
  37. package/dist/esm/index-4517c5bc.esm.js.map +0 -1
  38. package/dist/esm/index-476343c1.esm.js.map +0 -1
  39. package/dist/esm/index-6d94aeff.esm.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { useApi, identityApiRef, alertApiRef } from '@backstage/core-plugin-api';
2
- import { Tooltip, Typography } from '@material-ui/core';
2
+ import Tooltip from '@material-ui/core/Tooltip';
3
+ import Typography from '@material-ui/core/Typography';
3
4
  import React, { useMemo, useEffect } from 'react';
4
5
  import useAsync from 'react-use/lib/useAsync';
5
6
 
@@ -634,4 +635,4 @@ const WelcomeTitle = ({ language }) => {
634
635
  };
635
636
 
636
637
  export { WelcomeTitle };
637
- //# sourceMappingURL=index-c91caa6e.esm.js.map
638
+ //# sourceMappingURL=index-3ec8912b.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-c91caa6e.esm.js","sources":["../../src/homePageComponents/WelcomeTitle/timeUtil.ts","../../src/homePageComponents/WelcomeTitle/WelcomeTitle.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 goodMorning from './locales/goodMorning.locales.json';\nimport goodAfternoon from './locales/goodAfternoon.locales.json';\nimport goodEvening from './locales/goodEvening.locales.json';\n\n// Select a large random integer at startup, to prevent the greetings to change\n// every time the user navigates.\nconst greetingRandomSeed = Math.floor(Math.random() * 1000000);\n\nexport function getTimeBasedGreeting(language?: string[]): {\n language: string;\n greeting: string;\n} {\n const random = (array: string[]) => array[greetingRandomSeed % array.length];\n\n const currentHour = new Date(Date.now()).getHours();\n if (currentHour >= 23) {\n return {\n language: 'Seriously',\n greeting: 'Get some rest',\n };\n }\n\n const timeOfDay = (hour: number): { [language: string]: string } => {\n if (hour < 12) return goodMorning;\n if (hour < 17) return goodAfternoon;\n return goodEvening;\n };\n\n const greetings = timeOfDay(currentHour);\n\n if (Array.isArray(language) && language.length > 0) {\n const validLanguages = language.filter(lang => lang && greetings[lang]);\n if (validLanguages.length > 0) {\n const greetingsKey = random(validLanguages);\n return {\n language: greetingsKey,\n greeting: greetings[greetingsKey],\n };\n }\n }\n\n const greetingsKey = random(Object.keys(greetings));\n return {\n language: greetingsKey,\n greeting: greetings[greetingsKey],\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n alertApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { Tooltip, Typography } from '@material-ui/core';\nimport React, { useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { getTimeBasedGreeting } from './timeUtil';\n\n/** @public */\nexport type WelcomeTitleLanguageProps = {\n language?: string[];\n};\n\nexport const WelcomeTitle = ({ language }: WelcomeTitleLanguageProps) => {\n const identityApi = useApi(identityApiRef);\n const alertApi = useApi(alertApiRef);\n const greeting = useMemo(() => getTimeBasedGreeting(language), [language]);\n\n const { value: profile, error } = useAsync(() =>\n identityApi.getProfileInfo(),\n );\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load user identity: ${error}`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n return (\n <Tooltip title={greeting.language}>\n <Typography component=\"span\" variant=\"inherit\">{`${greeting.greeting}${\n profile?.displayName ? `, ${profile?.displayName}` : ''\n }!`}</Typography>\n </Tooltip>\n );\n};\n"],"names":["greetingsKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CACN,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"index-3ec8912b.esm.js","sources":["../../src/homePageComponents/WelcomeTitle/timeUtil.ts","../../src/homePageComponents/WelcomeTitle/WelcomeTitle.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 goodMorning from './locales/goodMorning.locales.json';\nimport goodAfternoon from './locales/goodAfternoon.locales.json';\nimport goodEvening from './locales/goodEvening.locales.json';\n\n// Select a large random integer at startup, to prevent the greetings to change\n// every time the user navigates.\nconst greetingRandomSeed = Math.floor(Math.random() * 1000000);\n\nexport function getTimeBasedGreeting(language?: string[]): {\n language: string;\n greeting: string;\n} {\n const random = (array: string[]) => array[greetingRandomSeed % array.length];\n\n const currentHour = new Date(Date.now()).getHours();\n if (currentHour >= 23) {\n return {\n language: 'Seriously',\n greeting: 'Get some rest',\n };\n }\n\n const timeOfDay = (hour: number): { [language: string]: string } => {\n if (hour < 12) return goodMorning;\n if (hour < 17) return goodAfternoon;\n return goodEvening;\n };\n\n const greetings = timeOfDay(currentHour);\n\n if (Array.isArray(language) && language.length > 0) {\n const validLanguages = language.filter(lang => lang && greetings[lang]);\n if (validLanguages.length > 0) {\n const greetingsKey = random(validLanguages);\n return {\n language: greetingsKey,\n greeting: greetings[greetingsKey],\n };\n }\n }\n\n const greetingsKey = random(Object.keys(greetings));\n return {\n language: greetingsKey,\n greeting: greetings[greetingsKey],\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n alertApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport React, { useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { getTimeBasedGreeting } from './timeUtil';\n\n/** @public */\nexport type WelcomeTitleLanguageProps = {\n language?: string[];\n};\n\nexport const WelcomeTitle = ({ language }: WelcomeTitleLanguageProps) => {\n const identityApi = useApi(identityApiRef);\n const alertApi = useApi(alertApiRef);\n const greeting = useMemo(() => getTimeBasedGreeting(language), [language]);\n\n const { value: profile, error } = useAsync(() =>\n identityApi.getProfileInfo(),\n );\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load user identity: ${error}`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n return (\n <Tooltip title={greeting.language}>\n <Typography component=\"span\" variant=\"inherit\">{`${greeting.greeting}${\n profile?.displayName ? `, ${profile?.displayName}` : ''\n }!`}</Typography>\n </Tooltip>\n );\n};\n"],"names":["greetingsKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,MAAA,EAAO,OAAQ,EAAA,SAAA,EAAA,EAAW,GAAG,QAAS,CAAA,QAAQ,CAClE,EAAA,CAAA,OAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,CAAS,WAAc,IAAA,CAAA,EAAA,EAAK,mCAAS,WAAW,CAAA,CAAA,GAAK,EACvD,CAAA,CAAA,CAAI,CACN,CAAA,CAAA;AAEJ;;;;"}
@@ -1,15 +1,19 @@
1
1
  import React from 'react';
2
2
  import { useOutlet } from 'react-router-dom';
3
- export { C as CustomHomepageGrid, V as VisitListener } from './VisitListener-7a513ef0.esm.js';
3
+ export { C as CustomHomepageGrid, V as VisitListener } from './VisitListener-601cb70c.esm.js';
4
4
  import 'react-grid-layout';
5
5
  import '@backstage/core-plugin-api';
6
6
  import 'react-grid-layout/css/styles.css';
7
7
  import 'react-resizable/css/styles.css';
8
- import '@material-ui/core';
8
+ import '@material-ui/core/Dialog';
9
+ import '@material-ui/core/styles';
9
10
  import 'lodash';
10
11
  import 'react-use/lib/useObservable';
11
12
  import '@backstage/core-components';
12
13
  import '@material-ui/core/Typography';
14
+ import '@material-ui/core/DialogContent';
15
+ import '@material-ui/core/Grid';
16
+ import '@material-ui/core/Tooltip';
13
17
  import '@material-ui/core/IconButton';
14
18
  import '@material-ui/icons/Settings';
15
19
  import '@material-ui/icons/Delete';
@@ -18,6 +22,8 @@ import '@rjsf/material-ui';
18
22
  import '@rjsf/validator-ajv8';
19
23
  import '@material-ui/core/List';
20
24
  import '@material-ui/core/ListItem';
25
+ import '@material-ui/core/DialogTitle';
26
+ import '@material-ui/core/ListItemAvatar';
21
27
  import '@material-ui/icons/Add';
22
28
  import '@material-ui/core/ListItemText';
23
29
  import '@material-ui/core/Button';
@@ -36,4 +42,4 @@ const HomepageCompositionRoot = (props) => {
36
42
  };
37
43
 
38
44
  export { HomepageCompositionRoot };
39
- //# sourceMappingURL=index-abfba912.esm.js.map
45
+ //# sourceMappingURL=index-5967d606.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-abfba912.esm.js","sources":["../../src/components/HomepageCompositionRoot.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode } from 'react';\nimport { useOutlet } from 'react-router-dom';\n\nexport const HomepageCompositionRoot = (props: {\n title?: string;\n children?: ReactNode;\n}) => {\n const outlet = useOutlet();\n const children = props.children ?? outlet;\n return <>{children}</>;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBa,MAAA,uBAAA,GAA0B,CAAC,KAGlC,KAAA;AAtBN,EAAA,IAAA,EAAA,CAAA;AAuBE,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AACzB,EAAM,MAAA,QAAA,GAAA,CAAW,EAAM,GAAA,KAAA,CAAA,QAAA,KAAN,IAAkB,GAAA,EAAA,GAAA,MAAA,CAAA;AACnC,EAAA,iEAAU,QAAS,CAAA,CAAA;AACrB;;;;"}
1
+ {"version":3,"file":"index-5967d606.esm.js","sources":["../../src/components/HomepageCompositionRoot.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode } from 'react';\nimport { useOutlet } from 'react-router-dom';\n\nexport const HomepageCompositionRoot = (props: {\n title?: string;\n children?: ReactNode;\n}) => {\n const outlet = useOutlet();\n const children = props.children ?? outlet;\n return <>{children}</>;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBa,MAAA,uBAAA,GAA0B,CAAC,KAGlC,KAAA;AAtBN,EAAA,IAAA,EAAA,CAAA;AAuBE,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AACzB,EAAM,MAAA,QAAA,GAAA,CAAW,EAAM,GAAA,KAAA,CAAA,QAAA,KAAN,IAAkB,GAAA,EAAA,GAAA,MAAA,CAAA;AACnC,EAAA,iEAAU,QAAS,CAAA,CAAA;AACrB;;;;"}
@@ -3,7 +3,8 @@ import useAsync from 'react-use/lib/useAsync';
3
3
  import { Progress, ErrorPanel, Link, EmptyState, LinkButton } from '@backstage/core-components';
4
4
  import { catalogApiRef, EntityDisplayName } from '@backstage/plugin-catalog-react';
5
5
  import { useApi } from '@backstage/core-plugin-api';
6
- import { makeStyles, Typography } from '@material-ui/core';
6
+ import Typography from '@material-ui/core/Typography';
7
+ import { makeStyles } from '@material-ui/core/styles';
7
8
  import { stringifyEntityRef } from '@backstage/catalog-model';
8
9
 
9
10
  const useStyles = makeStyles(
@@ -93,4 +94,4 @@ const Content = (props) => {
93
94
  };
94
95
 
95
96
  export { Content };
96
- //# sourceMappingURL=index-21ffb782.esm.js.map
97
+ //# sourceMappingURL=index-60f5dc58.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-60f5dc58.esm.js","sources":["../../src/homePageComponents/FeaturedDocsCard/Content.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport {\n LinkButton,\n EmptyState,\n Link,\n Progress,\n ErrorPanel,\n} from '@backstage/core-components';\nimport {\n catalogApiRef,\n CatalogApi,\n EntityDisplayName,\n} from '@backstage/plugin-catalog-react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { EntityFilterQuery } from '@backstage/catalog-client';\n\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\n\n/**\n * Props customizing the <FeaturedDocsCard/> component.\n *\n * @public\n */\nexport type FeaturedDocsCardProps = {\n /** The entity filter used to display only the intended item/s */\n filter: EntityFilterQuery;\n /** An optional ReactNode for empty states */\n emptyState?: React.JSX.Element;\n /** An optional linkDestination to set for the Featured Doc */\n linkDestination?: string;\n /** An optional limit to set for link destination */\n responseLimit?: number;\n /** An optional string to customize sublink text */\n subLinkText?: string;\n};\n\nconst useStyles = makeStyles(\n theme => ({\n docDescription: {\n fontSize: theme.typography.body1.fontSize,\n fontWeight: theme.typography.body1.fontWeight,\n marginBottom: theme.spacing(2),\n marginTop: theme.spacing(2),\n },\n docSubLink: {\n fontSize: theme.typography.subtitle1.fontSize,\n fontWeight: theme.typography.subtitle1.fontWeight,\n lineHeight: theme.typography.subtitle1.lineHeight,\n },\n docsTitleLink: {\n fontSize: theme.typography.h6.fontSize,\n fontWeight: theme.typography.h6.fontWeight,\n lineHeight: theme.typography.h6.lineHeight,\n },\n }),\n { name: 'HomeFeaturedDocsCard' },\n);\n\n/**\n * A component to display specific Featured Docs.\n *\n * @public\n */\nexport const Content = (props: FeaturedDocsCardProps): JSX.Element => {\n const { emptyState, filter, linkDestination, responseLimit, subLinkText } =\n props;\n const linkText = subLinkText || 'LEARN MORE';\n const styles = useStyles();\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: filter,\n limit: responseLimit || 10,\n });\n return response.items;\n });\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return entities?.length ? (\n <>\n {entities.map(d => (\n <div\n key={`${d.metadata.name}-${d.kind}-${d.metadata.namespace}`}\n data-testid=\"docs-card-content\"\n >\n <Link\n className={styles.docsTitleLink}\n data-testid=\"docs-card-title\"\n to={\n linkDestination ||\n `/docs/${d.metadata.namespace || 'default'}/${d.kind}/${\n d.metadata.name\n }/`\n }\n >\n <EntityDisplayName entityRef={stringifyEntityRef(d)} />\n </Link>\n {d.metadata.description && (\n <Typography className={styles.docDescription}>\n {d.metadata.description}\n </Typography>\n )}\n <Link\n className={styles.docSubLink}\n data-testid=\"docs-card-sub-link\"\n to={\n linkDestination ||\n `/docs/${d.metadata.namespace || 'default'}/${d.kind}/${\n d.metadata.name\n }/`\n }\n >\n {linkText}\n </Link>\n </div>\n ))}\n </>\n ) : (\n emptyState || (\n <EmptyState\n missing=\"data\"\n title=\"No documents to show\"\n description=\"Create your own document. Check out our Getting Started Information\"\n action={\n <LinkButton\n to=\"https://backstage.io/docs/features/techdocs/getting-started\"\n variant=\"contained\"\n >\n DOCS\n </LinkButton>\n }\n />\n )\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAuDA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,QAAA,EAAU,KAAM,CAAA,UAAA,CAAW,KAAM,CAAA,QAAA;AAAA,MACjC,UAAA,EAAY,KAAM,CAAA,UAAA,CAAW,KAAM,CAAA,UAAA;AAAA,MACnC,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MA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;AAAA,oBAEF,KAAA,CAAA,aAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,WAAW,MAAO,CAAA,UAAA;AAAA,QAClB,aAAY,EAAA,oBAAA;AAAA,QACZ,EACE,EAAA,eAAA,IACA,CAAS,MAAA,EAAA,CAAA,CAAE,QAAS,CAAA,SAAA,IAAa,SAAS,CAAA,CAAA,EAAI,CAAE,CAAA,IAAI,CAClD,CAAA,EAAA,CAAA,CAAE,SAAS,IACb,CAAA,CAAA,CAAA;AAAA,OAAA;AAAA,MAGD,QAAA;AAAA,KACH;AAAA,GAEH,CACH,CAAA,GAEA,UACE,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,MAAA;AAAA,MACR,KAAM,EAAA,sBAAA;AAAA,MACN,WAAY,EAAA,qEAAA;AAAA,MACZ,MACE,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,EAAG,EAAA,6DAAA;AAAA,UACH,OAAQ,EAAA,WAAA;AAAA,SAAA;AAAA,QACT,MAAA;AAAA,OAED;AAAA,KAAA;AAAA,GAEJ,CAAA;AAGN;;;;"}
@@ -1,9 +1,15 @@
1
1
  import React from 'react';
2
2
  import { SettingsModal } from '@backstage/plugin-home-react';
3
- import { Accordion, AccordionSummary, IconButton, Typography, AccordionDetails, Tabs, Tab } from '@material-ui/core';
3
+ import Accordion from '@material-ui/core/Accordion';
4
+ import AccordionDetails from '@material-ui/core/AccordionDetails';
5
+ import AccordionSummary from '@material-ui/core/AccordionSummary';
6
+ import Typography from '@material-ui/core/Typography';
7
+ import IconButton from '@material-ui/core/IconButton';
4
8
  import { makeStyles } from '@material-ui/core/styles';
5
9
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
6
10
  import SettingsIcon from '@material-ui/icons/Settings';
11
+ import Tabs from '@material-ui/core/Tabs';
12
+ import Tab from '@material-ui/core/Tab';
7
13
  import { InfoCard } from '@backstage/core-components';
8
14
 
9
15
  const useStyles = makeStyles((theme) => ({
@@ -80,4 +86,4 @@ const ComponentTab = (props) => {
80
86
  };
81
87
 
82
88
  export { ComponentAccordion, ComponentTab, ComponentTabs };
83
- //# sourceMappingURL=index-3155d776.esm.js.map
89
+ //# sourceMappingURL=index-6c4cdf60.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-6c4cdf60.esm.js","sources":["../../src/componentRenderers/ComponentAccordion.tsx","../../src/componentRenderers/ComponentTabs/ComponentTabs.tsx","../../src/componentRenderers/ComponentTabs/ComponentTab.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { SettingsModal } from '@backstage/plugin-home-react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport { Theme } from '@material-ui/core/styles';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport SettingsIcon from '@material-ui/icons/Settings';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n settingsIconButton: {\n padding: theme.spacing(0, 1, 0, 0),\n },\n contentContainer: {\n width: '100%',\n },\n}));\n\nexport const ComponentAccordion = (props: {\n title?: string;\n expanded?: boolean;\n Content: () => JSX.Element;\n Actions?: () => JSX.Element;\n Settings?: () => JSX.Element;\n ContextProvider?: (props: any) => JSX.Element;\n}) => {\n const {\n title,\n expanded = false,\n Content,\n Actions,\n Settings,\n ContextProvider,\n ...childProps\n } = props;\n\n const classes = useStyles();\n const [settingsIsExpanded, setSettingsIsExpanded] = React.useState(false);\n const [isExpanded, setIsExpanded] = React.useState(expanded);\n\n const handleOpenSettings = (e: any) => {\n e.stopPropagation();\n setSettingsIsExpanded(prevState => !prevState);\n };\n\n const innerContent = (\n <>\n {Settings && (\n <SettingsModal\n open={settingsIsExpanded}\n close={() => setSettingsIsExpanded(false)}\n componentName={title}\n >\n <Settings />\n </SettingsModal>\n )}\n <Accordion\n expanded={isExpanded}\n onChange={(_e: any, expandedValue: boolean) =>\n setIsExpanded(expandedValue)\n }\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n {Settings && (\n <IconButton\n onClick={handleOpenSettings}\n className={classes.settingsIconButton}\n >\n <SettingsIcon />\n </IconButton>\n )}\n <Typography>{title}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <div className={classes.contentContainer}>\n <Content />\n {Actions && <Actions />}\n </div>\n </AccordionDetails>\n </Accordion>\n </>\n );\n\n return ContextProvider ? (\n <ContextProvider {...childProps}>{innerContent}</ContextProvider>\n ) : (\n innerContent\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport { InfoCard } from '@backstage/core-components';\n\ntype TabType = {\n label: string;\n Component: () => JSX.Element;\n};\n\nexport const ComponentTabs = (props: { title: string; tabs: TabType[] }) => {\n const { title, tabs } = props;\n\n const [value, setValue] = React.useState(0);\n\n const handleChange = (_event: any, newValue: number) => {\n setValue(newValue);\n };\n\n return (\n <InfoCard title={title}>\n <Tabs value={value} onChange={handleChange}>\n {tabs.map(t => (\n <Tab key={t.label} label={t.label} />\n ))}\n </Tabs>\n {tabs.map(({ Component }, idx) => (\n <div\n key={idx}\n {...(idx !== value ? { style: { display: 'none' } } : {})}\n >\n <Component />\n </div>\n ))}\n </InfoCard>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\n\nexport const ComponentTab = (props: {\n title: string;\n Content: () => JSX.Element;\n ContextProvider?: (props: any) => JSX.Element;\n}) => {\n const { title, Content, ContextProvider, ...childProps } = props;\n\n return ContextProvider ? (\n <ContextProvider {...childProps}>\n <Content />\n </ContextProvider>\n ) : (\n <Content />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA4BA,MAAM,SAAA,GAAY,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EAC9C,kBAAoB,EAAA;AAAA,IAClB,SAAS,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,GACnC;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,KAAO,EAAA,MAAA;AAAA,GACT;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,kBAAA,GAAqB,CAAC,KAO7B,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,QAAW,GAAA,KAAA;AAAA,IACX,OAAA;AAAA,IACA,OAAA;AAAA,IAC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aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAK,EAAA,GAAA;AAAA,MACJ,GAAI,GAAQ,KAAA,KAAA,GAAQ,EAAE,KAAA,EAAO,EAAE,OAAS,EAAA,MAAA,EAAS,EAAA,GAAI,EAAC;AAAA,KAAA;AAAA,wCAEtD,SAAU,EAAA,IAAA,CAAA;AAAA,GAEd,CACH,CAAA,CAAA;AAEJ;;AClCa,MAAA,YAAA,GAAe,CAAC,KAIvB,KAAA;AACJ,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,eAAiB,EAAA,GAAG,YAAe,GAAA,KAAA,CAAA;AAE3D,EAAO,OAAA,eAAA,mBACJ,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAiB,GAAG,UAAA,EAAA,sCAClB,OAAQ,EAAA,IAAA,CACX,CAEA,mBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,IAAA,CAAA,CAAA;AAEb;;;;"}
@@ -1,4 +1,4 @@
1
- import { Typography } from '@material-ui/core';
1
+ import Typography from '@material-ui/core/Typography';
2
2
  import { useApi, configApiRef } from '@backstage/core-plugin-api';
3
3
  import React from 'react';
4
4
 
@@ -9,4 +9,4 @@ const CompanyLogo = (props) => {
9
9
  };
10
10
 
11
11
  export { CompanyLogo };
12
- //# sourceMappingURL=index-476343c1.esm.js.map
12
+ //# sourceMappingURL=index-81188117.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-81188117.esm.js","sources":["../../src/homePageComponents/CompanyLogo/CompanyLogo.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Typography from '@material-ui/core/Typography';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport React from 'react';\n\ntype CompanyLogoProps = {\n logo?: React.ReactNode;\n className?: string;\n};\n\n/**\n * A component to display a company logo for the user.\n *\n * @public\n */\nexport const CompanyLogo = (props: CompanyLogoProps) => {\n const { logo, className } = props;\n const configApi = useApi(configApiRef);\n\n return (\n <div className={className}>\n {logo ? (\n <>{logo}</>\n ) : (\n <Typography variant=\"h1\">{configApi.getString('app.title')}</Typography>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AA6Ba,MAAA,WAAA,GAAc,CAAC,KAA4B,KAAA;AACtD,EAAM,MAAA,EAAE,IAAM,EAAA,SAAA,EAAc,GAAA,KAAA,CAAA;AAC5B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AAErC,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SACF,EAAA,EAAA,IAAA,6DACI,IAAK,CAAA,mBAEP,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,IAAM,EAAA,EAAA,SAAA,CAAU,SAAU,CAAA,WAAW,CAAE,CAE/D,CAAA,CAAA;AAEJ;;;;"}
@@ -2,9 +2,17 @@ import { entityRouteRef, entityRouteParams, catalogApiRef, useStarredEntities }
2
2
  import { stringifyEntityRef } from '@backstage/catalog-model';
3
3
  import { useRouteRef, useApi } from '@backstage/core-plugin-api';
4
4
  import { Progress, ResponseErrorPanel } from '@backstage/core-components';
5
- import { ListItem, ListItemIcon, Tooltip, IconButton, ListItemText, Typography, List, Tabs, Tab } from '@material-ui/core';
5
+ import List from '@material-ui/core/List';
6
+ import Typography from '@material-ui/core/Typography';
7
+ import Tabs from '@material-ui/core/Tabs';
8
+ import Tab from '@material-ui/core/Tab';
6
9
  import React from 'react';
7
10
  import useAsync from 'react-use/lib/useAsync';
11
+ import ListItem from '@material-ui/core/ListItem';
12
+ import ListItemIcon from '@material-ui/core/ListItemIcon';
13
+ import Tooltip from '@material-ui/core/Tooltip';
14
+ import IconButton from '@material-ui/core/IconButton';
15
+ import ListItemText from '@material-ui/core/ListItemText';
8
16
  import { Link } from 'react-router-dom';
9
17
  import StarIcon from '@material-ui/icons/Star';
10
18
 
@@ -103,4 +111,4 @@ const Content = ({
103
111
  };
104
112
 
105
113
  export { Content };
106
- //# sourceMappingURL=index-6d94aeff.esm.js.map
114
+ //# sourceMappingURL=index-978cfdc4.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-978cfdc4.esm.js","sources":["../../src/components/StarredEntityListItem/StarredEntityListItem.tsx","../../src/homePageComponents/StarredEntities/Content.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 */\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { entityRouteParams } from '@backstage/plugin-catalog-react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport StarIcon from '@material-ui/icons/Star';\n\ntype EntityListItemProps = {\n entity: Entity;\n onToggleStarredEntity: (entity: Entity) => void;\n};\n\nexport const StarredEntityListItem = ({\n entity,\n onToggleStarredEntity,\n}: EntityListItemProps) => {\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n\n return (\n <ListItem key={stringifyEntityRef(entity)}>\n <ListItemIcon>\n <Tooltip title=\"Remove from starred\">\n <IconButton\n edge=\"end\"\n aria-label=\"unstar\"\n onClick={() => onToggleStarredEntity(entity)}\n >\n <StarIcon style={{ color: '#f3ba37' }} />\n </IconButton>\n </Tooltip>\n </ListItemIcon>\n <Link to={catalogEntityRoute(entityRouteParams(entity))}>\n <ListItemText primary={entity.metadata.title ?? entity.metadata.name} />\n </Link>\n </ListItem>\n );\n};\n","/*\n * Copyright 2022 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 catalogApiRef,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport Typography from '@material-ui/core/Typography';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport React from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { StarredEntityListItem } from '../../components/StarredEntityListItem/StarredEntityListItem';\n\n/**\n * A component to display a list of starred entities for the user.\n *\n * @public\n */\n\nexport type StarredEntitiesProps = {\n noStarredEntitiesMessage?: React.ReactNode | undefined;\n groupByKind?: boolean;\n};\n\nexport const Content = ({\n noStarredEntitiesMessage,\n groupByKind,\n}: StarredEntitiesProps) => {\n const catalogApi = useApi(catalogApiRef);\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n const [activeTab, setActiveTab] = React.useState(0);\n\n // Grab starred entities from catalog to ensure they still exist and also retrieve display titles\n const entities = useAsync(async () => {\n if (!starredEntities.size) {\n return [];\n }\n\n return (\n await catalogApi.getEntitiesByRefs({\n entityRefs: [...starredEntities],\n fields: [\n 'kind',\n 'metadata.namespace',\n 'metadata.name',\n 'metadata.title',\n ],\n })\n ).items.filter((e): e is Entity => !!e);\n }, [catalogApi, starredEntities]);\n\n if (starredEntities.size === 0)\n return (\n <Typography variant=\"body1\">\n {noStarredEntitiesMessage ||\n 'Click the star beside an entity name to add it to this list!'}\n </Typography>\n );\n\n if (entities.loading) {\n return <Progress />;\n }\n\n const groupedEntities: { [kind: string]: Entity[] } = {};\n entities.value?.forEach(entity => {\n const kind = entity.kind;\n if (!groupedEntities[kind]) {\n groupedEntities[kind] = [];\n }\n groupedEntities[kind].push(entity);\n });\n\n const groupByKindEntries = Object.entries(groupedEntities);\n\n return entities.error ? (\n <ResponseErrorPanel error={entities.error} />\n ) : (\n <div>\n {!groupByKind && (\n <List>\n {entities.value\n ?.sort((a, b) =>\n (a.metadata.title ?? a.metadata.name).localeCompare(\n b.metadata.title ?? b.metadata.name,\n ),\n )\n .map(entity => (\n <StarredEntityListItem\n key={stringifyEntityRef(entity)}\n entity={entity}\n onToggleStarredEntity={toggleStarredEntity}\n />\n ))}\n </List>\n )}\n\n {groupByKind && (\n <Tabs\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label=\"entity-tabs\"\n >\n {groupByKindEntries.map(([kind]) => (\n <Tab key={kind} label={kind} />\n ))}\n </Tabs>\n )}\n\n {groupByKind &&\n groupByKindEntries.map(([kind, entitiesByKind], index) => (\n <div key={kind} hidden={groupByKind && activeTab !== index}>\n <List>\n {entitiesByKind\n ?.sort((a, b) =>\n (a.metadata.title ?? a.metadata.name).localeCompare(\n b.metadata.title ?? b.metadata.name,\n ),\n )\n .map(entity => (\n <StarredEntityListItem\n key={stringifyEnt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
1
  import React, { createContext } from 'react';
2
- import { Button, FormControl, FormLabel, RadioGroup, FormControlLabel, Radio } from '@material-ui/core';
2
+ import Button from '@material-ui/core/Button';
3
3
  import Typography from '@material-ui/core/Typography';
4
+ import FormControl from '@material-ui/core/FormControl';
5
+ import FormLabel from '@material-ui/core/FormLabel';
6
+ import RadioGroup from '@material-ui/core/RadioGroup';
7
+ import FormControlLabel from '@material-ui/core/FormControlLabel';
8
+ import Radio from '@material-ui/core/Radio';
4
9
  import upperFirst from 'lodash/upperFirst';
5
10
 
6
11
  const Context = createContext(void 0);
@@ -82,4 +87,4 @@ const Settings = () => {
82
87
  };
83
88
 
84
89
  export { Actions, Content, ContextProvider, Settings };
85
- //# sourceMappingURL=index-4517c5bc.esm.js.map
90
+ //# sourceMappingURL=index-a6e42355.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-a6e42355.esm.js","sources":["../../src/homePageComponents/RandomJoke/Context.tsx","../../src/homePageComponents/RandomJoke/Actions.tsx","../../src/homePageComponents/RandomJoke/Content.tsx","../../src/homePageComponents/RandomJoke/Settings.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { createContext } from 'react';\n\nexport type JokeType = 'any' | 'programming';\n\ntype Joke = {\n setup: string;\n punchline: string;\n};\n\ntype RandomJokeContextValue = {\n loading: boolean;\n joke: Joke;\n type: JokeType;\n rerollJoke: Function;\n handleChangeType: Function;\n};\n\nconst Context = createContext<RandomJokeContextValue | undefined>(undefined);\n\nconst getNewJoke = (type: string): Promise<Joke> =>\n fetch(\n `https://official-joke-api.appspot.com/jokes${\n type !== 'any' ? `/${type}` : ''\n }/random`,\n )\n .then(res => res.json())\n .then(data => (Array.isArray(data) ? data[0] : data));\n\nexport const ContextProvider = (props: {\n children: JSX.Element;\n defaultCategory?: JokeType;\n}) => {\n const { children, defaultCategory } = props;\n\n const [loading, setLoading] = React.useState(true);\n const [joke, setJoke] = React.useState<Joke>({\n setup: '',\n punchline: '',\n });\n const [type, setType] = React.useState<JokeType>(\n defaultCategory || ('programming' as JokeType),\n );\n\n const rerollJoke = React.useCallback(() => {\n setLoading(true);\n getNewJoke(type).then(newJoke => setJoke(newJoke));\n }, [type]);\n\n const handleChangeType = (newType: JokeType) => {\n setType(newType);\n };\n\n React.useEffect(() => {\n setLoading(false);\n }, [joke]);\n\n React.useEffect(() => {\n rerollJoke();\n }, [rerollJoke]);\n\n const value: RandomJokeContextValue = {\n loading,\n joke,\n type,\n rerollJoke,\n handleChangeType,\n };\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useRandomJoke = () => {\n const value = React.useContext(Context);\n\n if (value === undefined) {\n throw new Error('useRandomJoke must be used within a RandomJokeProvider');\n }\n\n return value;\n};\n\nexport default Context;\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\n\nimport Button from '@material-ui/core/Button';\nimport { useRandomJoke } from './Context';\n\nexport const Actions = () => {\n const { rerollJoke } = useRandomJoke();\n return (\n <Button variant=\"contained\" color=\"primary\" onClick={() => rerollJoke()}>\n Reroll\n </Button>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { useRandomJoke } from './Context';\n\nexport const Content = () => {\n const { joke, loading } = useRandomJoke();\n\n if (loading) return <Typography paragraph>Loading...</Typography>;\n\n return (\n <div>\n <Typography paragraph>{joke.setup}</Typography>\n <Typography paragraph>{joke.punchline}</Typography>\n </div>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport FormControl from '@material-ui/core/FormControl';\nimport FormLabel from '@material-ui/core/FormLabel';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Radio from '@material-ui/core/Radio';\nimport React from 'react';\nimport { useRandomJoke, JokeType } from './Context';\nimport upperFirst from 'lodash/upperFirst';\n\nexport const Settings = () => {\n const { type, handleChangeType } = useRandomJoke();\n const JOKE_TYPES: JokeType[] = ['any' as JokeType, 'programming' as JokeType];\n return (\n <FormControl component=\"fieldset\">\n <FormLabel component=\"legend\">Joke Type</FormLabel>\n <RadioGroup\n aria-label=\"joke type\"\n value={type}\n onChange={e => handleChangeType(e.target.value)}\n >\n {JOKE_TYPES.map(t => (\n <FormControlLabel\n key={t}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
  import { Link } from '@backstage/core-components';
2
- import { makeStyles, List, ListItemIcon, ListItemText } from '@material-ui/core';
2
+ import List from '@material-ui/core/List';
3
+ import ListItemIcon from '@material-ui/core/ListItemIcon';
4
+ import ListItemText from '@material-ui/core/ListItemText';
5
+ import { makeStyles } from '@material-ui/core/styles';
3
6
  import React, { createContext } from 'react';
4
7
 
5
8
  const Context = createContext(void 0);
@@ -58,4 +61,4 @@ const Content = (props) => {
58
61
  };
59
62
 
60
63
  export { Content, ContextProvider };
61
- //# sourceMappingURL=index-40d9ffac.esm.js.map
64
+ //# sourceMappingURL=index-f4fbaf5f.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-f4fbaf5f.esm.js","sources":["../../src/homePageComponents/Toolkit/Context.tsx","../../src/homePageComponents/Toolkit/Content.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React, { createContext } from 'react';\n\n/** @public */\nexport type Tool = {\n label: string;\n url: string;\n icon: React.ReactNode;\n};\n\ntype ToolkitContextValue = {\n tools: Tool[];\n};\n\nconst Context = createContext<ToolkitContextValue | undefined>(undefined);\n\nexport const ContextProvider = (props: {\n children: JSX.Element;\n tools: Tool[];\n}) => {\n const { children, tools } = props;\n\n const [toolsValue, _setTools] = React.useState(tools);\n\n const value: ToolkitContextValue = {\n tools: toolsValue,\n };\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useToolkit = () => {\n const value = React.useContext(Context);\n return value;\n};\n\nexport default Context;\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Link } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport { useToolkit, Tool } from './Context';\n\nconst useStyles = makeStyles(theme => ({\n toolkit: {\n display: 'flex',\n flexWrap: 'wrap',\n textAlign: 'center',\n },\n tool: {\n margin: theme.spacing(0.5, 1),\n },\n label: {\n marginTop: theme.spacing(1),\n width: '72px',\n fontSize: '0.9em',\n lineHeight: '1.25',\n overflowWrap: 'break-word',\n color: theme.palette.text.secondary,\n },\n icon: {\n width: '64px',\n height: '64px',\n borderRadius: '50px',\n justifyContent: 'center',\n alignItems: 'center',\n boxShadow: theme.shadows[1],\n backgroundColor: theme.palette.background.default,\n },\n}));\n\n/**\n * A component to display a list of tools for the user.\n *\n * @public\n */\nexport const Content = (props: ToolkitContentProps) => {\n const classes = useStyles();\n const toolkit = useToolkit();\n const tools = toolkit?.tools ?? props.tools;\n\n return (\n <List className={classes.toolkit}>\n {tools.map((tool: Tool) => (\n <Link key={tool.url} to={tool.url} className={classes.tool}>\n <ListItemIcon className={classes.icon}>{tool.icon}</ListItemIcon>\n <ListItemText\n secondaryTypographyProps={{ className: classes.label }}\n secondary={tool.label}\n />\n </Link>\n ))}\n </List>\n );\n};\n\n/**\n * Props for Toolkit Content component.\n *\n * @public\n */\nexport type ToolkitContentProps = {\n tools: Tool[];\n};\n"],"names":[],"mappings":";;;;;;;AA6BA,MAAM,OAAA,GAAU,cAA+C,KAAS,CAAA,CA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ComponentAccordion: (props: {
242
242
  expanded?: boolean | undefined;
243
243
  Content: () => JSX.Element;
244
244
  Actions?: (() => JSX.Element) | undefined;
245
+ /** @public */
245
246
  Settings?: (() => JSX.Element) | undefined;
246
247
  ContextProvider?: ((props: any) => JSX.Element) | undefined;
247
248
  }) => React.JSX.Element;
package/dist/index.esm.js CHANGED
@@ -1,18 +1,22 @@
1
1
  import { createRouteRef, createPlugin, createApiFactory, storageApiRef, identityApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
2
2
  import { createCardExtension as createCardExtension$1, SettingsModal as SettingsModal$1 } from '@backstage/plugin-home-react';
3
3
  import { WebStorage } from '@backstage/core-app-api';
4
- import { v as visitsApiRef } from './esm/VisitListener-7a513ef0.esm.js';
5
- export { C as CustomHomepageGrid, V as VisitListener, i as isOperator, v as visitsApiRef } from './esm/VisitListener-7a513ef0.esm.js';
4
+ import { v as visitsApiRef } from './esm/VisitListener-601cb70c.esm.js';
5
+ export { C as CustomHomepageGrid, V as VisitListener, i as isOperator, v as visitsApiRef } from './esm/VisitListener-601cb70c.esm.js';
6
6
  import React from 'react';
7
7
  import 'react-router-dom';
8
- import { makeStyles } from '@material-ui/core';
8
+ import { makeStyles } from '@material-ui/core/styles';
9
9
  import 'react-grid-layout';
10
10
  import 'react-grid-layout/css/styles.css';
11
11
  import 'react-resizable/css/styles.css';
12
+ import '@material-ui/core/Dialog';
12
13
  import 'lodash';
13
14
  import 'react-use/lib/useObservable';
14
15
  import '@backstage/core-components';
15
16
  import '@material-ui/core/Typography';
17
+ import '@material-ui/core/DialogContent';
18
+ import '@material-ui/core/Grid';
19
+ import '@material-ui/core/Tooltip';
16
20
  import '@material-ui/core/IconButton';
17
21
  import '@material-ui/icons/Settings';
18
22
  import '@material-ui/icons/Delete';
@@ -21,6 +25,8 @@ import '@rjsf/material-ui';
21
25
  import '@rjsf/validator-ajv8';
22
26
  import '@material-ui/core/List';
23
27
  import '@material-ui/core/ListItem';
28
+ import '@material-ui/core/DialogTitle';
29
+ import '@material-ui/core/ListItemAvatar';
24
30
  import '@material-ui/icons/Add';
25
31
  import '@material-ui/core/ListItemText';
26
32
  import '@material-ui/core/Button';
@@ -179,7 +185,7 @@ const homePlugin = createPlugin({
179
185
  const HomepageCompositionRoot = homePlugin.provide(
180
186
  createRoutableExtension({
181
187
  name: "HomepageCompositionRoot",
182
- component: () => import('./esm/index-abfba912.esm.js').then((m) => m.HomepageCompositionRoot),
188
+ component: () => import('./esm/index-5967d606.esm.js').then((m) => m.HomepageCompositionRoot),
183
189
  mountPoint: rootRouteRef
184
190
  })
185
191
  );
@@ -187,7 +193,7 @@ const ComponentAccordion = homePlugin.provide(
187
193
  createComponentExtension({
188
194
  name: "ComponentAccordion",
189
195
  component: {
190
- lazy: () => import('./esm/index-3155d776.esm.js').then((m) => m.ComponentAccordion)
196
+ lazy: () => import('./esm/index-6c4cdf60.esm.js').then((m) => m.ComponentAccordion)
191
197
  }
192
198
  })
193
199
  );
@@ -195,7 +201,7 @@ const ComponentTabs = homePlugin.provide(
195
201
  createComponentExtension({
196
202
  name: "ComponentTabs",
197
203
  component: {
198
- lazy: () => import('./esm/index-3155d776.esm.js').then((m) => m.ComponentTabs)
204
+ lazy: () => import('./esm/index-6c4cdf60.esm.js').then((m) => m.ComponentTabs)
199
205
  }
200
206
  })
201
207
  );
@@ -203,7 +209,7 @@ const ComponentTab = homePlugin.provide(
203
209
  createComponentExtension({
204
210
  name: "ComponentTab",
205
211
  component: {
206
- lazy: () => import('./esm/index-3155d776.esm.js').then((m) => m.ComponentTab)
212
+ lazy: () => import('./esm/index-6c4cdf60.esm.js').then((m) => m.ComponentTab)
207
213
  }
208
214
  })
209
215
  );
@@ -211,7 +217,7 @@ const WelcomeTitle = homePlugin.provide(
211
217
  createComponentExtension({
212
218
  name: "WelcomeTitle",
213
219
  component: {
214
- lazy: () => import('./esm/index-c91caa6e.esm.js').then((m) => m.WelcomeTitle)
220
+ lazy: () => import('./esm/index-3ec8912b.esm.js').then((m) => m.WelcomeTitle)
215
221
  }
216
222
  })
217
223
  );
@@ -219,7 +225,7 @@ const HomePageCompanyLogo = homePlugin.provide(
219
225
  createComponentExtension({
220
226
  name: "CompanyLogo",
221
227
  component: {
222
- lazy: () => import('./esm/index-476343c1.esm.js').then((m) => m.CompanyLogo)
228
+ lazy: () => import('./esm/index-81188117.esm.js').then((m) => m.CompanyLogo)
223
229
  }
224
230
  })
225
231
  );
@@ -227,7 +233,7 @@ const HomePageRandomJoke = homePlugin.provide(
227
233
  createCardExtension$1({
228
234
  name: "HomePageRandomJoke",
229
235
  title: "Random Joke",
230
- components: () => import('./esm/index-4517c5bc.esm.js'),
236
+ components: () => import('./esm/index-a6e42355.esm.js'),
231
237
  description: "Shows a random joke about optional category",
232
238
  layout: {
233
239
  height: { minRows: 4 },
@@ -253,14 +259,14 @@ const HomePageToolkit = homePlugin.provide(
253
259
  createCardExtension$1({
254
260
  name: "HomePageToolkit",
255
261
  title: "Toolkit",
256
- components: () => import('./esm/index-40d9ffac.esm.js')
262
+ components: () => import('./esm/index-f4fbaf5f.esm.js')
257
263
  })
258
264
  );
259
265
  const HomePageStarredEntities = homePlugin.provide(
260
266
  createCardExtension$1({
261
267
  name: "HomePageStarredEntities",
262
268
  title: "Your Starred Entities",
263
- components: () => import('./esm/index-6d94aeff.esm.js')
269
+ components: () => import('./esm/index-978cfdc4.esm.js')
264
270
  })
265
271
  );
266
272
  const HeaderWorldClock = homePlugin.provide(
@@ -276,20 +282,22 @@ const HeaderWorldClock = homePlugin.provide(
276
282
  const HomePageTopVisited = homePlugin.provide(
277
283
  createCardExtension$1({
278
284
  name: "HomePageTopVisited",
279
- components: () => import('./esm/TopVisited-d22fb15d.esm.js')
285
+ title: "Top Visited",
286
+ components: () => import('./esm/TopVisited-93920c20.esm.js')
280
287
  })
281
288
  );
282
289
  const HomePageRecentlyVisited = homePlugin.provide(
283
290
  createCardExtension$1({
284
291
  name: "HomePageRecentlyVisited",
285
- components: () => import('./esm/RecentlyVisited-c0ca7307.esm.js')
292
+ title: "Recently Visited",
293
+ components: () => import('./esm/RecentlyVisited-399210d7.esm.js')
286
294
  })
287
295
  );
288
296
  const FeaturedDocsCard = homePlugin.provide(
289
297
  createCardExtension$1({
290
298
  name: "FeaturedDocsCard",
291
299
  title: "Featured Docs",
292
- components: () => import('./esm/index-21ffb782.esm.js')
300
+ components: () => import('./esm/index-60f5dc58.esm.js')
293
301
  })
294
302
  );
295
303