@apolitical/component-library 1.7.0 → 1.7.1-beta.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/4TNE5QTO-29f4faa2.mjs +9077 -0
- package/4TNE5QTO-59ee46fe.js +987 -0
- package/context/index.d.ts +1 -0
- package/context/react-query/index.d.ts +1 -0
- package/context/react-query/react-query.provider.d.ts +7 -0
- package/context/user/user.context.d.ts +2 -0
- package/discussion/components/add-post/add-post.d.ts +16 -0
- package/discussion/components/add-post/index.d.ts +1 -0
- package/discussion/{form → components/form}/form.d.ts +1 -1
- package/discussion/components/index.d.ts +7 -0
- package/discussion/{likes → components/likes}/likes.d.ts +3 -3
- package/discussion/{likes → components/likes}/likes.helpers.d.ts +1 -1
- package/discussion/{post → components/post}/post.d.ts +1 -1
- package/discussion/feeds/activities-feed/activities-feed.d.ts +28 -0
- package/discussion/feeds/activities-feed/activities-feed.handlers.d.ts +30 -0
- package/discussion/feeds/activities-feed/activities-feed.helpers.d.ts +23 -0
- package/discussion/feeds/activities-feed/activities-feed.mock.d.ts +318 -0
- package/discussion/feeds/activities-feed/index.d.ts +1 -0
- package/discussion/feeds/index.d.ts +2 -0
- package/discussion/feeds/replies-feed/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/replies-feed.d.ts +29 -0
- package/discussion/feeds/replies-feed/replies-feed.handlers.d.ts +82 -0
- package/discussion/feeds/replies-feed/replies-feed.mock.d.ts +2 -0
- package/discussion/index.d.ts +3 -6
- package/discussion/sections/activity-section/activity-section.d.ts +36 -0
- package/discussion/sections/activity-section/activity-section.handlers.d.ts +60 -0
- package/discussion/sections/activity-section/activity.mock.d.ts +2 -0
- package/discussion/sections/activity-section/index.d.ts +1 -0
- package/discussion/sections/index.d.ts +1 -0
- package/index-413092b1.js +101 -0
- package/index-513c58d1.mjs +23279 -0
- package/index.js +1 -101
- package/index.mjs +77 -19498
- package/package.json +1 -1
- /package/discussion/{conversation → components/conversation}/conversation.d.ts +0 -0
- /package/discussion/{conversation → components/conversation}/index.d.ts +0 -0
- /package/discussion/{form → components/form}/index.d.ts +0 -0
- /package/discussion/{likes → components/likes}/index.d.ts +0 -0
- /package/discussion/{post → components/post}/index.d.ts +0 -0
- /package/discussion/{post → components/post}/post.mock.d.ts +0 -0
- /package/discussion/{responses-heading → components/responses-heading}/index.d.ts +0 -0
- /package/discussion/{responses-heading → components/responses-heading}/responses-heading.d.ts +0 -0
- /package/discussion/{thread → components/thread}/index.d.ts +0 -0
- /package/discussion/{thread → components/thread}/thread.d.ts +0 -0
package/context/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './react-query.provider';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UseMutateFunction } from '@tanstack/react-query';
|
|
3
|
+
import { IDiscussionContentType } from '../../discussion';
|
|
4
|
+
interface Props {
|
|
5
|
+
membershipRequiredToPost: {
|
|
6
|
+
required: boolean;
|
|
7
|
+
isMember?: boolean;
|
|
8
|
+
join?: () => Promise<void>;
|
|
9
|
+
leave?: () => Promise<void>;
|
|
10
|
+
notMemberStateText?: string;
|
|
11
|
+
};
|
|
12
|
+
contentType: IDiscussionContentType;
|
|
13
|
+
createPost: UseMutateFunction<any, any, any, any>;
|
|
14
|
+
}
|
|
15
|
+
declare const AddPost: React.FC<Props>;
|
|
16
|
+
export default AddPost;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AddPost } from './add-post';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DiscussionCreateContentFunction, IDiscussionContent } from '
|
|
2
|
+
import { DiscussionCreateContentFunction, IDiscussionContent } from './../../discussion';
|
|
3
3
|
interface Props {
|
|
4
4
|
/** Information about the content being created/edited */
|
|
5
5
|
content: IDiscussionContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MemberProps } from '
|
|
3
|
-
import { IDiscussionContent } from '
|
|
2
|
+
import { MemberProps } from '../../../user';
|
|
3
|
+
import { IDiscussionContent } from './../../discussion';
|
|
4
4
|
interface Props {
|
|
5
5
|
/** The element to render around the content */
|
|
6
6
|
element?: 'li' | 'div';
|
|
@@ -26,7 +26,7 @@ interface Props {
|
|
|
26
26
|
/** The language to use for the text */
|
|
27
27
|
locale?: string;
|
|
28
28
|
}
|
|
29
|
-
declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, functions: { createLike, deleteLike } }: Props) => React.DetailedReactHTMLElement<{
|
|
29
|
+
declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, functions: { createLike, deleteLike }, }: Props) => React.DetailedReactHTMLElement<{
|
|
30
30
|
className: string;
|
|
31
31
|
onClick: (e: React.MouseEvent<HTMLElement>) => false | undefined;
|
|
32
32
|
onMouseEnter: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, IFullDiscussionContent } from '
|
|
2
|
+
import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, IFullDiscussionContent } from '../../discussion';
|
|
3
3
|
interface Props {
|
|
4
4
|
/** The element that will render around the content */
|
|
5
5
|
element?: 'li' | 'div' | 'section' | 'article';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InvalidateQueryFilters, QueryFunction } from '@tanstack/react-query';
|
|
3
|
+
interface Props {
|
|
4
|
+
basePath: string;
|
|
5
|
+
parentId: string;
|
|
6
|
+
membershipRequiredToPost: {
|
|
7
|
+
isMember: boolean;
|
|
8
|
+
join: () => Promise<void>;
|
|
9
|
+
leave: () => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
cache: {
|
|
12
|
+
activitiesListQueryKey: InvalidateQueryFilters;
|
|
13
|
+
singleActivityQueryKeyWithoutVariable: InvalidateQueryFilters;
|
|
14
|
+
};
|
|
15
|
+
functions: {
|
|
16
|
+
list: QueryFunction<unknown, InvalidateQueryFilters[], never>;
|
|
17
|
+
create: () => Promise<void>;
|
|
18
|
+
like: ({ activityId }: {
|
|
19
|
+
activityId: string;
|
|
20
|
+
}) => Promise<void>;
|
|
21
|
+
unlike: ({ activityId, reactionId, }: {
|
|
22
|
+
activityId: string;
|
|
23
|
+
reactionId: string;
|
|
24
|
+
}) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
declare const ActivitiesFeed: React.FC<Props>;
|
|
28
|
+
export default ActivitiesFeed;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { QueryClient, InvalidateQueryFilters } from '@tanstack/query-core';
|
|
2
|
+
import { IUserContext } from '../../..';
|
|
3
|
+
export interface buildAddActivityHandlersProps {
|
|
4
|
+
queryClient: QueryClient;
|
|
5
|
+
queryKey: InvalidateQueryFilters;
|
|
6
|
+
user: IUserContext | null;
|
|
7
|
+
mutationFn: () => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const buildAddActivityHandlers: ({ queryClient, queryKey, user, mutationFn, }: buildAddActivityHandlersProps) => object;
|
|
10
|
+
interface buildLikeActivityHandlersProps {
|
|
11
|
+
queryClient: QueryClient;
|
|
12
|
+
queryKey: InvalidateQueryFilters;
|
|
13
|
+
mutationFn: ({ activityId }: {
|
|
14
|
+
activityId: string;
|
|
15
|
+
}) => Promise<void>;
|
|
16
|
+
affectedQueryKey: InvalidateQueryFilters;
|
|
17
|
+
}
|
|
18
|
+
export declare const buildLikeActivityHandlers: ({ queryClient, queryKey, mutationFn, affectedQueryKey, }: buildLikeActivityHandlersProps) => object;
|
|
19
|
+
interface buildUnlikeActivityHandlersProps {
|
|
20
|
+
queryClient: QueryClient;
|
|
21
|
+
queryKey: InvalidateQueryFilters;
|
|
22
|
+
user: IUserContext | null;
|
|
23
|
+
mutationFn: ({ activityId, reactionId, }: {
|
|
24
|
+
activityId: string;
|
|
25
|
+
reactionId: string;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
affectedQueryKey: InvalidateQueryFilters;
|
|
28
|
+
}
|
|
29
|
+
export declare const buildUnlikeActivityHandlers: ({ queryClient, queryKey, user, mutationFn, affectedQueryKey, }: buildUnlikeActivityHandlersProps) => object;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IUserDetails } from '../../../context';
|
|
2
|
+
export declare const createActivityObject: ({ user, content, verb, }: {
|
|
3
|
+
user: IUserDetails;
|
|
4
|
+
content: string;
|
|
5
|
+
verb: string;
|
|
6
|
+
}) => {
|
|
7
|
+
actor: {
|
|
8
|
+
id: string | undefined;
|
|
9
|
+
data: {
|
|
10
|
+
name: string | undefined;
|
|
11
|
+
organization: string | undefined;
|
|
12
|
+
jobTitle: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
content: string;
|
|
16
|
+
latest_reactions: {
|
|
17
|
+
like: never[];
|
|
18
|
+
};
|
|
19
|
+
reaction_counts: {
|
|
20
|
+
like: number;
|
|
21
|
+
};
|
|
22
|
+
verb: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
export declare const activitiesFeedMock: ({
|
|
2
|
+
actor: {
|
|
3
|
+
created_at: string;
|
|
4
|
+
updated_at: string;
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
jobTitle: string;
|
|
8
|
+
name: string;
|
|
9
|
+
organization: string;
|
|
10
|
+
thumbnail: null;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
content: string;
|
|
14
|
+
feed_id: string;
|
|
15
|
+
foreign_id: string;
|
|
16
|
+
id: string;
|
|
17
|
+
latest_reactions: {
|
|
18
|
+
like: {
|
|
19
|
+
created_at: string;
|
|
20
|
+
updated_at: string;
|
|
21
|
+
id: string;
|
|
22
|
+
user_id: string;
|
|
23
|
+
user: {
|
|
24
|
+
created_at: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
id: string;
|
|
27
|
+
data: {
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
kind: string;
|
|
32
|
+
activity_id: string;
|
|
33
|
+
data: {};
|
|
34
|
+
parent: string;
|
|
35
|
+
latest_children: {};
|
|
36
|
+
children_counts: {};
|
|
37
|
+
}[];
|
|
38
|
+
reply: {
|
|
39
|
+
created_at: string;
|
|
40
|
+
updated_at: string;
|
|
41
|
+
id: string;
|
|
42
|
+
user_id: string;
|
|
43
|
+
user: {
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
id: string;
|
|
47
|
+
data: {
|
|
48
|
+
name: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
kind: string;
|
|
52
|
+
activity_id: string;
|
|
53
|
+
data: {
|
|
54
|
+
content: {
|
|
55
|
+
text: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
parent: string;
|
|
59
|
+
latest_children: {};
|
|
60
|
+
children_counts: {};
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
latest_reactions_extra: {
|
|
64
|
+
like: {
|
|
65
|
+
next: string;
|
|
66
|
+
};
|
|
67
|
+
reply: {
|
|
68
|
+
next: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
object: string;
|
|
72
|
+
origin: null;
|
|
73
|
+
own_reactions: {
|
|
74
|
+
like: {
|
|
75
|
+
created_at: string;
|
|
76
|
+
updated_at: string;
|
|
77
|
+
id: string;
|
|
78
|
+
user_id: string;
|
|
79
|
+
user: {
|
|
80
|
+
created_at: string;
|
|
81
|
+
updated_at: string;
|
|
82
|
+
id: string;
|
|
83
|
+
data: {
|
|
84
|
+
name: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
kind: string;
|
|
88
|
+
activity_id: string;
|
|
89
|
+
data: {};
|
|
90
|
+
parent: string;
|
|
91
|
+
latest_children: {};
|
|
92
|
+
children_counts: {};
|
|
93
|
+
}[];
|
|
94
|
+
reply: {
|
|
95
|
+
created_at: string;
|
|
96
|
+
updated_at: string;
|
|
97
|
+
id: string;
|
|
98
|
+
user_id: string;
|
|
99
|
+
user: {
|
|
100
|
+
created_at: string;
|
|
101
|
+
updated_at: string;
|
|
102
|
+
id: string;
|
|
103
|
+
data: {
|
|
104
|
+
name: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
kind: string;
|
|
108
|
+
activity_id: string;
|
|
109
|
+
data: {
|
|
110
|
+
content: {
|
|
111
|
+
text: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
parent: string;
|
|
115
|
+
latest_children: {};
|
|
116
|
+
children_counts: {};
|
|
117
|
+
}[];
|
|
118
|
+
};
|
|
119
|
+
reaction_counts: {
|
|
120
|
+
like: number;
|
|
121
|
+
reply: number;
|
|
122
|
+
};
|
|
123
|
+
target: string;
|
|
124
|
+
time: string;
|
|
125
|
+
verb: string;
|
|
126
|
+
} | {
|
|
127
|
+
actor: {
|
|
128
|
+
created_at: string;
|
|
129
|
+
updated_at: string;
|
|
130
|
+
id: string;
|
|
131
|
+
data: {
|
|
132
|
+
name: string;
|
|
133
|
+
jobTitle?: undefined;
|
|
134
|
+
organization?: undefined;
|
|
135
|
+
thumbnail?: undefined;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
content: string;
|
|
139
|
+
feed_id: string;
|
|
140
|
+
foreign_id: string;
|
|
141
|
+
id: string;
|
|
142
|
+
latest_reactions: {
|
|
143
|
+
like: {
|
|
144
|
+
created_at: string;
|
|
145
|
+
updated_at: string;
|
|
146
|
+
id: string;
|
|
147
|
+
user_id: string;
|
|
148
|
+
user: {
|
|
149
|
+
created_at: string;
|
|
150
|
+
updated_at: string;
|
|
151
|
+
id: string;
|
|
152
|
+
data: {
|
|
153
|
+
jobTitle: string;
|
|
154
|
+
name: string;
|
|
155
|
+
organization: string;
|
|
156
|
+
thumbnail: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
kind: string;
|
|
160
|
+
activity_id: string;
|
|
161
|
+
data: {};
|
|
162
|
+
parent: string;
|
|
163
|
+
latest_children: {};
|
|
164
|
+
children_counts: {};
|
|
165
|
+
}[];
|
|
166
|
+
reply?: undefined;
|
|
167
|
+
};
|
|
168
|
+
latest_reactions_extra: {
|
|
169
|
+
like: {
|
|
170
|
+
next: string;
|
|
171
|
+
};
|
|
172
|
+
reply?: undefined;
|
|
173
|
+
};
|
|
174
|
+
object: string;
|
|
175
|
+
origin: null;
|
|
176
|
+
own_reactions: {
|
|
177
|
+
like?: undefined;
|
|
178
|
+
reply?: undefined;
|
|
179
|
+
};
|
|
180
|
+
reaction_counts: {
|
|
181
|
+
like: number;
|
|
182
|
+
reply?: undefined;
|
|
183
|
+
};
|
|
184
|
+
target: string;
|
|
185
|
+
time: string;
|
|
186
|
+
verb: string;
|
|
187
|
+
} | {
|
|
188
|
+
actor: {
|
|
189
|
+
created_at: string;
|
|
190
|
+
updated_at: string;
|
|
191
|
+
id: string;
|
|
192
|
+
data: {
|
|
193
|
+
jobTitle: string;
|
|
194
|
+
name: string;
|
|
195
|
+
organization: string;
|
|
196
|
+
thumbnail: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
content: string;
|
|
200
|
+
feed_id: string;
|
|
201
|
+
foreign_id: string;
|
|
202
|
+
id: string;
|
|
203
|
+
latest_reactions: {
|
|
204
|
+
like: ({
|
|
205
|
+
created_at: string;
|
|
206
|
+
updated_at: string;
|
|
207
|
+
id: string;
|
|
208
|
+
user_id: string;
|
|
209
|
+
user: {
|
|
210
|
+
created_at: string;
|
|
211
|
+
updated_at: string;
|
|
212
|
+
id: string;
|
|
213
|
+
data: {
|
|
214
|
+
jobTitle: string;
|
|
215
|
+
name: string;
|
|
216
|
+
organization: string;
|
|
217
|
+
thumbnail: null;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
kind: string;
|
|
221
|
+
activity_id: string;
|
|
222
|
+
data: {};
|
|
223
|
+
parent: string;
|
|
224
|
+
latest_children: {};
|
|
225
|
+
children_counts: {};
|
|
226
|
+
} | {
|
|
227
|
+
created_at: string;
|
|
228
|
+
updated_at: string;
|
|
229
|
+
id: string;
|
|
230
|
+
user_id: string;
|
|
231
|
+
user: {
|
|
232
|
+
created_at: string;
|
|
233
|
+
updated_at: string;
|
|
234
|
+
id: string;
|
|
235
|
+
data: {
|
|
236
|
+
name: string;
|
|
237
|
+
jobTitle?: undefined;
|
|
238
|
+
organization?: undefined;
|
|
239
|
+
thumbnail?: undefined;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
kind: string;
|
|
243
|
+
activity_id: string;
|
|
244
|
+
data: {};
|
|
245
|
+
parent: string;
|
|
246
|
+
latest_children: {};
|
|
247
|
+
children_counts: {};
|
|
248
|
+
} | {
|
|
249
|
+
created_at: string;
|
|
250
|
+
updated_at: string;
|
|
251
|
+
id: string;
|
|
252
|
+
user_id: string;
|
|
253
|
+
user: {
|
|
254
|
+
created_at: string;
|
|
255
|
+
updated_at: string;
|
|
256
|
+
id: string;
|
|
257
|
+
data: {
|
|
258
|
+
jobTitle: string;
|
|
259
|
+
name: string;
|
|
260
|
+
organization: string;
|
|
261
|
+
thumbnail: string;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
kind: string;
|
|
265
|
+
activity_id: string;
|
|
266
|
+
data: {};
|
|
267
|
+
parent: string;
|
|
268
|
+
latest_children: {};
|
|
269
|
+
children_counts: {};
|
|
270
|
+
})[];
|
|
271
|
+
reply: {
|
|
272
|
+
created_at: string;
|
|
273
|
+
updated_at: string;
|
|
274
|
+
id: string;
|
|
275
|
+
user_id: string;
|
|
276
|
+
user: {
|
|
277
|
+
created_at: string;
|
|
278
|
+
updated_at: string;
|
|
279
|
+
id: string;
|
|
280
|
+
data: {
|
|
281
|
+
jobTitle: string;
|
|
282
|
+
name: string;
|
|
283
|
+
organization: string;
|
|
284
|
+
thumbnail: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
kind: string;
|
|
288
|
+
activity_id: string;
|
|
289
|
+
data: {
|
|
290
|
+
content: string;
|
|
291
|
+
};
|
|
292
|
+
parent: string;
|
|
293
|
+
latest_children: {};
|
|
294
|
+
children_counts: {};
|
|
295
|
+
}[];
|
|
296
|
+
};
|
|
297
|
+
latest_reactions_extra: {
|
|
298
|
+
like: {
|
|
299
|
+
next: string;
|
|
300
|
+
};
|
|
301
|
+
reply: {
|
|
302
|
+
next: string;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
object: string;
|
|
306
|
+
origin: null;
|
|
307
|
+
own_reactions: {
|
|
308
|
+
like?: undefined;
|
|
309
|
+
reply?: undefined;
|
|
310
|
+
};
|
|
311
|
+
reaction_counts: {
|
|
312
|
+
like: number;
|
|
313
|
+
reply: number;
|
|
314
|
+
};
|
|
315
|
+
target: string;
|
|
316
|
+
time: string;
|
|
317
|
+
verb: string;
|
|
318
|
+
})[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ActivitiesFeed } from './activities-feed';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RepliesFeed } from './replies-feed';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InvalidateQueryFilters } from '@tanstack/react-query';
|
|
3
|
+
import { IReply } from '../../getstream';
|
|
4
|
+
interface Props {
|
|
5
|
+
basePath: string;
|
|
6
|
+
parentId: string;
|
|
7
|
+
activityId: string;
|
|
8
|
+
repliesList: IReply[] | undefined;
|
|
9
|
+
cache: {
|
|
10
|
+
activitiesListQueryKey: InvalidateQueryFilters;
|
|
11
|
+
singleActivityQueryKeyWithoutVariable: InvalidateQueryFilters;
|
|
12
|
+
};
|
|
13
|
+
membershipRequiredToPost: {
|
|
14
|
+
isMember: boolean;
|
|
15
|
+
join: () => Promise<void>;
|
|
16
|
+
leave: () => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
functions: {
|
|
19
|
+
createReply: () => Promise<void>;
|
|
20
|
+
like: ({ replyId }: {
|
|
21
|
+
replyId: string;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
unlike: ({ replyId }: {
|
|
24
|
+
replyId: string;
|
|
25
|
+
}) => Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
declare const RepliesFeed: React.FC<Props>;
|
|
29
|
+
export default RepliesFeed;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { QueryClient, InvalidateQueryFilters } from '@tanstack/query-core';
|
|
2
|
+
import { IActivity, ILike, IReply } from '../../getstream';
|
|
3
|
+
import { IUserContext } from '../../..';
|
|
4
|
+
interface buildAddReplyHandlersProps {
|
|
5
|
+
queryClient: QueryClient;
|
|
6
|
+
queryKey: InvalidateQueryFilters;
|
|
7
|
+
mutationFn: () => Promise<void>;
|
|
8
|
+
affectedQueryKey: InvalidateQueryFilters;
|
|
9
|
+
}
|
|
10
|
+
export declare const buildAddReplyHandlers: ({ queryClient, queryKey, mutationFn, affectedQueryKey, }: buildAddReplyHandlersProps) => {
|
|
11
|
+
mutationFn: () => Promise<void>;
|
|
12
|
+
onMutate: () => Promise<void>;
|
|
13
|
+
onError: (_err: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
}, _newActivity: {
|
|
16
|
+
activityId: string;
|
|
17
|
+
}, context: {
|
|
18
|
+
previousActivity: IActivity;
|
|
19
|
+
}) => void;
|
|
20
|
+
onSuccess: (data: IReply) => {
|
|
21
|
+
previousActivity: IActivity;
|
|
22
|
+
} | undefined;
|
|
23
|
+
onSettled: () => void;
|
|
24
|
+
};
|
|
25
|
+
interface buildLikeReplyHandlersProps {
|
|
26
|
+
queryClient: QueryClient;
|
|
27
|
+
queryKey: InvalidateQueryFilters;
|
|
28
|
+
mutationFn: ({ replyId }: {
|
|
29
|
+
replyId: string;
|
|
30
|
+
}) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare const buildLikeReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildLikeReplyHandlersProps) => {
|
|
33
|
+
mutationFn: ({ replyId }: {
|
|
34
|
+
replyId: string;
|
|
35
|
+
}) => Promise<void>;
|
|
36
|
+
onMutate: ({ replyId }: {
|
|
37
|
+
replyId: string;
|
|
38
|
+
}) => Promise<{
|
|
39
|
+
previousActivity: IActivity | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
onError: (_err: {
|
|
42
|
+
[key: string]: string;
|
|
43
|
+
}, _newActivity: {
|
|
44
|
+
activityId: string;
|
|
45
|
+
}, context: {
|
|
46
|
+
previousActivity: IActivity;
|
|
47
|
+
}) => void;
|
|
48
|
+
onSuccess: (data: ILike) => {
|
|
49
|
+
previousActivity: IActivity | undefined;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
interface buildUnlikeReplyHandlersProps {
|
|
53
|
+
queryClient: QueryClient;
|
|
54
|
+
queryKey: InvalidateQueryFilters;
|
|
55
|
+
user: IUserContext | null;
|
|
56
|
+
mutationFn: ({ replyId }: {
|
|
57
|
+
replyId: string;
|
|
58
|
+
}) => Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
export declare const buildUnlikeReplyHandlers: ({ queryClient, queryKey, user, mutationFn, }: buildUnlikeReplyHandlersProps) => {
|
|
61
|
+
mutationFn: ({ replyId }: {
|
|
62
|
+
replyId: string;
|
|
63
|
+
}) => Promise<void>;
|
|
64
|
+
onMutate: ({ replyId }: {
|
|
65
|
+
replyId: string;
|
|
66
|
+
}) => Promise<{
|
|
67
|
+
previousActivity: IActivity;
|
|
68
|
+
} | undefined>;
|
|
69
|
+
onError: (_err: {
|
|
70
|
+
[key: string]: string;
|
|
71
|
+
}, _newActivity: {
|
|
72
|
+
activityId: string;
|
|
73
|
+
}, context: {
|
|
74
|
+
previousActivity: IActivity;
|
|
75
|
+
}) => void;
|
|
76
|
+
onSuccess: (data: ILike, { replyId }: {
|
|
77
|
+
replyId: string;
|
|
78
|
+
}) => {
|
|
79
|
+
previousActivity: IActivity;
|
|
80
|
+
} | undefined;
|
|
81
|
+
};
|
|
82
|
+
export {};
|
package/discussion/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './post';
|
|
5
|
-
export * from './responses-heading';
|
|
6
|
-
export * from './thread';
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './feeds';
|
|
3
|
+
export * from './sections';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QueryFunction, InvalidateQueryFilters } from '@tanstack/react-query';
|
|
3
|
+
import { IActivity } from '../../getstream';
|
|
4
|
+
interface Props {
|
|
5
|
+
basePath: string;
|
|
6
|
+
parentId: string;
|
|
7
|
+
activityId: string;
|
|
8
|
+
membershipRequiredToPost: {
|
|
9
|
+
isMember: boolean;
|
|
10
|
+
join: () => Promise<void>;
|
|
11
|
+
leave: () => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
cache: {
|
|
14
|
+
activitiesListQueryKey: InvalidateQueryFilters;
|
|
15
|
+
singleActivityQueryKeyWithoutVariable: InvalidateQueryFilters;
|
|
16
|
+
};
|
|
17
|
+
functions: {
|
|
18
|
+
get: QueryFunction<IActivity, InvalidateQueryFilters[], never>;
|
|
19
|
+
likeActivity: ({ activityId }: {
|
|
20
|
+
activityId: string;
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
unlikeActivity: ({ activityId, reactionId, }: {
|
|
23
|
+
activityId: string;
|
|
24
|
+
reactionId: string | undefined;
|
|
25
|
+
}) => Promise<void>;
|
|
26
|
+
createReply: () => Promise<void>;
|
|
27
|
+
likeReply: ({ replyId }: {
|
|
28
|
+
replyId: string;
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
unlikeReply: ({ replyId }: {
|
|
31
|
+
replyId: string;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
declare const ActivitySection: React.FC<Props>;
|
|
36
|
+
export default ActivitySection;
|