@apolitical/component-library 1.15.5-beta.0 → 1.16.0-4186.44
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.context.d.ts +1 -1
- package/context/user/user.hook.d.ts +1 -0
- package/context/user/user.provider.d.ts +1 -1
- package/discussion/feeds/activities-feed/activities-feed.d.ts +6 -20
- package/discussion/feeds/activities-feed/cache/handlers/error.handler.d.ts +2 -0
- package/discussion/feeds/activities-feed/cache/handlers/index.d.ts +2 -0
- package/discussion/feeds/activities-feed/cache/handlers/mutate.handler.d.ts +2 -0
- package/discussion/feeds/activities-feed/cache/helpers/activity.helper.d.ts +14 -0
- package/discussion/feeds/activities-feed/cache/helpers/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/create/create.hook.d.ts +6 -0
- package/discussion/feeds/activities-feed/cache/hooks/create/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/edit/edit.hook.d.ts +7 -0
- package/discussion/feeds/activities-feed/cache/hooks/edit/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/feed/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/index.d.ts +7 -0
- package/discussion/feeds/activities-feed/cache/hooks/like/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/like/like.hook.d.ts +7 -0
- package/discussion/feeds/activities-feed/cache/hooks/list/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/list/list.hook.d.ts +7 -0
- package/discussion/feeds/activities-feed/cache/hooks/remove/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/remove/remove.hook.d.ts +6 -0
- package/discussion/feeds/activities-feed/cache/hooks/unlike/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/cache/hooks/unlike/unlike.hook.d.ts +7 -0
- package/discussion/feeds/activities-feed/cache/index.d.ts +3 -0
- package/discussion/feeds/activities-feed/cache/interfaces/cache.interface.d.ts +4 -0
- package/discussion/feeds/activities-feed/cache/interfaces/handler.interface.d.ts +4 -0
- package/discussion/feeds/activities-feed/cache/interfaces/index.d.ts +4 -0
- package/discussion/feeds/activities-feed/cache/interfaces/mutation.interface.d.ts +12 -0
- package/discussion/feeds/activities-feed/cache/interfaces/query.interface.d.ts +9 -0
- package/discussion/feeds/replies-feed/replies-feed.handlers.d.ts +1 -1
- package/discussion/feeds/replies-to-replies-feed/replies-to-replies-feed.handlers.d.ts +1 -1
- package/discussion/sections/activity-section/activity-section.handlers.d.ts +1 -1
- package/index.d.ts +0 -1
- package/index.js +15 -15
- package/index.mjs +2689 -2847
- package/package.json +1 -1
- package/style.css +1 -1
- package/discussion/feeds/activities-feed/activities-feed.handlers.d.ts +0 -72
- package/discussion/feeds/activities-feed/activities-feed.helpers.d.ts +0 -23
|
@@ -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
|
@@ -11,4 +11,4 @@ export interface IUserDetails {
|
|
|
11
11
|
export interface IUserContext extends IUserDetails {
|
|
12
12
|
isLoading: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const UserContext: import("react").Context<IUserContext
|
|
14
|
+
export declare const UserContext: import("react").Context<IUserContext>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useUser(): import("./user.context").IUserContext;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { IUserContext } from './user.context';
|
|
3
3
|
interface Props {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
user: IUserContext
|
|
5
|
+
user: IUserContext;
|
|
6
6
|
}
|
|
7
7
|
export declare const UserProvider: ({ children, user }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
edit: ({ parentId, activityId, content, }: {
|
|
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>;
|
|
7
|
+
create: (_: unknown) => 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>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IUserContext } from '../../../../../context';
|
|
2
|
+
import type { ICacheItem } from '../interfaces';
|
|
3
|
+
interface IBuildTmpActivity {
|
|
4
|
+
content: string;
|
|
5
|
+
user: IUserContext;
|
|
6
|
+
verb?: string;
|
|
7
|
+
}
|
|
8
|
+
interface IBuildFinalActivity {
|
|
9
|
+
activity: ICacheItem;
|
|
10
|
+
user: IUserContext;
|
|
11
|
+
}
|
|
12
|
+
export declare function buildTmpActivity({ content, user, verb }: IBuildTmpActivity): ICacheItem;
|
|
13
|
+
export declare function buildFinalActivity({ activity, user }: IBuildFinalActivity): ICacheItem;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './activity.helper';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IMutationProps, IHandlerContext, ICacheItem } from '../../interfaces';
|
|
2
|
+
interface ICreateVars {
|
|
3
|
+
content: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function useCreateActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, user, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutationResult<ICacheItem, Error, ICreateVars, IHandlerContext>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create.hook';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMutationProps, IHandlerContext, ICacheItem } from '../../interfaces';
|
|
2
|
+
interface IEditVars {
|
|
3
|
+
activityId: string;
|
|
4
|
+
body: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useEditActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutationResult<ICacheItem, Error, IEditVars, IHandlerContext>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './edit.hook';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './feed.hook';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './like.hook';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMutationProps, IHandlerContext, ICacheSubitem } from '../../interfaces';
|
|
2
|
+
interface ILikeVars {
|
|
3
|
+
activityId: string;
|
|
4
|
+
reactionId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useLikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutationResult<ICacheSubitem, Error, ILikeVars, IHandlerContext>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './list.hook';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './remove.hook';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IMutationProps, IHandlerContext, ICacheItem } from '../../interfaces';
|
|
2
|
+
interface IRemoveVars {
|
|
3
|
+
activityId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function useRemoveActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutationResult<ICacheItem, Error, IRemoveVars, IHandlerContext>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './unlike.hook';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMutationProps, IHandlerContext } from '../../interfaces';
|
|
2
|
+
interface IUnlikeVars {
|
|
3
|
+
activityId: string;
|
|
4
|
+
reactionId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useUnlikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, user, }: IMutationProps): import("@tanstack/react-query/build/legacy/types").UseMutationResult<unknown, Error, IUnlikeVars, IHandlerContext>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IUserContext } from '../../../../../context';
|
|
2
|
+
import type { IQueryContext, ICacheItems, IHandlerContext } from '.';
|
|
3
|
+
export interface IMutationContext extends IQueryContext {
|
|
4
|
+
mutationHandlers: {
|
|
5
|
+
mutate: (callback: (data: ICacheItems) => ICacheItems) => Promise<IHandlerContext>;
|
|
6
|
+
error: (error: Error, variables: unknown, context?: IHandlerContext) => void;
|
|
7
|
+
};
|
|
8
|
+
user: IUserContext;
|
|
9
|
+
}
|
|
10
|
+
export interface IMutationProps extends IMutationContext {
|
|
11
|
+
mutationFn: (_: any) => Promise<any>;
|
|
12
|
+
}
|
|
@@ -117,7 +117,7 @@ export declare const buildLikeReplyHandlers: ({ queryClient, queryKey, mutationF
|
|
|
117
117
|
interface buildUnlikeReplyHandlersProps {
|
|
118
118
|
queryClient: QueryClient;
|
|
119
119
|
queryKey: QueryKey;
|
|
120
|
-
user: IUserContext
|
|
120
|
+
user: IUserContext;
|
|
121
121
|
mutationFn: ({ replyId }: {
|
|
122
122
|
replyId: string;
|
|
123
123
|
}) => Promise<void>;
|
|
@@ -127,7 +127,7 @@ export declare const buildLikeReplyHandlers: ({ queryClient, queryKey, mutationF
|
|
|
127
127
|
interface buildUnlikeReplyHandlersProps {
|
|
128
128
|
queryClient: QueryClient;
|
|
129
129
|
queryKey: QueryKey;
|
|
130
|
-
user: IUserContext
|
|
130
|
+
user: IUserContext;
|
|
131
131
|
mutationFn: ({ replyId, replyParentId, }: {
|
|
132
132
|
replyId: string;
|
|
133
133
|
replyParentId?: string;
|
|
@@ -56,7 +56,7 @@ export declare const buildLikeActivityHandlers: ({ queryClient, queryKey, mutati
|
|
|
56
56
|
interface buildUnlikeActivityHandlersProps {
|
|
57
57
|
queryClient: QueryClient;
|
|
58
58
|
queryKey: QueryKey;
|
|
59
|
-
user: IUserContext
|
|
59
|
+
user: IUserContext;
|
|
60
60
|
activity: IActivity | undefined;
|
|
61
61
|
mutationFn: ({ activityId }: {
|
|
62
62
|
activityId: string;
|