@amityco/ui-kit-open-source 4.8.1 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +766 -767
- package/dist/index.css +1 -1
- package/dist/index.d.mts +61 -34
- package/dist/index.d.ts +61 -34
- package/dist/index.js +867 -868
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -7,7 +7,24 @@ type AmityReactionType = {
|
|
|
7
7
|
image: string;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
type
|
|
10
|
+
type IconConfiguration = {
|
|
11
|
+
icon?: string;
|
|
12
|
+
image?: string;
|
|
13
|
+
};
|
|
14
|
+
type TextConfiguration = {
|
|
15
|
+
text?: string;
|
|
16
|
+
};
|
|
17
|
+
type CustomConfiguration = {
|
|
18
|
+
[key: string]: string | undefined | boolean | Array<string> | number | Record<string, unknown>;
|
|
19
|
+
};
|
|
20
|
+
type ThemeConfiguration = {
|
|
21
|
+
preferred_theme?: 'light' | 'dark' | 'default';
|
|
22
|
+
theme?: {
|
|
23
|
+
light?: Partial<Theme['light']>;
|
|
24
|
+
dark?: Partial<Theme['dark']>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type ConfigurableThemeValue = {
|
|
11
28
|
primary_color: string;
|
|
12
29
|
secondary_color: string;
|
|
13
30
|
secondary_shade1_color: string;
|
|
@@ -25,16 +42,22 @@ type ThemeValue = {
|
|
|
25
42
|
base_inverse_color: string;
|
|
26
43
|
};
|
|
27
44
|
type Theme = {
|
|
28
|
-
light:
|
|
29
|
-
dark:
|
|
45
|
+
light: ConfigurableThemeValue;
|
|
46
|
+
dark: ConfigurableThemeValue;
|
|
30
47
|
};
|
|
31
|
-
type
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
type GetConfigReturnValue = IconConfiguration & TextConfiguration & ThemeConfiguration & CustomConfiguration;
|
|
49
|
+
type DefaultConfig = {
|
|
50
|
+
preferred_theme: 'light' | 'dark' | 'default';
|
|
51
|
+
theme: {
|
|
52
|
+
light: Theme['light'];
|
|
53
|
+
dark: Theme['dark'];
|
|
54
|
+
};
|
|
55
|
+
excludes: string[];
|
|
56
|
+
customizations?: {
|
|
57
|
+
[key: string]: GetConfigReturnValue;
|
|
36
58
|
};
|
|
37
59
|
};
|
|
60
|
+
|
|
38
61
|
type NetworkConfig = {
|
|
39
62
|
config: DefaultConfig;
|
|
40
63
|
};
|
|
@@ -47,30 +70,9 @@ interface Config {
|
|
|
47
70
|
excludes?: string[];
|
|
48
71
|
message_reactions?: AmityReactionType[];
|
|
49
72
|
customizations?: {
|
|
50
|
-
[key: string]:
|
|
73
|
+
[key: string]: GetConfigReturnValue;
|
|
51
74
|
};
|
|
52
75
|
}
|
|
53
|
-
type DefaultConfig = {
|
|
54
|
-
preferred_theme: 'light' | 'dark' | 'default';
|
|
55
|
-
theme: {
|
|
56
|
-
light: Theme['light'];
|
|
57
|
-
dark: Theme['dark'];
|
|
58
|
-
};
|
|
59
|
-
excludes: string[];
|
|
60
|
-
customizations?: {
|
|
61
|
-
[key: string]: IconConfiguration & TextConfiguration & ThemeConfiguration & CustomConfiguration;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
type IconConfiguration = {
|
|
65
|
-
icon?: string;
|
|
66
|
-
image?: string;
|
|
67
|
-
};
|
|
68
|
-
type TextConfiguration = {
|
|
69
|
-
text?: string;
|
|
70
|
-
};
|
|
71
|
-
type CustomConfiguration = {
|
|
72
|
-
[key: string]: string | undefined | boolean | Array<string> | number | Record<string, unknown>;
|
|
73
|
-
};
|
|
74
76
|
|
|
75
77
|
declare enum AmityPostContentComponentStyle {
|
|
76
78
|
FEED = "feed",
|
|
@@ -266,6 +268,9 @@ interface PageBehavior {
|
|
|
266
268
|
targetId: string | null;
|
|
267
269
|
targetType: 'community' | 'user';
|
|
268
270
|
}): void;
|
|
271
|
+
goToPendingRequestPage?(context: {
|
|
272
|
+
community: Amity.Community;
|
|
273
|
+
}): void;
|
|
269
274
|
};
|
|
270
275
|
AmitySocialHomeTopNavigationComponentBehavior?: {
|
|
271
276
|
goToCreateCommunityPage?(context: {
|
|
@@ -281,6 +286,10 @@ interface PageBehavior {
|
|
|
281
286
|
communityId?: string;
|
|
282
287
|
onAddedAction?: (userId: string[]) => void;
|
|
283
288
|
}): void;
|
|
289
|
+
goToInviteMemberPage?(context: {
|
|
290
|
+
communityId?: string;
|
|
291
|
+
onSubmit?: (userId: string[]) => void;
|
|
292
|
+
}): void;
|
|
284
293
|
};
|
|
285
294
|
AmityCommunitySettingPageBehavior?: {
|
|
286
295
|
goToEditCommunityPage?(context: {
|
|
@@ -290,6 +299,9 @@ interface PageBehavior {
|
|
|
290
299
|
goToMembershipPage?(context: {
|
|
291
300
|
community: Amity.Community;
|
|
292
301
|
}): void;
|
|
302
|
+
goToPendingInvitationPage?(context: {
|
|
303
|
+
community: Amity.Community;
|
|
304
|
+
}): void;
|
|
293
305
|
goToPostPermissionPage?(context: {
|
|
294
306
|
community: Amity.Community;
|
|
295
307
|
}): void;
|
|
@@ -307,6 +319,20 @@ interface PageBehavior {
|
|
|
307
319
|
goToUserProfilePage?: (context: {
|
|
308
320
|
userId: string;
|
|
309
321
|
}) => void;
|
|
322
|
+
goToInviteMemberPage?(context: {
|
|
323
|
+
communityId?: string;
|
|
324
|
+
onSubmit?: (userId: string[]) => void;
|
|
325
|
+
}): void;
|
|
326
|
+
};
|
|
327
|
+
AmityCommunityPendingInvitationPageBehavior?: {
|
|
328
|
+
goToUserProfilePage?: (context: {
|
|
329
|
+
userId: string;
|
|
330
|
+
}) => void;
|
|
331
|
+
};
|
|
332
|
+
AmityCommunityInviteMemberPageBehavior?: {
|
|
333
|
+
goToUserProfilePage?: (context: {
|
|
334
|
+
userId: string;
|
|
335
|
+
}) => void;
|
|
310
336
|
};
|
|
311
337
|
AmityUserFeedComponentBehavior?: {
|
|
312
338
|
goToPostDetailPage?(context: {
|
|
@@ -810,7 +836,7 @@ interface PostDetailPageProps {
|
|
|
810
836
|
commentId?: string;
|
|
811
837
|
parentId?: string;
|
|
812
838
|
}
|
|
813
|
-
declare function PostDetailPage({ id, hideTarget, category, commentId, parentId, }: PostDetailPageProps): React.JSX.Element;
|
|
839
|
+
declare function PostDetailPage({ id, hideTarget, category, commentId, parentId, }: PostDetailPageProps): React.JSX.Element | null;
|
|
814
840
|
|
|
815
841
|
type UserProfilePageProps = {
|
|
816
842
|
userId: string;
|
|
@@ -962,9 +988,10 @@ declare const CommunitySearchResult: ({ isLoading, onLoadMore, pageId, onClosePo
|
|
|
962
988
|
type TopSearchBarProps = {
|
|
963
989
|
pageId?: string;
|
|
964
990
|
onFocus?: () => void;
|
|
991
|
+
hasCancelButton?: boolean;
|
|
965
992
|
search: (keyword: string) => void;
|
|
966
993
|
};
|
|
967
|
-
declare function TopSearchBar({ pageId, search, onFocus }: TopSearchBarProps): React.JSX.Element | null;
|
|
994
|
+
declare function TopSearchBar({ pageId, search, onFocus, hasCancelButton, }: TopSearchBarProps): React.JSX.Element | null;
|
|
968
995
|
|
|
969
996
|
interface MyCommunitiesProps {
|
|
970
997
|
pageId?: string;
|
|
@@ -975,7 +1002,7 @@ interface GlobalFeedProps {
|
|
|
975
1002
|
pageId?: string;
|
|
976
1003
|
componentId?: string;
|
|
977
1004
|
items: Array<Amity.Post | Amity.Ad>;
|
|
978
|
-
globalFeaturedPosts?: Array<Amity.
|
|
1005
|
+
globalFeaturedPosts?: Array<Amity.PinnedPost>;
|
|
979
1006
|
isLoading: boolean;
|
|
980
1007
|
isGlobalFeaturedPostsLoading?: boolean;
|
|
981
1008
|
onFeedReachBottom: () => void;
|
|
@@ -1043,7 +1070,7 @@ type PendingPostContentProps = {
|
|
|
1043
1070
|
canReviewCommunityPosts?: boolean;
|
|
1044
1071
|
refresh?: () => void;
|
|
1045
1072
|
};
|
|
1046
|
-
declare const PendingPostContent: ({ pageId, post: initialPost, canReviewCommunityPosts, refresh, }: PendingPostContentProps) => React.JSX.Element;
|
|
1073
|
+
declare const PendingPostContent: ({ pageId, post: initialPost, canReviewCommunityPosts, refresh, }: PendingPostContentProps) => React.JSX.Element | null;
|
|
1047
1074
|
|
|
1048
1075
|
interface UserProfileHeaderProps {
|
|
1049
1076
|
user?: Amity.User | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,24 @@ type AmityReactionType = {
|
|
|
7
7
|
image: string;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
type
|
|
10
|
+
type IconConfiguration = {
|
|
11
|
+
icon?: string;
|
|
12
|
+
image?: string;
|
|
13
|
+
};
|
|
14
|
+
type TextConfiguration = {
|
|
15
|
+
text?: string;
|
|
16
|
+
};
|
|
17
|
+
type CustomConfiguration = {
|
|
18
|
+
[key: string]: string | undefined | boolean | Array<string> | number | Record<string, unknown>;
|
|
19
|
+
};
|
|
20
|
+
type ThemeConfiguration = {
|
|
21
|
+
preferred_theme?: 'light' | 'dark' | 'default';
|
|
22
|
+
theme?: {
|
|
23
|
+
light?: Partial<Theme['light']>;
|
|
24
|
+
dark?: Partial<Theme['dark']>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type ConfigurableThemeValue = {
|
|
11
28
|
primary_color: string;
|
|
12
29
|
secondary_color: string;
|
|
13
30
|
secondary_shade1_color: string;
|
|
@@ -25,16 +42,22 @@ type ThemeValue = {
|
|
|
25
42
|
base_inverse_color: string;
|
|
26
43
|
};
|
|
27
44
|
type Theme = {
|
|
28
|
-
light:
|
|
29
|
-
dark:
|
|
45
|
+
light: ConfigurableThemeValue;
|
|
46
|
+
dark: ConfigurableThemeValue;
|
|
30
47
|
};
|
|
31
|
-
type
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
type GetConfigReturnValue = IconConfiguration & TextConfiguration & ThemeConfiguration & CustomConfiguration;
|
|
49
|
+
type DefaultConfig = {
|
|
50
|
+
preferred_theme: 'light' | 'dark' | 'default';
|
|
51
|
+
theme: {
|
|
52
|
+
light: Theme['light'];
|
|
53
|
+
dark: Theme['dark'];
|
|
54
|
+
};
|
|
55
|
+
excludes: string[];
|
|
56
|
+
customizations?: {
|
|
57
|
+
[key: string]: GetConfigReturnValue;
|
|
36
58
|
};
|
|
37
59
|
};
|
|
60
|
+
|
|
38
61
|
type NetworkConfig = {
|
|
39
62
|
config: DefaultConfig;
|
|
40
63
|
};
|
|
@@ -47,30 +70,9 @@ interface Config {
|
|
|
47
70
|
excludes?: string[];
|
|
48
71
|
message_reactions?: AmityReactionType[];
|
|
49
72
|
customizations?: {
|
|
50
|
-
[key: string]:
|
|
73
|
+
[key: string]: GetConfigReturnValue;
|
|
51
74
|
};
|
|
52
75
|
}
|
|
53
|
-
type DefaultConfig = {
|
|
54
|
-
preferred_theme: 'light' | 'dark' | 'default';
|
|
55
|
-
theme: {
|
|
56
|
-
light: Theme['light'];
|
|
57
|
-
dark: Theme['dark'];
|
|
58
|
-
};
|
|
59
|
-
excludes: string[];
|
|
60
|
-
customizations?: {
|
|
61
|
-
[key: string]: IconConfiguration & TextConfiguration & ThemeConfiguration & CustomConfiguration;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
type IconConfiguration = {
|
|
65
|
-
icon?: string;
|
|
66
|
-
image?: string;
|
|
67
|
-
};
|
|
68
|
-
type TextConfiguration = {
|
|
69
|
-
text?: string;
|
|
70
|
-
};
|
|
71
|
-
type CustomConfiguration = {
|
|
72
|
-
[key: string]: string | undefined | boolean | Array<string> | number | Record<string, unknown>;
|
|
73
|
-
};
|
|
74
76
|
|
|
75
77
|
declare enum AmityPostContentComponentStyle {
|
|
76
78
|
FEED = "feed",
|
|
@@ -266,6 +268,9 @@ interface PageBehavior {
|
|
|
266
268
|
targetId: string | null;
|
|
267
269
|
targetType: 'community' | 'user';
|
|
268
270
|
}): void;
|
|
271
|
+
goToPendingRequestPage?(context: {
|
|
272
|
+
community: Amity.Community;
|
|
273
|
+
}): void;
|
|
269
274
|
};
|
|
270
275
|
AmitySocialHomeTopNavigationComponentBehavior?: {
|
|
271
276
|
goToCreateCommunityPage?(context: {
|
|
@@ -281,6 +286,10 @@ interface PageBehavior {
|
|
|
281
286
|
communityId?: string;
|
|
282
287
|
onAddedAction?: (userId: string[]) => void;
|
|
283
288
|
}): void;
|
|
289
|
+
goToInviteMemberPage?(context: {
|
|
290
|
+
communityId?: string;
|
|
291
|
+
onSubmit?: (userId: string[]) => void;
|
|
292
|
+
}): void;
|
|
284
293
|
};
|
|
285
294
|
AmityCommunitySettingPageBehavior?: {
|
|
286
295
|
goToEditCommunityPage?(context: {
|
|
@@ -290,6 +299,9 @@ interface PageBehavior {
|
|
|
290
299
|
goToMembershipPage?(context: {
|
|
291
300
|
community: Amity.Community;
|
|
292
301
|
}): void;
|
|
302
|
+
goToPendingInvitationPage?(context: {
|
|
303
|
+
community: Amity.Community;
|
|
304
|
+
}): void;
|
|
293
305
|
goToPostPermissionPage?(context: {
|
|
294
306
|
community: Amity.Community;
|
|
295
307
|
}): void;
|
|
@@ -307,6 +319,20 @@ interface PageBehavior {
|
|
|
307
319
|
goToUserProfilePage?: (context: {
|
|
308
320
|
userId: string;
|
|
309
321
|
}) => void;
|
|
322
|
+
goToInviteMemberPage?(context: {
|
|
323
|
+
communityId?: string;
|
|
324
|
+
onSubmit?: (userId: string[]) => void;
|
|
325
|
+
}): void;
|
|
326
|
+
};
|
|
327
|
+
AmityCommunityPendingInvitationPageBehavior?: {
|
|
328
|
+
goToUserProfilePage?: (context: {
|
|
329
|
+
userId: string;
|
|
330
|
+
}) => void;
|
|
331
|
+
};
|
|
332
|
+
AmityCommunityInviteMemberPageBehavior?: {
|
|
333
|
+
goToUserProfilePage?: (context: {
|
|
334
|
+
userId: string;
|
|
335
|
+
}) => void;
|
|
310
336
|
};
|
|
311
337
|
AmityUserFeedComponentBehavior?: {
|
|
312
338
|
goToPostDetailPage?(context: {
|
|
@@ -810,7 +836,7 @@ interface PostDetailPageProps {
|
|
|
810
836
|
commentId?: string;
|
|
811
837
|
parentId?: string;
|
|
812
838
|
}
|
|
813
|
-
declare function PostDetailPage({ id, hideTarget, category, commentId, parentId, }: PostDetailPageProps): React.JSX.Element;
|
|
839
|
+
declare function PostDetailPage({ id, hideTarget, category, commentId, parentId, }: PostDetailPageProps): React.JSX.Element | null;
|
|
814
840
|
|
|
815
841
|
type UserProfilePageProps = {
|
|
816
842
|
userId: string;
|
|
@@ -962,9 +988,10 @@ declare const CommunitySearchResult: ({ isLoading, onLoadMore, pageId, onClosePo
|
|
|
962
988
|
type TopSearchBarProps = {
|
|
963
989
|
pageId?: string;
|
|
964
990
|
onFocus?: () => void;
|
|
991
|
+
hasCancelButton?: boolean;
|
|
965
992
|
search: (keyword: string) => void;
|
|
966
993
|
};
|
|
967
|
-
declare function TopSearchBar({ pageId, search, onFocus }: TopSearchBarProps): React.JSX.Element | null;
|
|
994
|
+
declare function TopSearchBar({ pageId, search, onFocus, hasCancelButton, }: TopSearchBarProps): React.JSX.Element | null;
|
|
968
995
|
|
|
969
996
|
interface MyCommunitiesProps {
|
|
970
997
|
pageId?: string;
|
|
@@ -975,7 +1002,7 @@ interface GlobalFeedProps {
|
|
|
975
1002
|
pageId?: string;
|
|
976
1003
|
componentId?: string;
|
|
977
1004
|
items: Array<Amity.Post | Amity.Ad>;
|
|
978
|
-
globalFeaturedPosts?: Array<Amity.
|
|
1005
|
+
globalFeaturedPosts?: Array<Amity.PinnedPost>;
|
|
979
1006
|
isLoading: boolean;
|
|
980
1007
|
isGlobalFeaturedPostsLoading?: boolean;
|
|
981
1008
|
onFeedReachBottom: () => void;
|
|
@@ -1043,7 +1070,7 @@ type PendingPostContentProps = {
|
|
|
1043
1070
|
canReviewCommunityPosts?: boolean;
|
|
1044
1071
|
refresh?: () => void;
|
|
1045
1072
|
};
|
|
1046
|
-
declare const PendingPostContent: ({ pageId, post: initialPost, canReviewCommunityPosts, refresh, }: PendingPostContentProps) => React.JSX.Element;
|
|
1073
|
+
declare const PendingPostContent: ({ pageId, post: initialPost, canReviewCommunityPosts, refresh, }: PendingPostContentProps) => React.JSX.Element | null;
|
|
1047
1074
|
|
|
1048
1075
|
interface UserProfileHeaderProps {
|
|
1049
1076
|
user?: Amity.User | null;
|