@apolitical/component-library 1.15.5-beta.0 → 1.16.0-4186.18
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 +6 -7
- package/context/user/index.d.ts +1 -0
- package/context/user/user.hook.d.ts +1 -0
- package/discussion/feeds/activities-feed/activities-feed.d.ts +5 -19
- package/discussion/feeds/activities-feed/activities-feed.helpers.d.ts +39 -11
- package/discussion/feeds/activities-feed/activities-feed.hooks.d.ts +34 -0
- package/index.d.ts +0 -1
- package/index.js +15 -15
- package/index.mjs +2567 -2817
- package/package.json +1 -1
- package/style.css +1 -1
- package/discussion/feeds/activities-feed/activities-feed.handlers.d.ts +0 -72
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PaginationType } from '../../navigation';
|
|
1
2
|
import { MemberDetailsProps } from '../../user';
|
|
2
3
|
interface CommunityMemberProps extends MemberDetailsProps {
|
|
3
4
|
/** Whether the user is an admin of the community or not */
|
|
@@ -6,13 +7,11 @@ interface CommunityMemberProps extends MemberDetailsProps {
|
|
|
6
7
|
interface Props {
|
|
7
8
|
/** Details about members in the community */
|
|
8
9
|
members: {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
total?: number | undefined;
|
|
11
|
+
data?: CommunityMemberProps[];
|
|
11
12
|
};
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/** Function to load the next page of members */
|
|
15
|
-
loadNextPage?: () => void;
|
|
13
|
+
/** Details for the pagination */
|
|
14
|
+
pagination?: PaginationType;
|
|
16
15
|
/** The GTM context to use */
|
|
17
16
|
gtmContext?: string;
|
|
18
17
|
/** The GTM event to use */
|
|
@@ -20,5 +19,5 @@ interface Props {
|
|
|
20
19
|
/** Additional classes */
|
|
21
20
|
className?: string;
|
|
22
21
|
}
|
|
23
|
-
declare const MembersList: ({ members: {
|
|
22
|
+
declare const MembersList: ({ members: { total, data: members }, pagination, gtmContext, gtmType, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
24
23
|
export default MembersList;
|
package/context/user/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useUser(): import("./user.context").IUserContext | null;
|
|
@@ -1,31 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InvalidateQueryFilters, QueryFunction } from '@tanstack/react-query';
|
|
3
2
|
interface Props {
|
|
4
3
|
basePath: string;
|
|
5
4
|
parentId: string;
|
|
6
5
|
isMember: boolean;
|
|
7
6
|
functions: {
|
|
8
|
-
list: QueryFunction<unknown, InvalidateQueryFilters[], never>;
|
|
9
7
|
create: () => Promise<void>;
|
|
10
|
-
edit: (
|
|
11
|
-
parentId: string;
|
|
12
|
-
activityId: string;
|
|
13
|
-
content: {
|
|
14
|
-
body: string;
|
|
15
|
-
};
|
|
16
|
-
}) => Promise<void>;
|
|
17
|
-
remove: ({ activityId }: {
|
|
18
|
-
activityId: string;
|
|
19
|
-
}) => Promise<void>;
|
|
20
|
-
like: ({ activityId }: {
|
|
21
|
-
activityId: string;
|
|
22
|
-
}) => Promise<void>;
|
|
23
|
-
unlike: ({ activityId, reactionId, }: {
|
|
24
|
-
activityId: string;
|
|
25
|
-
reactionId: string;
|
|
26
|
-
}) => Promise<void>;
|
|
8
|
+
edit: (_: unknown) => Promise<void>;
|
|
27
9
|
join: () => Promise<void>;
|
|
28
10
|
leave: () => Promise<void>;
|
|
11
|
+
like: (_: unknown) => Promise<void>;
|
|
12
|
+
list: () => Promise<unknown>;
|
|
13
|
+
remove: (_: unknown) => Promise<void>;
|
|
14
|
+
unlike: (_: unknown) => Promise<void>;
|
|
29
15
|
};
|
|
30
16
|
}
|
|
31
17
|
declare const ActivitiesFeed: React.FC<Props>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export function mockActivity({ user, content, verb }: {
|
|
2
|
+
user: any;
|
|
3
|
+
content: any;
|
|
4
|
+
verb?: string | undefined;
|
|
5
|
+
}): {
|
|
6
|
+
id: string;
|
|
7
7
|
actor: {
|
|
8
|
-
id:
|
|
8
|
+
id: any;
|
|
9
9
|
data: {
|
|
10
|
-
name:
|
|
11
|
-
organization:
|
|
12
|
-
jobTitle:
|
|
10
|
+
name: any;
|
|
11
|
+
organization: any;
|
|
12
|
+
jobTitle: any;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
content:
|
|
15
|
+
content: any;
|
|
16
16
|
latest_reactions: {
|
|
17
17
|
like: never[];
|
|
18
18
|
};
|
|
@@ -21,3 +21,31 @@ export declare const createActivityObject: ({ user, content, verb, }: {
|
|
|
21
21
|
};
|
|
22
22
|
verb: string;
|
|
23
23
|
};
|
|
24
|
+
export function mockReaction({ user, activityId, kind }: {
|
|
25
|
+
user: any;
|
|
26
|
+
activityId: any;
|
|
27
|
+
kind?: string | undefined;
|
|
28
|
+
}): {
|
|
29
|
+
id: string;
|
|
30
|
+
user_id: any;
|
|
31
|
+
user: {
|
|
32
|
+
id: any;
|
|
33
|
+
data: {
|
|
34
|
+
name: any;
|
|
35
|
+
organization: any;
|
|
36
|
+
jobTitle: any;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
kind: string;
|
|
40
|
+
activity_id: any;
|
|
41
|
+
data: {};
|
|
42
|
+
parent: string;
|
|
43
|
+
latest_children: {};
|
|
44
|
+
children_counts: {};
|
|
45
|
+
};
|
|
46
|
+
export function parseActivity(activity: any, user: any): {
|
|
47
|
+
isAuthor: boolean;
|
|
48
|
+
userLiked: boolean;
|
|
49
|
+
likeId: any;
|
|
50
|
+
peopleWhoLiked: any;
|
|
51
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function useActivitiesFeed({ queryKey, queryFns: { list, create, edit, remove, like, unlike, } }: {
|
|
2
|
+
queryKey: any;
|
|
3
|
+
queryFns: {
|
|
4
|
+
list: any;
|
|
5
|
+
create: any;
|
|
6
|
+
edit: any;
|
|
7
|
+
remove: any;
|
|
8
|
+
like: any;
|
|
9
|
+
unlike: any;
|
|
10
|
+
};
|
|
11
|
+
}): {
|
|
12
|
+
activities: unknown;
|
|
13
|
+
error: Error | null;
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
isFetching: boolean;
|
|
16
|
+
mutations: {
|
|
17
|
+
create: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, any, any, {
|
|
18
|
+
data: any;
|
|
19
|
+
}>;
|
|
20
|
+
edit: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, any, any, {
|
|
21
|
+
data: any;
|
|
22
|
+
}>;
|
|
23
|
+
remove: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, any, any, {
|
|
24
|
+
data: any;
|
|
25
|
+
}>;
|
|
26
|
+
like: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, any, any, {
|
|
27
|
+
data: any;
|
|
28
|
+
}>;
|
|
29
|
+
unlike: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, any, any, {
|
|
30
|
+
data: any;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
user: import('../../../context').IUserContext | null;
|
|
34
|
+
};
|