@apolitical/component-library 1.17.2 → 1.18.0-4247.39
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/discussion/components/thread/thread.d.ts +2 -2
- package/discussion/feeds/activities-feed/cache/cache.helper.d.ts +5 -0
- package/discussion/feeds/activities-feed/cache/cache.interface.d.ts +13 -0
- package/discussion/feeds/activities-feed/cache/hooks/create/create.hook.d.ts +7 -0
- package/discussion/feeds/activities-feed/cache/hooks/edit/edit.hook.d.ts +8 -0
- package/discussion/feeds/activities-feed/cache/hooks/like/like.hook.d.ts +3 -2
- package/discussion/feeds/activities-feed/cache/hooks/list/list.hook.d.ts +2 -2
- package/discussion/feeds/activities-feed/cache/hooks/remove/remove.hook.d.ts +7 -0
- package/discussion/feeds/activities-feed/cache/hooks/unlike/unlike.hook.d.ts +4 -3
- package/discussion/feeds/activities-feed/cache/index.d.ts +2 -3
- package/discussion/feeds/activities-feed/cache/mocks/cache.mock.d.ts +24 -0
- package/discussion/feeds/activities-feed/cache/mocks/index.d.ts +0 -4
- package/discussion/feeds/activities-feed/mocks/activities-feed.mock.d.ts +57 -0
- package/discussion/feeds/activities-feed/mocks/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/cache.helper.d.ts +16 -0
- package/discussion/feeds/replies-feed/cache/cache.interface.d.ts +13 -0
- package/discussion/feeds/replies-feed/cache/hooks/create/create.hook.d.ts +9 -0
- package/discussion/feeds/replies-feed/cache/hooks/create/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/edit/edit.hook.d.ts +8 -0
- package/discussion/feeds/replies-feed/cache/hooks/edit/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/feed/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/index.d.ts +7 -0
- package/discussion/feeds/replies-feed/cache/hooks/like/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/like/like.hook.d.ts +8 -0
- package/discussion/feeds/replies-feed/cache/hooks/list/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/list/list.hook.d.ts +14 -0
- package/discussion/feeds/replies-feed/cache/hooks/remove/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/remove/remove.hook.d.ts +7 -0
- package/discussion/feeds/replies-feed/cache/hooks/unlike/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/unlike/unlike.hook.d.ts +8 -0
- package/discussion/feeds/replies-feed/cache/index.d.ts +3 -0
- package/discussion/feeds/replies-feed/cache/mocks/cache.mock.d.ts +24 -0
- package/discussion/feeds/replies-feed/cache/mocks/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/index.d.ts +2 -0
- package/discussion/feeds/replies-feed/mocks/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/mocks/replies-feed.mock.d.ts +101 -0
- package/discussion/feeds/replies-feed/nested-replies-feed/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/nested-replies-feed/mocks/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/nested-replies-feed/mocks/nested-replies-feed.mock.d.ts +26 -0
- package/discussion/feeds/replies-feed/nested-replies-feed/nested-replies-feed.d.ts +12 -0
- package/discussion/feeds/replies-feed/replies-feed.d.ts +2 -24
- package/discussion/sections/activity-section/activity-section.d.ts +7 -37
- package/discussion/sections/activity-section/cache/cache.interface.d.ts +5 -0
- package/discussion/sections/activity-section/cache/hooks/edit/edit.hook.d.ts +7 -0
- package/discussion/sections/activity-section/cache/hooks/edit/index.d.ts +1 -0
- package/discussion/sections/activity-section/cache/hooks/index.d.ts +5 -0
- package/discussion/sections/activity-section/cache/hooks/like/index.d.ts +1 -0
- package/discussion/sections/activity-section/cache/hooks/like/like.hook.d.ts +8 -0
- package/discussion/sections/activity-section/cache/hooks/read/index.d.ts +1 -0
- package/discussion/sections/activity-section/cache/hooks/read/read.hook.d.ts +12 -0
- package/discussion/sections/activity-section/cache/hooks/section/index.d.ts +1 -0
- package/discussion/sections/activity-section/cache/hooks/unlike/index.d.ts +1 -0
- package/discussion/sections/activity-section/cache/hooks/unlike/unlike.hook.d.ts +8 -0
- package/discussion/sections/activity-section/cache/index.d.ts +2 -0
- package/discussion/sections/activity-section/cache/mocks/cache.mock.d.ts +4 -0
- package/discussion/sections/activity-section/cache/mocks/index.d.ts +1 -0
- package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +37 -0
- package/discussion/sections/activity-section/mocks/index.d.ts +2 -0
- package/discussion/shared/constants.d.ts +3 -0
- package/discussion/shared/handlers/error.handler.d.ts +2 -0
- package/discussion/shared/handlers/mutate.handler.d.ts +2 -0
- package/discussion/shared/helpers/activity.helper.d.ts +28 -0
- package/discussion/{feeds/activities-feed/cache → shared}/helpers/index.d.ts +1 -1
- package/discussion/shared/helpers/reaction.helper.d.ts +28 -0
- package/discussion/shared/helpers/reply.helper.d.ts +33 -0
- package/discussion/shared/helpers/user.helper.d.ts +10 -0
- package/discussion/shared/index.d.ts +5 -0
- package/discussion/shared/interfaces/activity.interface.d.ts +4 -0
- package/discussion/shared/interfaces/context.interface.d.ts +14 -0
- package/discussion/shared/interfaces/index.d.ts +4 -0
- package/discussion/shared/interfaces/reaction.interface.d.ts +3 -0
- package/discussion/shared/interfaces/user.interface.d.ts +9 -0
- package/discussion/shared/mocks/index.d.ts +4 -0
- package/discussion/shared/mocks/reply.mock.d.ts +80 -0
- package/index.js +15 -15
- package/index.mjs +3740 -3135
- package/package.json +1 -1
- package/discussion/feeds/activities-feed/activities-feed.mock.d.ts +0 -318
- package/discussion/feeds/activities-feed/cache/handlers/error.handler.d.ts +0 -2
- package/discussion/feeds/activities-feed/cache/handlers/mutate.handler.d.ts +0 -2
- package/discussion/feeds/activities-feed/cache/interfaces/cache.interface.d.ts +0 -15
- package/discussion/feeds/activities-feed/cache/interfaces/index.d.ts +0 -3
- package/discussion/feeds/activities-feed/cache/interfaces/mutation.interface.d.ts +0 -12
- package/discussion/feeds/activities-feed/cache/interfaces/query.interface.d.ts +0 -5
- package/discussion/feeds/replies-feed/replies-feed.handlers.d.ts +0 -147
- package/discussion/feeds/replies-feed/replies-feed.mock.d.ts +0 -2
- package/discussion/feeds/replies-to-replies-feed/index.d.ts +0 -1
- package/discussion/feeds/replies-to-replies-feed/replies-to-replies-feed.d.ts +0 -38
- package/discussion/feeds/replies-to-replies-feed/replies-to-replies-feed.handlers.d.ts +0 -161
- package/discussion/sections/activity-section/activity-section.handlers.d.ts +0 -84
- package/discussion/sections/activity-section/activity.mock.d.ts +0 -2
- /package/discussion/{feeds/activities-feed/cache → shared}/handlers/index.d.ts +0 -0
- /package/discussion/{feeds/activities-feed/cache → shared}/mocks/activity.mock.d.ts +0 -0
- /package/discussion/{feeds/activities-feed/cache → shared}/mocks/reaction.mock.d.ts +0 -0
- /package/discussion/{feeds/activities-feed/cache → shared}/mocks/user.mock.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface Props {
|
|
3
|
-
/** The number of posts in the thread */
|
|
4
|
-
count?:
|
|
3
|
+
/** The number of posts in the thread (defined as a string to allow "count+" format) */
|
|
4
|
+
count?: string;
|
|
5
5
|
/** Whether to show the show replies button or not */
|
|
6
6
|
showRepliesButton?: boolean;
|
|
7
7
|
/** The posts to render */
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ICache, ICacheItem, ICacheItems } from './cache.interface';
|
|
2
|
+
export declare function addItem(item: ICacheItem, cache?: ICache, replace?: boolean): ICache;
|
|
3
|
+
export declare function findItem(itemId: string, cache?: ICache): import("../../../shared").IActivity | undefined;
|
|
4
|
+
export declare function removeItem(itemId: string, cache: ICache): ICache;
|
|
5
|
+
export declare function flattenCache(cache?: ICache): ICacheItems;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InfiniteData } from '@tanstack/query-core';
|
|
2
|
+
import type { FeedAPIResponse } from 'getstream';
|
|
3
|
+
import type { IActivity, IReaction, IUser } from '../../../../discussion/shared';
|
|
4
|
+
export type ICache = InfiniteData<ICachePage, string>;
|
|
5
|
+
export type ICachePage = ExtendedFeedAPIResponse;
|
|
6
|
+
export type ICacheItems = ICacheItem[];
|
|
7
|
+
export type ICacheItem = IActivity;
|
|
8
|
+
export type ICacheSubitem = IReaction;
|
|
9
|
+
export type ICacheUser = IUser;
|
|
10
|
+
interface ExtendedFeedAPIResponse extends FeedAPIResponse {
|
|
11
|
+
results: IActivity[];
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache, ICacheItem } from '../..';
|
|
3
|
+
interface ICreateVars {
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useCreateActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, user, }: IMutationContext<ICacheItem, Error, ICreateVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IActivity, Error, ICreateVars, ICache>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache, ICacheItem } from '../..';
|
|
3
|
+
interface IEditVars {
|
|
4
|
+
activityId: string;
|
|
5
|
+
body: string;
|
|
6
|
+
}
|
|
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
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache, ICacheSubitem } from '../..';
|
|
2
3
|
interface ILikeVars {
|
|
3
4
|
activityId: string;
|
|
4
5
|
reactionId?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function useLikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, }:
|
|
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>;
|
|
7
8
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { QueryKey } from '@tanstack/react-query';
|
|
2
|
-
import type { ICache, ICachePage } from '
|
|
2
|
+
import type { ICache, ICachePage } from '../..';
|
|
3
3
|
export interface IListActivitiesArgs {
|
|
4
4
|
queryFn: (_: unknown) => Promise<ICachePage>;
|
|
5
5
|
queryKey: QueryKey;
|
|
6
6
|
}
|
|
7
7
|
export declare function useListActivities({ queryFn, queryKey }: IListActivitiesArgs): {
|
|
8
|
-
activities: import("
|
|
8
|
+
activities: import("../..").ICacheItems;
|
|
9
9
|
error: Error | null;
|
|
10
10
|
isLoading: boolean;
|
|
11
11
|
hasNextPage: boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache } from '../..';
|
|
3
|
+
interface IRemoveVars {
|
|
4
|
+
activityId: string;
|
|
5
|
+
}
|
|
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
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache } from '../..';
|
|
2
3
|
interface IUnlikeVars {
|
|
3
4
|
activityId: string;
|
|
4
|
-
reactionId
|
|
5
|
+
reactionId?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function useUnlikeActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, user, }:
|
|
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>;
|
|
7
8
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const cacheMock1: Readonly<{
|
|
2
|
+
pages: {
|
|
3
|
+
next: string;
|
|
4
|
+
results: import('../../../../../discussion/shared').IActivity[];
|
|
5
|
+
}[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const cacheMock2: Readonly<{
|
|
8
|
+
pages: {
|
|
9
|
+
next: string;
|
|
10
|
+
results: import('../../../../../discussion/shared').IActivity[];
|
|
11
|
+
}[];
|
|
12
|
+
}>;
|
|
13
|
+
export declare const cacheMock3: Readonly<{
|
|
14
|
+
pages: {
|
|
15
|
+
next: string;
|
|
16
|
+
results: import('../../../../../discussion/shared').IActivity[];
|
|
17
|
+
}[];
|
|
18
|
+
}>;
|
|
19
|
+
export declare const cacheMock4: Readonly<{
|
|
20
|
+
pages: {
|
|
21
|
+
next: string;
|
|
22
|
+
results: import('../../../../../discussion/shared').IActivity[];
|
|
23
|
+
}[];
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const activitiesFeedMock: {
|
|
2
|
+
results: ({
|
|
3
|
+
actor: {
|
|
4
|
+
created_at: string;
|
|
5
|
+
updated_at: string;
|
|
6
|
+
id: string;
|
|
7
|
+
data: {
|
|
8
|
+
jobTitle: string;
|
|
9
|
+
name: string;
|
|
10
|
+
organization: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
content: string;
|
|
14
|
+
feed_id: string;
|
|
15
|
+
foreign_id: string;
|
|
16
|
+
id: string;
|
|
17
|
+
latest_reactions: {};
|
|
18
|
+
latest_reactions_extra: {};
|
|
19
|
+
object: string;
|
|
20
|
+
origin: null;
|
|
21
|
+
own_reactions: {};
|
|
22
|
+
reaction_counts: {
|
|
23
|
+
like: number;
|
|
24
|
+
};
|
|
25
|
+
target: string;
|
|
26
|
+
time: string;
|
|
27
|
+
verb: string;
|
|
28
|
+
} | {
|
|
29
|
+
actor: {
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
id: string;
|
|
33
|
+
data: {
|
|
34
|
+
jobTitle: string;
|
|
35
|
+
name: string;
|
|
36
|
+
organization: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
content: string;
|
|
40
|
+
feed_id: string;
|
|
41
|
+
foreign_id: string;
|
|
42
|
+
id: string;
|
|
43
|
+
latest_reactions: {};
|
|
44
|
+
latest_reactions_extra: {};
|
|
45
|
+
object: string;
|
|
46
|
+
origin: null;
|
|
47
|
+
own_reactions: {};
|
|
48
|
+
reaction_counts: {
|
|
49
|
+
like?: undefined;
|
|
50
|
+
};
|
|
51
|
+
target: string;
|
|
52
|
+
time: string;
|
|
53
|
+
verb: string;
|
|
54
|
+
})[];
|
|
55
|
+
next: string;
|
|
56
|
+
duration: string;
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './activities-feed.mock';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ICache, ICacheItem, ICacheItems } from './cache.interface';
|
|
2
|
+
interface IAdditionOptions {
|
|
3
|
+
append?: boolean;
|
|
4
|
+
replace?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function addItem(item: ICacheItem, cache?: ICache, opts?: IAdditionOptions): {
|
|
7
|
+
pages: {
|
|
8
|
+
next: string;
|
|
9
|
+
results: import("../../../shared").IReaction[];
|
|
10
|
+
}[];
|
|
11
|
+
pageParams: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare function findItem(itemId: string, cache?: ICache): import("../../../shared").IReaction | undefined;
|
|
14
|
+
export declare function removeItem(itemId: string, cache: ICache): ICache;
|
|
15
|
+
export declare function flattenCache(cache?: ICache): ICacheItems;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InfiniteData } from '@tanstack/query-core';
|
|
2
|
+
import type { ReactionFilterAPIResponse } from 'getstream';
|
|
3
|
+
import type { IReaction, IUser } from '../../../../discussion/shared';
|
|
4
|
+
export type ICache = InfiniteData<ICachePage, string>;
|
|
5
|
+
export type ICachePage = ExtendedReactionFilterAPIResponse;
|
|
6
|
+
export type ICacheItems = ICacheItem[];
|
|
7
|
+
export type ICacheItem = IReaction;
|
|
8
|
+
export type ICacheSubitem = IReaction;
|
|
9
|
+
export type ICacheUser = IUser;
|
|
10
|
+
interface ExtendedReactionFilterAPIResponse extends ReactionFilterAPIResponse {
|
|
11
|
+
results: IReaction[];
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache, ICacheItem } from '../..';
|
|
3
|
+
interface ICreateVars {
|
|
4
|
+
activityId: string;
|
|
5
|
+
content: string;
|
|
6
|
+
replyId?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function useCreateReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, queryClient, queryKey, user, }: IMutationContext<ICacheItem, Error, ICreateVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IReaction, Error, ICreateVars, ICache>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create.hook';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache, ICacheItem } from '../..';
|
|
3
|
+
interface IEditVars {
|
|
4
|
+
replyId: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
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
|
+
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,8 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache, ICacheSubitem } from '../..';
|
|
3
|
+
interface ILikeVars {
|
|
4
|
+
replyId: string;
|
|
5
|
+
reactionId?: string;
|
|
6
|
+
}
|
|
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
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './list.hook';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryKey } from '@tanstack/react-query';
|
|
2
|
+
import type { ICache, ICachePage } from '../..';
|
|
3
|
+
export interface IListRepliesArgs {
|
|
4
|
+
queryFn: (_: unknown) => Promise<ICachePage>;
|
|
5
|
+
queryKey: QueryKey;
|
|
6
|
+
}
|
|
7
|
+
export declare function useListReplies({ queryFn, queryKey }: IListRepliesArgs): {
|
|
8
|
+
replies: import("../..").ICacheItems;
|
|
9
|
+
repliesCount: string;
|
|
10
|
+
error: Error | null;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
hasNextPage: boolean;
|
|
13
|
+
fetchNextPage: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").a2 | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").aj<ICache, Error>>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './remove.hook';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache } from '../..';
|
|
3
|
+
interface IRemoveVars {
|
|
4
|
+
replyId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useRemoveReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationContext<void, Error, IRemoveVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<void, Error, IRemoveVars, ICache>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './unlike.hook';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache } from '../..';
|
|
3
|
+
interface IUnlikeVars {
|
|
4
|
+
replyId: string;
|
|
5
|
+
reactionId?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function useUnlikeReply({ 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
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const cacheMock1: Readonly<{
|
|
2
|
+
pages: {
|
|
3
|
+
next: string;
|
|
4
|
+
results: import('../../../../../discussion/shared').IReaction[];
|
|
5
|
+
}[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const cacheMock2: Readonly<{
|
|
8
|
+
pages: {
|
|
9
|
+
next: string;
|
|
10
|
+
results: import('../../../../../discussion/shared').IReaction[];
|
|
11
|
+
}[];
|
|
12
|
+
}>;
|
|
13
|
+
export declare const cacheMock3: Readonly<{
|
|
14
|
+
pages: {
|
|
15
|
+
next: string;
|
|
16
|
+
results: import('../../../../../discussion/shared').IReaction[];
|
|
17
|
+
}[];
|
|
18
|
+
}>;
|
|
19
|
+
export declare const cacheMock4: Readonly<{
|
|
20
|
+
pages: {
|
|
21
|
+
next: string;
|
|
22
|
+
results: import('../../../../../discussion/shared').IReaction[];
|
|
23
|
+
}[];
|
|
24
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cache.mock';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './replies-feed.mock';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export declare const repliesFeedMock: {
|
|
2
|
+
next: string;
|
|
3
|
+
results: ({
|
|
4
|
+
created_at: string;
|
|
5
|
+
updated_at: string;
|
|
6
|
+
id: string;
|
|
7
|
+
user_id: string;
|
|
8
|
+
user: {
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
id: string;
|
|
12
|
+
data: {
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
kind: string;
|
|
17
|
+
activity_id: string;
|
|
18
|
+
data: {
|
|
19
|
+
content: string;
|
|
20
|
+
};
|
|
21
|
+
parent: string;
|
|
22
|
+
latest_children: {
|
|
23
|
+
reply?: undefined;
|
|
24
|
+
};
|
|
25
|
+
children_counts: {
|
|
26
|
+
reply?: undefined;
|
|
27
|
+
};
|
|
28
|
+
own_children?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
id: string;
|
|
33
|
+
user_id: string;
|
|
34
|
+
user: {
|
|
35
|
+
created_at: string;
|
|
36
|
+
updated_at: string;
|
|
37
|
+
id: string;
|
|
38
|
+
data: {
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
kind: string;
|
|
43
|
+
activity_id: string;
|
|
44
|
+
data: {
|
|
45
|
+
content: string;
|
|
46
|
+
};
|
|
47
|
+
parent: string;
|
|
48
|
+
latest_children: {
|
|
49
|
+
reply: {
|
|
50
|
+
created_at: string;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
id: string;
|
|
53
|
+
user_id: string;
|
|
54
|
+
user: {
|
|
55
|
+
created_at: string;
|
|
56
|
+
updated_at: string;
|
|
57
|
+
id: string;
|
|
58
|
+
data: {
|
|
59
|
+
name: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
kind: string;
|
|
63
|
+
activity_id: string;
|
|
64
|
+
data: {
|
|
65
|
+
content: string;
|
|
66
|
+
};
|
|
67
|
+
parent: string;
|
|
68
|
+
latest_children: {};
|
|
69
|
+
children_counts: {};
|
|
70
|
+
}[];
|
|
71
|
+
};
|
|
72
|
+
own_children: {
|
|
73
|
+
reply: {
|
|
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
|
+
name: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
kind: string;
|
|
87
|
+
activity_id: string;
|
|
88
|
+
data: {
|
|
89
|
+
content: string;
|
|
90
|
+
};
|
|
91
|
+
parent: string;
|
|
92
|
+
latest_children: {};
|
|
93
|
+
children_counts: {};
|
|
94
|
+
}[];
|
|
95
|
+
};
|
|
96
|
+
children_counts: {
|
|
97
|
+
reply: number;
|
|
98
|
+
};
|
|
99
|
+
})[];
|
|
100
|
+
duration: string;
|
|
101
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NestedRepliesFeed } from './nested-replies-feed';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './nested-replies-feed.mock';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const nestedRepliesFeedMock: {
|
|
2
|
+
next: string;
|
|
3
|
+
results: {
|
|
4
|
+
created_at: string;
|
|
5
|
+
updated_at: string;
|
|
6
|
+
id: string;
|
|
7
|
+
user_id: string;
|
|
8
|
+
user: {
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
id: string;
|
|
12
|
+
data: {
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
kind: string;
|
|
17
|
+
activity_id: string;
|
|
18
|
+
data: {
|
|
19
|
+
content: string;
|
|
20
|
+
};
|
|
21
|
+
parent: string;
|
|
22
|
+
latest_children: {};
|
|
23
|
+
children_counts: {};
|
|
24
|
+
}[];
|
|
25
|
+
duration: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IQueryFns } from '../cache';
|
|
3
|
+
interface Props {
|
|
4
|
+
basePath: string;
|
|
5
|
+
parentId: string;
|
|
6
|
+
activityId: string;
|
|
7
|
+
replyId: string;
|
|
8
|
+
isMember: boolean;
|
|
9
|
+
functions: IQueryFns;
|
|
10
|
+
}
|
|
11
|
+
declare const NestedRepliesFeed: React.FC<Props>;
|
|
12
|
+
export default NestedRepliesFeed;
|
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import type { IQueryFns } from './cache';
|
|
3
3
|
interface Props {
|
|
4
4
|
basePath: string;
|
|
5
5
|
parentId: string;
|
|
6
6
|
activityId: string;
|
|
7
|
-
repliesList: IReply[] | undefined;
|
|
8
7
|
isMember: boolean;
|
|
9
8
|
functions: {
|
|
10
|
-
|
|
11
|
-
activityId?: string;
|
|
12
|
-
replyId?: string;
|
|
13
|
-
content: string;
|
|
14
|
-
}) => Promise<void>;
|
|
15
|
-
edit: ({ parentId, replyId, content, }: {
|
|
16
|
-
parentId: string;
|
|
17
|
-
replyId: string;
|
|
18
|
-
content: {
|
|
19
|
-
body: string;
|
|
20
|
-
};
|
|
21
|
-
}) => Promise<void>;
|
|
22
|
-
remove: ({ replyId }: {
|
|
23
|
-
replyId: string;
|
|
24
|
-
}) => Promise<void>;
|
|
25
|
-
like: ({ replyId, replyParentId, }: {
|
|
26
|
-
replyId: string;
|
|
27
|
-
replyParentId?: string;
|
|
28
|
-
}) => Promise<void>;
|
|
29
|
-
unlike: ({ replyId }: {
|
|
30
|
-
replyId: string;
|
|
31
|
-
}) => Promise<void>;
|
|
9
|
+
reactions: IQueryFns;
|
|
32
10
|
join: () => Promise<void>;
|
|
33
11
|
leave: () => Promise<void>;
|
|
34
12
|
};
|
|
@@ -1,49 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { IRepliesFeedQueryFns } from '../../../discussion/feeds';
|
|
3
|
+
import type { IQueryFns } from './cache';
|
|
4
|
+
interface IActivitySectionQueryFns extends IQueryFns {
|
|
5
|
+
remove: () => Promise<void>;
|
|
6
|
+
}
|
|
4
7
|
interface Props {
|
|
5
8
|
basePath: string;
|
|
6
9
|
parentId: string;
|
|
7
10
|
activityId: string;
|
|
8
11
|
isMember: boolean;
|
|
9
12
|
functions: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
parentId: string;
|
|
13
|
-
activityId: string;
|
|
14
|
-
content: {
|
|
15
|
-
body: string;
|
|
16
|
-
};
|
|
17
|
-
}) => Promise<void>;
|
|
18
|
-
removeActivity: ({ activityId }: {
|
|
19
|
-
activityId: string;
|
|
20
|
-
}) => Promise<void>;
|
|
21
|
-
likeActivity: ({ activityId }: {
|
|
22
|
-
activityId: string;
|
|
23
|
-
}) => Promise<void>;
|
|
24
|
-
unlikeActivity: ({ activityId, reactionId, }: {
|
|
25
|
-
activityId: string;
|
|
26
|
-
reactionId: string | undefined;
|
|
27
|
-
}) => Promise<void>;
|
|
28
|
-
createReply: () => Promise<void>;
|
|
29
|
-
likeReply: ({ replyId }: {
|
|
30
|
-
replyId: string;
|
|
31
|
-
}) => Promise<void>;
|
|
32
|
-
unlikeReply: ({ replyId }: {
|
|
33
|
-
replyId: string;
|
|
34
|
-
}) => Promise<void>;
|
|
13
|
+
activities: IActivitySectionQueryFns;
|
|
14
|
+
reactions: IRepliesFeedQueryFns;
|
|
35
15
|
join: () => Promise<void>;
|
|
36
16
|
leave: () => Promise<void>;
|
|
37
|
-
editReply: ({ parentId, replyId, content, }: {
|
|
38
|
-
parentId: string;
|
|
39
|
-
replyId: string;
|
|
40
|
-
content: {
|
|
41
|
-
body: string;
|
|
42
|
-
};
|
|
43
|
-
}) => Promise<void>;
|
|
44
|
-
removeReply: ({ replyId }: {
|
|
45
|
-
replyId: string;
|
|
46
|
-
}) => Promise<void>;
|
|
47
17
|
};
|
|
48
18
|
}
|
|
49
19
|
declare const ActivitySection: React.FC<Props>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMutationContext } from '../../../../../../discussion/shared';
|
|
2
|
+
import type { ICache } from '../..';
|
|
3
|
+
interface IEditVars {
|
|
4
|
+
body: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useEditActivity({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError, }, }: IMutationContext<ICache, Error, IEditVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IActivity, Error, IEditVars, import('../../../../../../discussion/shared').IActivity>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './edit.hook';
|