@amityco/ulta-ui-kit 1.0.0-alpha.1 → 1.0.0-alpha.10
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/DeleteIcon-JDFUIJH2.svg +10 -0
- package/dist/Welcome-WSYGNAL7.svg +14 -0
- package/dist/WelcomeDesktop-CP7A4QPB.svg +14 -0
- package/dist/esm/DeleteIcon-JDFUIJH2.svg +10 -0
- package/dist/esm/Welcome-WSYGNAL7.svg +14 -0
- package/dist/esm/WelcomeDesktop-CP7A4QPB.svg +14 -0
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +1463 -1012
- package/dist/index.css +1 -1
- package/dist/index.d.mts +49 -149
- package/dist/index.d.ts +49 -149
- package/dist/index.js +1534 -1083
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -3
- 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.mts
CHANGED
|
@@ -1,153 +1,35 @@
|
|
|
1
1
|
import React, { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { PostContentType } from '@amityco/ts-sdk';
|
|
2
3
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
3
4
|
import * as styled_components from 'styled-components';
|
|
4
5
|
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
image: string;
|
|
8
|
-
};
|
|
6
|
+
type CustomComponentName = 'Avatar' | 'CategoryHeader' | 'CategorySelector' | 'Chat' | 'ChatDetails' | 'ChatHeader' | 'ChatItem' | 'Comment' | 'CommentComposerBar' | 'CommentLikeButton' | 'CommunityCreatedModel' | 'CommunityCreationModal' | 'CommunityForm' | 'CommunityItem' | 'CommunityMembers' | 'CommunityName' | 'CommunityPermissions' | 'EmptyFeed' | 'EngagementBar' | 'Feed' | 'FeedHeaderTabs' | 'File' | 'Image' | 'ImageGallery' | 'Images' | 'Layout' | 'MediaGallery' | 'MenuTab' | 'Message' | 'MessageComposerBar' | 'MessageList' | 'NickNameCreationModal' | 'Post' | 'PostLikeButton' | 'PostTargetSelector' | 'ProfileSettings' | 'ProfileSettingsTabs' | 'RecentChat' | 'SideNavBar' | 'SocialSearch' | 'Tabs' | 'UICategoryCard' | 'UICommunityCard' | 'UICommunityHeader' | 'UICommunityInfo' | 'UIEngagementBar' | 'UIPostHeader' | 'UITextContent' | 'UITrendingItem' | 'UIUserInfo' | 'UserChip' | 'UserHeader' | 'UserSelector';
|
|
7
|
+
type CustomComponentType = Partial<Record<CustomComponentName, <TProps>(props: TProps) => React.ReactElement<TProps>>>;
|
|
9
8
|
|
|
10
|
-
type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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>;
|
|
9
|
+
type PostRendererProps = {
|
|
10
|
+
childrenPosts?: Amity.Post[];
|
|
11
|
+
className?: string;
|
|
12
|
+
currentUserId?: string;
|
|
13
|
+
handleDeletePost?: (postId: string) => void;
|
|
14
|
+
handleReportPost?: () => void;
|
|
15
|
+
handleUnreportPost?: () => void;
|
|
16
|
+
handleApprovePost?: () => void;
|
|
17
|
+
handleDeclinePost?: () => void;
|
|
18
|
+
handleClosePoll?: () => void;
|
|
19
|
+
poll?: Amity.Poll | null;
|
|
20
|
+
isPollClosed?: boolean;
|
|
21
|
+
hidePostTarget?: boolean;
|
|
22
|
+
isFlaggedByMe?: boolean;
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
post?: Amity.Post;
|
|
25
|
+
user?: Amity.User | null;
|
|
26
|
+
userRoles?: string[];
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
avatarFileUrl?: string;
|
|
59
29
|
};
|
|
30
|
+
type PostRendererConfigType = Record<ValueOf<typeof PostContentType> | string, (props: PostRendererProps) => ReactNode>;
|
|
60
31
|
|
|
61
|
-
|
|
62
|
-
CREATE = "create",
|
|
63
|
-
EDIT = "edit"
|
|
64
|
-
}
|
|
65
|
-
interface AmityPostComposerEditOptions {
|
|
66
|
-
mode: Mode.EDIT;
|
|
67
|
-
post: Amity.Post;
|
|
68
|
-
}
|
|
69
|
-
interface AmityPostComposerCreateOptions {
|
|
70
|
-
mode: Mode.CREATE;
|
|
71
|
-
targetId: string | null;
|
|
72
|
-
targetType: 'community' | 'user';
|
|
73
|
-
community?: Amity.Community;
|
|
74
|
-
}
|
|
75
|
-
type PostComposerPageProps = AmityPostComposerCreateOptions | AmityPostComposerEditOptions;
|
|
76
|
-
declare function PostComposerPage(props: PostComposerPageProps): React.JSX.Element;
|
|
77
|
-
|
|
78
|
-
interface PageBehavior {
|
|
79
|
-
AmityStoryViewPageBehavior?: {
|
|
80
|
-
onCloseAction?(): void;
|
|
81
|
-
hyperLinkAction?(context: Record<string, unknown>): void;
|
|
82
|
-
};
|
|
83
|
-
AmityDraftStoryPageBehavior?: {
|
|
84
|
-
onCloseAction?(): void;
|
|
85
|
-
};
|
|
86
|
-
onClickHyperLink?(): void;
|
|
87
|
-
AmitySocialHomePageBehavior?: Record<string, unknown>;
|
|
88
|
-
AmityGlobalFeedComponentBehavior?: {
|
|
89
|
-
goToPostDetailPage?: (context: {
|
|
90
|
-
postId: string;
|
|
91
|
-
}) => void;
|
|
92
|
-
goToViewStoryPage?: (context: {
|
|
93
|
-
targetId: string;
|
|
94
|
-
targetType: Amity.StoryTargetType;
|
|
95
|
-
storyType: 'communityFeed' | 'globalFeed';
|
|
96
|
-
targetIds?: string[];
|
|
97
|
-
}) => void;
|
|
98
|
-
};
|
|
99
|
-
AmityPostDetailPageBehavior?: Record<string, unknown>;
|
|
100
|
-
AmityPostContentComponentBehavior?: {
|
|
101
|
-
goToCommunityProfilePage?: (context: {
|
|
102
|
-
communityId: string;
|
|
103
|
-
}) => void;
|
|
104
|
-
goToUserProfilePage?: (context: {
|
|
105
|
-
userId: string;
|
|
106
|
-
}) => void;
|
|
107
|
-
goToPostComposerPage?: (context: {
|
|
108
|
-
mode: Mode.EDIT;
|
|
109
|
-
post: Amity.Post;
|
|
110
|
-
}) => void;
|
|
111
|
-
};
|
|
112
|
-
AmitySocialGlobalSearchPageBehavior?: Record<string, unknown>;
|
|
113
|
-
AmityCommunitySearchResultComponentBehavior?: {
|
|
114
|
-
goToCommunityProfilePage?: (context: {
|
|
115
|
-
communityId: string;
|
|
116
|
-
}) => void;
|
|
117
|
-
};
|
|
118
|
-
AmityCreatePostMenuComponentBehavior?: {
|
|
119
|
-
goToSelectPostTargetPage?(): void;
|
|
120
|
-
goToStoryTargetSelectionPage?(): void;
|
|
121
|
-
};
|
|
122
|
-
AmityPostTargetSelectionPage?: {
|
|
123
|
-
goToPostComposerPage?: (context: {
|
|
124
|
-
mode: Mode.CREATE;
|
|
125
|
-
targetId: string | null;
|
|
126
|
-
targetType: 'community' | 'user';
|
|
127
|
-
community?: Amity.Community;
|
|
128
|
-
}) => void;
|
|
129
|
-
};
|
|
130
|
-
AmityStoryTargetSelectionPage?: {
|
|
131
|
-
goToStoryCreationPage?(context: {
|
|
132
|
-
targetId: string | null;
|
|
133
|
-
targetType: Amity.StoryTargetType;
|
|
134
|
-
mediaType: {
|
|
135
|
-
type: 'image';
|
|
136
|
-
url: string;
|
|
137
|
-
} | {
|
|
138
|
-
type: 'video';
|
|
139
|
-
url: string;
|
|
140
|
-
};
|
|
141
|
-
storyType: 'communityFeed' | 'globalFeed';
|
|
142
|
-
}): void;
|
|
143
|
-
};
|
|
144
|
-
AmityPostComposerPageBehavior?: {
|
|
145
|
-
goToSocialHomePage?(): void;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
type AmityUIKitConfig = Config;
|
|
150
|
-
interface AmityUIKitProviderProps {
|
|
32
|
+
interface UiKitProviderProps {
|
|
151
33
|
apiKey: string;
|
|
152
34
|
apiRegion: string;
|
|
153
35
|
apiEndpoint?: {
|
|
@@ -156,10 +38,10 @@ interface AmityUIKitProviderProps {
|
|
|
156
38
|
};
|
|
157
39
|
userId: string;
|
|
158
40
|
displayName: string;
|
|
159
|
-
|
|
41
|
+
customComponents?: CustomComponentType;
|
|
42
|
+
postRendererConfig?: PostRendererConfigType;
|
|
160
43
|
theme?: Record<string, unknown>;
|
|
161
44
|
children?: React.ReactNode;
|
|
162
|
-
socialCommunityCreationButtonVisible?: boolean;
|
|
163
45
|
actionHandlers?: {
|
|
164
46
|
onChangePage?: (data: {
|
|
165
47
|
type: string;
|
|
@@ -174,15 +56,16 @@ interface AmityUIKitProviderProps {
|
|
|
174
56
|
}) => void;
|
|
175
57
|
onEditUser?: (userId: string) => void;
|
|
176
58
|
onMessageUser?: (userId: string) => void;
|
|
59
|
+
onBack?: () => void;
|
|
177
60
|
};
|
|
178
|
-
|
|
61
|
+
socialCommunityCreationButtonVisible?: boolean;
|
|
179
62
|
onConnectionStatusChange?: (state: Amity.SessionStates) => void;
|
|
180
63
|
onConnected?: () => void;
|
|
181
64
|
onDisconnected?: () => void;
|
|
65
|
+
pageBehavior?: Record<string, unknown>;
|
|
182
66
|
getAuthToken?: () => Promise<string>;
|
|
183
|
-
configs?: AmityUIKitConfig;
|
|
184
67
|
}
|
|
185
|
-
declare const
|
|
68
|
+
declare const UiKitProvider: ({ apiKey, apiRegion, apiEndpoint, userId, displayName, customComponents, postRendererConfig, theme, children, socialCommunityCreationButtonVisible, actionHandlers, onConnectionStatusChange, onDisconnected, getAuthToken, }: UiKitProviderProps) => React.JSX.Element;
|
|
186
69
|
|
|
187
70
|
interface FeedProps {
|
|
188
71
|
className?: string;
|
|
@@ -684,6 +567,23 @@ declare const ViewStoryPage: React.FC<AmityViewStoryPageProps>;
|
|
|
684
567
|
|
|
685
568
|
declare function StoryTargetSelectionPage(): React.JSX.Element;
|
|
686
569
|
|
|
570
|
+
declare enum Mode {
|
|
571
|
+
CREATE = "create",
|
|
572
|
+
EDIT = "edit"
|
|
573
|
+
}
|
|
574
|
+
interface AmityPostComposerEditOptions {
|
|
575
|
+
mode: Mode.EDIT;
|
|
576
|
+
post: Amity.Post;
|
|
577
|
+
}
|
|
578
|
+
interface AmityPostComposerCreateOptions {
|
|
579
|
+
mode: Mode.CREATE;
|
|
580
|
+
targetId: string | null;
|
|
581
|
+
targetType: 'community' | 'user';
|
|
582
|
+
community?: Amity.Community;
|
|
583
|
+
}
|
|
584
|
+
type PostComposerPageProps = AmityPostComposerCreateOptions | AmityPostComposerEditOptions;
|
|
585
|
+
declare function PostComposerPage(props: PostComposerPageProps): React.JSX.Element;
|
|
586
|
+
|
|
687
587
|
declare function SelectPostTargetPage(): React.JSX.Element;
|
|
688
588
|
|
|
689
589
|
declare function MyCommunitiesSearchPage(): React.JSX.Element;
|
|
@@ -695,4 +595,4 @@ interface PostDetailPageProps {
|
|
|
695
595
|
}
|
|
696
596
|
declare function PostDetailPage({ id }: PostDetailPageProps): React.JSX.Element;
|
|
697
597
|
|
|
698
|
-
export { _default$1 as AmityAvatar, CommentTray as AmityCommentTrayComponent, CommunitySearchResult as AmityCommunitySearchResultComponent, CreatePostMenu as AmityCreatePostMenuComponent, DetailedMediaAttachment as AmityDetailedMediaAttachmentComponent, AmityDraftStoryPage, 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,
|
|
598
|
+
export { _default$1 as AmityAvatar, CommentTray as AmityCommentTrayComponent, CommunitySearchResult as AmityCommunitySearchResultComponent, CreatePostMenu as AmityCreatePostMenuComponent, DetailedMediaAttachment as AmityDetailedMediaAttachmentComponent, AmityDraftStoryPage, 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, UiKitProvider as AmityUiKitProvider, Community as AmityUiKitSocial, UserSearchResult as AmityUserSearchResultComponent, ViewStoryPage as AmityViewStoryPage, ExplorePage, addChatMembers as amityAddChatMembers, removeChatMembers as amityRemoveChatMembers, useNavigation as useAmityNavigation, useSDK as useAmitySDK, useUser as useAmityUser };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,153 +1,35 @@
|
|
|
1
1
|
import React, { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { PostContentType } from '@amityco/ts-sdk';
|
|
2
3
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
3
4
|
import * as styled_components from 'styled-components';
|
|
4
5
|
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
image: string;
|
|
8
|
-
};
|
|
6
|
+
type CustomComponentName = 'Avatar' | 'CategoryHeader' | 'CategorySelector' | 'Chat' | 'ChatDetails' | 'ChatHeader' | 'ChatItem' | 'Comment' | 'CommentComposerBar' | 'CommentLikeButton' | 'CommunityCreatedModel' | 'CommunityCreationModal' | 'CommunityForm' | 'CommunityItem' | 'CommunityMembers' | 'CommunityName' | 'CommunityPermissions' | 'EmptyFeed' | 'EngagementBar' | 'Feed' | 'FeedHeaderTabs' | 'File' | 'Image' | 'ImageGallery' | 'Images' | 'Layout' | 'MediaGallery' | 'MenuTab' | 'Message' | 'MessageComposerBar' | 'MessageList' | 'NickNameCreationModal' | 'Post' | 'PostLikeButton' | 'PostTargetSelector' | 'ProfileSettings' | 'ProfileSettingsTabs' | 'RecentChat' | 'SideNavBar' | 'SocialSearch' | 'Tabs' | 'UICategoryCard' | 'UICommunityCard' | 'UICommunityHeader' | 'UICommunityInfo' | 'UIEngagementBar' | 'UIPostHeader' | 'UITextContent' | 'UITrendingItem' | 'UIUserInfo' | 'UserChip' | 'UserHeader' | 'UserSelector';
|
|
7
|
+
type CustomComponentType = Partial<Record<CustomComponentName, <TProps>(props: TProps) => React.ReactElement<TProps>>>;
|
|
9
8
|
|
|
10
|
-
type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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>;
|
|
9
|
+
type PostRendererProps = {
|
|
10
|
+
childrenPosts?: Amity.Post[];
|
|
11
|
+
className?: string;
|
|
12
|
+
currentUserId?: string;
|
|
13
|
+
handleDeletePost?: (postId: string) => void;
|
|
14
|
+
handleReportPost?: () => void;
|
|
15
|
+
handleUnreportPost?: () => void;
|
|
16
|
+
handleApprovePost?: () => void;
|
|
17
|
+
handleDeclinePost?: () => void;
|
|
18
|
+
handleClosePoll?: () => void;
|
|
19
|
+
poll?: Amity.Poll | null;
|
|
20
|
+
isPollClosed?: boolean;
|
|
21
|
+
hidePostTarget?: boolean;
|
|
22
|
+
isFlaggedByMe?: boolean;
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
post?: Amity.Post;
|
|
25
|
+
user?: Amity.User | null;
|
|
26
|
+
userRoles?: string[];
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
avatarFileUrl?: string;
|
|
59
29
|
};
|
|
30
|
+
type PostRendererConfigType = Record<ValueOf<typeof PostContentType> | string, (props: PostRendererProps) => ReactNode>;
|
|
60
31
|
|
|
61
|
-
|
|
62
|
-
CREATE = "create",
|
|
63
|
-
EDIT = "edit"
|
|
64
|
-
}
|
|
65
|
-
interface AmityPostComposerEditOptions {
|
|
66
|
-
mode: Mode.EDIT;
|
|
67
|
-
post: Amity.Post;
|
|
68
|
-
}
|
|
69
|
-
interface AmityPostComposerCreateOptions {
|
|
70
|
-
mode: Mode.CREATE;
|
|
71
|
-
targetId: string | null;
|
|
72
|
-
targetType: 'community' | 'user';
|
|
73
|
-
community?: Amity.Community;
|
|
74
|
-
}
|
|
75
|
-
type PostComposerPageProps = AmityPostComposerCreateOptions | AmityPostComposerEditOptions;
|
|
76
|
-
declare function PostComposerPage(props: PostComposerPageProps): React.JSX.Element;
|
|
77
|
-
|
|
78
|
-
interface PageBehavior {
|
|
79
|
-
AmityStoryViewPageBehavior?: {
|
|
80
|
-
onCloseAction?(): void;
|
|
81
|
-
hyperLinkAction?(context: Record<string, unknown>): void;
|
|
82
|
-
};
|
|
83
|
-
AmityDraftStoryPageBehavior?: {
|
|
84
|
-
onCloseAction?(): void;
|
|
85
|
-
};
|
|
86
|
-
onClickHyperLink?(): void;
|
|
87
|
-
AmitySocialHomePageBehavior?: Record<string, unknown>;
|
|
88
|
-
AmityGlobalFeedComponentBehavior?: {
|
|
89
|
-
goToPostDetailPage?: (context: {
|
|
90
|
-
postId: string;
|
|
91
|
-
}) => void;
|
|
92
|
-
goToViewStoryPage?: (context: {
|
|
93
|
-
targetId: string;
|
|
94
|
-
targetType: Amity.StoryTargetType;
|
|
95
|
-
storyType: 'communityFeed' | 'globalFeed';
|
|
96
|
-
targetIds?: string[];
|
|
97
|
-
}) => void;
|
|
98
|
-
};
|
|
99
|
-
AmityPostDetailPageBehavior?: Record<string, unknown>;
|
|
100
|
-
AmityPostContentComponentBehavior?: {
|
|
101
|
-
goToCommunityProfilePage?: (context: {
|
|
102
|
-
communityId: string;
|
|
103
|
-
}) => void;
|
|
104
|
-
goToUserProfilePage?: (context: {
|
|
105
|
-
userId: string;
|
|
106
|
-
}) => void;
|
|
107
|
-
goToPostComposerPage?: (context: {
|
|
108
|
-
mode: Mode.EDIT;
|
|
109
|
-
post: Amity.Post;
|
|
110
|
-
}) => void;
|
|
111
|
-
};
|
|
112
|
-
AmitySocialGlobalSearchPageBehavior?: Record<string, unknown>;
|
|
113
|
-
AmityCommunitySearchResultComponentBehavior?: {
|
|
114
|
-
goToCommunityProfilePage?: (context: {
|
|
115
|
-
communityId: string;
|
|
116
|
-
}) => void;
|
|
117
|
-
};
|
|
118
|
-
AmityCreatePostMenuComponentBehavior?: {
|
|
119
|
-
goToSelectPostTargetPage?(): void;
|
|
120
|
-
goToStoryTargetSelectionPage?(): void;
|
|
121
|
-
};
|
|
122
|
-
AmityPostTargetSelectionPage?: {
|
|
123
|
-
goToPostComposerPage?: (context: {
|
|
124
|
-
mode: Mode.CREATE;
|
|
125
|
-
targetId: string | null;
|
|
126
|
-
targetType: 'community' | 'user';
|
|
127
|
-
community?: Amity.Community;
|
|
128
|
-
}) => void;
|
|
129
|
-
};
|
|
130
|
-
AmityStoryTargetSelectionPage?: {
|
|
131
|
-
goToStoryCreationPage?(context: {
|
|
132
|
-
targetId: string | null;
|
|
133
|
-
targetType: Amity.StoryTargetType;
|
|
134
|
-
mediaType: {
|
|
135
|
-
type: 'image';
|
|
136
|
-
url: string;
|
|
137
|
-
} | {
|
|
138
|
-
type: 'video';
|
|
139
|
-
url: string;
|
|
140
|
-
};
|
|
141
|
-
storyType: 'communityFeed' | 'globalFeed';
|
|
142
|
-
}): void;
|
|
143
|
-
};
|
|
144
|
-
AmityPostComposerPageBehavior?: {
|
|
145
|
-
goToSocialHomePage?(): void;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
type AmityUIKitConfig = Config;
|
|
150
|
-
interface AmityUIKitProviderProps {
|
|
32
|
+
interface UiKitProviderProps {
|
|
151
33
|
apiKey: string;
|
|
152
34
|
apiRegion: string;
|
|
153
35
|
apiEndpoint?: {
|
|
@@ -156,10 +38,10 @@ interface AmityUIKitProviderProps {
|
|
|
156
38
|
};
|
|
157
39
|
userId: string;
|
|
158
40
|
displayName: string;
|
|
159
|
-
|
|
41
|
+
customComponents?: CustomComponentType;
|
|
42
|
+
postRendererConfig?: PostRendererConfigType;
|
|
160
43
|
theme?: Record<string, unknown>;
|
|
161
44
|
children?: React.ReactNode;
|
|
162
|
-
socialCommunityCreationButtonVisible?: boolean;
|
|
163
45
|
actionHandlers?: {
|
|
164
46
|
onChangePage?: (data: {
|
|
165
47
|
type: string;
|
|
@@ -174,15 +56,16 @@ interface AmityUIKitProviderProps {
|
|
|
174
56
|
}) => void;
|
|
175
57
|
onEditUser?: (userId: string) => void;
|
|
176
58
|
onMessageUser?: (userId: string) => void;
|
|
59
|
+
onBack?: () => void;
|
|
177
60
|
};
|
|
178
|
-
|
|
61
|
+
socialCommunityCreationButtonVisible?: boolean;
|
|
179
62
|
onConnectionStatusChange?: (state: Amity.SessionStates) => void;
|
|
180
63
|
onConnected?: () => void;
|
|
181
64
|
onDisconnected?: () => void;
|
|
65
|
+
pageBehavior?: Record<string, unknown>;
|
|
182
66
|
getAuthToken?: () => Promise<string>;
|
|
183
|
-
configs?: AmityUIKitConfig;
|
|
184
67
|
}
|
|
185
|
-
declare const
|
|
68
|
+
declare const UiKitProvider: ({ apiKey, apiRegion, apiEndpoint, userId, displayName, customComponents, postRendererConfig, theme, children, socialCommunityCreationButtonVisible, actionHandlers, onConnectionStatusChange, onDisconnected, getAuthToken, }: UiKitProviderProps) => React.JSX.Element;
|
|
186
69
|
|
|
187
70
|
interface FeedProps {
|
|
188
71
|
className?: string;
|
|
@@ -684,6 +567,23 @@ declare const ViewStoryPage: React.FC<AmityViewStoryPageProps>;
|
|
|
684
567
|
|
|
685
568
|
declare function StoryTargetSelectionPage(): React.JSX.Element;
|
|
686
569
|
|
|
570
|
+
declare enum Mode {
|
|
571
|
+
CREATE = "create",
|
|
572
|
+
EDIT = "edit"
|
|
573
|
+
}
|
|
574
|
+
interface AmityPostComposerEditOptions {
|
|
575
|
+
mode: Mode.EDIT;
|
|
576
|
+
post: Amity.Post;
|
|
577
|
+
}
|
|
578
|
+
interface AmityPostComposerCreateOptions {
|
|
579
|
+
mode: Mode.CREATE;
|
|
580
|
+
targetId: string | null;
|
|
581
|
+
targetType: 'community' | 'user';
|
|
582
|
+
community?: Amity.Community;
|
|
583
|
+
}
|
|
584
|
+
type PostComposerPageProps = AmityPostComposerCreateOptions | AmityPostComposerEditOptions;
|
|
585
|
+
declare function PostComposerPage(props: PostComposerPageProps): React.JSX.Element;
|
|
586
|
+
|
|
687
587
|
declare function SelectPostTargetPage(): React.JSX.Element;
|
|
688
588
|
|
|
689
589
|
declare function MyCommunitiesSearchPage(): React.JSX.Element;
|
|
@@ -695,4 +595,4 @@ interface PostDetailPageProps {
|
|
|
695
595
|
}
|
|
696
596
|
declare function PostDetailPage({ id }: PostDetailPageProps): React.JSX.Element;
|
|
697
597
|
|
|
698
|
-
export { _default$1 as AmityAvatar, CommentTray as AmityCommentTrayComponent, CommunitySearchResult as AmityCommunitySearchResultComponent, CreatePostMenu as AmityCreatePostMenuComponent, DetailedMediaAttachment as AmityDetailedMediaAttachmentComponent, AmityDraftStoryPage, 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,
|
|
598
|
+
export { _default$1 as AmityAvatar, CommentTray as AmityCommentTrayComponent, CommunitySearchResult as AmityCommunitySearchResultComponent, CreatePostMenu as AmityCreatePostMenuComponent, DetailedMediaAttachment as AmityDetailedMediaAttachmentComponent, AmityDraftStoryPage, 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, UiKitProvider as AmityUiKitProvider, Community as AmityUiKitSocial, UserSearchResult as AmityUserSearchResultComponent, ViewStoryPage as AmityViewStoryPage, ExplorePage, addChatMembers as amityAddChatMembers, removeChatMembers as amityRemoveChatMembers, useNavigation as useAmityNavigation, useSDK as useAmitySDK, useUser as useAmityUser };
|