@amityco/ui-kit-open-source 4.0.0-beta.9 → 4.0.2
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/dist/esm/index.css +1 -1
- package/dist/esm/index.js +1759 -2019
- package/dist/index.css +1 -1
- package/dist/index.d.mts +537 -81
- package/dist/index.d.ts +537 -81
- package/dist/index.js +1815 -2054
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +19 -17
- package/readme.md +2 -122
- package/dist/Inter-Black-PFV6RWF7.woff2 +0 -0
- package/dist/Inter-BlackItalic-OUXR4CVK.woff2 +0 -0
- package/dist/Inter-Bold-K6PA7FOK.woff2 +0 -0
- package/dist/Inter-BoldItalic-QKFESTQE.woff2 +0 -0
- package/dist/Inter-ExtraBold-2ZPQFALF.woff2 +0 -0
- package/dist/Inter-ExtraBoldItalic-RR7KYXHD.woff2 +0 -0
- package/dist/Inter-ExtraLight-NASBO7I6.woff2 +0 -0
- package/dist/Inter-ExtraLightItalic-AUJY3XPT.woff2 +0 -0
- package/dist/Inter-Italic-2WJ2RX3Z.woff2 +0 -0
- package/dist/Inter-Light-E4ED7JRX.woff2 +0 -0
- package/dist/Inter-LightItalic-BJ4DXCNT.woff2 +0 -0
- package/dist/Inter-Medium-3R4SWUEO.woff2 +0 -0
- package/dist/Inter-MediumItalic-QTJUSOU7.woff2 +0 -0
- package/dist/Inter-Regular-6HYMGWZS.woff2 +0 -0
- package/dist/Inter-SemiBold-7SYQBR3A.woff2 +0 -0
- package/dist/Inter-SemiBoldItalic-3EHSSXIM.woff2 +0 -0
- package/dist/Inter-Thin-3L5KITMZ.woff2 +0 -0
- package/dist/Inter-ThinItalic-J7DGFM6P.woff2 +0 -0
- package/dist/Inter-italic.var-SWFAXF2C.woff2 +0 -0
- package/dist/Inter-roman.var-WIJJYAE4.woff2 +0 -0
- package/dist/Inter.var-OMHIC2JW.woff2 +0 -0
- package/dist/esm/Inter-Black-PFV6RWF7.woff2 +0 -0
- package/dist/esm/Inter-BlackItalic-OUXR4CVK.woff2 +0 -0
- package/dist/esm/Inter-Bold-K6PA7FOK.woff2 +0 -0
- package/dist/esm/Inter-BoldItalic-QKFESTQE.woff2 +0 -0
- package/dist/esm/Inter-ExtraBold-2ZPQFALF.woff2 +0 -0
- package/dist/esm/Inter-ExtraBoldItalic-RR7KYXHD.woff2 +0 -0
- package/dist/esm/Inter-ExtraLight-NASBO7I6.woff2 +0 -0
- package/dist/esm/Inter-ExtraLightItalic-AUJY3XPT.woff2 +0 -0
- package/dist/esm/Inter-Italic-2WJ2RX3Z.woff2 +0 -0
- package/dist/esm/Inter-Light-E4ED7JRX.woff2 +0 -0
- package/dist/esm/Inter-LightItalic-BJ4DXCNT.woff2 +0 -0
- package/dist/esm/Inter-Medium-3R4SWUEO.woff2 +0 -0
- package/dist/esm/Inter-MediumItalic-QTJUSOU7.woff2 +0 -0
- package/dist/esm/Inter-Regular-6HYMGWZS.woff2 +0 -0
- package/dist/esm/Inter-SemiBold-7SYQBR3A.woff2 +0 -0
- package/dist/esm/Inter-SemiBoldItalic-3EHSSXIM.woff2 +0 -0
- package/dist/esm/Inter-Thin-3L5KITMZ.woff2 +0 -0
- package/dist/esm/Inter-ThinItalic-J7DGFM6P.woff2 +0 -0
- package/dist/esm/Inter-italic.var-SWFAXF2C.woff2 +0 -0
- package/dist/esm/Inter-roman.var-WIJJYAE4.woff2 +0 -0
- package/dist/esm/Inter.var-OMHIC2JW.woff2 +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,48 +1,340 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { PostContentType } from '@amityco/ts-sdk';
|
|
3
|
-
import * as styled_components from 'styled-components';
|
|
1
|
+
import React, { ReactNode, RefObject } from 'react';
|
|
4
2
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
3
|
+
import * as styled_components from 'styled-components';
|
|
5
4
|
|
|
6
|
-
type
|
|
7
|
-
|
|
5
|
+
type AmityReactionType = {
|
|
6
|
+
name: string;
|
|
7
|
+
image: string;
|
|
8
|
+
};
|
|
8
9
|
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
type ThemeValue = {
|
|
11
|
+
primary_color: string;
|
|
12
|
+
secondary_color: string;
|
|
13
|
+
secondary_shade1_color: string;
|
|
14
|
+
secondary_shade2_color: string;
|
|
15
|
+
secondary_shade3_color: string;
|
|
16
|
+
secondary_shade4_color: string;
|
|
17
|
+
base_color: string;
|
|
18
|
+
base_shade1_color: string;
|
|
19
|
+
base_shade2_color: string;
|
|
20
|
+
base_shade3_color: string;
|
|
21
|
+
base_shade4_color: string;
|
|
22
|
+
base_shade5_color: string;
|
|
23
|
+
alert_color: string;
|
|
24
|
+
background_color: string;
|
|
25
|
+
base_inverse_color: string;
|
|
26
|
+
};
|
|
27
|
+
type Theme = {
|
|
28
|
+
light: ThemeValue;
|
|
29
|
+
dark: ThemeValue;
|
|
30
|
+
};
|
|
31
|
+
type ThemeConfiguration = {
|
|
32
|
+
preferred_theme?: 'light' | 'dark' | 'default';
|
|
33
|
+
theme?: {
|
|
34
|
+
light?: Partial<Theme['light']>;
|
|
35
|
+
dark?: Partial<Theme['dark']>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
interface Config {
|
|
39
|
+
preferred_theme?: 'light' | 'dark' | 'default';
|
|
40
|
+
theme?: {
|
|
41
|
+
light?: Theme['light'];
|
|
42
|
+
dark?: Theme['dark'];
|
|
43
|
+
};
|
|
44
|
+
excludes?: string[];
|
|
45
|
+
message_reactions?: AmityReactionType[];
|
|
46
|
+
customizations?: {
|
|
47
|
+
[key: string]: IconConfiguration & TextConfiguration & ThemeConfiguration & CustomConfiguration;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
type IconConfiguration = {
|
|
51
|
+
icon?: string;
|
|
52
|
+
image?: string;
|
|
53
|
+
};
|
|
54
|
+
type TextConfiguration = {
|
|
55
|
+
text?: string;
|
|
56
|
+
};
|
|
57
|
+
type CustomConfiguration = {
|
|
58
|
+
[key: string]: string | undefined | boolean | Array<string> | number | Record<string, unknown>;
|
|
29
59
|
};
|
|
30
|
-
type PostRendererConfigType = Record<ValueOf<typeof PostContentType> | string, (props: PostRendererProps) => ReactNode>;
|
|
31
60
|
|
|
32
|
-
|
|
61
|
+
declare enum AmityPostContentComponentStyle {
|
|
62
|
+
FEED = "feed",
|
|
63
|
+
DETAIL = "detail"
|
|
64
|
+
}
|
|
65
|
+
declare enum AmityPostCategory {
|
|
66
|
+
GENERAL = "general",
|
|
67
|
+
ANNOUNCEMENT = "announcement",
|
|
68
|
+
PIN = "pin",
|
|
69
|
+
PIN_AND_ANNOUNCEMENT = "pin_and_announcement"
|
|
70
|
+
}
|
|
71
|
+
interface PostContentProps {
|
|
72
|
+
post: Amity.Post;
|
|
73
|
+
onClick?: () => void;
|
|
74
|
+
onPostDeleted?: (post: Amity.Post) => void;
|
|
75
|
+
style: AmityPostContentComponentStyle;
|
|
76
|
+
category: AmityPostCategory;
|
|
77
|
+
hideMenu?: boolean;
|
|
78
|
+
hideTarget?: boolean;
|
|
79
|
+
pageId?: string;
|
|
80
|
+
disabledContent?: boolean;
|
|
81
|
+
isGlobalFeaturePost?: boolean;
|
|
82
|
+
}
|
|
83
|
+
declare const PostContent: ({ pageId, post: initialPost, onClick, onPostDeleted, category, hideMenu, hideTarget, style, disabledContent, isGlobalFeaturePost, }: PostContentProps) => React.JSX.Element;
|
|
84
|
+
|
|
85
|
+
type MemberCommunitySetup = {
|
|
86
|
+
userId: string;
|
|
87
|
+
displayName: string;
|
|
88
|
+
};
|
|
89
|
+
declare enum AmityCommunitySetupPageMode {
|
|
90
|
+
CREATE = "create",
|
|
91
|
+
EDIT = "edit"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare enum Mode {
|
|
95
|
+
CREATE = "create",
|
|
96
|
+
EDIT = "edit"
|
|
97
|
+
}
|
|
98
|
+
interface AmityPostComposerEditOptions {
|
|
99
|
+
mode: Mode.EDIT;
|
|
100
|
+
post: Amity.Post;
|
|
101
|
+
}
|
|
102
|
+
interface AmityPostComposerCreateOptions {
|
|
103
|
+
mode: Mode.CREATE;
|
|
104
|
+
targetId: string | null;
|
|
105
|
+
targetType: 'community' | 'user';
|
|
106
|
+
community?: Amity.Community;
|
|
107
|
+
}
|
|
108
|
+
type PostComposerPageProps = AmityPostComposerCreateOptions | AmityPostComposerEditOptions;
|
|
109
|
+
declare function PostComposerPage(props: PostComposerPageProps): React.JSX.Element;
|
|
110
|
+
|
|
111
|
+
declare const enum UserRelationshipPageTabs {
|
|
112
|
+
FOLLOWING = "following",
|
|
113
|
+
FOLLOWER = "followers"
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface PageBehavior {
|
|
117
|
+
AmityStoryViewPageBehavior?: {
|
|
118
|
+
onCloseAction?(): void;
|
|
119
|
+
hyperLinkAction?(context: Record<string, unknown>): void;
|
|
120
|
+
};
|
|
121
|
+
AmityDraftStoryPageBehavior?: {
|
|
122
|
+
closeAction?(): void;
|
|
123
|
+
};
|
|
124
|
+
onClickHyperLink?(): void;
|
|
125
|
+
AmitySocialHomePageBehavior?: Record<string, unknown>;
|
|
126
|
+
AmityGlobalFeedComponentBehavior?: {
|
|
127
|
+
goToPostDetailPage?: (context: {
|
|
128
|
+
postId: string;
|
|
129
|
+
hideTarget?: boolean;
|
|
130
|
+
category?: AmityPostCategory;
|
|
131
|
+
}) => void;
|
|
132
|
+
goToViewStoryPage?: (context: {
|
|
133
|
+
targetId: string;
|
|
134
|
+
targetType: Amity.StoryTargetType;
|
|
135
|
+
storyType: 'communityFeed' | 'globalFeed';
|
|
136
|
+
targetIds?: string[];
|
|
137
|
+
}) => void;
|
|
138
|
+
goToCreateCommunityPage?(context: {
|
|
139
|
+
mode: AmityCommunitySetupPageMode;
|
|
140
|
+
}): void;
|
|
141
|
+
};
|
|
142
|
+
AmityPostDetailPageBehavior?: Record<string, unknown>;
|
|
143
|
+
AmityPostContentComponentBehavior?: {
|
|
144
|
+
goToCommunityProfilePage?: (context: {
|
|
145
|
+
communityId: string;
|
|
146
|
+
}) => void;
|
|
147
|
+
goToUserProfilePage?: (context: {
|
|
148
|
+
userId: string;
|
|
149
|
+
}) => void;
|
|
150
|
+
goToPostComposerPage?: (context: {
|
|
151
|
+
mode: Mode.EDIT;
|
|
152
|
+
post: Amity.Post;
|
|
153
|
+
}) => void;
|
|
154
|
+
};
|
|
155
|
+
AmitySocialGlobalSearchPageBehavior?: Record<string, unknown>;
|
|
156
|
+
AmityCommunitySearchResultComponentBehavior?: {
|
|
157
|
+
goToCommunityProfilePage?: (context: {
|
|
158
|
+
communityId: string;
|
|
159
|
+
}) => void;
|
|
160
|
+
};
|
|
161
|
+
AmityUserSearchResultComponentBehavior?: {
|
|
162
|
+
goToUserProfilePage?: (context: {
|
|
163
|
+
userId: string;
|
|
164
|
+
}) => void;
|
|
165
|
+
};
|
|
166
|
+
AmityCreatePostMenuComponentBehavior?: {
|
|
167
|
+
goToSelectPostTargetPage?(): void;
|
|
168
|
+
goToStoryTargetSelectionPage?(): void;
|
|
169
|
+
goToSelectPollPostTargetPage?(): void;
|
|
170
|
+
};
|
|
171
|
+
AmityPostTargetSelectionPage?: {
|
|
172
|
+
goToPostComposerPage?: (context: {
|
|
173
|
+
mode: Mode.CREATE;
|
|
174
|
+
targetId: string | null;
|
|
175
|
+
targetType: 'community' | 'user';
|
|
176
|
+
community?: Amity.Community;
|
|
177
|
+
}) => void;
|
|
178
|
+
};
|
|
179
|
+
AmityStoryTargetSelectionPage?: {
|
|
180
|
+
goToStoryCreationPage?(context: {
|
|
181
|
+
targetId: string | null;
|
|
182
|
+
targetType: Amity.StoryTargetType;
|
|
183
|
+
mediaType: {
|
|
184
|
+
type: 'image';
|
|
185
|
+
url: string;
|
|
186
|
+
} | {
|
|
187
|
+
type: 'video';
|
|
188
|
+
url: string;
|
|
189
|
+
};
|
|
190
|
+
storyType: 'communityFeed' | 'globalFeed';
|
|
191
|
+
}): void;
|
|
192
|
+
};
|
|
193
|
+
AmityPostComposerPageBehavior?: {
|
|
194
|
+
goToSocialHomePage?(): void;
|
|
195
|
+
};
|
|
196
|
+
AmityCommunityProfilePageBehavior?: {
|
|
197
|
+
goToPostComposerPage?(context: {
|
|
198
|
+
mode: Mode.CREATE | Mode.EDIT;
|
|
199
|
+
targetId: string | null;
|
|
200
|
+
targetType: 'community' | 'user';
|
|
201
|
+
community?: Amity.Community;
|
|
202
|
+
post?: Amity.Post;
|
|
203
|
+
}): void;
|
|
204
|
+
goToPostDetailPage?(context: {
|
|
205
|
+
postId: string;
|
|
206
|
+
hideTarget?: boolean;
|
|
207
|
+
category?: AmityPostCategory;
|
|
208
|
+
}): void;
|
|
209
|
+
goToStoryCreationPage?(context: {
|
|
210
|
+
targetId: string | null;
|
|
211
|
+
targetType: Amity.StoryTargetType;
|
|
212
|
+
mediaType: {
|
|
213
|
+
type: 'image';
|
|
214
|
+
url: string;
|
|
215
|
+
} | {
|
|
216
|
+
type: 'video';
|
|
217
|
+
url: string;
|
|
218
|
+
};
|
|
219
|
+
storyType: 'communityFeed' | 'globalFeed';
|
|
220
|
+
}): void;
|
|
221
|
+
goToCommunitySettingPage?(context: {
|
|
222
|
+
community: Amity.Community;
|
|
223
|
+
}): void;
|
|
224
|
+
goToEditCommunityPage?(context: {
|
|
225
|
+
mode: AmityCommunitySetupPageMode;
|
|
226
|
+
community: Amity.Community;
|
|
227
|
+
}): void;
|
|
228
|
+
goToPendingPostPage?(context: {
|
|
229
|
+
communityId: string;
|
|
230
|
+
}): void;
|
|
231
|
+
goToMembershipPage?(context: {
|
|
232
|
+
community: Amity.Community;
|
|
233
|
+
}): void;
|
|
234
|
+
goToPollPostComposerPage?(context: {
|
|
235
|
+
targetId: string | null;
|
|
236
|
+
targetType: 'community' | 'user';
|
|
237
|
+
}): void;
|
|
238
|
+
};
|
|
239
|
+
AmitySocialHomeTopNavigationComponentBehavior?: {
|
|
240
|
+
goToCreateCommunityPage?(context: {
|
|
241
|
+
mode: AmityCommunitySetupPageMode;
|
|
242
|
+
}): void;
|
|
243
|
+
};
|
|
244
|
+
AmityCommunitySetupPageBehavior?: {
|
|
245
|
+
goToAddCategoryPage?(context: {
|
|
246
|
+
categories?: Amity.Category[];
|
|
247
|
+
}): void;
|
|
248
|
+
goToAddMemberPage?(context: {
|
|
249
|
+
members?: MemberCommunitySetup[];
|
|
250
|
+
communityId?: string;
|
|
251
|
+
onAddedAction?: (userId: string[]) => void;
|
|
252
|
+
}): void;
|
|
253
|
+
};
|
|
254
|
+
AmityCommunitySettingPageBehavior?: {
|
|
255
|
+
goToEditCommunityPage?(context: {
|
|
256
|
+
mode: AmityCommunitySetupPageMode;
|
|
257
|
+
community: Amity.Community;
|
|
258
|
+
}): void;
|
|
259
|
+
goToMembershipPage?(context: {
|
|
260
|
+
community: Amity.Community;
|
|
261
|
+
}): void;
|
|
262
|
+
goToPostPermissionPage?(context: {
|
|
263
|
+
community: Amity.Community;
|
|
264
|
+
}): void;
|
|
265
|
+
goToStorySettingPage?(context: {
|
|
266
|
+
community: Amity.Community;
|
|
267
|
+
}): void;
|
|
268
|
+
goToSocialHomePage?(): void;
|
|
269
|
+
};
|
|
270
|
+
AmityCommunityMembershipPage?: {
|
|
271
|
+
goToAddMemberPage?(context: {
|
|
272
|
+
members?: MemberCommunitySetup[];
|
|
273
|
+
communityId?: string;
|
|
274
|
+
onAddedAction?: (userId: string[]) => void;
|
|
275
|
+
}): void;
|
|
276
|
+
goToUserProfilePage?: (context: {
|
|
277
|
+
userId: string;
|
|
278
|
+
}) => void;
|
|
279
|
+
};
|
|
280
|
+
AmityUserFeedComponentBehavior?: {
|
|
281
|
+
goToPostDetailPage?(context: {
|
|
282
|
+
postId: string;
|
|
283
|
+
}): void;
|
|
284
|
+
};
|
|
285
|
+
AmityUserProfilePageBehavior?: {
|
|
286
|
+
goToEditUserPage?(context: {
|
|
287
|
+
userId: string;
|
|
288
|
+
}): void;
|
|
289
|
+
goToBlockedUsersPage?(): void;
|
|
290
|
+
goToPostComposerPage?(context: {
|
|
291
|
+
userId: string;
|
|
292
|
+
}): void;
|
|
293
|
+
};
|
|
294
|
+
AmityUserProfileHeaderComponentBehavior: {
|
|
295
|
+
goToUserRelationshipPage?(context: {
|
|
296
|
+
userId: string;
|
|
297
|
+
selectedTab: UserRelationshipPageTabs;
|
|
298
|
+
}): void;
|
|
299
|
+
goToPendingFollowRequestPage?(): void;
|
|
300
|
+
};
|
|
301
|
+
AmityUserRelationshipPageBehavior: {
|
|
302
|
+
goToUserProfilePage?(context: {
|
|
303
|
+
userId: string;
|
|
304
|
+
}): void;
|
|
305
|
+
};
|
|
306
|
+
AmityUserPendingFollowRequestsPageBehavior: {
|
|
307
|
+
goToUserProfilePage?(context: {
|
|
308
|
+
userId: string;
|
|
309
|
+
}): void;
|
|
310
|
+
};
|
|
311
|
+
AmityBlockedUsersPageBehavior: {
|
|
312
|
+
goToUserProfilePage?(context: {
|
|
313
|
+
userId: string;
|
|
314
|
+
}): void;
|
|
315
|
+
};
|
|
316
|
+
AmityPollTargetSelectionPageBehavior?: {
|
|
317
|
+
goToPollPostComposerPage?(context: {
|
|
318
|
+
targetId: string | null;
|
|
319
|
+
targetType: 'community' | 'user';
|
|
320
|
+
}): void;
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
type AmityUIKitConfig = Config;
|
|
325
|
+
interface AmityUIKitProviderProps {
|
|
33
326
|
apiKey: string;
|
|
34
327
|
apiRegion: string;
|
|
35
328
|
apiEndpoint?: {
|
|
36
329
|
http?: string;
|
|
37
330
|
mqtt?: string;
|
|
38
331
|
};
|
|
39
|
-
authToken?: string;
|
|
40
332
|
userId: string;
|
|
41
|
-
displayName
|
|
42
|
-
|
|
43
|
-
postRendererConfig?: PostRendererConfigType;
|
|
333
|
+
displayName?: string;
|
|
334
|
+
postRendererConfig?: any;
|
|
44
335
|
theme?: Record<string, unknown>;
|
|
45
336
|
children?: React.ReactNode;
|
|
337
|
+
socialCommunityCreationButtonVisible?: boolean;
|
|
46
338
|
actionHandlers?: {
|
|
47
339
|
onChangePage?: (data: {
|
|
48
340
|
type: string;
|
|
@@ -57,15 +349,15 @@ interface UiKitProviderProps {
|
|
|
57
349
|
}) => void;
|
|
58
350
|
onEditUser?: (userId: string) => void;
|
|
59
351
|
onMessageUser?: (userId: string) => void;
|
|
60
|
-
onBack?: () => void;
|
|
61
352
|
};
|
|
62
|
-
|
|
353
|
+
pageBehavior?: PageBehavior;
|
|
63
354
|
onConnectionStatusChange?: (state: Amity.SessionStates) => void;
|
|
64
355
|
onConnected?: () => void;
|
|
65
356
|
onDisconnected?: () => void;
|
|
66
|
-
|
|
357
|
+
getAuthToken?: () => Promise<string>;
|
|
358
|
+
configs?: AmityUIKitConfig;
|
|
67
359
|
}
|
|
68
|
-
declare const
|
|
360
|
+
declare const AmityUIKitProvider: React.FC<AmityUIKitProviderProps>;
|
|
69
361
|
|
|
70
362
|
interface FeedProps {
|
|
71
363
|
className?: string;
|
|
@@ -80,7 +372,7 @@ interface FeedProps {
|
|
|
80
372
|
}
|
|
81
373
|
declare const _default$2: React.MemoExoticComponent<(props: FeedProps) => React.JSX.Element>;
|
|
82
374
|
|
|
83
|
-
declare const
|
|
375
|
+
declare const Application: () => React.JSX.Element;
|
|
84
376
|
|
|
85
377
|
type PartialChannel = Pick<Amity.Channel, 'channelId' | 'type'>;
|
|
86
378
|
declare const ChatApplication: ({ membershipFilter, defaultChannelId, onMemberSelect, onChannelSelect, onAddNewChannel, onEditChatMember, }: {
|
|
@@ -178,6 +470,7 @@ type ContextValue = {
|
|
|
178
470
|
title: ReactNode;
|
|
179
471
|
content: ReactNode;
|
|
180
472
|
okText: ReactNode;
|
|
473
|
+
onOk?: () => void;
|
|
181
474
|
} | null | undefined) => void;
|
|
182
475
|
};
|
|
183
476
|
declare const useNavigation: () => ContextValue;
|
|
@@ -200,10 +493,10 @@ interface AvatarProps {
|
|
|
200
493
|
}
|
|
201
494
|
declare const _default$1: (props: AvatarProps) => React.JSX.Element;
|
|
202
495
|
|
|
203
|
-
declare const PostContainer:
|
|
496
|
+
declare const PostContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<{
|
|
204
497
|
className?: string | undefined;
|
|
205
498
|
children?: ReactNode;
|
|
206
|
-
}, never>> & Omit<({ className, ...props }: {
|
|
499
|
+
}, never>> & string & Omit<({ className, ...props }: {
|
|
207
500
|
className?: string | undefined;
|
|
208
501
|
children?: ReactNode;
|
|
209
502
|
}) => React.JSX.Element, keyof React.Component<any, {}, any>>;
|
|
@@ -213,6 +506,7 @@ type Mentioned = {
|
|
|
213
506
|
length: number;
|
|
214
507
|
index: number;
|
|
215
508
|
type: string;
|
|
509
|
+
displayName: string;
|
|
216
510
|
};
|
|
217
511
|
|
|
218
512
|
interface EngagementBarProps {
|
|
@@ -279,11 +573,12 @@ declare class AmityUIKitManager {
|
|
|
279
573
|
* @param userId - The user ID to be used for login.
|
|
280
574
|
* @param displayName - The display name of the user.
|
|
281
575
|
* @param sessionHandler - The session handler for access token renewal.
|
|
576
|
+
* @param authToken - The authentication token to be used for login.
|
|
282
577
|
* @param onConnectionStatusChange - The callback function for connection status changes.
|
|
283
578
|
* @param onConnected - The callback function to be called when connected.
|
|
284
579
|
* @param onDisconnected - The callback function to be called when disconnected.
|
|
285
580
|
*/
|
|
286
|
-
static registerDevice(userId: string, displayName: string, sessionHandler: SessionHandler, onConnectionStatusChange?: (state: Amity.SessionStates) => void, onConnected?: () => void, onDisconnected?: () => void): Promise<void>;
|
|
581
|
+
static registerDevice(userId: string, displayName: string, sessionHandler: SessionHandler, authToken?: string, onConnectionStatusChange?: (state: Amity.SessionStates) => void, onConnected?: () => void, onDisconnected?: () => void): Promise<void>;
|
|
287
582
|
/**
|
|
288
583
|
* Sets the AmityClient instance to be used by the AmityUIKitManager.
|
|
289
584
|
* This method is useful when sharing the AmityClient instance between different parts of the application.
|
|
@@ -313,15 +608,61 @@ declare class AmityUIKitManager {
|
|
|
313
608
|
isClientConnected(): boolean;
|
|
314
609
|
}
|
|
315
610
|
|
|
316
|
-
interface
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
611
|
+
interface ChatHeaderProps {
|
|
612
|
+
channel: Amity.Channel | null;
|
|
613
|
+
pageId?: string;
|
|
614
|
+
componentId?: string;
|
|
615
|
+
}
|
|
616
|
+
declare const ChatHeader: ({ channel, pageId }: ChatHeaderProps) => React.JSX.Element;
|
|
617
|
+
|
|
618
|
+
interface AmityLiveChatMessageListProps {
|
|
619
|
+
pageId?: string;
|
|
620
|
+
channel: Amity.Channel;
|
|
621
|
+
replyMessage: (message: Amity.Message<'text'>) => void;
|
|
622
|
+
}
|
|
623
|
+
declare const MessageList: ({ pageId, channel, replyMessage, }: AmityLiveChatMessageListProps) => React.JSX.Element;
|
|
624
|
+
|
|
625
|
+
type ComposeActionTypes = {
|
|
626
|
+
replyMessage?: Amity.Message;
|
|
627
|
+
mentionMessage?: Amity.Message;
|
|
628
|
+
clearReplyMessage?: () => void;
|
|
629
|
+
clearMention?: () => void;
|
|
630
|
+
};
|
|
631
|
+
interface MessageComposerProps {
|
|
632
|
+
channel: Amity.Channel;
|
|
633
|
+
composeAction: ComposeActionTypes;
|
|
634
|
+
suggestionRef?: RefObject<HTMLDivElement>;
|
|
635
|
+
disabled?: boolean;
|
|
322
636
|
pageId?: string;
|
|
323
637
|
}
|
|
324
|
-
declare const
|
|
638
|
+
declare const MessageComposer: ({ pageId, channel, composeAction: { replyMessage, mentionMessage, clearReplyMessage, clearMention }, }: MessageComposerProps) => React.JSX.Element;
|
|
639
|
+
|
|
640
|
+
declare const MessageReactionPreview: ({ message, onClick, }: {
|
|
641
|
+
message: Amity.Message;
|
|
642
|
+
onClick?: (() => void) | undefined;
|
|
643
|
+
}) => React.JSX.Element | null;
|
|
644
|
+
|
|
645
|
+
declare const MessageReactionPicker: ({ message, onSelectReaction, }: {
|
|
646
|
+
message: Amity.Message;
|
|
647
|
+
onSelectReaction: (reactionName: string) => void;
|
|
648
|
+
}) => React.JSX.Element | null;
|
|
649
|
+
|
|
650
|
+
interface MessageQuickReactionProps {
|
|
651
|
+
pageId?: string;
|
|
652
|
+
componentId?: string;
|
|
653
|
+
message: Amity.Message;
|
|
654
|
+
onSelectReaction?: () => void;
|
|
655
|
+
}
|
|
656
|
+
declare const MessageQuickReaction: ({ pageId, componentId, message, onSelectReaction, }: MessageQuickReactionProps) => React.JSX.Element;
|
|
657
|
+
|
|
658
|
+
type MessageActionType = {
|
|
659
|
+
onCopy?: () => void;
|
|
660
|
+
onFlag?: () => void;
|
|
661
|
+
onUnflag?: () => void;
|
|
662
|
+
onDelete?: () => void;
|
|
663
|
+
onReply?: () => void;
|
|
664
|
+
onMention?: () => void;
|
|
665
|
+
};
|
|
325
666
|
|
|
326
667
|
interface ReactionListProps$1 {
|
|
327
668
|
pageId: string;
|
|
@@ -335,23 +676,6 @@ interface ReactionListProps {
|
|
|
335
676
|
referenceType: Amity.ReactableType;
|
|
336
677
|
}
|
|
337
678
|
|
|
338
|
-
type StoryTabProps = ({
|
|
339
|
-
type: 'communityFeed';
|
|
340
|
-
communityId: string;
|
|
341
|
-
} | {
|
|
342
|
-
type: 'globalFeed';
|
|
343
|
-
}) & {
|
|
344
|
-
pageId?: string;
|
|
345
|
-
};
|
|
346
|
-
declare const StoryTab: React.FC<StoryTabProps>;
|
|
347
|
-
|
|
348
|
-
declare enum HomePageTab {
|
|
349
|
-
Newsfeed = "Newsfeed",
|
|
350
|
-
Explore = "Explore",
|
|
351
|
-
MyCommunities = "My communities"
|
|
352
|
-
}
|
|
353
|
-
declare function SocialHomePage(): React.JSX.Element;
|
|
354
|
-
|
|
355
679
|
interface LiveChatProps {
|
|
356
680
|
channelId: Amity.Channel['channelId'];
|
|
357
681
|
}
|
|
@@ -412,22 +736,7 @@ declare const ViewStoryPage: React.FC<AmityViewStoryPageProps>;
|
|
|
412
736
|
|
|
413
737
|
declare function StoryTargetSelectionPage(): React.JSX.Element;
|
|
414
738
|
|
|
415
|
-
declare
|
|
416
|
-
CREATE = "create",
|
|
417
|
-
EDIT = "edit"
|
|
418
|
-
}
|
|
419
|
-
interface AmityPostComposerEditOptions {
|
|
420
|
-
mode: Mode.EDIT;
|
|
421
|
-
post?: Amity.Post;
|
|
422
|
-
}
|
|
423
|
-
interface AmityPostComposerCreateOptions {
|
|
424
|
-
mode: Mode.CREATE;
|
|
425
|
-
targetId: string | null;
|
|
426
|
-
targetType: 'community' | 'user';
|
|
427
|
-
community?: Amity.Community;
|
|
428
|
-
}
|
|
429
|
-
type PostComposerPageProps = AmityPostComposerCreateOptions | AmityPostComposerEditOptions;
|
|
430
|
-
declare function PostComposerPage(props: PostComposerPageProps): React.JSX.Element | null;
|
|
739
|
+
declare function SocialHomePage(): React.JSX.Element;
|
|
431
740
|
|
|
432
741
|
declare function SelectPostTargetPage(): React.JSX.Element;
|
|
433
742
|
|
|
@@ -437,7 +746,154 @@ declare function SocialGlobalSearchPage(): React.JSX.Element;
|
|
|
437
746
|
|
|
438
747
|
interface PostDetailPageProps {
|
|
439
748
|
id: string;
|
|
749
|
+
hideTarget?: boolean;
|
|
750
|
+
category?: AmityPostCategory;
|
|
751
|
+
}
|
|
752
|
+
declare function PostDetailPage({ id, hideTarget, category }: PostDetailPageProps): React.JSX.Element;
|
|
753
|
+
|
|
754
|
+
interface CommunityProfileProps {
|
|
755
|
+
communityId: string;
|
|
756
|
+
page?: number;
|
|
757
|
+
}
|
|
758
|
+
declare const CommunityProfilePage: React.FC<CommunityProfileProps>;
|
|
759
|
+
|
|
760
|
+
type UserProfilePageProps = {
|
|
761
|
+
userId: string;
|
|
762
|
+
};
|
|
763
|
+
declare const UserProfilePage: React.FC<UserProfilePageProps>;
|
|
764
|
+
|
|
765
|
+
interface EditUserProfilePageProps {
|
|
766
|
+
userId: string;
|
|
767
|
+
}
|
|
768
|
+
declare const EditUserProfilePage: React.FC<EditUserProfilePageProps>;
|
|
769
|
+
|
|
770
|
+
type CommentTrayProps = {
|
|
771
|
+
pageId?: string;
|
|
772
|
+
referenceId: string;
|
|
773
|
+
community: Amity.Community;
|
|
774
|
+
shouldAllowCreation?: boolean;
|
|
775
|
+
shouldAllowInteraction: boolean;
|
|
776
|
+
referenceType: Amity.CommentReferenceType;
|
|
777
|
+
};
|
|
778
|
+
declare const CommentTray: ({ referenceId, pageId, referenceType, shouldAllowCreation, shouldAllowInteraction, community, }: CommentTrayProps) => React.JSX.Element;
|
|
779
|
+
|
|
780
|
+
type StoryTabProps = ({
|
|
781
|
+
type: 'communityFeed';
|
|
782
|
+
communityId: string;
|
|
783
|
+
} | {
|
|
784
|
+
type: 'globalFeed';
|
|
785
|
+
}) & {
|
|
786
|
+
pageId?: string;
|
|
787
|
+
};
|
|
788
|
+
declare const StoryTab: React.FC<StoryTabProps>;
|
|
789
|
+
|
|
790
|
+
type CreatePostMenuProps = {
|
|
791
|
+
pageId: string;
|
|
792
|
+
};
|
|
793
|
+
declare function CreatePostMenu({ pageId }: CreatePostMenuProps): React.JSX.Element;
|
|
794
|
+
|
|
795
|
+
interface MediaAttachmentProps {
|
|
796
|
+
pageId: string;
|
|
797
|
+
uploadLoading?: boolean;
|
|
798
|
+
isVisibleCamera: boolean;
|
|
799
|
+
isVisibleImage: boolean;
|
|
800
|
+
isVisibleVideo: boolean;
|
|
801
|
+
onVideoFileChange?: (files: File[]) => void;
|
|
802
|
+
onImageFileChange?: (files: File[]) => void;
|
|
803
|
+
}
|
|
804
|
+
declare function MediaAttachment({ pageId, isVisibleCamera, isVisibleImage, isVisibleVideo, onVideoFileChange, onImageFileChange, }: MediaAttachmentProps): React.JSX.Element | null;
|
|
805
|
+
|
|
806
|
+
interface DetailedMediaAttachmentProps {
|
|
807
|
+
pageId: string;
|
|
808
|
+
isVisibleCamera: boolean;
|
|
809
|
+
isVisibleImage: boolean;
|
|
810
|
+
isVisibleVideo: boolean;
|
|
811
|
+
onVideoFileChange?: (files: File[]) => void;
|
|
812
|
+
onImageFileChange?: (files: File[]) => void;
|
|
813
|
+
}
|
|
814
|
+
declare function DetailedMediaAttachment({ pageId, isVisibleCamera, isVisibleImage, isVisibleVideo, onVideoFileChange, onImageFileChange, }: DetailedMediaAttachmentProps): React.JSX.Element | null;
|
|
815
|
+
|
|
816
|
+
type UserSearchResultProps = {
|
|
817
|
+
pageId?: string;
|
|
818
|
+
isLoading: boolean;
|
|
819
|
+
onLoadMore: () => void;
|
|
820
|
+
userCollection: Amity.User[];
|
|
821
|
+
onClosePopover?: () => void;
|
|
822
|
+
};
|
|
823
|
+
declare const UserSearchResult: ({ isLoading, onLoadMore, pageId, onClosePopover, userCollection, }: UserSearchResultProps) => React.JSX.Element;
|
|
824
|
+
|
|
825
|
+
type CommunitySearchResultProps = {
|
|
826
|
+
pageId?: string;
|
|
827
|
+
isLoading: boolean;
|
|
828
|
+
onLoadMore: () => void;
|
|
829
|
+
showJoinButton?: boolean;
|
|
830
|
+
onClosePopover?: () => void;
|
|
831
|
+
communityCollection: Amity.Community[];
|
|
832
|
+
};
|
|
833
|
+
declare const CommunitySearchResult: ({ isLoading, onLoadMore, pageId, onClosePopover, showJoinButton, communityCollection, }: CommunitySearchResultProps) => React.JSX.Element;
|
|
834
|
+
|
|
835
|
+
type TopSearchBarProps = {
|
|
836
|
+
pageId?: string;
|
|
837
|
+
onFocus?: () => void;
|
|
838
|
+
search: (keyword: string) => void;
|
|
839
|
+
};
|
|
840
|
+
declare function TopSearchBar({ pageId, search, onFocus }: TopSearchBarProps): React.JSX.Element | null;
|
|
841
|
+
|
|
842
|
+
interface MyCommunitiesProps {
|
|
843
|
+
pageId?: string;
|
|
844
|
+
}
|
|
845
|
+
declare const MyCommunities: ({ pageId }: MyCommunitiesProps) => React.JSX.Element;
|
|
846
|
+
|
|
847
|
+
interface GlobalFeedProps {
|
|
848
|
+
pageId?: string;
|
|
849
|
+
componentId?: string;
|
|
850
|
+
items: Array<Amity.Post | Amity.Ad>;
|
|
851
|
+
isLoading: boolean;
|
|
852
|
+
onFeedReachBottom: () => void;
|
|
853
|
+
onPostDeleted?: (post: Amity.Post) => void;
|
|
854
|
+
}
|
|
855
|
+
declare const GlobalFeed: ({ pageId, componentId, items, isLoading, onFeedReachBottom, onPostDeleted, }: GlobalFeedProps) => React.JSX.Element;
|
|
856
|
+
|
|
857
|
+
interface EmptyNewsfeedProps {
|
|
858
|
+
pageId?: string;
|
|
859
|
+
}
|
|
860
|
+
declare function EmptyNewsfeed({ pageId }: EmptyNewsfeedProps): React.JSX.Element | null;
|
|
861
|
+
|
|
862
|
+
type NewsfeedProps = {
|
|
863
|
+
pageId?: string;
|
|
864
|
+
};
|
|
865
|
+
declare const Newsfeed: ({ pageId }: NewsfeedProps) => React.JSX.Element;
|
|
866
|
+
|
|
867
|
+
declare enum HomePageTab {
|
|
868
|
+
Newsfeed = "Newsfeed",
|
|
869
|
+
Explore = "Explore",
|
|
870
|
+
MyCommunities = "My communities"
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
interface TopNavigationProps {
|
|
874
|
+
pageId?: string;
|
|
875
|
+
selectedTab?: HomePageTab;
|
|
876
|
+
onClickPostCreationButton?: () => void;
|
|
877
|
+
}
|
|
878
|
+
declare function TopNavigation({ pageId, selectedTab, onClickPostCreationButton, }: TopNavigationProps): React.JSX.Element | null;
|
|
879
|
+
|
|
880
|
+
interface CommunityProfileHeaderProps {
|
|
881
|
+
pageId?: string;
|
|
882
|
+
community: Amity.Community;
|
|
883
|
+
isSticky?: boolean;
|
|
884
|
+
page?: number;
|
|
885
|
+
}
|
|
886
|
+
declare const CommunityHeader: React.FC<CommunityProfileHeaderProps>;
|
|
887
|
+
|
|
888
|
+
interface CommunityFeedProps {
|
|
889
|
+
communityId: string;
|
|
890
|
+
pageId?: string;
|
|
891
|
+
}
|
|
892
|
+
declare const CommunityFeed: ({ pageId, communityId }: CommunityFeedProps) => React.JSX.Element | null;
|
|
893
|
+
|
|
894
|
+
interface CommunityPinnedPostProps {
|
|
895
|
+
communityId?: string;
|
|
440
896
|
}
|
|
441
|
-
declare
|
|
897
|
+
declare const CommunityPinnedPost: ({ communityId }: CommunityPinnedPostProps) => React.JSX.Element;
|
|
442
898
|
|
|
443
|
-
export { _default$1 as AmityAvatar, CommentTray as AmityCommentTrayComponent, AmityDraftStoryPage, CommentText as AmityExpandableText, LiveChat as AmityLiveChatPage, MyCommunitiesSearchPage as AmityMyCommunitiesSearchPage, PostComposerPage as AmityPostComposerPage, PostContainer as AmityPostContainer, PostDetailPage as AmityPostDetailPage, _default as AmityPostEngagementBar, SelectPostTargetPage as AmityPostTargetSelectionPage, ReactionList as
|
|
899
|
+
export { _default$1 as AmityAvatar, CommentTray as AmityCommentTrayComponent, CommunityFeed as AmityCommunityFeedComponent, CommunityHeader as AmityCommunityHeaderComponent, CommunityPinnedPost as AmityCommunityPinnedPostComponent, CommunityProfilePage as AmityCommunityProfilePage, CommunitySearchResult as AmityCommunitySearchResultComponent, CreatePostMenu as AmityCreatePostMenuComponent, DetailedMediaAttachment as AmityDetailedMediaAttachmentComponent, AmityDraftStoryPage, EditUserProfilePage as AmityEditUserProfilePage, EmptyNewsfeed as AmityEmptyNewsFeedComponent, CommentText as AmityExpandableText, GlobalFeed as AmityGlobalFeedComponent, ChatHeader as AmityLiveChatHeader, MessageComposer as AmityLiveChatMessageComposeBar, MessageList as AmityLiveChatMessageList, MessageQuickReaction as AmityLiveChatMessageQuickReaction, MessageReactionPicker as AmityLiveChatMessageReactionPicker, MessageReactionPreview as AmityLiveChatMessageReactionPreview, LiveChat as AmityLiveChatPage, MediaAttachment as AmityMediaAttachmentComponent, type MessageActionType as AmityMessageActionType, MyCommunities as AmityMyCommunitiesComponent, MyCommunitiesSearchPage as AmityMyCommunitiesSearchPage, Newsfeed as AmityNewsFeedComponent, PostComposerPage as AmityPostComposerPage, PostContainer as AmityPostContainer, PostContent as AmityPostContentComponent, PostDetailPage as AmityPostDetailPage, _default as AmityPostEngagementBar, SelectPostTargetPage as AmityPostTargetSelectionPage, ReactionList as AmityReactionListComponent, type ReactionListProps as AmityReactionListProps, SocialGlobalSearchPage as AmitySocialGlobalSearchPage, SocialHomePage as AmitySocialHomePage, HomePageTab as AmitySocialHomePageTab, TopNavigation as AmitySocialHomeTopNavigationComponent, StoryPreview as AmityStoryPreview, StoryPreviewThumbnail as AmityStoryPreviewThumbnail, StoryTab as AmityStoryTabComponent, StoryTargetSelectionPage as AmityStoryTargetSelectionPage, TopSearchBar as AmityTopSearchBarComponent, AmityUIKitManager, ChatApplication as AmityUiKitChat, _default$2 as AmityUiKitFeed, AmityUIKitProvider as AmityUiKitProvider, Application as AmityUiKitSocial, UserProfilePage as AmityUserProfilePage, UserSearchResult as AmityUserSearchResultComponent, ViewStoryPage as AmityViewStoryPage, addChatMembers as amityAddChatMembers, removeChatMembers as amityRemoveChatMembers, useNavigation as useAmityNavigation, useSDK as useAmitySDK, useUser as useAmityUser };
|