@medipha/chat 1.0.17 → 1.0.18

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.
@@ -1,5 +1,7 @@
1
1
  import { ChatUser, MessageContent } from '../../utils/chat';
2
2
  interface ConversationComposerProps {
3
+ /** Keys the saved draft. Omit (or pass undefined) to disable draft persistence. */
4
+ draftKey?: string;
3
5
  conversationName: string;
4
6
  members: ChatUser[];
5
7
  canMentionAll: boolean;
@@ -2,8 +2,8 @@ interface UseTypingNotifierOptions {
2
2
  onTypingStart?: () => void;
3
3
  onTypingStop?: () => void;
4
4
  }
5
- /** Emits typing:start at most once per burst of edits, then typing:stop after ~5s of
6
- * inactivity, a send, or unmount — whichever comes first. */
5
+ /** Emits typing:start on the first edit of a burst, then typing:stop after
6
+ * TYPING_STOP_DELAY_MS of inactivity, a send, or unmount — whichever comes first. */
7
7
  export declare function useTypingNotifier({ onTypingStart, onTypingStop }: UseTypingNotifierOptions): {
8
8
  notifyTyping: () => void;
9
9
  stopTyping: () => void;
@@ -0,0 +1,16 @@
1
+ import { ReactionType } from '@medipha/chat-core';
2
+ interface ReactionAsset {
3
+ /** Flat SVG — what every resting reaction renders as (badges, tabs, burst particles). */
4
+ static: string;
5
+ /** Lottie URL, fetched only when a player for it actually mounts (`?url`, so the ~40KB
6
+ * of JSON never lands in the main bundle). Reserved for the hover picker. */
7
+ animated: string;
8
+ }
9
+ /**
10
+ * Google's Noto Animated Emoji (Apache-2.0) standing in for Facebook's reaction set, which
11
+ * is Meta artwork we can't ship. Same six expressions, same "pop" motion in the picker.
12
+ * Downloaded from fonts.gstatic.com/s/e/notoemoji — see git history for the codepoints.
13
+ */
14
+ export declare const REACTION_ASSET_BY_TYPE: Record<ReactionType, ReactionAsset>;
15
+ export declare const REACTION_LABEL_BY_TYPE: Record<ReactionType, string>;
16
+ export {};
@@ -0,0 +1,16 @@
1
+ import { ReactionType } from '@medipha/chat-core';
2
+ import { REACTION_LABEL_BY_TYPE } from './reaction-assets';
3
+ interface ReactionIconProps {
4
+ type: ReactionType;
5
+ className?: string;
6
+ /**
7
+ * Runs the Lottie animation instead of drawing the flat SVG. Off by default and meant to
8
+ * stay that way outside the hover picker: a timeline can hold hundreds of reaction badges
9
+ * at once, and a Lottie player per badge means hundreds of rAF loops running forever.
10
+ */
11
+ animated?: boolean;
12
+ }
13
+ /** One reaction's artwork — flat SVG at rest, Lottie while `animated`. Decorative by
14
+ * default (the surrounding button carries the accessible name). */
15
+ export declare function ReactionIcon({ type, className, animated }: ReactionIconProps): import("react/jsx-runtime").JSX.Element;
16
+ export { REACTION_LABEL_BY_TYPE };
@@ -3,8 +3,11 @@ import { ChatUser, ConversationMember } from '../../utils/chat';
3
3
  * Tracks up to TYPING_INDICATOR_CAP most-recently-active typers for a conversation (most
4
4
  * recent first) and auto-clears one if its typing:stop event never arrives. Eviction past
5
5
  * the cap is a local display-cap only — it does not emit typing:stop for the evicted user.
6
+ *
7
+ * The resolved names are also mirrored into the typing store so the sidebar row for this
8
+ * conversation can show "Đang nhập..." while the thread is open.
6
9
  */
7
- export declare function useTypingIndicator(isGroup: boolean, otherMember: ConversationMember | undefined, mentionMembers: ChatUser[]): {
10
+ export declare function useTypingIndicator(conversationId: string | undefined, isGroup: boolean, otherMember: ConversationMember | undefined, mentionMembers: ChatUser[]): {
8
11
  typingNames: string[];
9
12
  markUserTyping: (userId: string) => void;
10
13
  markUserStoppedTyping: (userId: string) => void;