@drodil/backstage-plugin-qeta-react 3.57.0 → 3.58.1

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 (54) hide show
  1. package/dist/components/Badges/BadgeChip.esm.js +2 -2
  2. package/dist/components/Badges/BadgeChip.esm.js.map +1 -1
  3. package/dist/components/Buttons/CollectionFollowButton.esm.js +4 -4
  4. package/dist/components/Buttons/CollectionFollowButton.esm.js.map +1 -1
  5. package/dist/components/Buttons/EntityFollowButton.esm.js +4 -4
  6. package/dist/components/Buttons/EntityFollowButton.esm.js.map +1 -1
  7. package/dist/components/Buttons/FollowPostButton.esm.js +44 -0
  8. package/dist/components/Buttons/FollowPostButton.esm.js.map +1 -0
  9. package/dist/components/Buttons/TagFollowButton.esm.js +4 -4
  10. package/dist/components/Buttons/TagFollowButton.esm.js.map +1 -1
  11. package/dist/components/Buttons/UserFollowButton.esm.js +4 -4
  12. package/dist/components/Buttons/UserFollowButton.esm.js.map +1 -1
  13. package/dist/components/ContentHeader/ContentHeader.esm.js +2 -2
  14. package/dist/components/HomePageCards/CommunityActivityCard.esm.js +164 -0
  15. package/dist/components/HomePageCards/CommunityActivityCard.esm.js.map +1 -0
  16. package/dist/components/HomePageCards/FollowedItemsCard.esm.js +296 -0
  17. package/dist/components/HomePageCards/FollowedItemsCard.esm.js.map +1 -0
  18. package/dist/components/HomePageCards/ImpactCard.esm.js +141 -112
  19. package/dist/components/HomePageCards/ImpactCard.esm.js.map +1 -1
  20. package/dist/components/HomePageCards/PostsCard.esm.js +2 -2
  21. package/dist/components/Links/Links.esm.js +1 -1
  22. package/dist/components/MarkdownRenderer/MarkdownRenderer.esm.js +1 -5
  23. package/dist/components/MarkdownRenderer/MarkdownRenderer.esm.js.map +1 -1
  24. package/dist/components/PostHighlightList/PostHighlightList.esm.js +33 -5
  25. package/dist/components/PostHighlightList/PostHighlightList.esm.js.map +1 -1
  26. package/dist/components/PostsContainer/PostListItem.esm.js +2 -1
  27. package/dist/components/PostsContainer/PostListItem.esm.js.map +1 -1
  28. package/dist/components/PostsContainer/PostsContainer.esm.js +2 -2
  29. package/dist/components/PostsContainer/PostsGridItem.esm.js +2 -2
  30. package/dist/components/QetaEntityContainer/QetaEntityContainer.esm.js +3 -3
  31. package/dist/components/QetaEntityContainer/QetaEntityContainer.esm.js.map +1 -1
  32. package/dist/components/StatsChart/StatsChart.esm.js +10 -1
  33. package/dist/components/StatsChart/StatsChart.esm.js.map +1 -1
  34. package/dist/components/SuggestionsCard/SuggestionsCard.esm.js +8 -1
  35. package/dist/components/SuggestionsCard/SuggestionsCard.esm.js.map +1 -1
  36. package/dist/components/Timeline/Timeline.esm.js +3 -0
  37. package/dist/components/Timeline/Timeline.esm.js.map +1 -1
  38. package/dist/components/Timeline/TimelineItem.esm.js +1 -1
  39. package/dist/components/Tooltips/PostTooltip.esm.js +1 -0
  40. package/dist/components/Tooltips/PostTooltip.esm.js.map +1 -1
  41. package/dist/components/UsersContainer/UserListItem.esm.js +1 -0
  42. package/dist/components/UsersContainer/UserListItem.esm.js.map +1 -1
  43. package/dist/components/Utility/RightList.esm.js +14 -4
  44. package/dist/components/Utility/RightList.esm.js.map +1 -1
  45. package/dist/hooks/useEntityAuthor.esm.js +1 -1
  46. package/dist/hooks/useEntityAuthor.esm.js.map +1 -1
  47. package/dist/hooks/useUserFollow.esm.js +22 -1
  48. package/dist/hooks/useUserFollow.esm.js.map +1 -1
  49. package/dist/index.d.ts +55 -6
  50. package/dist/index.esm.js +5 -2
  51. package/dist/index.esm.js.map +1 -1
  52. package/dist/translation.esm.js +48 -3
  53. package/dist/translation.esm.js.map +1 -1
  54. package/package.json +2 -2
