@drodil/backstage-plugin-qeta-react 3.55.8 → 3.56.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 (38) hide show
  1. package/dist/components/CollectionsContainer/CollectionsContainer.esm.js +2 -1
  2. package/dist/components/CollectionsContainer/CollectionsContainer.esm.js.map +1 -1
  3. package/dist/components/FaviconItem/FaviconItem.esm.js +20 -13
  4. package/dist/components/FaviconItem/FaviconItem.esm.js.map +1 -1
  5. package/dist/components/FollowedLists/FollowedUsersList.esm.js +1 -0
  6. package/dist/components/FollowedLists/FollowedUsersList.esm.js.map +1 -1
  7. package/dist/components/Links/Links.esm.js +1 -0
  8. package/dist/components/Links/Links.esm.js.map +1 -1
  9. package/dist/components/PostHighlightList/PostHighlightList.esm.js +1 -0
  10. package/dist/components/PostHighlightList/PostHighlightList.esm.js.map +1 -1
  11. package/dist/components/PostsContainer/PostsContainer.esm.js +9 -1
  12. package/dist/components/PostsContainer/PostsContainer.esm.js.map +1 -1
  13. package/dist/components/PostsContainer/PostsGridItem.esm.js +6 -11
  14. package/dist/components/PostsContainer/PostsGridItem.esm.js.map +1 -1
  15. package/dist/components/TagsAndEntities/UserChip.esm.js +1 -0
  16. package/dist/components/TagsAndEntities/UserChip.esm.js.map +1 -1
  17. package/dist/components/Timeline/TimelineItem.esm.js +1 -0
  18. package/dist/components/Timeline/TimelineItem.esm.js.map +1 -1
  19. package/dist/components/UsersContainer/UserListItem.esm.js +1 -0
  20. package/dist/components/UsersContainer/UserListItem.esm.js.map +1 -1
  21. package/dist/components/UsersContainer/UsersGridItem.esm.js +1 -0
  22. package/dist/components/UsersContainer/UsersGridItem.esm.js.map +1 -1
  23. package/dist/hooks/useCollectionsFollow.esm.js +21 -45
  24. package/dist/hooks/useCollectionsFollow.esm.js.map +1 -1
  25. package/dist/hooks/useEntityFollow.esm.js +25 -36
  26. package/dist/hooks/useEntityFollow.esm.js.map +1 -1
  27. package/dist/hooks/useFavicon.esm.js +52 -0
  28. package/dist/hooks/useFavicon.esm.js.map +1 -0
  29. package/dist/hooks/useFollow.esm.js +62 -0
  30. package/dist/hooks/useFollow.esm.js.map +1 -0
  31. package/dist/hooks/useTagsFollow.esm.js +22 -39
  32. package/dist/hooks/useTagsFollow.esm.js.map +1 -1
  33. package/dist/hooks/useUserFollow.esm.js +22 -39
  34. package/dist/hooks/useUserFollow.esm.js.map +1 -1
  35. package/dist/index.d.ts +32 -13
  36. package/dist/index.esm.js +2 -0
  37. package/dist/index.esm.js.map +1 -1
  38. package/package.json +2 -2
@@ -1,50 +1,33 @@
1
- import { useState, useEffect, useCallback } from 'react';
1
+ import { useCallback } from 'react';
2
2
  import { useApi } from '@backstage/core-plugin-api';
3
3
  import { qetaApiRef } from '../api.esm.js';
4
+ import { useFollow } from './useFollow.esm.js';
4
5
 
