@apolitical/component-library 1.11.0-beta.2 → 1.11.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/context/cache/cache.provider.d.ts +1 -1
- package/context/index.d.ts +0 -1
- package/discussion/feeds/activities-feed/activities-feed.d.ts +7 -0
- package/discussion/feeds/activities-feed/activities-feed.handlers.d.ts +12 -0
- package/discussion/feeds/replies-feed/replies-feed.d.ts +7 -0
- package/discussion/feeds/replies-feed/replies-feed.handlers.d.ts +38 -0
- package/discussion/sections/activity-section/activity-section.d.ts +14 -0
- package/discussion/sections/activity-section/activity-section.handlers.d.ts +12 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/use-feature-flag.d.ts +5 -0
- package/index.js +51 -14
- package/index.mjs +13197 -2358
- package/package.json +2 -2
- package/context/flags/flags.provider.d.ts +0 -8
- package/context/flags/index.d.ts +0 -1
package/context/index.d.ts
CHANGED
|
@@ -7,6 +7,13 @@ interface Props {
|
|
|
7
7
|
functions: {
|
|
8
8
|
list: QueryFunction<unknown, InvalidateQueryFilters[], never>;
|
|
9
9
|
create: () => Promise<void>;
|
|
10
|
+
edit: ({ parentId, activityId, content, }: {
|
|
11
|
+
parentId: string;
|
|
12
|
+
activityId: string;
|
|
13
|
+
content: {
|
|
14
|
+
body: string;
|
|
15
|
+
};
|
|
16
|
+
}) => Promise<void>;
|
|
10
17
|
like: ({ activityId }: {
|
|
11
18
|
activityId: string;
|
|
12
19
|
}) => Promise<void>;
|
|
@@ -7,6 +7,18 @@ export interface buildAddActivityHandlersProps {
|
|
|
7
7
|
mutationFn: () => Promise<void>;
|
|
8
8
|
}
|
|
9
9
|
export declare const buildAddActivityHandlers: ({ queryClient, queryKey, user, mutationFn, }: buildAddActivityHandlersProps) => object;
|
|
10
|
+
export interface buildEditActivityHandlersProps {
|
|
11
|
+
queryClient: QueryClient;
|
|
12
|
+
queryKey: QueryKey;
|
|
13
|
+
mutationFn: ({ parentId, activityId, content, }: {
|
|
14
|
+
parentId: string;
|
|
15
|
+
activityId: string;
|
|
16
|
+
content: {
|
|
17
|
+
body: string;
|
|
18
|
+
};
|
|
19
|
+
}) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export declare const buildEditActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildEditActivityHandlersProps) => object;
|
|
10
22
|
interface buildLikeActivityHandlersProps {
|
|
11
23
|
queryClient: QueryClient;
|
|
12
24
|
queryKey: QueryKey;
|
|
@@ -8,6 +8,13 @@ interface Props {
|
|
|
8
8
|
isMember: boolean;
|
|
9
9
|
functions: {
|
|
10
10
|
createReply: () => Promise<void>;
|
|
11
|
+
editReply: ({ parentId, replyId, content, }: {
|
|
12
|
+
parentId: string;
|
|
13
|
+
replyId: string;
|
|
14
|
+
content: {
|
|
15
|
+
body: string;
|
|
16
|
+
};
|
|
17
|
+
}) => Promise<void>;
|
|
11
18
|
like: ({ replyId }: {
|
|
12
19
|
replyId: string;
|
|
13
20
|
}) => Promise<void>;
|
|
@@ -21,6 +21,44 @@ export declare const buildAddReplyHandlers: ({ queryClient, queryKey, mutationFn
|
|
|
21
21
|
} | undefined;
|
|
22
22
|
onSettled: () => void;
|
|
23
23
|
};
|
|
24
|
+
interface buildEditReplyHandlersProps {
|
|
25
|
+
queryClient: QueryClient;
|
|
26
|
+
queryKey: QueryKey;
|
|
27
|
+
mutationFn: ({ parentId, replyId, content, }: {
|
|
28
|
+
parentId: string;
|
|
29
|
+
replyId: string;
|
|
30
|
+
content: {
|
|
31
|
+
body: string;
|
|
32
|
+
};
|
|
33
|
+
}) => Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export declare const buildEditReplyHanders: ({ queryClient, queryKey, mutationFn, }: buildEditReplyHandlersProps) => {
|
|
36
|
+
mutationFn: ({ parentId, replyId, content, }: {
|
|
37
|
+
parentId: string;
|
|
38
|
+
replyId: string;
|
|
39
|
+
content: {
|
|
40
|
+
body: string;
|
|
41
|
+
};
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
onMutate: ({ replyInfo, content: { body }, }: {
|
|
44
|
+
replyInfo: {
|
|
45
|
+
parentId: string;
|
|
46
|
+
replySlug: string;
|
|
47
|
+
};
|
|
48
|
+
content: {
|
|
49
|
+
body: string;
|
|
50
|
+
};
|
|
51
|
+
}) => Promise<{
|
|
52
|
+
previousActivity: IActivity;
|
|
53
|
+
} | undefined>;
|
|
54
|
+
onError: (_err: {
|
|
55
|
+
[key: string]: string;
|
|
56
|
+
}, _changedActivity: {
|
|
57
|
+
activityId: string;
|
|
58
|
+
}, context: {
|
|
59
|
+
previousActivity: IActivity;
|
|
60
|
+
}) => void;
|
|
61
|
+
};
|
|
24
62
|
interface buildLikeReplyHandlersProps {
|
|
25
63
|
queryClient: QueryClient;
|
|
26
64
|
queryKey: QueryKey;
|
|
@@ -8,6 +8,13 @@ interface Props {
|
|
|
8
8
|
isMember: boolean;
|
|
9
9
|
functions: {
|
|
10
10
|
get: QueryFunction<IActivity, InvalidateQueryFilters[], never>;
|
|
11
|
+
editActivity: ({ parentId, activityId, content, }: {
|
|
12
|
+
parentId: string;
|
|
13
|
+
activityId: string;
|
|
14
|
+
content: {
|
|
15
|
+
body: string;
|
|
16
|
+
};
|
|
17
|
+
}) => Promise<void>;
|
|
11
18
|
likeActivity: ({ activityId }: {
|
|
12
19
|
activityId: string;
|
|
13
20
|
}) => Promise<void>;
|
|
@@ -24,6 +31,13 @@ interface Props {
|
|
|
24
31
|
}) => Promise<void>;
|
|
25
32
|
join: () => Promise<void>;
|
|
26
33
|
leave: () => Promise<void>;
|
|
34
|
+
editReply: ({ parentId, replyId, content, }: {
|
|
35
|
+
parentId: string;
|
|
36
|
+
replyId: string;
|
|
37
|
+
content: {
|
|
38
|
+
body: string;
|
|
39
|
+
};
|
|
40
|
+
}) => Promise<void>;
|
|
27
41
|
};
|
|
28
42
|
}
|
|
29
43
|
declare const ActivitySection: React.FC<Props>;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { QueryClient, QueryKey } from '@tanstack/query-core';
|
|
2
2
|
import { IActivity, ILike } from '../../getstream';
|
|
3
3
|
import { IUserContext } from '../../..';
|
|
4
|
+
interface buildEditActivityHandlersProps {
|
|
5
|
+
queryClient: QueryClient;
|
|
6
|
+
queryKey: QueryKey;
|
|
7
|
+
mutationFn: ({ parentId, activityId, content, }: {
|
|
8
|
+
parentId: string;
|
|
9
|
+
activityId: string;
|
|
10
|
+
content: {
|
|
11
|
+
body: string;
|
|
12
|
+
};
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare const buildEditActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildEditActivityHandlersProps) => object;
|
|
4
16
|
interface buildLikeActivityHandlersProps {
|
|
5
17
|
queryClient: QueryClient;
|
|
6
18
|
queryKey: QueryKey;
|
package/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as useCurrentPath } from './use-current-path';
|
|
2
2
|
export { default as useEffectAfterMount } from './use-effect-after-mount';
|
|
3
|
+
export { default as useFeatureFlag } from './use-feature-flag';
|
|
3
4
|
export { default as useScreenWidth } from './use-screen-width';
|
|
4
5
|
export { default as useScrollListener } from './use-scroll-listener';
|
|
5
6
|
export { default as useScrollToHash } from './use-scroll-to-hash';
|