@apolitical/component-library 5.2.1-jc.4 → 5.2.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.
- package/communities/members-list/index.d.ts +2 -0
- package/communities/members-list/members-list.constants.d.ts +1 -0
- package/communities/members-list/members-list.d.ts +6 -2
- package/discussion/components/likes/components/index.d.ts +1 -0
- package/discussion/components/likes/components/likes-modal/index.d.ts +1 -0
- package/discussion/components/likes/components/likes-modal/likes-modal.d.ts +17 -0
- package/discussion/components/likes/index.d.ts +1 -0
- package/discussion/components/likes/likes.d.ts +14 -3
- package/discussion/components/likes/likes.mock.d.ts +2 -0
- package/discussion/components/likes/mocks/index.d.ts +1 -0
- package/discussion/components/likes/mocks/likes-response.mock.d.ts +64 -0
- package/discussion/components/likes/tooltip.hook.d.ts +5 -0
- package/discussion/components/post/index.d.ts +1 -0
- package/discussion/components/post/post.d.ts +17 -6
- package/discussion/components/post/post.mock.d.ts +64 -0
- package/discussion/discussion.helpers.d.ts +1 -1
- package/discussion/feeds/activities-feed/activities-feed.d.ts +2 -0
- package/discussion/feeds/activities-feed/cache/cache.helper.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/edit/edit.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/like/like.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/list/list.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/remove/remove.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/unlike/unlike.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/index.d.ts +0 -1
- package/discussion/feeds/activities-feed/mocks/activities-feed.mock.d.ts +75 -1
- package/discussion/feeds/index.d.ts +1 -0
- package/discussion/feeds/likes-feed/cache/cache.interface.d.ts +11 -0
- package/discussion/feeds/likes-feed/cache/hooks/feed/feed.hook.d.ts +20 -0
- package/discussion/feeds/likes-feed/cache/hooks/feed/index.d.ts +1 -0
- package/discussion/feeds/likes-feed/cache/hooks/index.d.ts +2 -0
- package/discussion/feeds/likes-feed/cache/hooks/list/index.d.ts +1 -0
- package/discussion/feeds/likes-feed/cache/hooks/list/list.hook.d.ts +16 -0
- package/discussion/feeds/likes-feed/cache/index.d.ts +2 -0
- package/discussion/feeds/likes-feed/index.d.ts +3 -0
- package/discussion/feeds/likes-feed/likes-feed.d.ts +16 -0
- package/discussion/feeds/replies-feed/cache/cache.helper.d.ts +2 -2
- package/discussion/feeds/replies-feed/cache/hooks/edit/edit.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/like/like.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/list/list.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/remove/remove.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/unlike/unlike.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/nested-replies-feed/nested-replies-feed.d.ts +7 -1
- package/discussion/feeds/replies-feed/replies-feed.d.ts +14 -10
- package/discussion/index.d.ts +2 -1
- package/discussion/sections/activity-section/activity-section.d.ts +2 -0
- package/discussion/sections/activity-section/cache/hooks/read/read.hook.d.ts +1 -1
- package/discussion/shared/helpers/cache.helper.d.ts +25 -0
- package/discussion/shared/helpers/index.d.ts +1 -0
- package/discussion/shared/interfaces/activity.interface.d.ts +2 -1
- package/discussion/shared/interfaces/discussion.interface.d.ts +84 -0
- package/discussion/shared/interfaces/index.d.ts +1 -0
- package/general/link/link.d.ts +2 -2
- package/general/responsive-image/responsive-image.helpers.d.ts +10 -1
- package/helpers/intl.d.ts +1 -1
- package/index.js +61 -61
- package/index.mjs +8783 -8619
- package/package.json +4 -1
- package/sections/full-width-section/full-width-section.d.ts +0 -2
- package/style.css +1 -1
- package/styles/variables/colors/_colors.scss +0 -2
- package/styles/variables/colors/theme/_base.scss +1 -1
- package/styles/variables/colors/theme/_general.scss +1 -0
- package/styles/variables/colors/theme/_layout.scss +1 -1
- package/text/helper-text-box/helper-text-box.d.ts +2 -2
- package/text/helper-text-box/index.d.ts +1 -0
- package/user/index.d.ts +2 -0
- package/user/member/member.d.ts +3 -0
- package/user/member/member.helpers.d.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MEMBERS_PER_PAGE = 25;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IProfileFormProps } from '../../form';
|
|
2
2
|
import { MemberDetailsProps } from '../../user';
|
|
3
|
-
interface CommunityMemberProps extends MemberDetailsProps {
|
|
3
|
+
export interface CommunityMemberProps extends MemberDetailsProps {
|
|
4
4
|
/** Whether the user is an admin of the community or not */
|
|
5
5
|
isAdmin?: boolean;
|
|
6
6
|
}
|
|
@@ -23,8 +23,12 @@ interface Props {
|
|
|
23
23
|
gtmContext?: string;
|
|
24
24
|
/** The GTM event to use */
|
|
25
25
|
gtmType?: string;
|
|
26
|
+
/** Whether to show the header */
|
|
27
|
+
showHeader?: boolean;
|
|
28
|
+
/** Whether to show placeholders */
|
|
29
|
+
showPlaceholders?: boolean;
|
|
26
30
|
/** Additional classes */
|
|
27
31
|
className?: string;
|
|
28
32
|
}
|
|
29
|
-
declare const MembersList: ({ members: { data, total }, communitySlug, isMember, hasNextPage, loadNextPage, profile, gtmContext, gtmType, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
33
|
+
declare const MembersList: ({ members: { data, total }, communitySlug, isMember, hasNextPage, loadNextPage, profile, gtmContext, gtmType, showHeader, showPlaceholders, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
30
34
|
export default MembersList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './likes-modal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LikesModal } from './likes-modal';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ILikesFeedProps, ILikesFeedQueryFns } from '../../../../../discussion/feeds';
|
|
2
|
+
export interface ILikesModalProps extends ILikesFeedProps {
|
|
3
|
+
/** Whether the modal is open on page load */
|
|
4
|
+
showModal?: boolean;
|
|
5
|
+
/** Functions used inside the modal */
|
|
6
|
+
functions: {
|
|
7
|
+
likes: {
|
|
8
|
+
list: ILikesFeedQueryFns['list'];
|
|
9
|
+
};
|
|
10
|
+
/** Function to call when the modal is closed */
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
};
|
|
13
|
+
/** Additional classes */
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const LikesModal: ({ showModal, activityId, functions: { onClose, likes: likesFns }, likeCount, className, basePath, parentId, }: ILikesModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default LikesModal;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MemberProps } from '../../../user';
|
|
2
|
+
import { IBadgesOption, MemberProps } from '../../../user';
|
|
3
3
|
import { IDiscussionContent } from './../../discussion';
|
|
4
|
+
import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
4
5
|
interface Props {
|
|
5
6
|
/** The element to render around the content */
|
|
6
7
|
element?: 'li' | 'div';
|
|
@@ -16,17 +17,27 @@ interface Props {
|
|
|
16
17
|
content?: IDiscussionContent;
|
|
17
18
|
/** If the user is able to like the content */
|
|
18
19
|
canLike?: boolean;
|
|
20
|
+
/** The ID of the activity */
|
|
21
|
+
activityId: string;
|
|
22
|
+
/** The base path, used for slugs */
|
|
23
|
+
basePath: string;
|
|
24
|
+
/** The ID of the parent, used for slugs */
|
|
25
|
+
parentId: string;
|
|
26
|
+
/** Whether to show badges and the scope of the badge */
|
|
27
|
+
badges: IBadgesOption | undefined;
|
|
19
28
|
/** Functions to handle liking and unliking */
|
|
20
|
-
functions
|
|
29
|
+
functions: {
|
|
21
30
|
/** Function to create a like */
|
|
22
31
|
createLike?: (args1: object) => void;
|
|
23
32
|
/** Function to delete a like */
|
|
24
33
|
deleteLike?: (args: object) => void;
|
|
34
|
+
/** Functions for the likes query */
|
|
35
|
+
listLikes?: ILikesFeedQueryFns['list'];
|
|
25
36
|
};
|
|
26
37
|
/** The language to use for the text */
|
|
27
38
|
locale?: string;
|
|
28
39
|
}
|
|
29
|
-
declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, functions: { createLike, deleteLike }, }: Props) => React.DetailedReactHTMLElement<{
|
|
40
|
+
declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, activityId, basePath, parentId, badges, functions: { createLike, deleteLike, listLikes, }, }: Props) => React.DetailedReactHTMLElement<{
|
|
30
41
|
className: string;
|
|
31
42
|
onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
32
43
|
onMouseEnter: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './likes-response.mock';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const likesResponseMock: {
|
|
2
|
+
results: ({
|
|
3
|
+
created_at: string;
|
|
4
|
+
updated_at: string;
|
|
5
|
+
id: string;
|
|
6
|
+
user_id: string;
|
|
7
|
+
user: {
|
|
8
|
+
id: string;
|
|
9
|
+
data: {
|
|
10
|
+
name: string;
|
|
11
|
+
thumbnail: string;
|
|
12
|
+
jobTitle: string;
|
|
13
|
+
organization: string;
|
|
14
|
+
badges: {
|
|
15
|
+
communities: {
|
|
16
|
+
'endor-alumni': string[];
|
|
17
|
+
};
|
|
18
|
+
platform?: undefined;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
created_at?: undefined;
|
|
22
|
+
updated_at?: undefined;
|
|
23
|
+
};
|
|
24
|
+
kind: string;
|
|
25
|
+
activity_id: string;
|
|
26
|
+
data: {
|
|
27
|
+
mentioned_users: null;
|
|
28
|
+
};
|
|
29
|
+
parent: string;
|
|
30
|
+
latest_children: {};
|
|
31
|
+
children_counts: {};
|
|
32
|
+
} | {
|
|
33
|
+
created_at: string;
|
|
34
|
+
updated_at: string;
|
|
35
|
+
id: string;
|
|
36
|
+
user_id: string;
|
|
37
|
+
user: {
|
|
38
|
+
created_at: string;
|
|
39
|
+
updated_at: string;
|
|
40
|
+
id: string;
|
|
41
|
+
data: {
|
|
42
|
+
jobTitle: string;
|
|
43
|
+
name: string;
|
|
44
|
+
organization: string;
|
|
45
|
+
thumbnail: string;
|
|
46
|
+
badges: {
|
|
47
|
+
platform: {
|
|
48
|
+
all: string[];
|
|
49
|
+
};
|
|
50
|
+
communities?: undefined;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
kind: string;
|
|
55
|
+
activity_id: string;
|
|
56
|
+
data: {
|
|
57
|
+
mentioned_users: null;
|
|
58
|
+
};
|
|
59
|
+
parent: string;
|
|
60
|
+
latest_children: {};
|
|
61
|
+
children_counts: {};
|
|
62
|
+
})[];
|
|
63
|
+
next: string;
|
|
64
|
+
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ListMembers
|
|
3
|
-
import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction,
|
|
2
|
+
import { ClickMentionFallback, type ListMembers } from '../../../form';
|
|
3
|
+
import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, DiscussionListLikesFunction } from '../../discussion';
|
|
4
|
+
import type { IForceHide, IFullDiscussionContent } from '../../shared/interfaces';
|
|
4
5
|
import { IBadgesOption } from '../../../user/badges';
|
|
5
|
-
interface
|
|
6
|
+
export interface IPostContent extends IFullDiscussionContent {
|
|
6
7
|
/** The post body */
|
|
7
8
|
postBody?: string;
|
|
9
|
+
/** Custom message to pass through to the Member component */
|
|
10
|
+
memberCustomMessage?: string;
|
|
8
11
|
}
|
|
9
|
-
interface
|
|
12
|
+
export interface IDiscussionPostProps {
|
|
10
13
|
/** The element that will render around the content */
|
|
11
14
|
element?: 'li' | 'div' | 'section' | 'article';
|
|
12
15
|
/** Information about the content being posted */
|
|
13
|
-
content:
|
|
16
|
+
content: IPostContent;
|
|
14
17
|
/** If the user has permission to interact with the post box and content, e.g. if they're a member of the community */
|
|
15
18
|
userHasPermissions?: boolean;
|
|
16
19
|
/** If the user has owner permissions, e.g. if they're a community owner */
|
|
@@ -36,6 +39,8 @@ interface Props {
|
|
|
36
39
|
createLike: DiscussionCreateLikeFunction;
|
|
37
40
|
/** Delete a like on the post */
|
|
38
41
|
deleteLike: DiscussionDeleteLikeFunction;
|
|
42
|
+
/** List the likes on the post */
|
|
43
|
+
listLikes: DiscussionListLikesFunction;
|
|
39
44
|
};
|
|
40
45
|
comments: {
|
|
41
46
|
/** Open comments on a post */
|
|
@@ -73,6 +78,8 @@ interface Props {
|
|
|
73
78
|
styling?: {
|
|
74
79
|
/** Option of whether or not to show the copy link button */
|
|
75
80
|
showShareLinkButton?: boolean;
|
|
81
|
+
/** Option of whether or not to show the more menu button */
|
|
82
|
+
showMoreMenuButton?: boolean;
|
|
76
83
|
};
|
|
77
84
|
/** If the browser should focus on this post */
|
|
78
85
|
setFocus?: boolean;
|
|
@@ -80,6 +87,10 @@ interface Props {
|
|
|
80
87
|
isCommunity?: boolean;
|
|
81
88
|
/** Whether to show badges and the scope of the badge */
|
|
82
89
|
badges?: IBadgesOption;
|
|
90
|
+
/** The base path, used for slugs */
|
|
91
|
+
basePath: string;
|
|
92
|
+
/** The ID of the parent, used for slugs */
|
|
93
|
+
parentId: string;
|
|
83
94
|
}
|
|
84
|
-
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton }, setFocus, isCommunity, badges, }:
|
|
95
|
+
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton, showMoreMenuButton }, setFocus, isCommunity, badges, basePath, parentId, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
85
96
|
export default Post;
|
|
@@ -9,6 +9,70 @@ declare namespace _default {
|
|
|
9
9
|
namespace likes {
|
|
10
10
|
function createLike(): void;
|
|
11
11
|
function deleteLike(): void;
|
|
12
|
+
function listLikes(): Promise<{
|
|
13
|
+
results: ({
|
|
14
|
+
created_at: string;
|
|
15
|
+
updated_at: string;
|
|
16
|
+
id: string;
|
|
17
|
+
user_id: string;
|
|
18
|
+
user: {
|
|
19
|
+
id: string;
|
|
20
|
+
data: {
|
|
21
|
+
name: string;
|
|
22
|
+
thumbnail: string;
|
|
23
|
+
jobTitle: string;
|
|
24
|
+
organization: string;
|
|
25
|
+
badges: {
|
|
26
|
+
communities: {
|
|
27
|
+
'endor-alumni': string[];
|
|
28
|
+
};
|
|
29
|
+
platform?: undefined;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
created_at?: undefined;
|
|
33
|
+
updated_at?: undefined;
|
|
34
|
+
};
|
|
35
|
+
kind: string;
|
|
36
|
+
activity_id: string;
|
|
37
|
+
data: {
|
|
38
|
+
mentioned_users: null;
|
|
39
|
+
};
|
|
40
|
+
parent: string;
|
|
41
|
+
latest_children: {};
|
|
42
|
+
children_counts: {};
|
|
43
|
+
} | {
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
id: string;
|
|
47
|
+
user_id: string;
|
|
48
|
+
user: {
|
|
49
|
+
created_at: string;
|
|
50
|
+
updated_at: string;
|
|
51
|
+
id: string;
|
|
52
|
+
data: {
|
|
53
|
+
jobTitle: string;
|
|
54
|
+
name: string;
|
|
55
|
+
organization: string;
|
|
56
|
+
thumbnail: string;
|
|
57
|
+
badges: {
|
|
58
|
+
platform: {
|
|
59
|
+
all: string[];
|
|
60
|
+
};
|
|
61
|
+
communities?: undefined;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
kind: string;
|
|
66
|
+
activity_id: string;
|
|
67
|
+
data: {
|
|
68
|
+
mentioned_users: null;
|
|
69
|
+
};
|
|
70
|
+
parent: string;
|
|
71
|
+
latest_children: {};
|
|
72
|
+
children_counts: {};
|
|
73
|
+
})[];
|
|
74
|
+
next: string;
|
|
75
|
+
}>;
|
|
12
76
|
}
|
|
13
77
|
namespace comments {
|
|
14
78
|
function openComments(): void;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { type IProfileFormProps } from '../../../form';
|
|
3
3
|
import type { IMentionsFns } from '../../../discussion/discussion.d';
|
|
4
4
|
import type { IQueryFns } from './cache';
|
|
5
|
+
import type { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
5
6
|
interface Props {
|
|
6
7
|
/** The base path, used for slugs */
|
|
7
8
|
basePath: string;
|
|
@@ -21,6 +22,7 @@ interface Props {
|
|
|
21
22
|
join: () => Promise<void>;
|
|
22
23
|
/** Function to leave the community */
|
|
23
24
|
leave: () => Promise<void>;
|
|
25
|
+
likes: ILikesFeedQueryFns;
|
|
24
26
|
};
|
|
25
27
|
/** Props to pass into the profile form */
|
|
26
28
|
profile: IProfileFormProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ICache, ICacheItem, ICacheItems } from './cache.interface';
|
|
2
2
|
export declare function addItem(item: ICacheItem, cache?: ICache, replace?: boolean): ICache;
|
|
3
|
-
export declare function findItem(itemId: string, cache?: ICache): import("
|
|
3
|
+
export declare function findItem(itemId: string, cache?: ICache): import("../../..").IActivity | undefined;
|
|
4
4
|
export declare function removeItem(itemId: string, cache: ICache): ICache;
|
|
5
5
|
export declare function flattenCache(cache?: ICache): ICacheItems;
|
|
@@ -4,5 +4,5 @@ interface IEditVars {
|
|
|
4
4
|
activityId: string;
|
|
5
5
|
content: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function useEditActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
7
|
+
export declare function useEditActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, }: IMutationContext<ICacheItem, Error, IEditVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IActivity, Error, IEditVars, ICache>;
|
|
8
8
|
export {};
|
|
@@ -4,5 +4,5 @@ interface ILikeVars {
|
|
|
4
4
|
activityId: string;
|
|
5
5
|
reactionId?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function useLikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
7
|
+
export declare function useLikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, queryClient, queryKey, }: IMutationContext<ICacheSubitem, Error, ILikeVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IReaction, Error, ILikeVars, ICache>;
|
|
8
8
|
export {};
|
|
@@ -6,7 +6,7 @@ export interface IListActivitiesArgs {
|
|
|
6
6
|
rankingMethod?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare function useListActivities({ queryFn, queryKey, rankingMethod, }: IListActivitiesArgs): {
|
|
9
|
-
activities: import(
|
|
9
|
+
activities: import('../../../../../../discussion/shared').IActivity[];
|
|
10
10
|
error: Error | null;
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
hasNextPage: boolean;
|
|
@@ -3,5 +3,5 @@ import type { ICache } from '../..';
|
|
|
3
3
|
interface IRemoveVars {
|
|
4
4
|
activityId: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function useRemoveActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
6
|
+
export declare function useRemoveActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, }: IMutationContext<void, Error, IRemoveVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<void, Error, IRemoveVars, ICache>;
|
|
7
7
|
export {};
|
|
@@ -4,5 +4,5 @@ interface IUnlikeVars {
|
|
|
4
4
|
activityId: string;
|
|
5
5
|
reactionId?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function useUnlikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
7
|
+
export declare function useUnlikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, user, }: IMutationContext<unknown, Error, IUnlikeVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, Error, IUnlikeVars, ICache>;
|
|
8
8
|
export {};
|
|
@@ -46,6 +46,55 @@ export declare const activitiesFeedMock: {
|
|
|
46
46
|
latest_children: {};
|
|
47
47
|
children_counts: {};
|
|
48
48
|
}[];
|
|
49
|
+
like: ({
|
|
50
|
+
created_at: string;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
id: string;
|
|
53
|
+
user_id: string;
|
|
54
|
+
user: {
|
|
55
|
+
id: string;
|
|
56
|
+
data: {
|
|
57
|
+
name: string;
|
|
58
|
+
thumbnail: string;
|
|
59
|
+
jobTitle: string;
|
|
60
|
+
organization: string;
|
|
61
|
+
};
|
|
62
|
+
created_at?: undefined;
|
|
63
|
+
updated_at?: undefined;
|
|
64
|
+
};
|
|
65
|
+
kind: string;
|
|
66
|
+
activity_id: string;
|
|
67
|
+
data: {
|
|
68
|
+
mentioned_users: null;
|
|
69
|
+
};
|
|
70
|
+
parent: string;
|
|
71
|
+
latest_children: {};
|
|
72
|
+
children_counts: {};
|
|
73
|
+
} | {
|
|
74
|
+
created_at: string;
|
|
75
|
+
updated_at: string;
|
|
76
|
+
id: string;
|
|
77
|
+
user_id: string;
|
|
78
|
+
user: {
|
|
79
|
+
created_at: string;
|
|
80
|
+
updated_at: string;
|
|
81
|
+
id: string;
|
|
82
|
+
data: {
|
|
83
|
+
jobTitle: string;
|
|
84
|
+
name: string;
|
|
85
|
+
organization: string;
|
|
86
|
+
thumbnail: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
kind: string;
|
|
90
|
+
activity_id: string;
|
|
91
|
+
data: {
|
|
92
|
+
mentioned_users: null;
|
|
93
|
+
};
|
|
94
|
+
parent: string;
|
|
95
|
+
latest_children: {};
|
|
96
|
+
children_counts: {};
|
|
97
|
+
})[];
|
|
49
98
|
};
|
|
50
99
|
latest_reactions_extra: {};
|
|
51
100
|
object: string;
|
|
@@ -81,6 +130,7 @@ export declare const activitiesFeedMock: {
|
|
|
81
130
|
id: string;
|
|
82
131
|
latest_reactions: {
|
|
83
132
|
pin?: undefined;
|
|
133
|
+
like?: undefined;
|
|
84
134
|
};
|
|
85
135
|
latest_reactions_extra: {};
|
|
86
136
|
object: string;
|
|
@@ -110,6 +160,29 @@ export declare const activitiesFeedMock: {
|
|
|
110
160
|
foreign_id: string;
|
|
111
161
|
id: string;
|
|
112
162
|
latest_reactions: {
|
|
163
|
+
like: {
|
|
164
|
+
created_at: string;
|
|
165
|
+
updated_at: string;
|
|
166
|
+
id: string;
|
|
167
|
+
user_id: string;
|
|
168
|
+
user: {
|
|
169
|
+
id: string;
|
|
170
|
+
data: {
|
|
171
|
+
name: string;
|
|
172
|
+
thumbnail: string;
|
|
173
|
+
jobTitle: string;
|
|
174
|
+
organization: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
kind: string;
|
|
178
|
+
activity_id: string;
|
|
179
|
+
data: {
|
|
180
|
+
mentioned_users: null;
|
|
181
|
+
};
|
|
182
|
+
parent: string;
|
|
183
|
+
latest_children: {};
|
|
184
|
+
children_counts: {};
|
|
185
|
+
}[];
|
|
113
186
|
pin?: undefined;
|
|
114
187
|
};
|
|
115
188
|
latest_reactions_extra: {};
|
|
@@ -117,7 +190,7 @@ export declare const activitiesFeedMock: {
|
|
|
117
190
|
origin: null;
|
|
118
191
|
own_reactions: {};
|
|
119
192
|
reaction_counts: {
|
|
120
|
-
like
|
|
193
|
+
like: number;
|
|
121
194
|
pin?: undefined;
|
|
122
195
|
};
|
|
123
196
|
target: string;
|
|
@@ -143,6 +216,7 @@ export declare const activitiesFeedMock: {
|
|
|
143
216
|
id: string;
|
|
144
217
|
latest_reactions: {
|
|
145
218
|
pin?: undefined;
|
|
219
|
+
like?: undefined;
|
|
146
220
|
};
|
|
147
221
|
latest_reactions_extra: {};
|
|
148
222
|
object: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InfiniteData } from '@tanstack/query-core';
|
|
2
|
+
import type { ReactionFilterAPIResponse } from 'getstream';
|
|
3
|
+
import type { IReaction } from '../../../../discussion/shared';
|
|
4
|
+
export type ICache = InfiniteData<ICachePage, string>;
|
|
5
|
+
export type ICachePage = ExtendedReactionFilterAPIResponse;
|
|
6
|
+
export type ICacheItems = ICacheItem[];
|
|
7
|
+
type ICacheItem = IReaction;
|
|
8
|
+
interface ExtendedReactionFilterAPIResponse extends ReactionFilterAPIResponse {
|
|
9
|
+
results: IReaction[];
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QueryKey } from '@tanstack/react-query';
|
|
2
|
+
import { UR } from 'getstream';
|
|
3
|
+
import type { ICachePage } from '../..';
|
|
4
|
+
export interface IQueryFns {
|
|
5
|
+
list: (_: UR) => Promise<ICachePage>;
|
|
6
|
+
}
|
|
7
|
+
interface ILikesFeedArgs {
|
|
8
|
+
queryFns: IQueryFns;
|
|
9
|
+
queryKey: QueryKey;
|
|
10
|
+
}
|
|
11
|
+
export declare function useLikesFeed({ queryFns: { list }, queryKey }: ILikesFeedArgs): {
|
|
12
|
+
likesCount: string;
|
|
13
|
+
error: Error | null;
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
hasNextPage: boolean;
|
|
16
|
+
fetchNextPage: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").a2 | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").aj<import("../..").ICache, Error>>;
|
|
17
|
+
refetch: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").Z | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").ac<import("../..").ICache, Error>>;
|
|
18
|
+
likes: import("../../../../..").IReaction[];
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './feed.hook';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './list.hook';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { QueryKey } from '@tanstack/react-query';
|
|
2
|
+
import { UR } from 'getstream';
|
|
3
|
+
import type { ICache, ICachePage } from '../..';
|
|
4
|
+
export interface IListLikesArgs {
|
|
5
|
+
queryFn: (_: UR) => Promise<ICachePage>;
|
|
6
|
+
queryKey: QueryKey;
|
|
7
|
+
}
|
|
8
|
+
export declare function useListLikes({ queryFn, queryKey }: IListLikesArgs): {
|
|
9
|
+
likes: import('../../../../../../discussion/shared').IReaction[];
|
|
10
|
+
likesCount: string;
|
|
11
|
+
error: Error | null;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
hasNextPage: boolean;
|
|
14
|
+
fetchNextPage: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").a2 | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").aj<ICache, Error>>;
|
|
15
|
+
refetch: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").Z | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").ac<ICache, Error>>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IQueryFns } from './cache';
|
|
2
|
+
export interface ILikesFeedProps {
|
|
3
|
+
/** The base path, used for slugs */
|
|
4
|
+
basePath: string;
|
|
5
|
+
/** The ID of the parent, used for slugs */
|
|
6
|
+
parentId: string;
|
|
7
|
+
/** The ID of the activity the replies are for */
|
|
8
|
+
activityId: string;
|
|
9
|
+
/** The total number of likes */
|
|
10
|
+
likeCount: number;
|
|
11
|
+
/** Functions for the replies query */
|
|
12
|
+
functions: {
|
|
13
|
+
likes: IQueryFns;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export default function LikesFeed({ basePath, parentId, activityId, likeCount, functions, }: ILikesFeedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,11 +6,11 @@ interface IAdditionOptions {
|
|
|
6
6
|
export declare function addItem(item: ICacheItem, cache?: ICache, opts?: IAdditionOptions): {
|
|
7
7
|
pages: {
|
|
8
8
|
next: string;
|
|
9
|
-
results: import("
|
|
9
|
+
results: import("../../..").IReaction[];
|
|
10
10
|
}[];
|
|
11
11
|
pageParams: string[];
|
|
12
12
|
};
|
|
13
|
-
export declare function findItem(itemId: string, cache?: ICache): import("
|
|
13
|
+
export declare function findItem(itemId: string, cache?: ICache): import("../../..").IReaction | undefined;
|
|
14
14
|
export declare function removeItem(itemId: string, cache: ICache): ICache;
|
|
15
15
|
export declare function flattenCache(cache?: ICache): ICacheItems;
|
|
16
16
|
export {};
|
|
@@ -4,5 +4,5 @@ interface IEditVars {
|
|
|
4
4
|
replyId: string;
|
|
5
5
|
content: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function useEditReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
7
|
+
export declare function useEditReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, }: IMutationContext<ICacheItem, Error, IEditVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IReaction, Error, IEditVars, ICache>;
|
|
8
8
|
export {};
|
|
@@ -4,5 +4,5 @@ interface ILikeVars {
|
|
|
4
4
|
replyId: string;
|
|
5
5
|
reactionId?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function useLikeReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
7
|
+
export declare function useLikeReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, queryClient, queryKey, }: IMutationContext<ICacheSubitem, Error, ILikeVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IReaction, Error, ILikeVars, ICache>;
|
|
8
8
|
export {};
|
|
@@ -5,7 +5,7 @@ export interface IListRepliesArgs {
|
|
|
5
5
|
queryKey: QueryKey;
|
|
6
6
|
}
|
|
7
7
|
export declare function useListReplies({ queryFn, queryKey }: IListRepliesArgs): {
|
|
8
|
-
replies: import(
|
|
8
|
+
replies: import('../../../../../../discussion/shared').IReaction[];
|
|
9
9
|
error: Error | null;
|
|
10
10
|
isLoading: boolean;
|
|
11
11
|
hasNextPage: boolean;
|