5
- let followedTags = void 0;
6
6
  const useTagsFollow = () => {
7
- const [tags, setTags] = useState(followedTags ?? []);
8
- const [loading, setLoading] = useState(followedTags === void 0);
9
7
  const qetaApi = useApi(qetaApiRef);
10
- useEffect(() => {
11
- if (followedTags === void 0) {
12
- qetaApi.getFollowedTags().then((res) => {
13
- followedTags = res.tags;
14
- setTags(res.tags);
15
- setLoading(false);
16
- });
17
- } else {
18
- setTags(followedTags);
8
+ const { items, follow, unfollow, isFollowing, loading } = useFollow(
9
+ "tags",
10
+ {
11
+ fetchFollowed: useCallback(
12
+ () => qetaApi.getFollowedTags().then((res) => res.tags),
13
+ [qetaApi]
14
+ ),
15
+ followItem: useCallback(
16
+ (tag) => qetaApi.followTag(tag),
17
+ [qetaApi]
18
+ ),
19
+ unfollowItem: useCallback(
20
+ (tag) => qetaApi.unfollowTag(tag),
21
+ [qetaApi]
22
+ ),
23
+ isEqual: (a, b) => a === b
19
24
  }
20
- }, [qetaApi]);
21
- const followTag = useCallback(
22
- (tag) => {
23
- qetaApi.followTag(tag).then(() => {
24
- setTags((prev) => [...prev, tag]);
25
- followedTags?.push(tag);
26
- });
27
- },
28
- [qetaApi]
29
- );
30
- const unfollowTag = useCallback(
31
- (tag) => {
32
- qetaApi.unfollowTag(tag).then(() => {
33
- setTags((prev) => prev.filter((t) => t !== tag));
34
- followedTags = followedTags?.filter((t) => t !== tag);
35
- });
36
- },
37
- [qetaApi]
38
- );
39
- const isFollowingTag = useCallback(
40
- (tag) => tags.includes(tag),
41
- [tags]
42
25
  );
43
26
  return {
44
- tags,
45
- followTag,
46
- unfollowTag,
47
- isFollowingTag,
27
+ tags: items,
28
+ followTag: follow,
29
+ unfollowTag: unfollow,
30
+ isFollowingTag: isFollowing,
48
31
  loading
49
32
  };
50
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useTagsFollow.esm.js","sources":["../../src/hooks/useTagsFollow.ts"],"sourcesContent":["import { useState, useCallback, useEffect } from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { qetaApiRef } from '../api';\n\nlet followedTags: string[] | undefined = undefined;\n\nexport const useTagsFollow = () => {\n const [tags, setTags] = useState<string[]>(followedTags ?? []);\n const [loading, setLoading] = useState(followedTags === undefined);\n const qetaApi = useApi(qetaApiRef);\n\n useEffect(() => {\n if (followedTags === undefined) {\n qetaApi.getFollowedTags().then(res => {\n followedTags = res.tags;\n setTags(res.tags);\n setLoading(false);\n });\n } else {\n setTags(followedTags);\n }\n }, [qetaApi]);\n\n const followTag = useCallback(\n (tag: string) => {\n qetaApi.followTag(tag).then(() => {\n setTags(prev => [...prev, tag]);\n followedTags?.push(tag);\n });\n },\n [qetaApi],\n );\n\n const unfollowTag = useCallback(\n (tag: string) => {\n qetaApi.unfollowTag(tag).then(() => {\n setTags(prev => prev.filter(t => t !== tag));\n followedTags = followedTags?.filter(t => t !== tag);\n });\n },\n [qetaApi],\n );\n\n const isFollowingTag = useCallback(\n (tag: string) => tags.includes(tag),\n [tags],\n );\n return {\n tags,\n followTag,\n unfollowTag,\n isFollowingTag,\n loading,\n };\n};\n"],"names":[],"mappings":";;;;AAIA,IAAI,YAAqC,GAAA,KAAA,CAAA;AAElC,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,IAAI,QAAmB,CAAA,YAAA,IAAgB,EAAE,CAAA;AAC7D,EAAA,MAAM,CAAC,OAAS,EAAA,UAAU,CAAI,GAAA,QAAA,CAAS,iBAAiB,KAAS,CAAA,CAAA;AACjE,EAAM,MAAA,OAAA,GAAU,OAAO,UAAU,CAAA;AAEjC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,iBAAiB,KAAW,CAAA,EAAA;AAC9B,MAAQ,OAAA,CAAA,eAAA,EAAkB,CAAA,IAAA,CAAK,CAAO,GAAA,KAAA;AACpC,QAAA,YAAA,GAAe,GAAI,CAAA,IAAA;AACnB,QAAA,OAAA,CAAQ,IAAI,IAAI,CAAA;AAChB,QAAA,UAAA,CAAW,KAAK,CAAA;AAAA,OACjB,CAAA;AAAA,KACI,MAAA;AACL,MAAA,OAAA,CAAQ,YAAY,CAAA;AAAA;AACtB,GACF,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,SAAY,GAAA,WAAA;AAAA,IAChB,CAAC,GAAgB,KAAA;AACf,MAAA,OAAA,CAAQ,SAAU,CAAA,GAAG,CAAE,CAAA,IAAA,CAAK,MAAM;AAChC,QAAA,OAAA,CAAQ,CAAQ,IAAA,KAAA,CAAC,GAAG,IAAA,EAAM,GAAG,CAAC,CAAA;AAC9B,QAAA,YAAA,EAAc,KAAK,GAAG,CAAA;AAAA,OACvB,CAAA;AAAA,KACH;AAAA,IACA,CAAC,OAAO;AAAA,GACV;AAEA,EAAA,MAAM,WAAc,GAAA,WAAA;AAAA,IAClB,CAAC,GAAgB,KAAA;AACf,MAAA,OAAA,CAAQ,WAAY,CAAA,GAAG,CAAE,CAAA,IAAA,CAAK,MAAM;AAClC,QAAA,OAAA,CAAQ,UAAQ,IAAK,CAAA,MAAA,CAAO,CAAK,CAAA,KAAA,CAAA,KAAM,GAAG,CAAC,CAAA;AAC3C,QAAA,YAAA,GAAe,YAAc,EAAA,MAAA,CAAO,CAAK,CAAA,KAAA,CAAA,KAAM,GAAG,CAAA;AAAA,OACnD,CAAA;AAAA,KACH;AAAA,IACA,CAAC,OAAO;AAAA,GACV;AAEA,EAAA,MAAM,cAAiB,GAAA,WAAA;AAAA,IACrB,CAAC,GAAA,KAAgB,IAAK,CAAA,QAAA,CAAS,GAAG,CAAA;AAAA,IAClC,CAAC,IAAI;AAAA,GACP;AACA,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"useTagsFollow.esm.js","sources":["../../src/hooks/useTagsFollow.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { qetaApiRef } from '../api';\nimport { useFollow } from './useFollow';\n\nexport const useTagsFollow = () => {\n const qetaApi = useApi(qetaApiRef);\n\n const { items, follow, unfollow, isFollowing, loading } = useFollow<string>(\n 'tags',\n {\n fetchFollowed: useCallback(\n () => qetaApi.getFollowedTags().then(res => res.tags),\n [qetaApi],\n ),\n followItem: useCallback(\n (tag: string) => qetaApi.followTag(tag),\n [qetaApi],\n ),\n unfollowItem: useCallback(\n (tag: string) => qetaApi.unfollowTag(tag),\n [qetaApi],\n ),\n isEqual: (a, b) => a === b,\n },\n );\n\n return {\n tags: items,\n followTag: follow,\n unfollowTag: unfollow,\n isFollowingTag: 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,MAAA;AAAA,IACA;AAAA,MACE,aAAe,EAAA,WAAA;AAAA,QACb,MAAM,OAAQ,CAAA,eAAA,GAAkB,IAAK,CAAA,CAAA,GAAA,KAAO,IAAI,IAAI,CAAA;AAAA,QACpD,CAAC,OAAO;AAAA,OACV;AAAA,MACA,UAAY,EAAA,WAAA;AAAA,QACV,CAAC,GAAA,KAAgB,OAAQ,CAAA,SAAA,CAAU,GAAG,CAAA;AAAA,QACtC,CAAC,OAAO;AAAA,OACV;AAAA,MACA,YAAc,EAAA,WAAA;AAAA,QACZ,CAAC,GAAA,KAAgB,OAAQ,CAAA,WAAA,CAAY,GAAG,CAAA;AAAA,QACxC,CAAC,OAAO;AAAA,OACV;AAAA,MACA,OAAS,EAAA,CAAC,CAAG,EAAA,CAAA,KAAM,CAAM,KAAA;AAAA;AAC3B,GACF;AAEA,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,KAAA;AAAA,IACN,SAAW,EAAA,MAAA;AAAA,IACX,WAAa,EAAA,QAAA;AAAA,IACb,cAAgB,EAAA,WAAA;AAAA,IAChB;AAAA,GACF;AACF;;;;"}
@@ -1,50 +1,33 @@
1
- import { useState, useEffect, useCallback } from 'react';
1
+ import { useCallback } from 'react';
2
2
  import { useApi } from '@backstage/core-plugin-api';
3
3
  import { qetaApiRef } from '../api.esm.js';
4
+ import { useFollow } from './useFollow.esm.js';
4
5
 
5
- let followedUsers = void 0;
6
6
  const useUserFollow = () => {
7
- const [users, setUsers] = useState(followedUsers ?? []);
8
- const [loading, setLoading] = useState(followedUsers === void 0);
9
7
  const qetaApi = useApi(qetaApiRef);
10
- useEffect(() => {
11
- if (followedUsers === void 0) {
12
- qetaApi.getFollowedUsers().then((res) => {
13
- followedUsers = res.followedUserRefs;
14
- setUsers(res.followedUserRefs);
15
- setLoading(false);
16
- });
17
- } else {
18
- setUsers(followedUsers);
8
+ const { items, follow, unfollow, isFollowing, loading } = useFollow(
9
+ "users",
10
+ {
11
+ fetchFollowed: useCallback(
12
+ () => qetaApi.getFollowedUsers().then((res) => res.followedUserRefs),
13
+ [qetaApi]
14
+ ),
15
+ followItem: useCallback(
16
+ (user) => qetaApi.followUser(user),
17
+ [qetaApi]
18
+ ),
19
+ unfollowItem: useCallback(
20
+ (user) => qetaApi.unfollowUser(user),
21
+ [qetaApi]
22
+ ),
23
+ isEqual: (a, b) => a === b
19
24
  }
20
- }, [qetaApi]);
21
- const followUser = useCallback(
22
- (user) => {
23
- qetaApi.followUser(user).then(() => {
24
- setUsers((prev) => [...prev, user]);
25
- followedUsers?.push(user);
26
- });
27
- },
28
- [qetaApi]
29
- );
30
- const unfollowUser = useCallback(
31
- (user) => {
32
- qetaApi.unfollowUser(user).then(() => {
33
- setUsers((prev) => prev.filter((t) => t !== user));
34
- followedUsers = followedUsers?.filter((t) => t !== user);
35
- });
36
- },
37
- [qetaApi]
38
- );
39
- const isFollowingUser = useCallback(
40
- (user) => users.includes(user),
41
- [users]
42
25
  );
43
26
  return {
44
- users,
45
- followUser,
46
- unfollowUser,
47
- isFollowingUser,
27
+ users: items,
28
+ followUser: follow,
29
+ unfollowUser: unfollow,
30
+ isFollowingUser: isFollowing,
48
31
  loading
49
32
  };
50
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useUserFollow.esm.js","sources":["../../src/hooks/useUserFollow.ts"],"sourcesContent":["import { useState, useCallback, useEffect } from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { qetaApiRef } from '../api';\n\nlet followedUsers: string[] | undefined = undefined;\n\nexport const useUserFollow = () => {\n const [users, setUsers] = useState<string[]>(followedUsers ?? []);\n const [loading, setLoading] = useState(followedUsers === undefined);\n const qetaApi = useApi(qetaApiRef);\n\n useEffect(() => {\n if (followedUsers === undefined) {\n qetaApi.getFollowedUsers().then(res => {\n followedUsers = res.followedUserRefs;\n setUsers(res.followedUserRefs);\n setLoading(false);\n });\n } else {\n setUsers(followedUsers);\n }\n }, [qetaApi]);\n\n const followUser = useCallback(\n (user: string) => {\n qetaApi.followUser(user).then(() => {\n setUsers(prev => [...prev, user]);\n followedUsers?.push(user);\n });\n },\n [qetaApi],\n );\n\n const unfollowUser = useCallback(\n (user: string) => {\n qetaApi.unfollowUser(user).then(() => {\n setUsers(prev => prev.filter(t => t !== user));\n followedUsers = followedUsers?.filter(t => t !== user);\n });\n },\n [qetaApi],\n );\n\n const isFollowingUser = useCallback(\n (user: string) => users.includes(user),\n [users],\n );\n return {\n users,\n followUser,\n unfollowUser,\n isFollowingUser,\n loading,\n };\n};\n"],"names":[],"mappings":";;;;AAIA,IAAI,aAAsC,GAAA,KAAA,CAAA;AAEnC,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,CAAC,KAAO,EAAA,QAAQ,IAAI,QAAmB,CAAA,aAAA,IAAiB,EAAE,CAAA;AAChE,EAAA,MAAM,CAAC,OAAS,EAAA,UAAU,CAAI,GAAA,QAAA,CAAS,kBAAkB,KAAS,CAAA,CAAA;AAClE,EAAM,MAAA,OAAA,GAAU,OAAO,UAAU,CAAA;AAEjC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,kBAAkB,KAAW,CAAA,EAAA;AAC/B,MAAQ,OAAA,CAAA,gBAAA,EAAmB,CAAA,IAAA,CAAK,CAAO,GAAA,KAAA;AACrC,QAAA,aAAA,GAAgB,GAAI,CAAA,gBAAA;AACpB,QAAA,QAAA,CAAS,IAAI,gBAAgB,CAAA;AAC7B,QAAA,UAAA,CAAW,KAAK,CAAA;AAAA,OACjB,CAAA;AAAA,KACI,MAAA;AACL,MAAA,QAAA,CAAS,aAAa,CAAA;AAAA;AACxB,GACF,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,UAAa,GAAA,WAAA;AAAA,IACjB,CAAC,IAAiB,KAAA;AAChB,MAAA,OAAA,CAAQ,UAAW,CAAA,IAAI,CAAE,CAAA,IAAA,CAAK,MAAM;AAClC,QAAA,QAAA,CAAS,CAAQ,IAAA,KAAA,CAAC,GAAG,IAAA,EAAM,IAAI,CAAC,CAAA;AAChC,QAAA,aAAA,EAAe,KAAK,IAAI,CAAA;AAAA,OACzB,CAAA;AAAA,KACH;AAAA,IACA,CAAC,OAAO;AAAA,GACV;AAEA,EAAA,MAAM,YAAe,GAAA,WAAA;AAAA,IACnB,CAAC,IAAiB,KAAA;AAChB,MAAA,OAAA,CAAQ,YAAa,CAAA,IAAI,CAAE,CAAA,IAAA,CAAK,MAAM;AACpC,QAAA,QAAA,CAAS,UAAQ,IAAK,CAAA,MAAA,CAAO,CAAK,CAAA,KAAA,CAAA,KAAM,IAAI,CAAC,CAAA;AAC7C,QAAA,aAAA,GAAgB,aAAe,EAAA,MAAA,CAAO,CAAK,CAAA,KAAA,CAAA,KAAM,IAAI,CAAA;AAAA,OACtD,CAAA;AAAA,KACH;AAAA,IACA,CAAC,OAAO;AAAA,GACV;AAEA,EAAA,MAAM,eAAkB,GAAA,WAAA;AAAA,IACtB,CAAC,IAAA,KAAiB,KAAM,CAAA,QAAA,CAAS,IAAI,CAAA;AAAA,IACrC,CAAC,KAAK;AAAA,GACR;AACA,EAAO,OAAA;AAAA,IACL,KAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
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;;;;"}
package/dist/index.d.ts CHANGED
@@ -132,6 +132,7 @@ declare const ViewToggle: ({ view, onChange }: ViewToggleProps) => react_jsx_run
132
132
  type PostsContainerProps = {
133
133
  type?: PostType;
134
134
  tags?: string[];
135
+ tagsRelation?: 'and' | 'or';
135
136
  author?: string;
136
137
  showFilters?: boolean;
137
138
  showTitle?: boolean;
@@ -144,6 +145,8 @@ type PostsContainerProps = {
144
145
  collectionId?: number;
145
146
  initialPageSize?: number;
146
147
  entity?: string;
148
+ entities?: string[];
149
+ entitiesRelation?: 'and' | 'or';
147
150
  filterPanelProps?: CommonFilterPanelProps;
148
151
  showTypeLabel?: boolean;
149
152
  allowRanking?: boolean;
@@ -643,19 +646,33 @@ declare function useVoting(resp: PostResponse | AnswerResponse): {
643
646
 
644
647
  declare const useListItemStyles: (props?: any) => _material_ui_styles.ClassNameMap<"root">;
645
648
 
649
+ interface UseFollowOptions<T> {
650
+ fetchFollowed: () => Promise<T[]>;
651
+ followItem: (item: T) => Promise<unknown>;
652
+ unfollowItem: (item: T) => Promise<unknown>;
653
+ isEqual: (a: T, b: T) => boolean;
654
+ }
655
+ declare const useFollow: <T>(key: string, options: UseFollowOptions<T>) => {
656
+ items: T[];
657
+ follow: (item: T) => void;
658
+ unfollow: (item: T) => void;
659
+ isFollowing: (item: T) => boolean;
660
+ loading: boolean;
661
+ };
662
+
646
663
  declare const useTagsFollow: () => {
647
664
  tags: string[];
648
- followTag: (tag: string) => void;
649
- unfollowTag: (tag: string) => void;
650
- isFollowingTag: (tag: string) => boolean;
665
+ followTag: (item: string) => void;
666
+ unfollowTag: (item: string) => void;
667
+ isFollowingTag: (item: string) => boolean;
651
668
  loading: boolean;
652
669
  };
653
670
 
654
671
  declare const useEntityFollow: () => {
655
672
  entities: string[];
656
- followEntity: (entityRef: string) => void;
657
- unfollowEntity: (entityRef: string) => void;
658
- isFollowingEntity: (entityRef: string) => boolean;
673
+ followEntity: (item: string) => void;
674
+ unfollowEntity: (item: string) => void;
675
+ isFollowingEntity: (item: string) => boolean;
659
676
  loading: boolean;
660
677
  };
661
678
 
@@ -678,9 +695,9 @@ declare const useEntityAuthor: (entity: PostResponse | AnswerResponse | Collecti
678
695
 
679
696
  declare const useUserFollow: () => {
680
697
  users: string[];
681
- followUser: (user: string) => void;
682
- unfollowUser: (user: string) => void;
683
- isFollowingUser: (user: string) => boolean;
698
+ followUser: (item: string) => void;
699
+ unfollowUser: (item: string) => void;
700
+ isFollowingUser: (item: string) => boolean;
684
701
  loading: boolean;
685
702
  };
686
703
 
@@ -688,9 +705,9 @@ declare function useIdentityApi<T>(f: (api: IdentityApi) => Promise<T>, deps?: a
688
705
 
689
706
  declare const useCollectionsFollow: () => {
690
707
  collections: Collection[];
691
- followCollection: (collection: Collection) => void;
692
- unfollowCollection: (collection: Collection) => void;
693
- isFollowingCollection: (collection: Collection) => boolean;
708
+ followCollection: (item: Collection) => void;
709
+ unfollowCollection: (item: Collection) => void;
710
+ isFollowingCollection: (item: Collection) => boolean;
694
711
  loading: boolean;
695
712
  };
696
713
 
@@ -778,6 +795,8 @@ type UserSettingsHook = {
778
795
  };
779
796
  declare const useUserSettings: () => UserSettingsHook;
780
797
 
798
+ declare const useFavicon: (url?: string) => string | undefined;
799
+
781
800
  /** @alpha */
782
801
  declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"qeta", {
783
802
  readonly "answer.questionTitle": "Q: {{question}}";
@@ -1491,4 +1510,4 @@ type QetaOverrides = Overrides & {
1491
1510
  [Name in keyof QetaComponentsNameToClassKey]?: Partial<StyleRules<QetaComponentsNameToClassKey[Name]>>;
1492
1511
  };
1493
1512
 
1494
- 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, useGridPageSize, useIdentityApi, useIsModerator, useListItemStyles, useQetaApi, useQetaContext, useQetaEntities, useTagsFollow, useUserFollow, useUserInfo, useUserSettings, useVoting, userRouteRef, usersRouteRef, writeRouteRef };
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 };
package/dist/index.esm.js CHANGED
@@ -82,6 +82,7 @@ export { ViewToggle } from './components/ViewToggle/ViewToggle.esm.js';
82
82
  export { useQetaApi } from './hooks/useQetaApi.esm.js';
83
83
  export { useVoting } from './hooks/useVoting.esm.js';
84
84
  export { useListItemStyles } from './hooks/useListItemStyles.esm.js';
85
+ export { useFollow } from './hooks/useFollow.esm.js';
85
86
  export { useTagsFollow } from './hooks/useTagsFollow.esm.js';
86
87
  export { useEntityFollow } from './hooks/useEntityFollow.esm.js';
87
88
  export { useEntityAuthor, useUserInfo } from './hooks/useEntityAuthor.esm.js';
@@ -94,5 +95,6 @@ export { useCanReview } from './hooks/useCanReview.esm.js';
94
95
  export { useGridPageSize } from './hooks/useGridPageSize.esm.js';
95
96
  export { useQetaEntities } from './hooks/useQetaEntities.esm.js';
96
97
  export { useUserSettings } from './hooks/useUserSettings.esm.js';
98
+ export { useFavicon } from './hooks/useFavicon.esm.js';
97
99
  export { qetaTranslationRef, qetaTranslations } from './translation.esm.js';
98
100
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "frontend",
8
8
  "backstage.io"
9
9
  ],
10
- "version": "3.55.8",
10
+ "version": "3.56.1",
11
11
  "main": "dist/index.esm.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "prepublishOnly": "yarn tsc && yarn build",
@@ -57,7 +57,7 @@
57
57
  "@backstage/plugin-permission-common": "^0.9.4",
58
58
  "@backstage/plugin-permission-react": "^0.4.39",
59
59
  "@backstage/plugin-signals-react": "^0.0.18",
60
- "@drodil/backstage-plugin-qeta-common": "^3.55.8",
60
+ "@drodil/backstage-plugin-qeta-common": "^3.56.1",
61
61
  "@jsdevtools/rehype-toc": "^3.0.2",
62
62
  "@material-ui/core": "^4.12.2",
63
63
  "@material-ui/icons": "^4.11.3",