@medipha/chat 1.0.26 → 1.0.27

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.
@@ -9,7 +9,6 @@ interface UseConversationSettingsParams {
9
9
  }
10
10
  /** Coordinates member management, rename, delete, and leave actions for a conversation. */
11
11
  export declare function useConversationSettings({ conversationId, currentUserId, onConversationUpdated, onDeleteSuccess, onLeaveSuccess, onMembersChanged, }: UseConversationSettingsParams): {
12
- actionError: string;
13
12
  addingUserId: string | null;
14
13
  addMember: (userId: string) => Promise<boolean>;
15
14
  addMembers: (userIds: string[]) => Promise<boolean>;
@@ -6,11 +6,8 @@ interface SettingsModalProps {
6
6
  onClose: () => void;
7
7
  /** Widens the dialog for dense user lists (add-member / members list). */
8
8
  medium?: boolean;
9
- /** Set false where a stray click outside would throw away work in progress (pickers with
10
- * a running selection) — the ✕ and Esc still close it. */
11
- dismissOnBackdrop?: boolean;
12
9
  }
13
- export declare function SettingsModal({ title, children, onClose, medium, dismissOnBackdrop, }: SettingsModalProps): import('react').ReactPortal;
10
+ export declare function SettingsModal({ title, children, onClose, medium }: SettingsModalProps): import('react').ReactPortal;
14
11
  interface UserIdentityProps {
15
12
  user: ChatUser;
16
13
  subtitle?: string;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ interface ChatDialogProps {
3
+ open: boolean;
4
+ title: string;
5
+ children: ReactNode;
6
+ onClose: () => void;
7
+ footer?: ReactNode;
8
+ width?: number;
9
+ /** Renders inside the caller's own box instead of the page — for a dialog opened from a
10
+ * panel that already sits above the conversation. */
11
+ inline?: boolean;
12
+ className?: string;
13
+ }
14
+ export declare function ChatDialog({ open, title, children, onClose, footer, width, inline, className, }: ChatDialogProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -1,7 +1,7 @@
1
1
  interface LoadMoreSentinelProps {
2
2
  /** Whether a next page exists to load. */
3
3
  enabled: boolean;
4
- /** True while the next page is being fetched (shows "Đang tải..." and gates refires). */
4
+ /** True while the next page is being fetched (shows the loading animation and gates refires). */
5
5
  isLoading: boolean;
6
6
  onLoadMore: () => void;
7
7
  }
@@ -0,0 +1,13 @@
1
+ interface LoadingStateProps {
2
+ /** `sm` fits inline slots — a tooltip, a "load more" sentinel; `md` is for panel and
3
+ * list bodies that own the whole area while they wait. */
4
+ size?: 'sm' | 'md';
5
+ /** Announced to screen readers, which no longer get the visible "Đang tải..." text. */
6
+ label?: string;
7
+ className?: string;
8
+ }
9
+ /** The app's one loading indicator: the shared loading animation, centred in whatever
10
+ * slot it's dropped into. Replaces the plain "Đang tải..." strings that used to stand in
11
+ * for it across the panels, lists and modals. */
12
+ export declare function LoadingState({ size, label, className }: LoadingStateProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Puts the caret in a dialog's first text field as soon as it opens, so every modal that
3
+ * has something to type into behaves the same way — search boxes, name inputs, message
4
+ * composers. Returns the ref to attach to the dialog element.
5
+ *
6
+ * `refocusKey` re-runs the focus whenever it changes — pass the active tab in a tabbed
7
+ * dialog, where each tab has its own field and switching tabs should hand the caret over.
8
+ * Left undefined, this runs once per mount, so a plain content refresh (a list reloading)
9
+ * never yanks focus back from wherever the user moved it.
10
+ */
11
+ export declare function useAutoFocusFirstField<T extends HTMLElement>(refocusKey?: unknown): import('react').RefObject<T>;
@@ -6,10 +6,11 @@ interface DraftState {
6
6
  }
7
7
  /** Flattens a draft doc to the one-line plain text the sidebar row previews. */
8
8
  export declare function getDraftText(doc: JSONContent | undefined): string;
9
- /** Writes the pending snapshot out now, skipping the debounce. */
10
- export declare function flushDrafts(): void;
11
- /** Swaps the loaded draft set to another account, flushing the previous one first. */
9
+ /** Drops every draft when the signed-in account changes — they belong to that account. */
12
10
  export declare function setDraftUser(userId: string | null): void;
13
- /** Unsent composer content per conversation, scoped to the signed-in user. */
11
+ /**
12
+ * Unsent composer content per conversation, held for this page session only: switching
13
+ * conversations keeps what you were typing, a reload starts clean.
14
+ */
14
15
  export declare const useDraftStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DraftState>>;
15
16
  export {};