@medipha/feed 0.1.2 → 0.1.4

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.
@@ -5,6 +5,7 @@ export interface FeedRuntime {
5
5
  me: FeedMe;
6
6
  basePath: string;
7
7
  chatApiUrl: string;
8
+ getAccessToken: () => string;
8
9
  isPostFeed: boolean;
9
10
  /** True inside NewsfeedAdminModule: enables admin-only actions such as deleting posts. */
10
11
  isAdmin: boolean;
@@ -5,6 +5,8 @@ export declare class FeedSession {
5
5
  readonly api: FeedApi;
6
6
  private props;
7
7
  constructor(apiUrl: string);
8
+ /** The chat service is a different API, so the share modal needs the current token itself. */
9
+ getAccessToken: () => string;
8
10
  update(props: SessionProps): void;
9
11
  private refreshAccessToken;
10
12
  }
@@ -0,0 +1,2 @@
1
+ /** Calls `onVisible` each time the returned sentinel scrolls into view while `enabled`. */
2
+ export declare function useLoadMoreOnVisible(enabled: boolean, onVisible: () => void): import('react').Dispatch<import('react').SetStateAction<HTMLDivElement | null>>;
@@ -0,0 +1,5 @@
1
+ /** After the reader sends a comment, brings the last item of the list (the new one) into view. */
2
+ export declare function useScrollToNewest(): {
3
+ listRef: import('react').RefObject<HTMLDivElement>;
4
+ scrollToNewest: () => void;
5
+ };
@@ -9,7 +9,5 @@ export interface PostCardProps {
9
9
  onRemoved?: (postId: string) => void;
10
10
  /** modal mode: where the comment composer renders, outside the scrolling area. */
11
11
  composerSlot?: HTMLElement | null;
12
- /** Posted-at links to the post page; on by default in the feed only, where it leads somewhere new. */
13
- linkTime?: boolean;
14
12
  }
15
- export declare function PostCard({ post, mode, footer, onChange, onRemoved, composerSlot, linkTime, }: PostCardProps): import('react/jsx-runtime').JSX.Element;
13
+ export declare function PostCard({ post, mode, footer, onChange, onRemoved, composerSlot, }: PostCardProps): import('react/jsx-runtime').JSX.Element;
@@ -2,8 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { FeedPost } from '../../../core';
3
3
  interface PostHeaderProps {
4
4
  post: FeedPost;
5
- linkToDetail: boolean;
6
5
  extra?: ReactNode;
7
6
  }
8
- export declare function PostHeader({ post, linkToDetail, extra }: PostHeaderProps): import('react/jsx-runtime').JSX.Element;
7
+ export declare function PostHeader({ post, extra }: PostHeaderProps): import('react/jsx-runtime').JSX.Element;
9
8
  export {};
@@ -4,6 +4,8 @@ interface LinkPreviewCardProps {
4
4
  url?: string;
5
5
  /** Post card: a model shared with the text, which hides the URL while the card shows it. */
6
6
  model?: LinkPreviewModel;
7
+ /** Rendered inside a post modal: keeps playing while the feed behind it stops. */
8
+ inModal?: boolean;
7
9
  }
8
- export declare function LinkPreviewCard({ url: urlProp, model }: LinkPreviewCardProps): import('react/jsx-runtime').JSX.Element | null;
10
+ export declare function LinkPreviewCard({ url: urlProp, model, inModal }: LinkPreviewCardProps): import('react/jsx-runtime').JSX.Element | null;
9
11
  export {};
@@ -0,0 +1,11 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface ChatShareModalProps {
3
+ post: FeedPost;
4
+ open: boolean;
5
+ onClose: () => void;
6
+ /** Called after the link reached chat, so the caller can count the share. */
7
+ onShared: () => void;
8
+ }
9
+ /** Same picker as the chat's "Chuyển tiếp": choose conversations, the post link goes in as a plain message. */
10
+ export declare function ChatShareModal({ post, open, onClose, onShared }: ChatShareModalProps): import('react/jsx-runtime').JSX.Element;
11
+ export {};