@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.
Files changed (57) hide show
  1. package/dist/DeleteIcon-JDFUIJH2.svg +10 -0
  2. package/dist/Welcome-WSYGNAL7.svg +14 -0
  3. package/dist/WelcomeDesktop-CP7A4QPB.svg +14 -0
  4. package/dist/esm/DeleteIcon-JDFUIJH2.svg +10 -0
  5. package/dist/esm/Welcome-WSYGNAL7.svg +14 -0
  6. package/dist/esm/WelcomeDesktop-CP7A4QPB.svg +14 -0
  7. package/dist/esm/index.css +1 -1
  8. package/dist/esm/index.js +1463 -1012
  9. package/dist/index.css +1 -1
  10. package/dist/index.d.mts +49 -149
  11. package/dist/index.d.ts +49 -149
  12. package/dist/index.js +1534 -1083
  13. package/dist/metafile-cjs.json +1 -1
  14. package/dist/metafile-esm.json +1 -1
  15. package/package.json +3 -3
  16. package/dist/Inter-Black-PFV6RWF7.woff2 +0 -0
  17. package/dist/Inter-BlackItalic-OUXR4CVK.woff2 +0 -0
  18. package/dist/Inter-Bold-K6PA7FOK.woff2 +0 -0
  19. package/dist/Inter-BoldItalic-QKFESTQE.woff2 +0 -0
  20. package/dist/Inter-ExtraBold-2ZPQFALF.woff2 +0 -0
  21. package/dist/Inter-ExtraBoldItalic-RR7KYXHD.woff2 +0 -0
  22. package/dist/Inter-ExtraLight-NASBO7I6.woff2 +0 -0
  23. package/dist/Inter-ExtraLightItalic-AUJY3XPT.woff2 +0 -0
  24. package/dist/Inter-Italic-2WJ2RX3Z.woff2 +0 -0
  25. package/dist/Inter-Light-E4ED7JRX.woff2 +0 -0
  26. package/dist/Inter-LightItalic-BJ4DXCNT.woff2 +0 -0
  27. package/dist/Inter-Medium-3R4SWUEO.woff2 +0 -0
  28. package/dist/Inter-MediumItalic-QTJUSOU7.woff2 +0 -0
  29. package/dist/Inter-Regular-6HYMGWZS.woff2 +0 -0
  30. package/dist/Inter-SemiBold-7SYQBR3A.woff2 +0 -0
  31. package/dist/Inter-SemiBoldItalic-3EHSSXIM.woff2 +0 -0
  32. package/dist/Inter-Thin-3L5KITMZ.woff2 +0 -0
  33. package/dist/Inter-ThinItalic-J7DGFM6P.woff2 +0 -0
  34. package/dist/Inter-italic.var-SWFAXF2C.woff2 +0 -0
  35. package/dist/Inter-roman.var-WIJJYAE4.woff2 +0 -0
  36. package/dist/Inter.var-OMHIC2JW.woff2 +0 -0
  37. package/dist/esm/Inter-Black-PFV6RWF7.woff2 +0 -0
  38. package/dist/esm/Inter-BlackItalic-OUXR4CVK.woff2 +0 -0
  39. package/dist/esm/Inter-Bold-K6PA7FOK.woff2 +0 -0
  40. package/dist/esm/Inter-BoldItalic-QKFESTQE.woff2 +0 -0
  41. package/dist/esm/Inter-ExtraBold-2ZPQFALF.woff2 +0 -0
  42. package/dist/esm/Inter-ExtraBoldItalic-RR7KYXHD.woff2 +0 -0
  43. package/dist/esm/Inter-ExtraLight-NASBO7I6.woff2 +0 -0
  44. package/dist/esm/Inter-ExtraLightItalic-AUJY3XPT.woff2 +0 -0
  45. package/dist/esm/Inter-Italic-2WJ2RX3Z.woff2 +0 -0
  46. package/dist/esm/Inter-Light-E4ED7JRX.woff2 +0 -0
  47. package/dist/esm/Inter-LightItalic-BJ4DXCNT.woff2 +0 -0
  48. package/dist/esm/Inter-Medium-3R4SWUEO.woff2 +0 -0
  49. package/dist/esm/Inter-MediumItalic-QTJUSOU7.woff2 +0 -0
  50. package/dist/esm/Inter-Regular-6HYMGWZS.woff2 +0 -0
  51. package/dist/esm/Inter-SemiBold-7SYQBR3A.woff2 +0 -0
  52. package/dist/esm/Inter-SemiBoldItalic-3EHSSXIM.woff2 +0 -0
  53. package/dist/esm/Inter-Thin-3L5KITMZ.woff2 +0 -0
  54. package/dist/esm/Inter-ThinItalic-J7DGFM6P.woff2 +0 -0
  55. package/dist/esm/Inter-italic.var-SWFAXF2C.woff2 +0 -0
  56. package/dist/esm/Inter-roman.var-WIJJYAE4.woff2 +0 -0
  57. 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 AmityReactionType = {
6
- name: string;
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 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>;
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
- declare enum Mode {
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
- postRendererConfig?: any;
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
- pageBehavior?: PageBehavior;
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 AmityUIKitProvider: React.FC<AmityUIKitProviderProps>;
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, AmityUIKitProvider 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 };
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 AmityReactionType = {
6
- name: string;
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 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>;
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
- declare enum Mode {
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
- postRendererConfig?: any;
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
- pageBehavior?: PageBehavior;
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 AmityUIKitProvider: React.FC<AmityUIKitProviderProps>;
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, AmityUIKitProvider 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 };
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 };