gotrip-fx-transaction-form 1.0.294-dev → 1.0.295-dev

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.294-dev",
3
+ "version": "1.0.295-dev",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -1,9 +1,9 @@
1
1
  interface Props {
2
+ name?: string;
2
3
  firstName?: string;
3
4
  lastName?: string;
4
5
  userId?: number;
5
6
  size?: number;
6
7
  }
7
- /** Round avatar with initials, colored deterministically by user id. */
8
- export declare const ChatAvatar: ({ firstName, lastName, userId, size }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ChatAvatar: ({ name, firstName, lastName, userId, size }: Props) => import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -4,6 +4,7 @@ interface Props {
4
4
  currentUserId: number;
5
5
  showAvatar?: boolean;
6
6
  showName?: boolean;
7
+ nameOverride?: string;
7
8
  }
8
- export declare const ChatMessage: ({ message, currentUserId, showAvatar, showName, }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const ChatMessage: ({ message, currentUserId, showAvatar, showName, nameOverride, }: Props) => import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ onSubmit: (name: string) => void;
3
+ }
4
+ export declare const ChatNameForm: ({ onSubmit }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { EChatTopic, IChatMessage, IChatSession } from '../types/chat';
2
2
  export declare const useChat: () => {
3
- startSession: (topic: EChatTopic) => Promise<IChatSession>;
3
+ startSession: (topic: EChatTopic, guestName?: string | null) => Promise<IChatSession>;
4
4
  getMyActiveSession: () => Promise<IChatSession | null>;
5
5
  getMessages: (sessionId: number, before?: number, limit?: number) => Promise<{
6
6
  data: IChatMessage[];
@@ -9,6 +9,7 @@ interface ChatStore {
9
9
  adminIsOnline: boolean | null;
10
10
  agencyIsOnline: boolean | null;
11
11
  allowedTopics: EChatTopic[] | null;
12
+ guestName: string | null;
12
13
  setSession: (session: IChatSession | null) => void;
13
14
  setMessages: (messages: IChatMessage[]) => void;
14
15
  addMessage: (message: IChatMessage) => void;
@@ -28,6 +29,7 @@ interface ChatStore {
28
29
  setAdminIsOnline: (isOnline: boolean | null) => void;
29
30
  setAgencyIsOnline: (isOnline: boolean | null) => void;
30
31
  setAllowedTopics: (topics: EChatTopic[] | null) => void;
32
+ setGuestName: (name: string | null) => void;
31
33
  }
32
34
  export declare const useChatStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ChatStore>>;
33
35
  export {};
@@ -39,6 +39,7 @@ export interface IChatSession {
39
39
  publicId: string;
40
40
  agencyUserId: number;
41
41
  browserKey?: string | null;
42
+ guestName?: string | null;
42
43
  agencyInfo?: AgencyInfo;
43
44
  assignedAdminId: number | null;
44
45
  adminInfo?: AdminInfo;
@@ -2,6 +2,7 @@ import { ETenantType } from '../types/enum';
2
2
  import { IChatMessage } from '../types/chat';
3
3
  export declare const getAvatarColor: (userId: number) => string;
4
4
  export declare const getAvatarInitials: (firstName?: string, lastName?: string) => string;
5
+ export declare const getNameInitials: (fullName?: string) => string;
5
6
  /** Join first + last name, falling back to `fallback` when both are empty. */
6
7
  export declare const getFullName: (info?: {
7
8
  firstName?: string;