@apolitical/component-library 5.2.1-jc.6 → 5.2.2-ac.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/add-post/add-post.d.ts +3 -0
- package/discussion/components/form/form.type.d.ts +5 -0
- 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/post.d.ts +14 -3
- 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 +7 -0
- 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 +6 -3
- 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 +79 -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/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/sections/activity-section/activity-section.d.ts +6 -0
- package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +1 -0
- 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 +1 -0
- package/discussion/shared/interfaces/community.category.interface.d.ts +4 -0
- package/discussion/shared/interfaces/discussion.interface.d.ts +2 -0
- package/discussion/shared/interfaces/index.d.ts +1 -0
- package/form/components/form/components/fields/checkbox/checkbox.d.ts +2 -2
- package/form/components/form/components/fields/input/input.d.ts +5 -0
- package/form/components/form/components/fields/multiple-options/multiple-options.d.ts +1 -1
- package/form/components/form/form.types.d.ts +8 -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 +3 -1
- package/index.js +62 -62
- package/index.mjs +8215 -7978
- package/navigation/filters/filters.d.ts +5 -1
- package/package.json +1 -1
- package/sections/full-width-section/full-width-section.d.ts +0 -2
- package/style.css +1 -1
- package/styles/base/_accessibility.scss +1 -0
- package/styles/mixins/_styles.scss +0 -3
- package/styles/variables/colors/_colors.scss +0 -2
- package/styles/variables/colors/theme/_base.scss +1 -2
- package/styles/variables/colors/theme/_general.scss +1 -0
- package/styles/variables/colors/theme/_layout.scss +2 -2
- package/styles/variables/colors/theme/_navigation.scss +4 -4
- 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.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;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { IDiscussionForm } from '../../../discussion/components/form';
|
|
3
|
+
import { ICategory } from '../../shared';
|
|
3
4
|
interface Props {
|
|
4
5
|
/** Whether the form should be displayed as a card */
|
|
5
6
|
isCard?: boolean;
|
|
@@ -7,6 +8,8 @@ interface Props {
|
|
|
7
8
|
parentId?: string;
|
|
8
9
|
/** Props for the form - this uses everything the `DiscussionForm` component does */
|
|
9
10
|
form: IDiscussionForm;
|
|
11
|
+
/** The categories to show in the form */
|
|
12
|
+
categories?: ICategory[];
|
|
10
13
|
/** Details about what a user needs to have to be able to access the form */
|
|
11
14
|
membershipRequiredToPost: {
|
|
12
15
|
/** Whether the user needs to be a member of the community to post */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ListMembers, ClickMentionFallback } from '../../../form';
|
|
2
2
|
import { DiscussionCreateContentFunction, IDiscussionContent, IListMemberData, IMentions } from './../../discussion';
|
|
3
|
+
import { ICategory } from '../../shared';
|
|
3
4
|
export interface IDiscussionFormMeta {
|
|
4
5
|
/** Whether the form data is still loading */
|
|
5
6
|
isLoading?: boolean;
|
|
@@ -23,6 +24,10 @@ export interface IDiscussionFormMeta {
|
|
|
23
24
|
};
|
|
24
25
|
/** Whether title text should show above the form */
|
|
25
26
|
showTitle?: boolean;
|
|
27
|
+
/** What category options should be made available for the form */
|
|
28
|
+
postCategories?: ICategory[];
|
|
29
|
+
/** Whether the post type should show */
|
|
30
|
+
showPostType?: boolean;
|
|
26
31
|
/** Whether the community guidelines text should show beneath the form */
|
|
27
32
|
showGuidelines?: boolean;
|
|
28
33
|
/** Whether to show a divider before the buttons */
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ListMembers
|
|
3
|
-
import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction } from '../../discussion';
|
|
2
|
+
import { ClickMentionFallback, type ListMembers } from '../../../form';
|
|
3
|
+
import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, DiscussionListLikesFunction } from '../../discussion';
|
|
4
4
|
import type { IForceHide, IFullDiscussionContent } from '../../shared/interfaces';
|
|
5
5
|
import { IBadgesOption } from '../../../user/badges';
|
|
6
6
|
export interface IPostContent extends IFullDiscussionContent {
|
|
@@ -39,6 +39,8 @@ export interface IDiscussionPostProps {
|
|
|
39
39
|
createLike: DiscussionCreateLikeFunction;
|
|
40
40
|
/** Delete a like on the post */
|
|
41
41
|
deleteLike: DiscussionDeleteLikeFunction;
|
|
42
|
+
/** List the likes on the post */
|
|
43
|
+
listLikes: DiscussionListLikesFunction;
|
|
42
44
|
};
|
|
43
45
|
comments: {
|
|
44
46
|
/** Open comments on a post */
|
|
@@ -85,6 +87,15 @@ export interface IDiscussionPostProps {
|
|
|
85
87
|
isCommunity?: boolean;
|
|
86
88
|
/** Whether to show badges and the scope of the badge */
|
|
87
89
|
badges?: IBadgesOption;
|
|
90
|
+
/** Categories for the community */
|
|
91
|
+
categories?: {
|
|
92
|
+
name: string;
|
|
93
|
+
slug: string;
|
|
94
|
+
}[];
|
|
95
|
+
/** The base path, used for slugs */
|
|
96
|
+
basePath: string;
|
|
97
|
+
/** The ID of the parent, used for slugs */
|
|
98
|
+
parentId: string;
|
|
88
99
|
}
|
|
89
|
-
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton, showMoreMenuButton }, setFocus, isCommunity, badges, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
100
|
+
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton, showMoreMenuButton }, setFocus, isCommunity, badges, categories, basePath, parentId, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
90
101
|
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;
|
|
@@ -11,6 +12,11 @@ interface Props {
|
|
|
11
12
|
isMember: boolean;
|
|
12
13
|
/** Whether the user is an owner of the community */
|
|
13
14
|
isOwner: boolean;
|
|
15
|
+
/** The categories for the community */
|
|
16
|
+
categories: {
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
}[];
|
|
14
20
|
/** Functions for the activities query */
|
|
15
21
|
functions: {
|
|
16
22
|
/** Query functions for the activities */
|
|
@@ -21,6 +27,7 @@ interface Props {
|
|
|
21
27
|
join: () => Promise<void>;
|
|
22
28
|
/** Function to leave the community */
|
|
23
29
|
leave: () => Promise<void>;
|
|
30
|
+
likes: ILikesFeedQueryFns;
|
|
24
31
|
};
|
|
25
32
|
/** Props to pass into the profile form */
|
|
26
33
|
profile: IProfileFormProps;
|
|
@@ -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 {};
|
|
@@ -3,10 +3,13 @@ import type { ICache, ICachePage } from '../..';
|
|
|
3
3
|
export interface IListActivitiesArgs {
|
|
4
4
|
queryFn: (_: unknown) => Promise<ICachePage>;
|
|
5
5
|
queryKey: QueryKey;
|
|
6
|
-
|
|
6
|
+
filterOption?: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
7
10
|
}
|
|
8
|
-
export declare function useListActivities({ queryFn, queryKey,
|
|
9
|
-
activities: import(
|
|
11
|
+
export declare function useListActivities({ queryFn, queryKey, filterOption, }: IListActivitiesArgs): {
|
|
12
|
+
activities: import('../../../../../../discussion/shared').IActivity[];
|
|
10
13
|
error: Error | null;
|
|
11
14
|
isLoading: boolean;
|
|
12
15
|
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 {};
|
|
@@ -16,6 +16,7 @@ export declare const activitiesFeedMock: {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
title: string;
|
|
19
|
+
categories: string[];
|
|
19
20
|
content: string;
|
|
20
21
|
feed_id: string;
|
|
21
22
|
foreign_id: string;
|
|
@@ -46,6 +47,55 @@ export declare const activitiesFeedMock: {
|
|
|
46
47
|
latest_children: {};
|
|
47
48
|
children_counts: {};
|
|
48
49
|
}[];
|
|
50
|
+
like: ({
|
|
51
|
+
created_at: string;
|
|
52
|
+
updated_at: string;
|
|
53
|
+
id: string;
|
|
54
|
+
user_id: string;
|
|
55
|
+
user: {
|
|
56
|
+
id: string;
|
|
57
|
+
data: {
|
|
58
|
+
name: string;
|
|
59
|
+
thumbnail: string;
|
|
60
|
+
jobTitle: string;
|
|
61
|
+
organization: string;
|
|
62
|
+
};
|
|
63
|
+
created_at?: undefined;
|
|
64
|
+
updated_at?: undefined;
|
|
65
|
+
};
|
|
66
|
+
kind: string;
|
|
67
|
+
activity_id: string;
|
|
68
|
+
data: {
|
|
69
|
+
mentioned_users: null;
|
|
70
|
+
};
|
|
71
|
+
parent: string;
|
|
72
|
+
latest_children: {};
|
|
73
|
+
children_counts: {};
|
|
74
|
+
} | {
|
|
75
|
+
created_at: string;
|
|
76
|
+
updated_at: string;
|
|
77
|
+
id: string;
|
|
78
|
+
user_id: string;
|
|
79
|
+
user: {
|
|
80
|
+
created_at: string;
|
|
81
|
+
updated_at: string;
|
|
82
|
+
id: string;
|
|
83
|
+
data: {
|
|
84
|
+
jobTitle: string;
|
|
85
|
+
name: string;
|
|
86
|
+
organization: string;
|
|
87
|
+
thumbnail: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
kind: string;
|
|
91
|
+
activity_id: string;
|
|
92
|
+
data: {
|
|
93
|
+
mentioned_users: null;
|
|
94
|
+
};
|
|
95
|
+
parent: string;
|
|
96
|
+
latest_children: {};
|
|
97
|
+
children_counts: {};
|
|
98
|
+
})[];
|
|
49
99
|
};
|
|
50
100
|
latest_reactions_extra: {};
|
|
51
101
|
object: string;
|
|
@@ -75,12 +125,14 @@ export declare const activitiesFeedMock: {
|
|
|
75
125
|
};
|
|
76
126
|
};
|
|
77
127
|
title: string;
|
|
128
|
+
categories: string[];
|
|
78
129
|
content: string;
|
|
79
130
|
feed_id: string;
|
|
80
131
|
foreign_id: string;
|
|
81
132
|
id: string;
|
|
82
133
|
latest_reactions: {
|
|
83
134
|
pin?: undefined;
|
|
135
|
+
like?: undefined;
|
|
84
136
|
};
|
|
85
137
|
latest_reactions_extra: {};
|
|
86
138
|
object: string;
|
|
@@ -105,11 +157,35 @@ export declare const activitiesFeedMock: {
|
|
|
105
157
|
badges?: undefined;
|
|
106
158
|
};
|
|
107
159
|
};
|
|
160
|
+
categories: string[];
|
|
108
161
|
content: string;
|
|
109
162
|
feed_id: string;
|
|
110
163
|
foreign_id: string;
|
|
111
164
|
id: string;
|
|
112
165
|
latest_reactions: {
|
|
166
|
+
like: {
|
|
167
|
+
created_at: string;
|
|
168
|
+
updated_at: string;
|
|
169
|
+
id: string;
|
|
170
|
+
user_id: string;
|
|
171
|
+
user: {
|
|
172
|
+
id: string;
|
|
173
|
+
data: {
|
|
174
|
+
name: string;
|
|
175
|
+
thumbnail: string;
|
|
176
|
+
jobTitle: string;
|
|
177
|
+
organization: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
kind: string;
|
|
181
|
+
activity_id: string;
|
|
182
|
+
data: {
|
|
183
|
+
mentioned_users: null;
|
|
184
|
+
};
|
|
185
|
+
parent: string;
|
|
186
|
+
latest_children: {};
|
|
187
|
+
children_counts: {};
|
|
188
|
+
}[];
|
|
113
189
|
pin?: undefined;
|
|
114
190
|
};
|
|
115
191
|
latest_reactions_extra: {};
|
|
@@ -117,7 +193,7 @@ export declare const activitiesFeedMock: {
|
|
|
117
193
|
origin: null;
|
|
118
194
|
own_reactions: {};
|
|
119
195
|
reaction_counts: {
|
|
120
|
-
like
|
|
196
|
+
like: number;
|
|
121
197
|
pin?: undefined;
|
|
122
198
|
};
|
|
123
199
|
target: string;
|
|
@@ -143,6 +219,7 @@ export declare const activitiesFeedMock: {
|
|
|
143
219
|
id: string;
|
|
144
220
|
latest_reactions: {
|
|
145
221
|
pin?: undefined;
|
|
222
|
+
like?: undefined;
|
|
146
223
|
};
|
|
147
224
|
latest_reactions_extra: {};
|
|
148
225
|
object: string;
|
|
@@ -155,6 +232,7 @@ export declare const activitiesFeedMock: {
|
|
|
155
232
|
target: string;
|
|
156
233
|
time: string;
|
|
157
234
|
verb: string;
|
|
235
|
+
categories?: undefined;
|
|
158
236
|
})[];
|
|
159
237
|
next: string;
|
|
160
238
|
duration: 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;
|