@medipha/feed 0.3.6 → 0.3.8
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/app/newsfeed-module.types.d.ts +6 -0
- package/dist/app/runtime/feed-runtime-context.d.ts +1 -0
- package/dist/core/feed-api.d.ts +1 -1
- package/dist/core/http.d.ts +2 -0
- package/dist/features/composer/media-picker.d.ts +8 -5
- package/dist/index.cjs +21 -21
- package/dist/index.js +3368 -3509
- package/dist/shared/components/user-profile-link.d.ts +4 -1
- package/dist/shared/utils/chat-share.d.ts +0 -30
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/shared/components/user-profile-modal.d.ts +0 -9
|
@@ -5,6 +5,12 @@ export interface NewsfeedModuleProps {
|
|
|
5
5
|
basePath: string;
|
|
6
6
|
onUnauthorized?: () => void;
|
|
7
7
|
onNavigateOutsideFeed?: (path: string) => void;
|
|
8
|
+
/**
|
|
9
|
+
* A click on a colleague's avatar or name. The host shows the chat widget's own "Thông tin tài
|
|
10
|
+
* khoản" dialog for that user id (ChatWidget `openProfileRequest`), whose "Nhắn tin" opens the
|
|
11
|
+
* conversation in the widget. Without it avatars and names are not clickable.
|
|
12
|
+
*/
|
|
13
|
+
onOpenUserProfile?: (userId: string) => void;
|
|
8
14
|
/**
|
|
9
15
|
* The feed never offers post creation (that lives in NewsfeedAdminModule).
|
|
10
16
|
* false also disables reactions, comments and the post actions menu. Defaults to true.
|
|
@@ -12,6 +12,7 @@ export interface FeedRuntime {
|
|
|
12
12
|
postUrl: (postId: string) => string;
|
|
13
13
|
postUrlPath: (postId: string) => string;
|
|
14
14
|
onNavigateOutsideFeed?: NewsfeedModuleProps['onNavigateOutsideFeed'];
|
|
15
|
+
onOpenUserProfile?: NewsfeedModuleProps['onOpenUserProfile'];
|
|
15
16
|
}
|
|
16
17
|
export declare const FeedRuntimeContext: import('react').Context<FeedRuntime | undefined>;
|
|
17
18
|
export declare function useFeedRuntime(): FeedRuntime;
|
package/dist/core/feed-api.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare function createFeedApi(config: FeedApiConfig): {
|
|
|
69
69
|
updatePost: (postId: string, input: UpdatePostInput) => Promise<FeedPost>;
|
|
70
70
|
submitPost: (postId: string) => Promise<FeedPost>;
|
|
71
71
|
deletePost: (postId: string) => Promise<void>;
|
|
72
|
-
uploadMedia: (file: Blob, fileName: string) => Promise<FeedMedia>;
|
|
72
|
+
uploadMedia: (file: Blob, fileName: string, onProgress?: (ratio: number) => void) => Promise<FeedMedia>;
|
|
73
73
|
listManagePosts: (params?: ListManagePostsParams, signal?: AbortSignal) => Promise<OffsetPage<FeedPost>>;
|
|
74
74
|
getManageCounts: (range?: Partial<DateRangeParams>, signal?: AbortSignal) => Promise<ManageCounts>;
|
|
75
75
|
approvePosts: (postIds: string[]) => Promise<void>;
|
package/dist/core/http.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface FeedRequestOptions {
|
|
|
12
12
|
body?: unknown;
|
|
13
13
|
signal?: AbortSignal;
|
|
14
14
|
responseType?: 'json' | 'blob';
|
|
15
|
+
/** Upload progress from 0 to 1; fetch cannot report it, so the request goes through XMLHttpRequest. */
|
|
16
|
+
onUploadProgress?: (ratio: number) => void;
|
|
15
17
|
}
|
|
16
18
|
export type FeedRequest = <T>(path: string, options?: FeedRequestOptions) => Promise<T>;
|
|
17
19
|
export declare function createFeedRequest(config: FeedApiConfig): FeedRequest;
|
|
@@ -4,14 +4,17 @@ interface MediaPickerButtonsProps {
|
|
|
4
4
|
count: number;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
variant?: 'label' | 'icon';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/** Each upload has an id so the composer can show its own progress while several run at once. */
|
|
8
|
+
onUploadStart: (uploadId: string) => void;
|
|
9
|
+
onUploadProgress: (uploadId: string, ratio: number) => void;
|
|
10
|
+
onUploaded: (uploadId: string, media: FeedMedia | null) => void;
|
|
9
11
|
}
|
|
10
|
-
export declare function MediaPickerButtons({ count, disabled, variant, onUploadStart, onUploaded, }: MediaPickerButtonsProps): import('react/jsx-runtime').JSX.Element;
|
|
12
|
+
export declare function MediaPickerButtons({ count, disabled, variant, onUploadStart, onUploadProgress, onUploaded, }: MediaPickerButtonsProps): import('react/jsx-runtime').JSX.Element;
|
|
11
13
|
interface AttachedMediaProps {
|
|
12
14
|
media: FeedMedia[];
|
|
13
|
-
|
|
15
|
+
/** Upload progress of each file still going out, from 0 to 1. */
|
|
16
|
+
uploading: number[];
|
|
14
17
|
onRemove: (mediaId: string) => void;
|
|
15
18
|
}
|
|
16
|
-
export declare function AttachedMedia({ media,
|
|
19
|
+
export declare function AttachedMedia({ media, uploading, onRemove }: AttachedMediaProps): import('react/jsx-runtime').JSX.Element | null;
|
|
17
20
|
export {};
|