@apolitical/component-library 1.16.0-4186.44 → 1.16.0-4186.49
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/members-list.d.ts +7 -6
- package/discussion/feeds/activities-feed/cache/helpers/activity.helper.d.ts +15 -8
- package/discussion/feeds/activities-feed/cache/helpers/cache.helper.d.ts +4 -0
- package/discussion/feeds/activities-feed/cache/helpers/context.helper.d.ts +2 -0
- package/discussion/feeds/activities-feed/cache/helpers/index.d.ts +2 -0
- package/discussion/feeds/activities-feed/cache/hooks/create/create.hook.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/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/mocks/activity.mock.d.ts +44 -0
- package/discussion/feeds/activities-feed/cache/mocks/cache.mock.d.ts +4 -0
- package/discussion/feeds/activities-feed/cache/mocks/context.mock.d.ts +9 -0
- package/discussion/feeds/activities-feed/cache/mocks/index.d.ts +5 -0
- package/discussion/feeds/activities-feed/cache/mocks/reaction.mock.d.ts +20 -0
- package/discussion/feeds/activities-feed/cache/mocks/user.mock.d.ts +20 -0
- package/index.js +11 -11
- package/index.mjs +1214 -1212
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PaginationType } from '../../navigation';
|
|
2
1
|
import { MemberDetailsProps } from '../../user';
|
|
3
2
|
interface CommunityMemberProps extends MemberDetailsProps {
|
|
4
3
|
/** Whether the user is an admin of the community or not */
|
|
@@ -7,11 +6,13 @@ interface CommunityMemberProps extends MemberDetailsProps {
|
|
|
7
6
|
interface Props {
|
|
8
7
|
/** Details about members in the community */
|
|
9
8
|
members: {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
data: CommunityMemberProps[];
|
|
10
|
+
total?: number;
|
|
12
11
|
};
|
|
13
|
-
/**
|
|
14
|
-
|
|
12
|
+
/** Whether there is another page of members to load */
|
|
13
|
+
hasNextPage?: boolean;
|
|
14
|
+
/** Function to load the next page of members */
|
|
15
|
+
loadNextPage?: () => void;
|
|
15
16
|
/** The GTM context to use */
|
|
16
17
|
gtmContext?: string;
|
|
17
18
|
/** The GTM event to use */
|
|
@@ -19,5 +20,5 @@ interface Props {
|
|
|
19
20
|
/** Additional classes */
|
|
20
21
|
className?: string;
|
|
21
22
|
}
|
|
22
|
-
declare const MembersList: ({ members: {
|
|
23
|
+
declare const MembersList: ({ members: { data, total }, hasNextPage, loadNextPage, gtmContext, gtmType, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
23
24
|
export default MembersList;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { IUserContext } from '../../../../../context';
|
|
2
|
-
import type { ICacheItem } from '../interfaces';
|
|
3
|
-
interface
|
|
4
|
-
|
|
2
|
+
import type { ICacheItem, ICacheSubitem } from '../interfaces';
|
|
3
|
+
interface IEnrichActivityArgs {
|
|
4
|
+
activity: ICacheItem | Partial<ICacheItem> | {
|
|
5
|
+
content: string;
|
|
6
|
+
};
|
|
5
7
|
user: IUserContext;
|
|
6
|
-
verb?: string;
|
|
7
8
|
}
|
|
8
|
-
interface
|
|
9
|
+
interface IIncrementLikesArgs {
|
|
9
10
|
activity: ICacheItem;
|
|
10
|
-
|
|
11
|
+
reaction?: ICacheSubitem;
|
|
12
|
+
user?: IUserContext;
|
|
13
|
+
}
|
|
14
|
+
interface IDecrementLikesArgs {
|
|
15
|
+
activity: ICacheItem;
|
|
16
|
+
user?: IUserContext;
|
|
11
17
|
}
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function
|
|
18
|
+
export declare function enrichActivity({ activity, user }: IEnrichActivityArgs): ICacheItem;
|
|
19
|
+
export declare function incrementLikes({ activity, reaction }: IIncrementLikesArgs): void;
|
|
20
|
+
export declare function decrementLikes({ activity, user }: IDecrementLikesArgs): void;
|
|
14
21
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ICacheItem, ICacheItems } from '../interfaces';
|
|
2
|
+
export declare function addItem(item: ICacheItem, cache: ICacheItems): ICacheItem[];
|
|
3
|
+
export declare function findItem(itemId: string, cache: ICacheItems): ICacheItem | undefined;
|
|
4
|
+
export declare function removeItem(itemId: string, cache: ICacheItems): ICacheItem[];
|
|
@@ -2,5 +2,5 @@ import type { IMutationProps, IHandlerContext, ICacheItem } from '../../interfac
|
|
|
2
2
|
interface ICreateVars {
|
|
3
3
|
content: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function useCreateActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, user, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").
|
|
5
|
+
export declare function useCreateActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, user, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<ICacheItem, Error, ICreateVars, IHandlerContext>;
|
|
6
6
|
export {};
|
|
@@ -3,5 +3,5 @@ interface IEditVars {
|
|
|
3
3
|
activityId: string;
|
|
4
4
|
body: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function useEditActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").
|
|
6
|
+
export declare function useEditActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<ICacheItem, Error, IEditVars, IHandlerContext>;
|
|
7
7
|
export {};
|
|
@@ -3,5 +3,5 @@ interface ILikeVars {
|
|
|
3
3
|
activityId: string;
|
|
4
4
|
reactionId: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function useLikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").
|
|
6
|
+
export declare function useLikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<ICacheSubitem, Error, ILikeVars, IHandlerContext>;
|
|
7
7
|
export {};
|
|
@@ -2,5 +2,5 @@ import type { IMutationProps, IHandlerContext, ICacheItem } from '../../interfac
|
|
|
2
2
|
interface IRemoveVars {
|
|
3
3
|
activityId: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function useRemoveActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").
|
|
5
|
+
export declare function useRemoveActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<ICacheItem, Error, IRemoveVars, IHandlerContext>;
|
|
6
6
|
export {};
|
|
@@ -3,5 +3,5 @@ interface IUnlikeVars {
|
|
|
3
3
|
activityId: string;
|
|
4
4
|
reactionId: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function useUnlikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, },
|
|
6
|
+
export declare function useUnlikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, user, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, Error, IUnlikeVars, IHandlerContext>;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const activityMock1: Readonly<{
|
|
2
|
+
actor: "SU:some-user-id-1";
|
|
3
|
+
content: "some content 1";
|
|
4
|
+
duration: "5.53ms";
|
|
5
|
+
feed_id: "some-feed-id-1";
|
|
6
|
+
foreign_id: "post:some-foriegn-id-1";
|
|
7
|
+
id: "some-activity-id-1";
|
|
8
|
+
object: "comment";
|
|
9
|
+
time: "2023-11-24T17:52:36.162000";
|
|
10
|
+
verb: "post";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const activityMock2: Readonly<{
|
|
13
|
+
actor: "SU:some-user-id-2";
|
|
14
|
+
content: "some content 2";
|
|
15
|
+
duration: "5.53ms";
|
|
16
|
+
feed_id: "some-feed-id-2";
|
|
17
|
+
foreign_id: "post:some-foriegn-id-2";
|
|
18
|
+
id: "some-activity-id-2";
|
|
19
|
+
object: "comment";
|
|
20
|
+
time: "2023-11-24T17:54:36.162000";
|
|
21
|
+
verb: "post";
|
|
22
|
+
}>;
|
|
23
|
+
export declare const activityMock3: Readonly<{
|
|
24
|
+
actor: "SU:some-user-id-1";
|
|
25
|
+
content: "some content 3";
|
|
26
|
+
duration: "5.53ms";
|
|
27
|
+
feed_id: "some-feed-id-3";
|
|
28
|
+
foreign_id: "post:some-foriegn-id-3";
|
|
29
|
+
id: "some-activity-id-3";
|
|
30
|
+
object: "comment";
|
|
31
|
+
time: "2023-11-24T17:56:36.162000";
|
|
32
|
+
verb: "post";
|
|
33
|
+
}>;
|
|
34
|
+
export declare const activityMock4: Readonly<{
|
|
35
|
+
actor: "SU:some-user-id-2";
|
|
36
|
+
content: "some content 4";
|
|
37
|
+
duration: "5.53ms";
|
|
38
|
+
feed_id: "some-feed-id-4";
|
|
39
|
+
foreign_id: "post:some-foriegn-id-4";
|
|
40
|
+
id: "some-activity-id-4";
|
|
41
|
+
object: "comment";
|
|
42
|
+
time: "2023-11-24T17:54:36.162000";
|
|
43
|
+
verb: "post";
|
|
44
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const cacheMock1: readonly import("../interfaces").ICacheItem[];
|
|
2
|
+
export declare const cacheMock2: readonly import("../interfaces").ICacheItem[];
|
|
3
|
+
export declare const cacheMock3: readonly import("../interfaces").ICacheItem[];
|
|
4
|
+
export declare const cacheMock4: readonly import("../interfaces").ICacheItem[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const contextMock1: Readonly<{
|
|
2
|
+
data: readonly import("../interfaces").ICacheItem[];
|
|
3
|
+
}>;
|
|
4
|
+
export declare const contextMock2: Readonly<{
|
|
5
|
+
data: readonly import("../interfaces").ICacheItem[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const contextMock3: Readonly<{
|
|
8
|
+
data: readonly import("../interfaces").ICacheItem[];
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const reactionMock1: Readonly<{
|
|
2
|
+
id: "some-reaction-id-1";
|
|
3
|
+
activity_id: "some-activity-id-1";
|
|
4
|
+
kind: "like";
|
|
5
|
+
created_at: "2023-11-24T17:58:36.162000";
|
|
6
|
+
data: {};
|
|
7
|
+
parent: "";
|
|
8
|
+
updated_at: "2023-11-24T17:58:36.162000";
|
|
9
|
+
user_id: "some-user-id-2";
|
|
10
|
+
children_counts: {};
|
|
11
|
+
latest_children: {};
|
|
12
|
+
latest_children_extra: {};
|
|
13
|
+
own_children: {};
|
|
14
|
+
user: {
|
|
15
|
+
id: "some-user-id-2";
|
|
16
|
+
data: {};
|
|
17
|
+
created_at: string;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const userMock1: Readonly<{
|
|
2
|
+
id: "some-user-id-1";
|
|
3
|
+
name: "some user name 1";
|
|
4
|
+
organization: "some user organization 1";
|
|
5
|
+
jobTitle: "some user job title 1";
|
|
6
|
+
image: {
|
|
7
|
+
thumbnail: string;
|
|
8
|
+
};
|
|
9
|
+
isLoading: false;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const userMock2: Readonly<{
|
|
12
|
+
id: "some-user-id-2";
|
|
13
|
+
name: "some user name 2";
|
|
14
|
+
organization: "some user organization 2";
|
|
15
|
+
jobTitle: "some user job title 2";
|
|
16
|
+
image: {
|
|
17
|
+
thumbnail: string;
|
|
18
|
+
};
|
|
19
|
+
isLoading: false;
|
|
20
|
+
}>;
|