@@ -12,6 +12,9 @@ const useStyles = makeStyles((theme) => ({
12
12
  marginBottom: "1em"
13
13
  },
14
14
  subheader: {
15
+ display: "flex",
16
+ alignItems: "center",
17
+ gap: theme.spacing(0.5),
15
18
  color: theme.palette.text.hint,
16
19
  padding: "0px 0px 0.5rem 0.5rem",
17
20
  whiteSpace: "nowrap",
@@ -35,7 +38,14 @@ const useStyles = makeStyles((theme) => ({
35
38
  }));
36
39
  const RightListContainer = (props) => {
37
40
  const styles = useStyles();
38
- return /* @__PURE__ */ jsx(Box, { display: { md: "none", lg: "block" }, className: styles.container, children: props.children });
41
+ return /* @__PURE__ */ jsx(
42
+ Box,
43
+ {
44
+ display: { md: "none", lg: "block" },
45
+ className: `${styles.container} ${props.className ?? ""}`,
46
+ children: props.children
47
+ }
48
+ );
39
49
  };
40
50
  const RightList = (props) => {
41
51
  const styles = useStyles();
@@ -63,10 +73,10 @@ const RightList = (props) => {
63
73
  component: "div",
64
74
  id: "nested-list-subheader",
65
75
  color: "primary",
66
- className: styles.subheader,
76
+ className: `${styles.subheader} ${props.titleClassName ?? ""}`,
67
77
  children: [
68
- props.title,
69
- props.icon
78
+ props.icon,
79
+ props.title
70
80
  ]
71
81
  }
72
82
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"RightList.esm.js","sources":["../../../src/components/Utility/RightList.tsx"],"sourcesContent":["import { ReactNode, useState, Children, useMemo } from 'react';\nimport {\n Box,\n Button,\n List,\n ListSubheader,\n makeStyles,\n} from '@material-ui/core';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { qetaTranslationRef } from '../../translation';\nimport ExpandMore from '@material-ui/icons/ExpandMore';\nimport ExpandLess from '@material-ui/icons/ExpandLess';\n\nconst useStyles = makeStyles(theme => ({\n container: {\n width: '100%',\n marginBottom: '1em',\n },\n subheader: {\n color: theme.palette.text.hint,\n padding: '0px 0px 0.5rem 0.5rem',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n lineHeight: 1.5,\n },\n list: {\n '& li': {\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n },\n },\n showMoreButton: {\n marginLeft: theme.spacing(1),\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n fontSize: '0.8rem',\n },\n}));\n\nexport const RightListContainer = (props: { children: ReactNode }) => {\n const styles = useStyles();\n return (\n <Box display={{ md: 'none', lg: 'block' }} className={styles.container}>\n {props.children}\n </Box>\n );\n};\n\nexport const RightList = (props: {\n children: ReactNode;\n title?: string;\n icon?: ReactNode;\n limit?: number;\n randomize?: boolean;\n}) => {\n const styles = useStyles();\n const { t } = useTranslationRef(qetaTranslationRef);\n const [expanded, setExpanded] = useState(false);\n const arrayChildren = useMemo(() => {\n const children = Children.toArray(props.children);\n if (props.randomize && props.limit && children.length > props.limit) {\n return children.sort(() => 0.5 - Math.random());\n }\n return children;\n }, [props.children, props.randomize, props.limit]);\n const showButton = props.limit && arrayChildren.length > props.limit;\n const displayChildren =\n showButton && !expanded\n ? arrayChildren.slice(0, props.limit)\n : arrayChildren;\n\n return (\n <List\n component=\"nav\"\n aria-labelledby=\"nested-list-subheader\"\n className={styles.list}\n subheader={\n <ListSubheader\n disableSticky\n component=\"div\"\n id=\"nested-list-subheader\"\n color=\"primary\"\n className={styles.subheader}\n >\n {props.title}\n {props.icon}\n </ListSubheader>\n }\n >\n {displayChildren}\n {showButton && (\n <Button\n onClick={() => setExpanded(!expanded)}\n color=\"primary\"\n size=\"small\"\n className={styles.showMoreButton}\n endIcon={expanded ? <ExpandLess /> : <ExpandMore />}\n >\n {expanded ? t('common.showLess') : t('common.showMore')}\n </Button>\n )}\n </List>\n );\n};\n"],"names":["ExpandLess","ExpandMore"],"mappings":";;;;;;;;AAaA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,IAAA;AAAA,IAC1B,OAAS,EAAA,uBAAA;AAAA,IACT,UAAY,EAAA,QAAA;AAAA,IACZ,QAAU,EAAA,QAAA;AAAA,IACV,YAAc,EAAA,UAAA;A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AI,EAAE,iBAAiB;AAAA;AAAA;AACxD;AAAA;AAAA,GAEJ;AAEJ;;;;"}
1
+ {"version":3,"file":"RightList.esm.js","sources":["../../../src/components/Utility/RightList.tsx"],"sourcesContent":["import { ReactNode, useState, Children, useMemo } from 'react';\nimport {\n Box,\n Button,\n List,\n ListSubheader,\n makeStyles,\n} from '@material-ui/core';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { qetaTranslationRef } from '../../translation';\nimport ExpandMore from '@material-ui/icons/ExpandMore';\nimport ExpandLess from '@material-ui/icons/ExpandLess';\n\nconst useStyles = makeStyles(theme => ({\n container: {\n width: '100%',\n marginBottom: '1em',\n },\n subheader: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(0.5),\n color: theme.palette.text.hint,\n padding: '0px 0px 0.5rem 0.5rem',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n lineHeight: 1.5,\n },\n list: {\n '& li': {\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n },\n },\n showMoreButton: {\n marginLeft: theme.spacing(1),\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n fontSize: '0.8rem',\n },\n}));\n\nexport const RightListContainer = (props: {\n children: ReactNode;\n className?: string;\n}) => {\n const styles = useStyles();\n return (\n <Box\n display={{ md: 'none', lg: 'block' }}\n className={`${styles.container} ${props.className ?? ''}`}\n >\n {props.children}\n </Box>\n );\n};\n\nexport const RightList = (props: {\n children: ReactNode;\n title?: string;\n icon?: ReactNode;\n limit?: number;\n randomize?: boolean;\n titleClassName?: string;\n}) => {\n const styles = useStyles();\n const { t } = useTranslationRef(qetaTranslationRef);\n const [expanded, setExpanded] = useState(false);\n const arrayChildren = useMemo(() => {\n const children = Children.toArray(props.children);\n if (props.randomize && props.limit && children.length > props.limit) {\n return children.sort(() => 0.5 - Math.random());\n }\n return children;\n }, [props.children, props.randomize, props.limit]);\n const showButton = props.limit && arrayChildren.length > props.limit;\n const displayChildren =\n showButton && !expanded\n ? arrayChildren.slice(0, props.limit)\n : arrayChildren;\n\n return (\n <List\n component=\"nav\"\n aria-labelledby=\"nested-list-subheader\"\n className={styles.list}\n subheader={\n <ListSubheader\n disableSticky\n component=\"div\"\n id=\"nested-list-subheader\"\n color=\"primary\"\n className={`${styles.subheader} ${props.titleClassName ?? ''}`}\n >\n {props.icon}\n {props.title}\n </ListSubheader>\n }\n >\n {displayChildren}\n {showButton && (\n <Button\n onClick={() => setExpanded(!expanded)}\n color=\"primary\"\n size=\"small\"\n className={styles.showMoreButton}\n endIcon={expanded ? <ExpandLess /> : <ExpandMore />}\n >\n {expanded ? t('common.showLess') : t('common.showMore')}\n </Button>\n )}\n </List>\n );\n};\n"],"names":["ExpandLess","ExpandMore"],"mappings":";;;;;;;;AAaA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,OAAS,EAAA,MAAA;AAAA,IACT,UAAY,EAAA,QAAA;AAAA,IACZ,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,IACtB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,IAAA;AAAA,IAC1B,OAAS,EAAA,uBAAA;AAAA,IACT,UAAY,EAAA,QAAA;AAAA,IACZ,QAAU,EAAA,QAAA;AAAA,IACV,YAAc,EAAA,UAAA;AAAA,IACd,UAAY,EAAA;AAAA,GACd;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA;AAAA,MACN,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC5B,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAC/B,GACF;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,UAAA,EAAY,KAAM,CA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(entity) => {
113
113
  return useUserInfo(author, anonymous);
114
114
  };
115
115
 
116
- export { useEntityAuthor, useUserInfo };
116
+ export { getEntityAuthorLoader, useEntityAuthor, useUserInfo };
117
117
  //# sourceMappingURL=useEntityAuthor.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityAuthor.esm.js","sources":["../../src/hooks/useEntityAuthor.ts"],"sourcesContent":["import {\n parseEntityRef,\n stringifyEntityRef,\n UserEntity,\n} from '@backstage/catalog-model';\nimport { CatalogApi } from '@backstage/catalog-client';\nimport DataLoader from 'dataloader';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n useEntityPresentation,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect, useState } from 'react';\nimport {\n AnswerResponse,\n CollectionResponse,\n PostResponse,\n UserResponse,\n} from '@drodil/backstage-plugin-qeta-common';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { qetaTranslationRef } from '../translation';\n\nconst userCache: Map<string, UserEntity> = new Map();\nlet userLoader: DataLoader<string, UserEntity | null> | undefined;\n\nconst getEntityAuthorLoader = (catalogApi: CatalogApi) => {\n if (userLoader) {\n return userLoader;\n }\n userLoader = new DataLoader<string, UserEntity | null>(\n async (entityRefs: readonly string[]) => {\n const { items } = await catalogApi.getEntitiesByRefs({\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'spec.profile.displayName',\n 'spec.profile.picture',\n ],\n entityRefs: entityRefs as string[],\n });\n\n entityRefs.forEach((entityRef, index) => {\n if (items[index]) {\n userCache.set(entityRef, items[index] as UserEntity);\n }\n });\n return items as (UserEntity | null)[];\n },\n {\n name: 'EntityAuthorLoader',\n cacheMap: new Map(),\n maxBatchSize: 100,\n batchScheduleFn: callback => {\n setTimeout(callback, 50);\n },\n },\n );\n return userLoader;\n};\n\nexport const useUserInfo = (entityRef: string, anonymous?: boolean) => {\n const catalogApi = useApi(catalogApiRef);\n const identityApi = useApi(identityApiRef);\n const { t } = useTranslationRef(qetaTranslationRef);\n const [name, setName] = useState<string>('');\n const [isCurrentUser, setIsCurrentUser] = useState<boolean>(false);\n const [user, setUser] = useState<UserEntity | null>(null);\n const [initials, setInitials] = useState<string | null>(null);\n const [currentUser, setCurrentUser] = useState<string | null>(null);\n const ref = entityRef\n ? stringifyEntityRef(parseEntityRef(entityRef, { defaultKind: 'user' }))\n : 'user:default/guest';\n\n const {\n primaryTitle: userName,\n secondaryTitle,\n Icon,\n } = useEntityPresentation(ref, { defaultKind: 'user' });\n\n useEffect(() => {\n if (anonymous || !entityRef) {\n return;\n }\n\n if (userCache.get(ref)) {\n setUser(userCache.get(ref) as UserEntity);\n return;\n }\n\n getEntityAuthorLoader(catalogApi)\n .load(ref)\n .then(data => {\n if (data) {\n setUser(data);\n } else {\n setUser(null);\n }\n })\n .catch(() => {\n setUser(null);\n });\n }, [catalogApi, ref, anonymous, entityRef]);\n\n useEffect(() => {\n identityApi.getBackstageIdentity().then(res => {\n setCurrentUser(res.userEntityRef ?? 'user:default/guest');\n });\n }, [identityApi]);\n\n useEffect(() => {\n let displayName = userName;\n if (currentUser) {\n const currentUserRef = parseEntityRef(currentUser, {\n defaultKind: 'user',\n });\n const userRef = parseEntityRef(ref, { defaultKind: 'user' });\n if (\n currentUserRef.name === userRef.name &&\n currentUserRef.namespace === userRef.namespace\n ) {\n setIsCurrentUser(true);\n displayName = `${t('userLink.you')}${\n anonymous\n ? ` (${t('userLink.anonymous').toLocaleLowerCase('en-US')})`\n : ''\n }`;\n } else if (anonymous) {\n displayName = t('userLink.anonymous');\n }\n } else if (anonymous) {\n displayName = t('userLink.anonymous');\n }\n setName(displayName);\n }, [ref, anonymous, currentUser, userName, t]);\n\n useEffect(() => {\n const init = (name ?? '')\n .replace(/[^a-zA-Z]/g, '')\n .split(' ')\n .map(p => p[0])\n .join('')\n .substring(0, 2)\n .toUpperCase();\n setInitials(init);\n }, [name]);\n\n return { name, initials, user, secondaryTitle, Icon, isCurrentUser };\n};\n\nexport const useEntityAuthor = (\n entity: PostResponse | AnswerResponse | CollectionResponse | UserResponse,\n) => {\n const anonymous = 'anonymous' in entity ? entity.anonymous ?? false : false;\n const author =\n // eslint-disable-next-line no-nested-ternary\n 'author' in entity\n ? entity.author\n : 'userRef' in entity\n ? entity.userRef\n : entity.owner;\n return useUserInfo(author, anonymous);\n};\n"],"names":[],"mappings":";;;;;;;;AAsBA,MAAM,SAAA,uBAAyC,GAAI,EAAA;AACnD,IAAI,UAAA;AAEJ,MAAM,qBAAA,GAAwB,CAAC,UAA2B,KAAA;AACxD,EAAA,IAAI,UAAY,EAAA;AACd,IAAO,OAAA,UAAA;AAAA;AAET,EAAA,UAAA,GAAa,IAAI,UAAA;AAAA,IACf,OAAO,UAAkC,KAAA;AACvC,MAAA,MAAM,EAAE,KAAA,EAAU,GAAA,MAAM,WAAW,iBAAkB,CAAA;AAAA,QACnD,MAAQ,EAAA;AAAA,UACN,MAAA;AAAA,UACA,eAAA;AAAA,UACA,oBAAA;AAAA,UACA,0BAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA;AAAA,OACD,CAAA;AAED,MAAW,UAAA,CAAA,OAAA,CAAQ,CAAC,SAAA,EAAW,KAAU,KAAA;AACvC,QAAI,IAAA,KAAA,CAAM,KAAK,CAAG,EAAA;AAChB,UAAA,SAAA,CAAU,GAAI,CAAA,SAAA,EAAW,KAAM,CAAA,KAAK,CAAe,CAAA;AAAA;AACrD,OACD,CAAA;AACD,MAAO,OAAA,KAAA;AAAA,KACT;AAAA,IACA;AAAA,MACE,IAAM,EAAA,oBAAA;AAAA,MACN,QAAA,sBAAc,GAAI,EAAA;AAAA,MAClB,YAAc,EAAA,GAAA;AAAA,MACd,iBAAiB,CAAY,QAAA,KAAA;AAC3B,QAAA,UAAA,CAAW,UAAU,EAAE,CAAA;AAAA;AACzB;AACF,GACF;AACA,EAAO,OAAA,UAAA;AACT,CAAA;AAEa,MAAA,WAAA,GAAc,CAAC,SAAA,EAAmB,SAAwB,K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A,EAAK,WAAW,WAAa,EAAA,QAAA,EAAU,CAAC,CAAC,CAAA;AAE7C,EAAA,SAAA,CAAU,MAAM;AACd,IAAM,MAAA,IAAA,GAAA,CAAQ,QAAQ,EACnB,EAAA,OAAA,CAAQ,cAAc,EAAE,CAAA,CACxB,KAAM,CAAA,GAAG,CACT,CAAA,GAAA,CAAI,OAAK,CAAE,CAAA,CAAC,CAAC,CAAA,CACb,IAAK,CAAA,EAAE,EACP,SAAU,CAAA,CAAA,EAAG,CAAC,CAAA,CACd,WAAY,EAAA;AACf,IAAA,WAAA,CAAY,IAAI,CAAA;AAAA,GAClB,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,OAAO,EAAE,IAAM,EAAA,QAAA,EAAU,IAAM,EAAA,cAAA,EAAgB,MAAM,aAAc,EAAA;AACrE;AAEa,MAAA,eAAA,GAAkB,CAC7B,MACG,KAAA;AACH,EAAA,MAAM,SAAY,GAAA,WAAA,IAAe,MAAS,GAAA,MAAA,CAAO,aAAa,KAAQ,GAAA,KAAA;AACtE,EAAM,MAAA,MAAA;AAAA;AAAA,IAEJ,QAAA,IAAY,SACR,MAAO,CAAA,MAAA,GACP,aAAa,MACb,GAAA,MAAA,CAAO,UACP,MAAO,CAAA;AAAA,GAAA;AACb,EAAO,OAAA,WAAA,CAAY,QAAQ,SAAS,CAAA;AACtC;;;;"}
1
+ {"version":3,"file":"useEntityAuthor.esm.js","sources":["../../src/hooks/useEntityAuthor.ts"],"sourcesContent":["import {\n parseEntityRef,\n stringifyEntityRef,\n UserEntity,\n} from '@backstage/catalog-model';\nimport { CatalogApi } from '@backstage/catalog-client';\nimport DataLoader from 'dataloader';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n useEntityPresentation,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect, useState } from 'react';\nimport {\n AnswerResponse,\n CollectionResponse,\n PostResponse,\n UserResponse,\n} from '@drodil/backstage-plugin-qeta-common';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { qetaTranslationRef } from '../translation';\n\nconst userCache: Map<string, UserEntity> = new Map();\nlet userLoader: DataLoader<string, UserEntity | null> | undefined;\n\nexport const getEntityAuthorLoader = (catalogApi: CatalogApi) => {\n if (userLoader) {\n return userLoader;\n }\n userLoader = new DataLoader<string, UserEntity | null>(\n async (entityRefs: readonly string[]) => {\n const { items } = await catalogApi.getEntitiesByRefs({\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'spec.profile.displayName',\n 'spec.profile.picture',\n ],\n entityRefs: entityRefs as string[],\n });\n\n entityRefs.forEach((entityRef, index) => {\n if (items[index]) {\n userCache.set(entityRef, items[index] as UserEntity);\n }\n });\n return items as (UserEntity | null)[];\n },\n {\n name: 'EntityAuthorLoader',\n cacheMap: new Map(),\n maxBatchSize: 100,\n batchScheduleFn: callback => {\n setTimeout(callback, 50);\n },\n },\n );\n return userLoader;\n};\n\nexport const useUserInfo = (entityRef: string, anonymous?: boolean) => {\n const catalogApi = useApi(catalogApiRef);\n const identityApi = useApi(identityApiRef);\n const { t } = useTranslationRef(qetaTranslationRef);\n const [name, setName] = useState<string>('');\n const [isCurrentUser, setIsCurrentUser] = useState<boolean>(false);\n const [user, setUser] = useState<UserEntity | null>(null);\n const [initials, setInitials] = useState<string | null>(null);\n const [currentUser, setCurrentUser] = useState<string | null>(null);\n const ref = entityRef\n ? stringifyEntityRef(parseEntityRef(entityRef, { defaultKind: 'user' }))\n : 'user:default/guest';\n\n const {\n primaryTitle: userName,\n secondaryTitle,\n Icon,\n } = useEntityPresentation(ref, { defaultKind: 'user' });\n\n useEffect(() => {\n if (anonymous || !entityRef) {\n return;\n }\n\n if (userCache.get(ref)) {\n setUser(userCache.get(ref) as UserEntity);\n return;\n }\n\n getEntityAuthorLoader(catalogApi)\n .load(ref)\n .then(data => {\n if (data) {\n setUser(data);\n } else {\n setUser(null);\n }\n })\n .catch(() => {\n setUser(null);\n });\n }, [catalogApi, ref, anonymous, entityRef]);\n\n useEffect(() => {\n identityApi.getBackstageIdentity().then(res => {\n setCurrentUser(res.userEntityRef ?? 'user:default/guest');\n });\n }, [identityApi]);\n\n useEffect(() => {\n let displayName = userName;\n if (currentUser) {\n const currentUserRef = parseEntityRef(currentUser, {\n defaultKind: 'user',\n });\n const userRef = parseEntityRef(ref, { defaultKind: 'user' });\n if (\n currentUserRef.name === userRef.name &&\n currentUserRef.namespace === userRef.namespace\n ) {\n setIsCurrentUser(true);\n displayName = `${t('userLink.you')}${\n anonymous\n ? ` (${t('userLink.anonymous').toLocaleLowerCase('en-US')})`\n : ''\n }`;\n } else if (anonymous) {\n displayName = t('userLink.anonymous');\n }\n } else if (anonymous) {\n displayName = t('userLink.anonymous');\n }\n setName(displayName);\n }, [ref, anonymous, currentUser, userName, t]);\n\n useEffect(() => {\n const init = (name ?? '')\n .replace(/[^a-zA-Z]/g, '')\n .split(' ')\n .map(p => p[0])\n .join('')\n .substring(0, 2)\n .toUpperCase();\n setInitials(init);\n }, [name]);\n\n return { name, initials, user, secondaryTitle, Icon, isCurrentUser };\n};\n\nexport const useEntityAuthor = (\n entity: PostResponse | AnswerResponse | CollectionResponse | UserResponse,\n) => {\n const anonymous = 'anonymous' in entity ? entity.anonymous ?? false : false;\n const author =\n // eslint-disable-next-line no-nested-ternary\n 'author' in entity\n ? entity.author\n : 'userRef' in entity\n ? entity.userRef\n : entity.owner;\n return useUserInfo(author, anonymous);\n};\n"],"names":[],"mappings":";;;;;;;;AAsBA,MAAM,SAAA,uBAAyC,GAAI,EAAA;AACnD,IAAI,UAAA;AAES,MAAA,qBAAA,GAAwB,CAAC,UAA2B,KAAA;AAC/D,EAAA,IAAI,UAAY,EAAA;AACd,IAAO,OAAA,UAAA;AAAA;AAET,EAAA,UAAA,GAAa,IAAI,UAAA;AAAA,IACf,OAAO,UAAkC,KAAA;AACvC,MAAA,MAAM,EAAE,KAAA,EAAU,GAAA,MAAM,WAAW,iBAAkB,CAAA;AAAA,QACnD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AAA,MAAM,SAAY,GAAA,WAAA,IAAe,MAAS,GAAA,MAAA,CAAO,aAAa,KAAQ,GAAA,KAAA;AACtE,EAAM,MAAA,MAAA;AAAA;AAAA,IAEJ,QAAA,IAAY,SACR,MAAO,CAAA,MAAA,GACP,aAAa,MACb,GAAA,MAAA,CAAO,UACP,MAAO,CAAA;AAAA,GAAA;AACb,EAAO,OAAA,WAAA,CAAY,QAAQ,SAAS,CAAA;AACtC;;;;"}
@@ -1,10 +1,16 @@
1
- import { useCallback } from 'react';
1
+ import { useState, useCallback, useEffect } from 'react';
2
2
  import { useApi } from '@backstage/core-plugin-api';
3
3
  import { qetaApiRef } from '../api.esm.js';
4
4
  import { useFollow } from './useFollow.esm.js';
5
+ import { catalogApiRef } from '@backstage/plugin-catalog-react';
6
+ import { getEntityAuthorLoader } from './useEntityAuthor.esm.js';
5
7
 
6
8
  const useUserFollow = () => {
7
9
  const qetaApi = useApi(qetaApiRef);
10
+ const catalogApi = useApi(catalogApiRef);
11
+ const [userEntities, setUserEntities] = useState(
12
+ /* @__PURE__ */ new Map()
13
+ );
8
14
  const { items, follow, unfollow, isFollowing, loading } = useFollow(
9
15
  "users",
10
16
  {
@@ -23,8 +29,23 @@ const useUserFollow = () => {
23
29
  isEqual: (a, b) => a === b
24
30
  }
25
31
  );
32
+ useEffect(() => {
33
+ if (items) {
34
+ const loader = getEntityAuthorLoader(catalogApi);
35
+ Promise.all(items.map((item) => loader.load(item))).then((users) => {
36
+ const newMap = /* @__PURE__ */ new Map();
37
+ users.forEach((user, index) => {
38
+ if (user) {
39
+ newMap.set(items[index], user);
40
+ }
41
+ });
42
+ setUserEntities(newMap);
43
+ });
44
+ }
45
+ }, [items, catalogApi]);
26
46
  return {
27
47
  users: items,
48
+ userEntities,
28
49
  followUser: follow,
29
50
  unfollowUser: unfollow,
30
51
  isFollowingUser: isFollowing,
@@ -1 +1 @@
1
- {"version":3,"file":"useUserFollow.esm.js","sources":["../../src/hooks/useUserFollow.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { qetaApiRef } from '../api';\nimport { useFollow } from './useFollow';\n\nexport const useUserFollow = () => {\n const qetaApi = useApi(qetaApiRef);\n\n const { items, follow, unfollow, isFollowing, loading } = useFollow<string>(\n 'users',\n {\n fetchFollowed: useCallback(\n () => qetaApi.getFollowedUsers().then(res => res.followedUserRefs),\n [qetaApi],\n ),\n followItem: useCallback(\n (user: string) => qetaApi.followUser(user),\n [qetaApi],\n ),\n unfollowItem: useCallback(\n (user: string) => qetaApi.unfollowUser(user),\n [qetaApi],\n ),\n isEqual: (a, b) => a === b,\n },\n );\n\n return {\n users: items,\n followUser: follow,\n unfollowUser: unfollow,\n isFollowingUser: isFollowing,\n loading,\n };\n};\n"],"names":[],"mappings":";;;;;AAKO,MAAM,gBAAgB,MAAM;AACjC,EAAM,MAAA,OAAA,GAAU,OAAO,UAAU,CAAA;AAEjC,EAAA,MAAM,EAAE,KAAO,EAAA,MAAA,EAAQ,QAAU,EAAA,WAAA,EAAa,SAAY,GAAA,SAAA;AAAA,IACxD,OAAA;AAAA,IACA;AAAA,MACE,aAAe,EAAA,WAAA;AAAA,QACb,MAAM,OAAQ,CAAA,gBAAA,GAAmB,IAAK,CAAA,CAAA,GAAA,KAAO,IAAI,gBAAgB,CAAA;AAAA,QACjE,CAAC,OAAO;AAAA,OACV;AAAA,MACA,UAAY,EAAA,WAAA;AAAA,QACV,CAAC,IAAA,KAAiB,OAAQ,CAAA,UAAA,CAAW,IAAI,CAAA;AAAA,QACzC,CAAC,OAAO;AAAA,OACV;AAAA,MACA,YAAc,EAAA,WAAA;AAAA,QACZ,CAAC,IAAA,KAAiB,OAAQ,CAAA,YAAA,CAAa,IAAI,CAAA;AAAA,QAC3C,CAAC,OAAO;AAAA,OACV;AAAA,MACA,OAAS,EAAA,CAAC,CAAG,EAAA,CAAA,KAAM,CAAM,KAAA;AAAA;AAC3B,GACF;AAEA,EAAO,OAAA;AAAA,IACL,KAAO,EAAA,KAAA;AAAA,IACP,UAAY,EAAA,MAAA;AAAA,IACZ,YAAc,EAAA,QAAA;AAAA,IACd,eAAiB,EAAA,WAAA;AAAA,IACjB;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"useUserFollow.esm.js","sources":["../../src/hooks/useUserFollow.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { qetaApiRef } from '../api';\nimport { useFollow } from './useFollow';\nimport { UserEntity } from '@backstage/catalog-model';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { getEntityAuthorLoader } from './useEntityAuthor';\n\nexport const useUserFollow = () => {\n const qetaApi = useApi(qetaApiRef);\n const catalogApi = useApi(catalogApiRef);\n const [userEntities, setUserEntities] = useState<Map<string, UserEntity>>(\n new Map(),\n );\n\n const { items, follow, unfollow, isFollowing, loading } = useFollow<string>(\n 'users',\n {\n fetchFollowed: useCallback(\n () => qetaApi.getFollowedUsers().then(res => res.followedUserRefs),\n [qetaApi],\n ),\n followItem: useCallback(\n (user: string) => qetaApi.followUser(user),\n [qetaApi],\n ),\n unfollowItem: useCallback(\n (user: string) => qetaApi.unfollowUser(user),\n [qetaApi],\n ),\n isEqual: (a, b) => a === b,\n },\n );\n\n useEffect(() => {\n if (items) {\n const loader = getEntityAuthorLoader(catalogApi);\n Promise.all(items.map(item => loader.load(item))).then(users => {\n const newMap = new Map<string, UserEntity>();\n users.forEach((user, index) => {\n if (user) {\n newMap.set(items[index], user);\n }\n });\n setUserEntities(newMap);\n });\n }\n }, [items, catalogApi]);\n\n return {\n users: items,\n userEntities,\n followUser: follow,\n unfollowUser: unfollow,\n isFollowingUser: isFollowing,\n loading,\n };\n};\n"],"names":[],"mappings":";;;;;;;AAQO,MAAM,gBAAgB,MAAM;AACjC,EAAM,MAAA,OAAA,GAAU,OAAO,UAAU,CAAA;AACjC,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAM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QAAA,eAAA,CAAgB,MAAM,CAAA;AAAA,OACvB,CAAA;AAAA;AACH,GACC,EAAA,CAAC,KAAO,EAAA,UAAU,CAAC,CAAA;AAEtB,EAAO,OAAA;AAAA,IACL,KAAO,EAAA,KAAA;AAAA,IACP,YAAA;AAAA,IACA,UAAY,EAAA,MAAA;AAAA,IACZ,YAAc,EAAA,QAAA;AAAA,IACd,eAAiB,EAAA,WAAA;AAAA,IACjB;AAAA,GACF;AACF;;;;"}
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ import { LinkProps } from '@backstage/core-components';
11
11
  import { SvgIconProps } from '@material-ui/core';
12
12
  import { PluggableList } from 'unified';
13
13
  import * as _material_ui_styles from '@material-ui/styles';
14
+ import { CatalogApi } from '@backstage/catalog-client';
15
+ import DataLoader from 'dataloader';
14
16
  import * as react_use_lib_useAsyncFn from 'react-use/lib/useAsyncFn';
15
17
  import * as react_router_dom from 'react-router-dom';
16
18
  import { Overrides } from '@material-ui/core/styles/overrides';
@@ -51,7 +53,7 @@ interface TimelineProps {
51
53
  loadMore?: boolean;
52
54
  limit?: number;
53
55
  }
54
- declare const Timeline: (props: TimelineProps) => react_jsx_runtime.JSX.Element;
56
+ declare const Timeline: (props: TimelineProps) => react_jsx_runtime.JSX.Element | null;
55
57
 
56
58
  declare const TimelineItemCard: ({ item }: {
57
59
  item: TimelineItem;
@@ -272,6 +274,10 @@ interface RankingButtonsProps {
272
274
  }
273
275
  declare const RankingButtons: (props: RankingButtonsProps) => react_jsx_runtime.JSX.Element | null;
274
276
 
277
+ declare const FollowPostButton: (props: {
278
+ post: Post;
279
+ }) => react_jsx_runtime.JSX.Element;
280
+
275
281
  declare const PostHighlightListContent: (props: {
276
282
  loading?: boolean;
277
283
  error?: any;
@@ -280,7 +286,10 @@ declare const PostHighlightListContent: (props: {
280
286
  icon?: ReactNode;
281
287
  noPostsLabel?: string;
282
288
  disableLoading?: boolean;
283
- }) => react_jsx_runtime.JSX.Element;
289
+ containerClassName?: string;
290
+ titleClassName?: string;
291
+ hideIfEmpty?: boolean;
292
+ }) => react_jsx_runtime.JSX.Element | null;
284
293
  declare const PostHighlightList: (props: {
285
294
  type: string;
286
295
  title: string;
@@ -288,6 +297,7 @@ declare const PostHighlightList: (props: {
288
297
  icon?: ReactNode;
289
298
  options?: PostsQuery;
290
299
  postType?: PostType;
300
+ hideIfEmpty?: boolean;
291
301
  }) => react_jsx_runtime.JSX.Element;
292
302
 
293
303
  declare const PostHighlightListContainer: ({ options, }: {
@@ -336,13 +346,17 @@ declare const QuestionCard: (props: {
336
346
  question: PostResponse;
337
347
  }) => react_jsx_runtime.JSX.Element;
338
348
 
349
+ declare const ImpactCard: () => react_jsx_runtime.JSX.Element;
350
+
339
351
  declare const PostsCard: (props: {
340
352
  title: string;
341
353
  options?: PostsQuery;
342
354
  postType?: PostType;
343
355
  }) => react_jsx_runtime.JSX.Element | null;
344
356
 
345
- declare const ImpactCard: () => react_jsx_runtime.JSX.Element;
357
+ declare const FollowedItemsCard: () => react_jsx_runtime.JSX.Element;
358
+
359
+ declare const CommunityActivityCard: () => react_jsx_runtime.JSX.Element;
346
360
 
347
361
  declare const FollowedEntitiesList: () => react_jsx_runtime.JSX.Element | null;
348
362
 
@@ -397,7 +411,7 @@ declare const QuestionsTable: (props: {
397
411
  type QetaStatsChartClassKey = 'tooltipLabel' | 'tooltipWrapper' | 'xAxis' | 'lineChart' | 'barChart';
398
412
  declare const StatsChart: (props: {
399
413
  data: Stat[];
400
- summary?: Record<string, number>;
414
+ summary?: Record<string, number | Date | string>;
401
415
  loading?: boolean;
402
416
  error?: string;
403
417
  }) => react_jsx_runtime.JSX.Element;
@@ -676,6 +690,7 @@ declare const useEntityFollow: () => {
676
690
  loading: boolean;
677
691
  };
678
692
 
693
+ declare const getEntityAuthorLoader: (catalogApi: CatalogApi) => DataLoader<string, UserEntity | null, string>;
679
694
  declare const useUserInfo: (entityRef: string, anonymous?: boolean) => {
680
695
  name: string;
681
696
  initials: string | null;
@@ -695,6 +710,7 @@ declare const useEntityAuthor: (entity: PostResponse | AnswerResponse | Collecti
695
710
 
696
711
  declare const useUserFollow: () => {
697
712
  users: string[];
713
+ userEntities: Map<string, UserEntity>;
698
714
  followUser: (item: string) => void;
699
715
  unfollowUser: (item: string) => void;
700
716
  isFollowingUser: (item: string) => boolean;
@@ -857,6 +873,7 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
857
873
  readonly "common.deleted": "Deleted";
858
874
  readonly "common.score": "{{score}} score";
859
875
  readonly "common.error": "Error";
876
+ readonly "common.posts": "Posts";
860
877
  readonly "common.answers": "answers";
861
878
  readonly "common.links": "links";
862
879
  readonly "common.questions": "questions";
@@ -1029,6 +1046,8 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
1029
1046
  readonly "writeArticleButton.title": "Write an article";
1030
1047
  readonly "createLinkButton.title": "Link";
1031
1048
  readonly "createCollectionButton.title": "Create a collection";
1049
+ readonly "followPostButton.follow": "By following this post, you will receive notifications when it is updated";
1050
+ readonly "followPostButton.unfollow": "By unfollowing this post, you will no longer receive notifications when it is updated";
1032
1051
  readonly "commentList.save": "Save";
1033
1052
  readonly "commentList.editLink": "edit";
1034
1053
  readonly "commentList.deleteLink": "delete";
@@ -1176,7 +1195,27 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
1176
1195
  readonly "suggestionsCard.needsReview3": "Content review needed: \"{{title}}\"";
1177
1196
  readonly "suggestionsCard.needsReview4": "Can you verify \"{{title}}\" is still valid?";
1178
1197
  readonly "suggestionsCard.needsReview5": "\"{{title}}\" is due for a review";
1198
+ readonly "communityActivity.title": "Community Activity";
1199
+ readonly "communityActivity.views": "Views";
1200
+ readonly "communityActivity.newPosts": "New Posts";
1201
+ readonly "communityActivity.newAnswers": "New Answers";
1202
+ readonly "communityActivity.newComments": "New Comments";
1203
+ readonly "communityActivity.newVotes": "New Votes";
1204
+ readonly "communityActivity.activeUsers": "Active Users";
1205
+ readonly "communityActivity.period.1d": "Last 24h";
1206
+ readonly "communityActivity.period.3d": "Last 3 days";
1207
+ readonly "communityActivity.period.7d": "Last 7 days";
1208
+ readonly "communityActivity.period.14d": "Last 14 days";
1209
+ readonly "communityActivity.period.30d": "Last 30 days";
1210
+ readonly "communityActivity.period.90d": "Last 90 days";
1211
+ readonly "communityActivity.period.1y": "Last year";
1212
+ readonly "homePage.tags": "Tags";
1213
+ readonly "homePage.entities": "Entities";
1179
1214
  readonly "homePage.title": "Home";
1215
+ readonly "homePage.users": "Users";
1216
+ readonly "homePage.collections": "Collections";
1217
+ readonly "homePage.followedItems": "Following";
1218
+ readonly "homePage.noFollowedItems": "You are not following anything yet";
1180
1219
  readonly "impactCard.reputation": "Reputation";
1181
1220
  readonly "impactCard.title": "Your impact";
1182
1221
  readonly "impactCard.error": "Failed to load impact data";
@@ -1185,7 +1224,7 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
1185
1224
  readonly "impactCard.questions": "Questions";
1186
1225
  readonly "impactCard.articles": "Articles";
1187
1226
  readonly "impactCard.votes": "Votes";
1188
- readonly "impactCard.views": "views";
1227
+ readonly "impactCard.views": "views on your posts";
1189
1228
  readonly "impactCard.followers": "Followers";
1190
1229
  readonly "impactCard.contributions": "Your contributions helped {{lastWeek}} people this week";
1191
1230
  readonly "impactCard.totalContributions": "Contributions";
@@ -1203,7 +1242,13 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
1203
1242
  readonly "rightMenu.followedUsers": "Followed users";
1204
1243
  readonly "rightMenu.similarQuestions": "Similar questions";
1205
1244
  readonly "rightMenu.similarPosts": "Similar posts";
1245
+ readonly "rightMenu.linkedPosts": "Linked posts";
1246
+ readonly "rightMenu.recentlyViewed": "Recently viewed";
1206
1247
  readonly "highlights.loadError": "Failed to load questions";
1248
+ readonly "highlights.hot.title": "Hot Posts";
1249
+ readonly "highlights.hot.noQuestionsLabel": "No hot posts";
1250
+ readonly "highlights.recent.title": "Recently Viewed";
1251
+ readonly "highlights.recent.noQuestionsLabel": "No recently viewed posts";
1207
1252
  readonly "highlights.own.title": "Your latest questions";
1208
1253
  readonly "highlights.own.noQuestionsLabel": "No questions";
1209
1254
  readonly "highlights.hotQuestions.title": "Hot questions";
@@ -1216,6 +1261,8 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
1216
1261
  readonly "highlights.unanswered.noQuestionsLabel": "No unanswered questions";
1217
1262
  readonly "highlights.incorrect.title": "Questions without correct answer";
1218
1263
  readonly "highlights.incorrect.noQuestionsLabel": "No questions without correct answers";
1264
+ readonly "highlights.followed.title": "Followed posts";
1265
+ readonly "highlights.followed.noQuestionsLabel": "No followed posts";
1219
1266
  readonly "questionsPage.title": "All questions";
1220
1267
  readonly "articlesPage.title": "All articles";
1221
1268
  readonly "linksPage.title": "All links";
@@ -1425,6 +1472,7 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
1425
1472
  readonly "stats.votes": "Votes";
1426
1473
  readonly "stats.views": "Views";
1427
1474
  readonly "stats.followers": "Followers";
1475
+ readonly "stats.activeUsers": "Active users";
1428
1476
  readonly "stats.answerScore": "Answer score";
1429
1477
  readonly "stats.postScore": "Post score";
1430
1478
  readonly "stats.correctAnswers": "Correct answers";
@@ -1438,6 +1486,7 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
1438
1486
  readonly "stats.totalUsers": "Total users";
1439
1487
  readonly "stats.totalTags": "Total tags";
1440
1488
  readonly "stats.totalFollowers": "Total followers";
1489
+ readonly "stats.lastSeen": "Last seen";
1441
1490
  readonly "collectionButton.follow": "Follow";
1442
1491
  readonly "collectionButton.tooltip": "By following a collection, you will get notified when ever a new post is added to the collection";
1443
1492
  readonly "collectionButton.unfollow": "Unfollow";
@@ -1510,4 +1559,4 @@ type QetaOverrides = Overrides & {
1510
1559
  [Name in keyof QetaComponentsNameToClassKey]?: Partial<StyleRules<QetaComponentsNameToClassKey[Name]>>;
1511
1560
  };
1512
1561
 
1513
- export { AIAnswerCard, AddToCollectionButton, AnswerCard, AnswerForm, AnswerListItem, AnswersContainer, AnswersGridItem, ArticleContent, AskQuestionButton, AuthorLink, BadgeChip, ButtonContainer, CollectionFollowButton, CollectionForm, CollectionsContainer, ContentHeader, ContentHeaderButton, ContentHeaderCard, type ContentHeaderCardProps, type ContentHeaderProps, CreateCollectionButton, CreateLinkButton, CreateTagModal, DeleteModal, DeletedBanner, DraftBanner, EditTagModal, EntitiesContainer, EntitiesGridItem, EntityFollowButton, EntityListItem, FaviconItem, type FilterChange, FilterPanel, FollowedCollectionsList, FollowedEntitiesList, FollowedTagsList, FollowedUsersList, type GridType, ImpactCard, LeftMenu, LeftMenuButton, LinkCard, MarkdownRenderer, ObsoleteBanner, ObsoleteModal, OpenLinkButton, PostForm, PostHighlightList, PostHighlightListContainer, PostHighlightListContent, PostListItem, PostsCard, PostsContainer, type PostsContainerProps, PostsGridItem, PostsTable, QetaContext, type QetaContextProps, type QetaEntitiesProps, type QetaOverrides, QetaProvider, QuestionCard, type QuestionFormValues, QuestionsTable, RankingButtons, RelativeTimeWithTooltip, SelectTemplateList, StatsChart, StatusChip, SuggestionsCard, type TagAndEntitiesFormValues, TagFollowButton, TagGridItem, TagListItem, TagsContainer, type TemplateFormValues, TemplateList, Timeline, TimelineItemCard, TopRankingUsers, TrophyIcon, UpdatedByLink, UserBadges, UserFollowButton, UserLink, UserListItem, type UserSettings, type UserSettingsHook, UsersContainer, UsersGridItem, ValidReviewModal, ViewToggle, type ViewType, WriteArticleButton, articleRouteRef, articlesRouteRef, askRouteRef, collectionCreateRouteRef, collectionEditRouteRef, collectionRouteRef, collectionsRouteRef, createLinkRouteRef, editArticleRouteRef, editLinkRouteRef, editQuestionRouteRef, entitiesRouteRef, entityRouteRef, favoriteQuestionsRouteRef, linkRouteRef, linksRouteRef, moderatorRouteRef, qetaApiRef, qetaRouteRef, qetaTranslationRef, qetaTranslations, questionRouteRef, questionsRouteRef, reviewRouteRef, settingsRouteRef, statisticsRouteRef, tagRouteRef, tagsRouteRef, useAI, useCanReview, useCollectionsFollow, useEntityAuthor, useEntityFollow, useFavicon, useFollow, useGridPageSize, useIdentityApi, useIsModerator, useListItemStyles, useQetaApi, useQetaContext, useQetaEntities, useTagsFollow, useUserFollow, useUserInfo, useUserSettings, useVoting, userRouteRef, usersRouteRef, writeRouteRef };
1562
+ export { AIAnswerCard, AddToCollectionButton, AnswerCard, AnswerForm, AnswerListItem, AnswersContainer, AnswersGridItem, ArticleContent, AskQuestionButton, AuthorLink, BadgeChip, ButtonContainer, CollectionFollowButton, CollectionForm, CollectionsContainer, CommunityActivityCard, ContentHeader, ContentHeaderButton, ContentHeaderCard, type ContentHeaderCardProps, type ContentHeaderProps, CreateCollectionButton, CreateLinkButton, CreateTagModal, DeleteModal, DeletedBanner, DraftBanner, EditTagModal, EntitiesContainer, EntitiesGridItem, EntityFollowButton, EntityListItem, FaviconItem, type FilterChange, FilterPanel, FollowPostButton, FollowedCollectionsList, FollowedEntitiesList, FollowedItemsCard, FollowedTagsList, FollowedUsersList, type GridType, ImpactCard, LeftMenu, LeftMenuButton, LinkCard, MarkdownRenderer, ObsoleteBanner, ObsoleteModal, OpenLinkButton, PostForm, PostHighlightList, PostHighlightListContainer, PostHighlightListContent, PostListItem, PostsCard, PostsContainer, type PostsContainerProps, PostsGridItem, PostsTable, QetaContext, type QetaContextProps, type QetaEntitiesProps, type QetaOverrides, QetaProvider, QuestionCard, type QuestionFormValues, QuestionsTable, RankingButtons, RelativeTimeWithTooltip, SelectTemplateList, StatsChart, StatusChip, SuggestionsCard, type TagAndEntitiesFormValues, TagFollowButton, TagGridItem, TagListItem, TagsContainer, type TemplateFormValues, TemplateList, Timeline, TimelineItemCard, TopRankingUsers, TrophyIcon, UpdatedByLink, UserBadges, UserFollowButton, UserLink, UserListItem, type UserSettings, type UserSettingsHook, UsersContainer, UsersGridItem, ValidReviewModal, ViewToggle, type ViewType, WriteArticleButton, articleRouteRef, articlesRouteRef, askRouteRef, collectionCreateRouteRef, collectionEditRouteRef, collectionRouteRef, collectionsRouteRef, createLinkRouteRef, editArticleRouteRef, editLinkRouteRef, editQuestionRouteRef, entitiesRouteRef, entityRouteRef, favoriteQuestionsRouteRef, getEntityAuthorLoader, linkRouteRef, linksRouteRef, moderatorRouteRef, qetaApiRef, qetaRouteRef, qetaTranslationRef, qetaTranslations, questionRouteRef, questionsRouteRef, reviewRouteRef, settingsRouteRef, statisticsRouteRef, tagRouteRef, tagsRouteRef, useAI, useCanReview, useCollectionsFollow, useEntityAuthor, useEntityFollow, useFavicon, useFollow, useGridPageSize, useIdentityApi, useIsModerator, useListItemStyles, useQetaApi, useQetaContext, useQetaEntities, useTagsFollow, useUserFollow, useUserInfo, useUserSettings, useVoting, userRouteRef, usersRouteRef, writeRouteRef };
package/dist/index.esm.js CHANGED
@@ -23,6 +23,7 @@ export { CollectionFollowButton } from './components/Buttons/CollectionFollowBut
23
23
  export { ButtonContainer } from './components/Buttons/ButtonContainer.esm.js';
24
24
  export { ContentHeaderButton } from './components/Buttons/ContentHeaderButton.esm.js';
25
25
  export { RankingButtons } from './components/Buttons/RankingButtons.esm.js';
26
+ export { FollowPostButton } from './components/Buttons/FollowPostButton.esm.js';
26
27
  export { PostHighlightList, PostHighlightListContent } from './components/PostHighlightList/PostHighlightList.esm.js';
27
28
  export { PostHighlightListContainer } from './components/PostHighlightList/PostHighlightListContainer.esm.js';
28
29
  export { MarkdownRenderer } from './components/MarkdownRenderer/MarkdownRenderer.esm.js';
@@ -31,8 +32,10 @@ export { ObsoleteModal } from './components/Modals/ObsoleteModal.esm.js';
31
32
  export { ValidReviewModal } from './components/Modals/ValidReviewModal.esm.js';
32
33
  export { AnswerCard } from './components/AnswerCard/AnswerCard.esm.js';
33
34
  export { QuestionCard } from './components/QuestionCard/QuestionCard.esm.js';
34
- export { PostsCard } from './components/HomePageCards/PostsCard.esm.js';
35
35
  export { ImpactCard } from './components/HomePageCards/ImpactCard.esm.js';
36
+ export { PostsCard } from './components/HomePageCards/PostsCard.esm.js';
37
+ export { FollowedItemsCard } from './components/HomePageCards/FollowedItemsCard.esm.js';
38
+ export { CommunityActivityCard } from './components/HomePageCards/CommunityActivityCard.esm.js';
36
39
  export { FollowedEntitiesList } from './components/FollowedLists/FollowedEntitiesList.esm.js';
37
40
  export { FollowedTagsList } from './components/FollowedLists/FollowedTagsList.esm.js';
38
41
  export { FollowedCollectionsList } from './components/FollowedLists/FollowedCollectionsList.esm.js';
@@ -85,7 +88,7 @@ export { useListItemStyles } from './hooks/useListItemStyles.esm.js';
85
88
  export { useFollow } from './hooks/useFollow.esm.js';
86
89
  export { useTagsFollow } from './hooks/useTagsFollow.esm.js';
87
90
  export { useEntityFollow } from './hooks/useEntityFollow.esm.js';
88
- export { useEntityAuthor, useUserInfo } from './hooks/useEntityAuthor.esm.js';
91
+ export { getEntityAuthorLoader, useEntityAuthor, useUserInfo } from './hooks/useEntityAuthor.esm.js';
89
92
  export { useUserFollow } from './hooks/useUserFollow.esm.js';
90
93
  export { useIdentityApi } from './hooks/useIdentityApi.esm.js';
91
94
  export { useCollectionsFollow } from './hooks/useCollectionsFollow.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -28,6 +28,7 @@ const qetaTranslationRef = createTranslationRef({
28
28
  },
29
29
  common: {
30
30
  post: "post",
31
+ posts: "Posts",
31
32
  experts: "Experts",
32
33
  error: "Error",
33
34
  tagExpert: "This user is an expert in this area",
@@ -293,6 +294,10 @@ const qetaTranslationRef = createTranslationRef({
293
294
  createCollectionButton: {
294
295
  title: "Create a collection"
295
296
  },
297
+ followPostButton: {
298
+ follow: "By following this post, you will receive notifications when it is updated",
299
+ unfollow: "By unfollowing this post, you will no longer receive notifications when it is updated"
300
+ },
296
301
  commentList: {
297
302
  save: "Save",
298
303
  editLink: "edit",
@@ -484,12 +489,36 @@ const qetaTranslationRef = createTranslationRef({
484
489
  needsReview4: 'Can you verify "{{title}}" is still valid?',
485
490
  needsReview5: '"{{title}}" is due for a review'
486
491
  },
492
+ communityActivity: {
493
+ title: "Community Activity",
494
+ newPosts: "New Posts",
495
+ newAnswers: "New Answers",
496
+ newComments: "New Comments",
497
+ newVotes: "New Votes",
498
+ activeUsers: "Active Users",
499
+ views: "Views",
500
+ period: {
501
+ "1d": "Last 24h",
502
+ "3d": "Last 3 days",
503
+ "7d": "Last 7 days",
504
+ "14d": "Last 14 days",
505
+ "30d": "Last 30 days",
506
+ "90d": "Last 90 days",
507
+ "1y": "Last year"
508
+ }
509
+ },
487
510
  homePage: {
488
- title: "Home"
511
+ title: "Home",
512
+ followedItems: "Following",
513
+ noFollowedItems: "You are not following anything yet",
514
+ tags: "Tags",
515
+ entities: "Entities",
516
+ users: "Users",
517
+ collections: "Collections"
489
518
  },
490
519
  impactCard: {
491
520
  title: "Your impact",
492
- views: "views",
521
+ views: "views on your posts",
493
522
  error: "Failed to load impact data",
494
523
  contributions: "Your contributions helped {{lastWeek}} people this week",
495
524
  totalContributions: "Contributions",
@@ -516,11 +545,21 @@ const qetaTranslationRef = createTranslationRef({
516
545
  followedUsers: "Followed users",
517
546
  similarQuestions: "Similar questions",
518
547
  similarPosts: "Similar posts",
548
+ linkedPosts: "Linked posts",
549
+ recentlyViewed: "Recently viewed",
519
550
  expand: "Expand sidebar",
520
551
  collapse: "Collapse sidebar"
521
552
  },
522
553
  highlights: {
523
554
  loadError: "Failed to load questions",
555
+ hot: {
556
+ title: "Hot Posts",
557
+ noQuestionsLabel: "No hot posts"
558
+ },
559
+ recent: {
560
+ title: "Recently Viewed",
561
+ noQuestionsLabel: "No recently viewed posts"
562
+ },
524
563
  own: {
525
564
  title: "Your latest questions",
526
565
  noQuestionsLabel: "No questions"
@@ -544,6 +583,10 @@ const qetaTranslationRef = createTranslationRef({
544
583
  incorrect: {
545
584
  title: "Questions without correct answer",
546
585
  noQuestionsLabel: "No questions without correct answers"
586
+ },
587
+ followed: {
588
+ title: "Followed posts",
589
+ noQuestionsLabel: "No followed posts"
547
590
  }
548
591
  },
549
592
  questionsPage: {
@@ -917,6 +960,7 @@ const qetaTranslationRef = createTranslationRef({
917
960
  totalComments: "Total comments",
918
961
  totalVotes: "Total votes",
919
962
  totalUsers: "Total users",
963
+ activeUsers: "Active users",
920
964
  totalTags: "Total tags",
921
965
  totalArticles: "Total articles",
922
966
  totalLinks: "Total links",
@@ -924,7 +968,8 @@ const qetaTranslationRef = createTranslationRef({
924
968
  reputation: "Reputation",
925
969
  answerScore: "Answer score",
926
970
  postScore: "Post score",
927
- correctAnswers: "Correct answers"
971
+ correctAnswers: "Correct answers",
972
+ lastSeen: "Last seen"
928
973
  },
929
974
  collectionButton: {
930
975
  follow: "Follow",